diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8db8ec5c008d7d13f315bed5650584ee2c54237a --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/downloads/ +/runtime_data/ +/work/ +__pycache__/ +*.pyc +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9e4444d19a1a8c4209def176deaa4ab032127a05 --- /dev/null +++ b/README.md @@ -0,0 +1,120 @@ +--- +pretty_name: CheckerBench +language: +- en +size_categories: +- n<1K +tags: +- code +- static-analysis +- vulnerability-detection +- codeql +- clang-static-analyzer +- benchmark +configs: +- config_name: default + data_files: + - split: test + path: data/test.parquet +--- + +# CheckerBench Dataset + +**300 static-analysis tasks with complete runtime assets: 159 CSA tasks and 141 CodeQL tasks.** + +| Backend / language | Tasks | +|---|---:| +| CSA (C/C++) | 159 | +| CodeQL Go | 30 | +| CodeQL Java | 30 | +| CodeQL JavaScript | 30 | +| CodeQL Python | 51 | +| **Total** | **300** | + +`dataset/tasks.jsonl` is the authoritative portable roster. `tasks/` contains browsable task inputs. The `assets/` directory provides complete task bundles, reference implementations, source snapshots, CodeQL databases, CSA build assets, refinement environments, and a frozen Docker image. + +## Load the task table + +```python +from datasets import load_dataset + +tasks = load_dataset("Benchanything/checkerbench", split="test") +assert len(tasks) == 300 +``` + +The single `test` split contains all 300 benchmark tasks; no training or validation split is provided. Each row includes the task ID, backend, language, CVE and source-project identifiers, task prompt, patch, before/after context, and task configuration as JSON text. `checker_template` contains the CSA starter implementation and is null for CodeQL tasks. The original browsable inputs are also available under `tasks/`. `task_path` identifies the task inside its restored bundle, while `environment_id` identifies its runtime environment. + +## Download and restore + +Requirements: Linux x86-64, Docker, Python 3.10+, and at least 100 GB of available disk space. Additional task workspaces require additional storage. + +Download the complete distribution, including the datasets and frozen runtime image (approximately 13.3 GB of compressed assets): + +```bash +pip install -U huggingface_hub +hf download Benchanything/checkerbench --repo-type dataset --local-dir checkerbench +cd checkerbench +python3 scripts/restore.py --assets assets --data runtime_data --load-image +``` + +For a private repository, authenticate with `hf auth login` using an account with access before downloading. Public downloads do not require authentication. + +To download only dataset archives using a local copy of this repository's scripts: + +```bash +python3 scripts/download.py --kind dataset --output assets +``` + +The downloader verifies every part against its SHA-256 checksum, and the restore script also verifies the complete compressed stream. Split archives are extracted or loaded directly without writing an extra combined copy. Verified downloads and completed restores can be reused. + +## Create a task workspace + +The `checkerbench-runtime:review-v1` image targets `linux/amd64` and includes LLVM/Clang 18.1.8, CodeQL 2.26.4, language toolchains, and Python dependencies. Model-service credentials are supplied separately by the operator. + +Start a container with stable paths: + +```bash +mkdir -p work +docker run --rm -it --network none --entrypoint /bin/bash \ + -v "$PWD:/release:ro" -v "$PWD/runtime_data:/data:ro" \ + -v "$PWD/work:/work" checkerbench-runtime:review-v1 +``` + +Prepare a CSA task: + +```bash +python /release/scripts/prepare.py csa pair_134943 \ + --data-root /data --output /work/pair_134943 +cd /work/pair_134943 +# Write checker.cpp, then compile and scan. +bash compile.sh +CHECKER_NAME=YOUR_CHECKER_NAME bash scan/scan_before.sh +CHECKER_NAME=YOUR_CHECKER_NAME bash scan/scan_after.sh +``` + +Prepare a CodeQL task: + +```bash +python /release/scripts/prepare.py codeql morefixes-32ed35a8bd8aba7b47ad \ + --language go --data-root /data --output /work/go-example +cd /work/go-example/tasks/morefixes-32ed35a8bd8aba7b47ad +# Edit query/vulnerability.ql, then compile and scan. +bash scripts/compile_query.sh +bash scripts/run_before.sh +bash scripts/run_after.sh +``` + +Only tasks in the fixed 300-task roster are accepted. Maintainers can add `--reference` to reproduce a bundled reference implementation. Keep the same container paths after preparing a workspace. CSA uses shared Git objects from the read-only dataset; CodeQL databases are copied into the task workspace. + +## Dataset contents + +- **CSA:** 159 tasks with source snapshots, captured build assets, reference implementations, and refinement environments. Shared runtime assets preserve restoration dependencies. +- **CodeQL:** four task bundles containing 30 Go, 30 Java, 30 JavaScript, and 51 Python tasks, with their captured analysis databases. +- `scripts/prepare.py` restores before/after scanning workspaces. The CSA bundle also includes `scripts/rehydrate_benchmark_env.py` for full refinement worktrees. Historical refinement assets contain absolute paths and symbolic links; see `docs/environment.md` for the restoration boundary. +- References and evaluator assets are maintainer material. During evaluation, expose only a prepared single-task workspace and its required runtime assets to the evaluated agent. + +## Integrity and validation + +`release-manifest.json` records archive and part sizes, SHA-256 checksums, and the image fingerprint. `environment/versions.json` records the toolchain versions; the exported image is the direct restoration entry point. `reports/validation.json` records the checks actually performed and their limits. + +Third-party source and tools retain their own license files. This repository does not assign a new blanket license to all bundled third-party content. diff --git a/SHA256SUMS b/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..f1867fe877c50a0278401bc82035d1edb7b60f67 --- /dev/null +++ b/SHA256SUMS @@ -0,0 +1,12 @@ +f1c061beb65d425414f8d20938b8918e521c6c908a706cbcdab2db568e269bd2 codeql_go_benchmark_top30_v1.tar.gz +94584869e15e944bdf4b48df044debff02a4607a60ba360ccc9db554037595bb codeql_java_benchmark_top30_v2.tar.gz +229fcbf134d2df605599a341245bef39dbce57d44b3e15a612bedb2e2fc21607 codeql_javascript_benchmark_top30_v1.tar.gz.part000 +f47cfe368d0f645445f5abc4b35c900640f0e97f5303a3e4704dce2178421183 codeql_javascript_benchmark_top30_v1.tar.gz.part001 +c19e99879456b637ded3ad3b8b524f0d7cf29d81af261fdb5d1086e57d7ae78c codeql_python_benchmark51_v2.tar.gz.part000 +37c12d1e099d89f65fdcb69677adca1e9f94e35f7372fb89ae92ea6dcee72d42 codeql_python_benchmark51_v2.tar.gz.part001 +7fddb3afd80e67d8eec2694e9704e24e65ce318dfb5d1260b8058dbc84c23830 checkerbench-csa159.tar.gz.part000 +0615ba64af1cb7e526c741eca523c1dd2a98ef9214b4834e229c92f7d6113706 checkerbench-csa159.tar.gz.part001 +54d83cf819a8d0777f1bcded9848cfe96605a7201878cbc563205880ab5ae85a checkerbench-csa159.tar.gz.part002 +b483ff23fcb3a303032ce2f7956e3e5280849491d917d8e565333077b818ba43 checkerbench-csa159.tar.gz.part003 +6dcc402d563e599525e9fb748244d754a983a48318ec6c871a85cfa18c854976 checkerbench-environment-linux-amd64.tar.gz.part000 +976c8e16a733cd76540f5374756c155a122edef44585b0eea12589d6f0ac09b9 checkerbench-environment-linux-amd64.tar.gz.part001 diff --git a/data/test.parquet b/data/test.parquet new file mode 100644 index 0000000000000000000000000000000000000000..99b3c81fe8e184236dd0a6ea3c61e5c01493269a --- /dev/null +++ b/data/test.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf6583507a74e33e53515bfdfd3bfb00acd4878f8e9e3772972e549f4fdfdf4e +size 2851404 diff --git a/dataset/manifest.json b/dataset/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..312cd4cb2c6dcc00e376aea97d21e3bbbac2544f --- /dev/null +++ b/dataset/manifest.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "task_count": 300, + "backend_counts": { + "csa": 159, + "codeql": 141 + }, + "language_counts": { + "c": 159, + "go": 30, + "java": 30, + "javascript": 30, + "python": 51 + }, + "csa_project_count": 32, + "selection_rule": "All tasks from the fixed 300-task evaluation roster. CSA is treated as a single group.", + "selected_roster_sha256": "ccc8ec0a88a1972fe649caf034454fb67183116ff7a3b5745286d3e4ab740a92" +} diff --git a/dataset/selected_tasks.csv b/dataset/selected_tasks.csv new file mode 100644 index 0000000000000000000000000000000000000000..2b18c94bd23a8a80317f53177c77f9869b6d18d4 --- /dev/null +++ b/dataset/selected_tasks.csv @@ -0,0 +1,301 @@ +backend,cve_id,dataset,environment_id,group,language,project_id,task_id,task_path +codeql,CVE-2022-4741,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78,CodeQL go,go,morefixes__sajari__docconv,morefixes-02cb4e0a6c5aaabd6a78,codeql_go_benchmark_top30_v1/tasks/morefixes-02cb4e0a6c5aaabd6a78 +codeql,CVE-2025-47281,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406,CodeQL go,go,morefixes__kyverno__kyverno,morefixes-08d699b1f7c72c366406,codeql_go_benchmark_top30_v1/tasks/morefixes-08d699b1f7c72c366406 +codeql,CVE-2020-29243,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb,CodeQL go,go,morefixes__dhowden__tag,morefixes-096cbfbd1d27f9ce86fb,codeql_go_benchmark_top30_v1/tasks/morefixes-096cbfbd1d27f9ce86fb +codeql,CVE-2023-34236,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f,CodeQL go,go,morefixes__weaveworks__tf-controller,morefixes-0adb0a489b07a50d6b2f,codeql_go_benchmark_top30_v1/tasks/morefixes-0adb0a489b07a50d6b2f +codeql,CVE-2022-41939,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28,CodeQL go,go,morefixes__knative__func,morefixes-110ab7950a2c0b2c6f28,codeql_go_benchmark_top30_v1/tasks/morefixes-110ab7950a2c0b2c6f28 +codeql,CVE-2023-27582,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555,CodeQL go,go,morefixes__foxcpp__maddy,morefixes-1218ce956f8120d59555,codeql_go_benchmark_top30_v1/tasks/morefixes-1218ce956f8120d59555 +codeql,CVE-2024-39315,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807,CodeQL go,go,morefixes__pomerium__pomerium,morefixes-14446e68cdc53bc98807,codeql_go_benchmark_top30_v1/tasks/morefixes-14446e68cdc53bc98807 +codeql,CVE-2022-2582,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5,CodeQL go,go,morefixes__aws__aws-sdk-go,morefixes-1d20aba9f4be2de73db5,codeql_go_benchmark_top30_v1/tasks/morefixes-1d20aba9f4be2de73db5 +codeql,CVE-2025-66626,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460,CodeQL go,go,morefixes__argoproj__argo-workflows,morefixes-2331a664751876781460,codeql_go_benchmark_top30_v1/tasks/morefixes-2331a664751876781460 +codeql,CVE-2019-12496,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26,CodeQL go,go,morefixes__hybridgroup__gobot,morefixes-2cc25dee5f2a118bcb26,codeql_go_benchmark_top30_v1/tasks/morefixes-2cc25dee5f2a118bcb26 +codeql,CVE-2026-40890,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b,CodeQL go,go,morefixes__gomarkdown__markdown,morefixes-30e495de2402bd4bed4b,codeql_go_benchmark_top30_v1/tasks/morefixes-30e495de2402bd4bed4b +codeql,CVE-2024-7773,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad,CodeQL go,go,morefixes__ollama__ollama,morefixes-32ed35a8bd8aba7b47ad,codeql_go_benchmark_top30_v1/tasks/morefixes-32ed35a8bd8aba7b47ad +codeql,CVE-2023-40586,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2,CodeQL go,go,morefixes__corazawaf__coraza,morefixes-398ac78e3981b77e4ee2,codeql_go_benchmark_top30_v1/tasks/morefixes-398ac78e3981b77e4ee2 +codeql,CVE-2022-41920,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443,CodeQL go,go,morefixes__duke-git__lancet,morefixes-461c7bace102119cf443,codeql_go_benchmark_top30_v1/tasks/morefixes-461c7bace102119cf443 +codeql,CVE-2026-10722,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e,CodeQL go,go,morefixes__cilium__ebpf,morefixes-50b28fbf07dd2d79022e,codeql_go_benchmark_top30_v1/tasks/morefixes-50b28fbf07dd2d79022e +codeql,CVE-2023-47105,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c,CodeQL go,go,morefixes__chaosblade-io__chaosblade,morefixes-5ad30634efaa1d03593c,codeql_go_benchmark_top30_v1/tasks/morefixes-5ad30634efaa1d03593c +codeql,CVE-2024-23840,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247,CodeQL go,go,morefixes__goreleaser__goreleaser,morefixes-5c2773bb1de86a62a247,codeql_go_benchmark_top30_v1/tasks/morefixes-5c2773bb1de86a62a247 +codeql,CVE-2022-30428,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17,CodeQL go,go,morefixes__gphper__ginadmin,morefixes-5cfa41b8575717ecee17,codeql_go_benchmark_top30_v1/tasks/morefixes-5cfa41b8575717ecee17 +codeql,CVE-2020-36568,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b,CodeQL go,go,morefixes__revel__revel,morefixes-6e40429ff01c5ab8b71b,codeql_go_benchmark_top30_v1/tasks/morefixes-6e40429ff01c5ab8b71b +codeql,CVE-2023-33965,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2,CodeQL go,go,morefixes__txthinking__brook,morefixes-7c57d35438d22210ced2,codeql_go_benchmark_top30_v1/tasks/morefixes-7c57d35438d22210ced2 +codeql,CVE-2026-8275,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a,CodeQL go,go,morefixes__bettercap__bettercap,morefixes-7e2af82757795db7f69a,codeql_go_benchmark_top30_v1/tasks/morefixes-7e2af82757795db7f69a +codeql,CVE-2024-41270,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4,CodeQL go,go,morefixes__appleboy__gorush,morefixes-9fbea0e4da10bfc882d4,codeql_go_benchmark_top30_v1/tasks/morefixes-9fbea0e4da10bfc882d4 +codeql,CVE-2023-46132,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d,CodeQL go,go,morefixes__hyperledger__fabric,morefixes-a469597c1a5d38baeb5d,codeql_go_benchmark_top30_v1/tasks/morefixes-a469597c1a5d38baeb5d +codeql,CVE-2023-34105,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1,CodeQL go,go,morefixes__ossrs__srs,morefixes-a9ee7c2085f2981a7be1,codeql_go_benchmark_top30_v1/tasks/morefixes-a9ee7c2085f2981a7be1 +codeql,CVE-2018-1002207,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1,CodeQL go,go,morefixes__mholt__archiver,morefixes-c254bd7b8a82b4ef45c1,codeql_go_benchmark_top30_v1/tasks/morefixes-c254bd7b8a82b4ef45c1 +codeql,CVE-2017-1000070,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3,CodeQL go,go,morefixes__bitly__oauth2_proxy,morefixes-cd95b2e4d63395291cd3,codeql_go_benchmark_top30_v1/tasks/morefixes-cd95b2e4d63395291cd3 +codeql,CVE-2025-67499,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685,CodeQL go,go,morefixes__containernetworking__plugins,morefixes-d3400ed5292d19661685,codeql_go_benchmark_top30_v1/tasks/morefixes-d3400ed5292d19661685 +codeql,CVE-2022-21698,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f,CodeQL go,go,morefixes__prometheus__client_golang,morefixes-e3f3ac87786e2080b81f,codeql_go_benchmark_top30_v1/tasks/morefixes-e3f3ac87786e2080b81f +codeql,CVE-2021-3538,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9,CodeQL go,go,morefixes__satori__go.uuid,morefixes-f0d857f4ad82fae5a3a9,codeql_go_benchmark_top30_v1/tasks/morefixes-f0d857f4ad82fae5a3a9 +codeql,CVE-2025-32445,codeql_go_benchmark_top30_v1,codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae,CodeQL go,go,morefixes__argoproj__argo-events,morefixes-fb75b5c545e3cb24f7ae,codeql_go_benchmark_top30_v1/tasks/morefixes-fb75b5c545e3cb24f7ae +codeql,CVE-2023-2196,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7,CodeQL java,java,morefixes__jenkinsci__codedx-plugin,morefixes-02f75a63a6f0b8d6c6c7,codeql_java_benchmark_top30_v2/tasks/morefixes-02f75a63a6f0b8d6c6c7 +codeql,CVE-2021-21656,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444,CodeQL java,java,morefixes__jenkinsci__xcode-plugin,morefixes-04bdb708bf23aabdc444,codeql_java_benchmark_top30_v2/tasks/morefixes-04bdb708bf23aabdc444 +codeql,CVE-2021-21632,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec,CodeQL java,java,morefixes__jenkinsci__dependency-track-plugin,morefixes-05d6240fd5a9017a44ec,codeql_java_benchmark_top30_v2/tasks/morefixes-05d6240fd5a9017a44ec +codeql,CVE-2020-2132,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561,CodeQL java,java,morefixes__jenkinsci__environment-manager-tools-plugin,morefixes-0608482232bb0119b561,codeql_java_benchmark_top30_v2/tasks/morefixes-0608482232bb0119b561 +codeql,CVE-2020-2311,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5,CodeQL java,java,morefixes__jenkinsci__aws-global-configuration-plugin,morefixes-0709c903a0f96b124bd5,codeql_java_benchmark_top30_v2/tasks/morefixes-0709c903a0f96b124bd5 +codeql,CVE-2020-14297,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a,CodeQL java,java,morefixes__wildfly__jboss-ejb-client,morefixes-09002f4d38e9ecf8238a,codeql_java_benchmark_top30_v2/tasks/morefixes-09002f4d38e9ecf8238a +codeql,CVE-2020-25023,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704,CodeQL java,java,morefixes__rweather__noise-java,morefixes-13b1b3610eb300ab9704,codeql_java_benchmark_top30_v2/tasks/morefixes-13b1b3610eb300ab9704 +codeql,CVE-2023-25141,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3,CodeQL java,java,morefixes__apache__sling-org-apache-sling-jcr-base,morefixes-149c5507d76b198944c3,codeql_java_benchmark_top30_v2/tasks/morefixes-149c5507d76b198944c3 +codeql,CVE-2022-43183,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493,CodeQL java,java,morefixes__xuxueli__xxl-job,morefixes-19d7bda86b839e7fc493,codeql_java_benchmark_top30_v2/tasks/morefixes-19d7bda86b839e7fc493 +codeql,CVE-2025-29908,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752,CodeQL java,java,morefixes__netty__netty-incubator-codec-quic,morefixes-1f67e1cf382f2e332752,codeql_java_benchmark_top30_v2/tasks/morefixes-1f67e1cf382f2e332752 +codeql,CVE-2020-25022,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c,CodeQL java,java,morefixes__rweather__noise-java,morefixes-21b89e6983680bd0068c,codeql_java_benchmark_top30_v2/tasks/morefixes-21b89e6983680bd0068c +codeql,CVE-2021-22573,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b,CodeQL java,java,morefixes__googleapis__google-oauth-java-client,morefixes-23c03b1bf7a3c44f444b,codeql_java_benchmark_top30_v2/tasks/morefixes-23c03b1bf7a3c44f444b +codeql,CVE-2021-39196,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a,CodeQL java,java,morefixes__jdhwpgmbca__pcapture,morefixes-2b14860afe0d3bf8094a,codeql_java_benchmark_top30_v2/tasks/morefixes-2b14860afe0d3bf8094a +codeql,CVE-2022-4641,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072,CodeQL java,java,morefixes__tdunning__pig-vector,morefixes-35510b21cf51a9acf072,codeql_java_benchmark_top30_v2/tasks/morefixes-35510b21cf51a9acf072 +codeql,CVE-2025-67030,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9,CodeQL java,java,morefixes__codehaus-plexus__plexus-utils,morefixes-378f408f498b20422fe9,codeql_java_benchmark_top30_v2/tasks/morefixes-378f408f498b20422fe9 +codeql,CVE-2024-39118,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71,CodeQL java,java,morefixes__mommyheather__advancedbackups,morefixes-3cc69a690ef991c8bd71,codeql_java_benchmark_top30_v2/tasks/morefixes-3cc69a690ef991c8bd71 +codeql,CVE-2024-36114,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20,CodeQL java,java,morefixes__airlift__aircompressor,morefixes-462566b2f857f458bf20,codeql_java_benchmark_top30_v2/tasks/morefixes-462566b2f857f458bf20 +codeql,CVE-2020-36640,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-4a0720656247f4fdd55d,CodeQL java,java,morefixes__bonitasoft__bonita-connector-webservice,morefixes-4a0720656247f4fdd55d,codeql_java_benchmark_top30_v2/tasks/morefixes-4a0720656247f4fdd55d +codeql,CVE-2023-48299,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-623c5f3c0558ba463c5a,CodeQL java,java,morefixes__pytorch__serve,morefixes-623c5f3c0558ba463c5a,codeql_java_benchmark_top30_v2/tasks/morefixes-623c5f3c0558ba463c5a +codeql,CVE-2024-1102,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-6c80dd14ea98e73d8b2e,CodeQL java,java,morefixes__jberet__jsr352,morefixes-6c80dd14ea98e73d8b2e,codeql_java_benchmark_top30_v2/tasks/morefixes-6c80dd14ea98e73d8b2e +codeql,CVE-2022-41967,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-76076416f1349da24444,CodeQL java,java,morefixes__hyperadev__dragonfly,morefixes-76076416f1349da24444,codeql_java_benchmark_top30_v2/tasks/morefixes-76076416f1349da24444 +codeql,CVE-2025-4641,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-80a186235f1faf976a71,CodeQL java,java,morefixes__bonigarcia__webdrivermanager,morefixes-80a186235f1faf976a71,codeql_java_benchmark_top30_v2/tasks/morefixes-80a186235f1faf976a71 +codeql,CVE-2020-1729,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-8641a4da2de2d0610576,CodeQL java,java,morefixes__smallrye__smallrye-config,morefixes-8641a4da2de2d0610576,codeql_java_benchmark_top30_v2/tasks/morefixes-8641a4da2de2d0610576 +codeql,CVE-2022-29631,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-8e4d1bd2b930ae852ae1,CodeQL java,java,morefixes__oblac__jodd-http,morefixes-8e4d1bd2b930ae852ae1,codeql_java_benchmark_top30_v2/tasks/morefixes-8e4d1bd2b930ae852ae1 +codeql,CVE-2020-17534,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-9db4a0f5f07f59debbce,CodeQL java,java,morefixes__apache__netbeans-html4j,morefixes-9db4a0f5f07f59debbce,codeql_java_benchmark_top30_v2/tasks/morefixes-9db4a0f5f07f59debbce +codeql,CVE-2025-67721,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-a624a25672727b30851a,CodeQL java,java,morefixes__airlift__aircompressor,morefixes-a624a25672727b30851a,codeql_java_benchmark_top30_v2/tasks/morefixes-a624a25672727b30851a +codeql,CVE-2022-24913,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-ab625a5d0d2a27547494,CodeQL java,java,morefixes__cowtowncoder__java-merge-sort,morefixes-ab625a5d0d2a27547494,codeql_java_benchmark_top30_v2/tasks/morefixes-ab625a5d0d2a27547494 +codeql,CVE-2024-57699,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-ac88413b62ef5803c04f,CodeQL java,java,morefixes__netplex__json-smart-v2,morefixes-ac88413b62ef5803c04f,codeql_java_benchmark_top30_v2/tasks/morefixes-ac88413b62ef5803c04f +codeql,CVE-2025-67721,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-cf8752e9dc2f57b1d5c8,CodeQL java,java,morefixes__airlift__aircompressor,morefixes-cf8752e9dc2f57b1d5c8,codeql_java_benchmark_top30_v2/tasks/morefixes-cf8752e9dc2f57b1d5c8 +codeql,CVE-2022-4494,codeql_java_benchmark_top30_v2,codeql_java_benchmark_top30_v2/morefixes-f298b6158c5168025365,CodeQL java,java,morefixes__bspkrs__mcpmappingviewer,morefixes-f298b6158c5168025365,codeql_java_benchmark_top30_v2/tasks/morefixes-f298b6158c5168025365 +codeql,CVE-2023-33194,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-040d724ca8211a3aaf1d,CodeQL javascript,javascript,morefixes__craftcms__cms,morefixes-040d724ca8211a3aaf1d,codeql_javascript_benchmark_top30_v1/tasks/morefixes-040d724ca8211a3aaf1d +codeql,CVE-2026-25642,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17,CodeQL javascript,javascript,morefixes__hedgedoc__hedgedoc,morefixes-04314885419e817d3b17,codeql_javascript_benchmark_top30_v1/tasks/morefixes-04314885419e817d3b17 +codeql,CVE-2025-59526,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-08f7e6287de57ef9a5c8,CodeQL javascript,javascript,morefixes__eladnava__mailgen,morefixes-08f7e6287de57ef9a5c8,codeql_javascript_benchmark_top30_v1/tasks/morefixes-08f7e6287de57ef9a5c8 +codeql,CVE-2018-3758,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-0e82cb4ad70fc2c896ef,CodeQL javascript,javascript,morefixes__mrvautin__expresscart,morefixes-0e82cb4ad70fc2c896ef,codeql_javascript_benchmark_top30_v1/tasks/morefixes-0e82cb4ad70fc2c896ef +codeql,CVE-2026-45787,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-0e8f49f3d1cc46668f9b,CodeQL javascript,javascript,morefixes__electerm__electerm,morefixes-0e8f49f3d1cc46668f9b,codeql_javascript_benchmark_top30_v1/tasks/morefixes-0e8f49f3d1cc46668f9b +codeql,CVE-2021-3801,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-0ea8f5f13e7432539721,CodeQL javascript,javascript,morefixes__prismjs__prism,morefixes-0ea8f5f13e7432539721,codeql_javascript_benchmark_top30_v1/tasks/morefixes-0ea8f5f13e7432539721 +codeql,CVE-2025-49590,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-0f4271d4851600835c47,CodeQL javascript,javascript,morefixes__cryptpad__cryptpad,morefixes-0f4271d4851600835c47,codeql_javascript_benchmark_top30_v1/tasks/morefixes-0f4271d4851600835c47 +codeql,CVE-2024-25981,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-135296414af3a0faf089,CodeQL javascript,javascript,morefixes__moodle__moodle,morefixes-135296414af3a0faf089,codeql_javascript_benchmark_top30_v1/tasks/morefixes-135296414af3a0faf089 +codeql,CVE-2014-5273,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-16768fdfa00c963539dc,CodeQL javascript,javascript,morefixes__phpmyadmin__phpmyadmin,morefixes-16768fdfa00c963539dc,codeql_javascript_benchmark_top30_v1/tasks/morefixes-16768fdfa00c963539dc +codeql,CVE-2024-40761,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-17d21311a4f5af9bbc4f,CodeQL javascript,javascript,morefixes__apache__incubator-answer,morefixes-17d21311a4f5af9bbc4f,codeql_javascript_benchmark_top30_v1/tasks/morefixes-17d21311a4f5af9bbc4f +codeql,CVE-2025-46344,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-1cf55be2336b09a515a6,CodeQL javascript,javascript,morefixes__auth0__nextjs-auth0,morefixes-1cf55be2336b09a515a6,codeql_javascript_benchmark_top30_v1/tasks/morefixes-1cf55be2336b09a515a6 +codeql,CVE-2026-22819,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e,CodeQL javascript,javascript,morefixes__outray-tunnel__outray,morefixes-312479357bdfa998bf6e,codeql_javascript_benchmark_top30_v1/tasks/morefixes-312479357bdfa998bf6e +codeql,CVE-2025-10044,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-374e3093d6d5875aa960,CodeQL javascript,javascript,morefixes__keycloak__keycloak,morefixes-374e3093d6d5875aa960,codeql_javascript_benchmark_top30_v1/tasks/morefixes-374e3093d6d5875aa960 +codeql,CVE-2021-4124,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-4b95de19a5da1e74a747,CodeQL javascript,javascript,morefixes__meetecho__janus-gateway,morefixes-4b95de19a5da1e74a747,codeql_javascript_benchmark_top30_v1/tasks/morefixes-4b95de19a5da1e74a747 +codeql,CVE-2021-25990,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-4ffaae63e8f8c0012a0f,CodeQL javascript,javascript,morefixes__ifmeorg__ifme,morefixes-4ffaae63e8f8c0012a0f,codeql_javascript_benchmark_top30_v1/tasks/morefixes-4ffaae63e8f8c0012a0f +codeql,CVE-2023-47635,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-516c6c53716bba29b7f0,CodeQL javascript,javascript,morefixes__decidim__decidim,morefixes-516c6c53716bba29b7f0,codeql_javascript_benchmark_top30_v1/tasks/morefixes-516c6c53716bba29b7f0 +codeql,CVE-2010-2273,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-550b9b77dc4d0c01e1fe,CodeQL javascript,javascript,morefixes__dojo__dojo,morefixes-550b9b77dc4d0c01e1fe,codeql_javascript_benchmark_top30_v1/tasks/morefixes-550b9b77dc4d0c01e1fe +codeql,CVE-2024-22411,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-58be9c1811ee7367cce5,CodeQL javascript,javascript,morefixes__avo-hq__avo,morefixes-58be9c1811ee7367cce5,codeql_javascript_benchmark_top30_v1/tasks/morefixes-58be9c1811ee7367cce5 +codeql,CVE-2020-11611,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-60205e347d7f83ebc999,CodeQL javascript,javascript,morefixes__ofirdagan__cross-domain-local-storage,morefixes-60205e347d7f83ebc999,codeql_javascript_benchmark_top30_v1/tasks/morefixes-60205e347d7f83ebc999 +codeql,CVE-2017-1000189,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-633246d79fea5271cdce,CodeQL javascript,javascript,morefixes__mde__ejs,morefixes-633246d79fea5271cdce,codeql_javascript_benchmark_top30_v1/tasks/morefixes-633246d79fea5271cdce +codeql,CVE-2018-11798,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-88a92b26b3a23d01f412,CodeQL javascript,javascript,morefixes__apache__thrift,morefixes-88a92b26b3a23d01f412,codeql_javascript_benchmark_top30_v1/tasks/morefixes-88a92b26b3a23d01f412 +codeql,CVE-2024-28176,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-941abf85c9b7d820de47,CodeQL javascript,javascript,morefixes__panva__jose,morefixes-941abf85c9b7d820de47,codeql_javascript_benchmark_top30_v1/tasks/morefixes-941abf85c9b7d820de47 +codeql,CVE-2026-39941,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e,CodeQL javascript,javascript,morefixes__churchcrm__crm,morefixes-99aea6539029d3ab985e,codeql_javascript_benchmark_top30_v1/tasks/morefixes-99aea6539029d3ab985e +codeql,CVE-2024-45312,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-9f8a2d1b597df98c6680,CodeQL javascript,javascript,morefixes__overleaf__overleaf,morefixes-9f8a2d1b597df98c6680,codeql_javascript_benchmark_top30_v1/tasks/morefixes-9f8a2d1b597df98c6680 +codeql,CVE-2025-11222,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-b475f3a535ea41bec3ff,CodeQL javascript,javascript,morefixes__line__centraldogma,morefixes-b475f3a535ea41bec3ff,codeql_javascript_benchmark_top30_v1/tasks/morefixes-b475f3a535ea41bec3ff +codeql,CVE-2026-10269,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-b61b3848e076036c7b06,CodeQL javascript,javascript,morefixes__decolua__9router,morefixes-b61b3848e076036c7b06,codeql_javascript_benchmark_top30_v1/tasks/morefixes-b61b3848e076036c7b06 +codeql,CVE-2022-39267,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-bd56f8e5b73f132cd962,CodeQL javascript,javascript,morefixes__brokercap__bifrost,morefixes-bd56f8e5b73f132cd962,codeql_javascript_benchmark_top30_v1/tasks/morefixes-bd56f8e5b73f132cd962 +codeql,CVE-2020-7729,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-bd86b40955cabdb21c65,CodeQL javascript,javascript,morefixes__gruntjs__grunt,morefixes-bd86b40955cabdb21c65,codeql_javascript_benchmark_top30_v1/tasks/morefixes-bd86b40955cabdb21c65 +codeql,CVE-2023-37259,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-f1044573e0d15a82a1d0,CodeQL javascript,javascript,morefixes__matrix-org__matrix-react-sdk,morefixes-f1044573e0d15a82a1d0,codeql_javascript_benchmark_top30_v1/tasks/morefixes-f1044573e0d15a82a1d0 +codeql,CVE-2021-21679,codeql_javascript_benchmark_top30_v1,codeql_javascript_benchmark_top30_v1/morefixes-f37103ca8d19c93116f8,CodeQL javascript,javascript,morefixes__jenkinsci__azure-ad-plugin,morefixes-f37103ca8d19c93116f8,codeql_javascript_benchmark_top30_v1/tasks/morefixes-f37103ca8d19c93116f8 +codeql,CVE-2021-21371,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-03252773bde39ba37465,CodeQL python,python,pyvul__tenable__integration-jira-cloud,pyvul-03252773bde39ba37465,codeql_python_benchmark51_v2/tasks/pyvul-03252773bde39ba37465 +codeql,CVE-2023-6977,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-07332271886167133edf,CodeQL python,python,pyvul__mlflow__mlflow,pyvul-07332271886167133edf,codeql_python_benchmark51_v2/tasks/pyvul-07332271886167133edf +codeql,CVE-2020-12889,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-0e38a9079f90a5ac566e,CodeQL python,python,pyvul__misp__misp-maltego,pyvul-0e38a9079f90a5ac566e,codeql_python_benchmark51_v2/tasks/pyvul-0e38a9079f90a5ac566e +codeql,CVE-2023-30629,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-10fb77265dc23f305315,CodeQL python,python,pyvul__vyperlang__vyper,pyvul-10fb77265dc23f305315,codeql_python_benchmark51_v2/tasks/pyvul-10fb77265dc23f305315 +codeql,CVE-2019-3830,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-135c7fcada946877931a,CodeQL python,python,pyvul__openstack__ceilometer,pyvul-135c7fcada946877931a,codeql_python_benchmark51_v2/tasks/pyvul-135c7fcada946877931a +codeql,CVE-2020-10799,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19,CodeQL python,python,pyvul__deeplook__svglib,pyvul-15c0ad3037992bda1b19,codeql_python_benchmark51_v2/tasks/pyvul-15c0ad3037992bda1b19 +codeql,CVE-2022-0736,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-1a630dd8f83b2e29740d,CodeQL python,python,pyvul__mlflow__mlflow,pyvul-1a630dd8f83b2e29740d,codeql_python_benchmark51_v2/tasks/pyvul-1a630dd8f83b2e29740d +codeql,CVE-2022-42965,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-1f5068a3fe5ca0192a07,CodeQL python,python,pyvul__snowflakedb__snowflake-connector-python,pyvul-1f5068a3fe5ca0192a07,codeql_python_benchmark51_v2/tasks/pyvul-1f5068a3fe5ca0192a07 +codeql,CVE-2021-46898,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-2ab65d62986b80922362,CodeQL python,python,pyvul__sehmaschine__django-grappelli,pyvul-2ab65d62986b80922362,codeql_python_benchmark51_v2/tasks/pyvul-2ab65d62986b80922362 +codeql,CVE-2023-48224,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-3062589ff0b3b95c2ed7,CodeQL python,python,pyvul__ethyca__fides,pyvul-3062589ff0b3b95c2ed7,codeql_python_benchmark51_v2/tasks/pyvul-3062589ff0b3b95c2ed7 +codeql,CVE-2020-19001,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-3187445bcbbf39128a26,CodeQL python,python,pyvul__tankywoo__simiki,pyvul-3187445bcbbf39128a26,codeql_python_benchmark51_v2/tasks/pyvul-3187445bcbbf39128a26 +codeql,CVE-2022-0845,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777,CodeQL python,python,pyvul__pytorchlightning__pytorch-lightning,pyvul-36a40541d7c74a9a7777,codeql_python_benchmark51_v2/tasks/pyvul-36a40541d7c74a9a7777 +codeql,CVE-2023-6395,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-3819b1a7530257524a75,CodeQL python,python,pyvul__xsuchy__templated-dictionary,pyvul-3819b1a7530257524a75,codeql_python_benchmark51_v2/tasks/pyvul-3819b1a7530257524a75 +codeql,CVE-2020-29128,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-394adf7b067d96b356ca,CodeQL python,python,pyvul__petl-developers__petl,pyvul-394adf7b067d96b356ca,codeql_python_benchmark51_v2/tasks/pyvul-394adf7b067d96b356ca +codeql,CVE-2021-41127,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-3994e3622b21c396ef8a,CodeQL python,python,pyvul__rasahq__rasa,pyvul-3994e3622b21c396ef8a,codeql_python_benchmark51_v2/tasks/pyvul-3994e3622b21c396ef8a +codeql,CVE-2014-1932,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-4954e5890cce23c8b03d,CodeQL python,python,pyvul__python-imaging__pillow,pyvul-4954e5890cce23c8b03d,codeql_python_benchmark51_v2/tasks/pyvul-4954e5890cce23c8b03d +codeql,CVE-2023-48700,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-4ac3440b9023e6511a91,CodeQL python,python,pyvul__nautobot__nautobot-plugin-device-onboarding,pyvul-4ac3440b9023e6511a91,codeql_python_benchmark51_v2/tasks/pyvul-4ac3440b9023e6511a91 +codeql,CVE-2021-4315,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-4e31b8fba29687b8d792,CodeQL python,python,pyvul__nyuccl__psiturk,pyvul-4e31b8fba29687b8d792,codeql_python_benchmark51_v2/tasks/pyvul-4e31b8fba29687b8d792 +codeql,CVE-2021-32839,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-509b1de3e2277ac89469,CodeQL python,python,pyvul__andialbrecht__sqlparse,pyvul-509b1de3e2277ac89469,codeql_python_benchmark51_v2/tasks/pyvul-509b1de3e2277ac89469 +codeql,CVE-2022-23530,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-533cc1a8c090c7529184,CodeQL python,python,pyvul__datadog__guarddog,pyvul-533cc1a8c090c7529184,codeql_python_benchmark51_v2/tasks/pyvul-533cc1a8c090c7529184 +codeql,CVE-2023-34540,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-5cffd45f7550a060e2cf,CodeQL python,python,pyvul__langchain-ai__langchain,pyvul-5cffd45f7550a060e2cf,codeql_python_benchmark51_v2/tasks/pyvul-5cffd45f7550a060e2cf +codeql,CVE-2022-0315,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd,CodeQL python,python,pyvul__horovod__horovod,pyvul-6b5cf1b92b87b04c09cd,codeql_python_benchmark51_v2/tasks/pyvul-6b5cf1b92b87b04c09cd +codeql,CVE-2021-23393,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-796a152aa965ce44a6db,CodeQL python,python,pyvul__briancappello__flask-unchained,pyvul-796a152aa965ce44a6db,codeql_python_benchmark51_v2/tasks/pyvul-796a152aa965ce44a6db +codeql,CVE-2021-21274,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-7c3c693e688548564c9a,CodeQL python,python,pyvul__matrix-org__synapse,pyvul-7c3c693e688548564c9a,codeql_python_benchmark51_v2/tasks/pyvul-7c3c693e688548564c9a +codeql,CVE-2017-16616,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-7c7eaf17f0df49603ae4,CodeQL python,python,pyvul__stranger6667__pyanyapi,pyvul-7c7eaf17f0df49603ae4,codeql_python_benchmark51_v2/tasks/pyvul-7c7eaf17f0df49603ae4 +codeql,CVE-2018-25082,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-810ace2bf3e4aa0f04a1,CodeQL python,python,pyvul__zwczou__weixin-python,pyvul-810ace2bf3e4aa0f04a1,codeql_python_benchmark51_v2/tasks/pyvul-810ace2bf3e4aa0f04a1 +codeql,CVE-2022-31605,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-812f35b535c5e549929b,CodeQL python,python,pyvul__nvidia__nvflare,pyvul-812f35b535c5e549929b,codeql_python_benchmark51_v2/tasks/pyvul-812f35b535c5e549929b +codeql,CVE-2013-4260,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-8297e406660c92268ba5,CodeQL python,python,pyvul__ansible__ansible,pyvul-8297e406660c92268ba5,codeql_python_benchmark51_v2/tasks/pyvul-8297e406660c92268ba5 +codeql,CVE-2022-36082,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-89a9ff0f9cf4f2f4cc91,CodeQL python,python,pyvul__mansuf__mangadex-downloader,pyvul-89a9ff0f9cf4f2f4cc91,codeql_python_benchmark51_v2/tasks/pyvul-89a9ff0f9cf4f2f4cc91 +codeql,CVE-2020-15239,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-8e39d07d2ff863a3f19e,CodeQL python,python,pyvul__horazont__xmpp-http-upload,pyvul-8e39d07d2ff863a3f19e,codeql_python_benchmark51_v2/tasks/pyvul-8e39d07d2ff863a3f19e +codeql,CVE-2023-29159,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-8f3613497f18d5cf2684,CodeQL python,python,pyvul__encode__starlette,pyvul-8f3613497f18d5cf2684,codeql_python_benchmark51_v2/tasks/pyvul-8f3613497f18d5cf2684 +codeql,CVE-2019-11340,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-98fc634e79976d5b5241,CodeQL python,python,pyvul__matrix-org__sydent,pyvul-98fc634e79976d5b5241,codeql_python_benchmark51_v2/tasks/pyvul-98fc634e79976d5b5241 +codeql,CVE-2019-14806,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-9ba7c665889bf20611cb,CodeQL python,python,pyvul__pallets__werkzeug,pyvul-9ba7c665889bf20611cb,codeql_python_benchmark51_v2/tasks/pyvul-9ba7c665889bf20611cb +codeql,CVE-2023-49277,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-9c089aba2c203455d420,CodeQL python,python,pyvul__darrenofficial__dpaste,pyvul-9c089aba2c203455d420,codeql_python_benchmark51_v2/tasks/pyvul-9c089aba2c203455d420 +codeql,CVE-2020-15120,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-9dcb85347ac437354c6f,CodeQL python,python,pyvul__spiral-project__ihatemoney,pyvul-9dcb85347ac437354c6f,codeql_python_benchmark51_v2/tasks/pyvul-9dcb85347ac437354c6f +codeql,CVE-2022-3301,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-a2d122cb9e3a61ddca7a,CodeQL python,python,pyvul__ikus060__rdiffweb,pyvul-a2d122cb9e3a61ddca7a,codeql_python_benchmark51_v2/tasks/pyvul-a2d122cb9e3a61ddca7a +codeql,CVE-2020-35653,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-a44d900bae2c75f9ea8d,CodeQL python,python,pyvul__python-pillow__pillow,pyvul-a44d900bae2c75f9ea8d,codeql_python_benchmark51_v2/tasks/pyvul-a44d900bae2c75f9ea8d +codeql,CVE-2021-34363,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-b10e0389c54d164db5b4,CodeQL python,python,pyvul__nvbn__thefuck,pyvul-b10e0389c54d164db5b4,codeql_python_benchmark51_v2/tasks/pyvul-b10e0389c54d164db5b4 +codeql,CVE-2014-1938,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-b5417e7c5b6909a4c5f9,CodeQL python,python,pyvul__alex__rply,pyvul-b5417e7c5b6909a4c5f9,codeql_python_benchmark51_v2/tasks/pyvul-b5417e7c5b6909a4c5f9 +codeql,CVE-2021-21360,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-bae2a9b05bba64edb040,CodeQL python,python,pyvul__zopefoundation__products.genericsetup,pyvul-bae2a9b05bba64edb040,codeql_python_benchmark51_v2/tasks/pyvul-bae2a9b05bba64edb040 +codeql,CVE-2022-24302,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-bf4aded7c76d99f9ef84,CodeQL python,python,pyvul__paramiko__paramiko,pyvul-bf4aded7c76d99f9ef84,codeql_python_benchmark51_v2/tasks/pyvul-bf4aded7c76d99f9ef84 +codeql,CVE-2021-43854,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-c4ca067f7fd871d25376,CodeQL python,python,pyvul__nltk__nltk,pyvul-c4ca067f7fd871d25376,codeql_python_benchmark51_v2/tasks/pyvul-c4ca067f7fd871d25376 +codeql,CVE-2023-2800,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-c52f0447bb0aa65cf9a4,CodeQL python,python,pyvul__huggingface__transformers,pyvul-c52f0447bb0aa65cf9a4,codeql_python_benchmark51_v2/tasks/pyvul-c52f0447bb0aa65cf9a4 +codeql,CVE-2022-4724,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-cb3f3f84ff4550031205,CodeQL python,python,pyvul__ikus060__rdiffweb,pyvul-cb3f3f84ff4550031205,codeql_python_benchmark51_v2/tasks/pyvul-cb3f3f84ff4550031205 +codeql,CVE-2023-49080,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-d005a7cf5935ac7e7aae,CodeQL python,python,pyvul__jupyter-server__jupyter_server,pyvul-d005a7cf5935ac7e7aae,codeql_python_benchmark51_v2/tasks/pyvul-d005a7cf5935ac7e7aae +codeql,CVE-2021-21386,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-d38a3c1956e86350a0c7,CodeQL python,python,pyvul__dwisiswant0__apkleaks,pyvul-d38a3c1956e86350a0c7,codeql_python_benchmark51_v2/tasks/pyvul-d38a3c1956e86350a0c7 +codeql,CVE-2023-5002,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-dbcc9a178b256c49887e,CodeQL python,python,pyvul__pgadmin-org__pgadmin4,pyvul-dbcc9a178b256c49887e,codeql_python_benchmark51_v2/tasks/pyvul-dbcc9a178b256c49887e +codeql,CVE-2023-38201,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede,CodeQL python,python,pyvul__keylime__keylime,pyvul-e305522c703de57f9ede,codeql_python_benchmark51_v2/tasks/pyvul-e305522c703de57f9ede +codeql,CVE-2023-45139,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-e73df8c8998a1ddc180a,CodeQL python,python,pyvul__fonttools__fonttools,pyvul-e73df8c8998a1ddc180a,codeql_python_benchmark51_v2/tasks/pyvul-e73df8c8998a1ddc180a +codeql,CVE-2021-39229,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-f55f7c013a9f5bd1eb0d,CodeQL python,python,pyvul__caronc__apprise,pyvul-f55f7c013a9f5bd1eb0d,codeql_python_benchmark51_v2/tasks/pyvul-f55f7c013a9f5bd1eb0d +codeql,CVE-2023-45813,codeql_python_benchmark51_v2,codeql_python_benchmark51_v2/pyvul-ff1e02f88768f34e43fb,CodeQL python,python,pyvul__dedsecinside__torbot,pyvul-ff1e02f88768f34e43fb,codeql_python_benchmark51_v2/tasks/pyvul-ff1e02f88768f34e43fb +csa,CVE-2014-0749,csa159,csa159/pair_134585,CSA,c/c++,adaptivecomputing_torque,pair_134585,csa159/tasks/pair_134585 +csa,CVE-2017-8911,csa159,csa159/pair_135745,CSA,c/c++,verdammelt_tnef,pair_135745,csa159/tasks/pair_135745 +csa,CVE-2014-8127,csa159,csa159/pair_136342,CSA,c/c++,vadz_libtiff,pair_136342,csa159/tasks/pair_136342 +csa,CVE-2019-9893,csa159,csa159/pair_137674,CSA,c/c++,seccomp_libseccomp,pair_137674,csa159/tasks/pair_137674 +csa,CVE-2014-5388,csa159,csa159/pair_137782,CSA,c/c++,qemu_qemu,pair_137782,csa159/tasks/pair_137782 +csa,CVE-2026-9501,csa159,csa159/pair_138263,CSA,c/c++,LibreDWG_libredwg,pair_138263,csa159/tasks/pair_138263 +csa,CVE-2019-20022,csa159,csa159/pair_138473,CSA,c/c++,saitoha_libsixel,pair_138473,csa159/tasks/pair_138473 +csa,CVE-2026-33165,csa159,csa159/pair_138511,CSA,c/c++,strukturag_libde265,pair_138511,csa159/tasks/pair_138511 +csa,CVE-2025-48367,csa159,csa159/pair_138570,CSA,c/c++,redis_redis,pair_138570,csa159/tasks/pair_138570 +csa,CVE-2024-25269,csa159,csa159/pair_138644,CSA,c/c++,strukturag_libheif,pair_138644,csa159/tasks/pair_138644 +csa,CVE-2025-62171,csa159,csa159/pair_138710,CSA,c/c++,ImageMagick_ImageMagick,pair_138710,csa159/tasks/pair_138710 +csa,CVE-2022-48923,csa159,csa159/pair_139922,CSA,c/c++,torvalds_linux,pair_139922,csa159/tasks/pair_139922 +csa,CVE-2022-49375,csa159,csa159/pair_140347,CSA,c/c++,torvalds_linux,pair_140347,csa159/tasks/pair_140347 +csa,CVE-2022-50419,csa159,csa159/pair_141329,CSA,c/c++,torvalds_linux,pair_141329,csa159/tasks/pair_141329 +csa,CVE-2023-53148,csa159,csa159/pair_142288,CSA,c/c++,torvalds_linux,pair_142288,csa159/tasks/pair_142288 +csa,CVE-2023-53532,csa159,csa159/pair_142647,CSA,c/c++,torvalds_linux,pair_142647,csa159/tasks/pair_142647 +csa,CVE-2025-38226,csa159,csa159/pair_147034,CSA,c/c++,torvalds_linux,pair_147034,csa159/tasks/pair_147034 +csa,CVE-2025-39773,csa159,csa159/pair_147640,CSA,c/c++,torvalds_linux,pair_147640,csa159/tasks/pair_147640 +csa,CVE-2025-39810,csa159,csa159/pair_147676,CSA,c/c++,torvalds_linux,pair_147676,csa159/tasks/pair_147676 +csa,CVE-2025-71146,csa159,csa159/pair_148601,CSA,c/c++,torvalds_linux,pair_148601,csa159/tasks/pair_148601 +csa,CVE-2026-23111,csa159,csa159/pair_148834,CSA,c/c++,torvalds_linux,pair_148834,csa159/tasks/pair_148834 +csa,CVE-2026-31747,csa159,csa159/pair_149548,CSA,c/c++,torvalds_linux,pair_149548,csa159/tasks/pair_149548 +csa,CVE-2026-43054,csa159,csa159/pair_149640,CSA,c/c++,torvalds_linux,pair_149640,csa159/tasks/pair_149640 +csa,CVE-2026-43166,csa159,csa159/pair_149751,CSA,c/c++,torvalds_linux,pair_149751,csa159/tasks/pair_149751 +csa,CVE-2026-43185,csa159,csa159/pair_149770,CSA,c/c++,torvalds_linux,pair_149770,csa159/tasks/pair_149770 +csa,CVE-2026-45863,csa159,csa159/pair_150111,CSA,c/c++,torvalds_linux,pair_150111,csa159/tasks/pair_150111 +csa,CVE-2026-46001,csa159,csa159/pair_150247,CSA,c/c++,torvalds_linux,pair_150247,csa159/tasks/pair_150247 +csa,CVE-2026-46180,csa159,csa159/pair_150426,CSA,c/c++,torvalds_linux,pair_150426,csa159/tasks/pair_150426 +csa,CVE-2022-48730,csa159,csa159/pair_156745,CSA,c/c++,torvalds_linux,pair_156745,csa159/tasks/pair_156745 +csa,CVE-2021-42252,csa159,csa159/pair_157090,CSA,c/c++,torvalds_linux,pair_157090,csa159/tasks/pair_157090 +csa,CVE-2022-50010,csa159,csa159/pair_157305,CSA,c/c++,torvalds_linux,pair_157305,csa159/tasks/pair_157305 +csa,CVE-2025-38692,csa159,csa159/pair_157307,CSA,c/c++,torvalds_linux,pair_157307,csa159/tasks/pair_157307 +csa,CVE-2022-48634,csa159,csa159/pair_158826,CSA,c/c++,torvalds_linux,pair_158826,csa159/tasks/pair_158826 +csa,CVE-2021-47437,csa159,csa159/pair_159680,CSA,c/c++,torvalds_linux,pair_159680,csa159/tasks/pair_159680 +csa,CVE-2024-26811,csa159,csa159/pair_161551,CSA,c/c++,torvalds_linux,pair_161551,csa159/tasks/pair_161551 +csa,CVE-2026-23299,csa159,csa159/pair_161587,CSA,c/c++,torvalds_linux,pair_161587,csa159/tasks/pair_161587 +csa,CVE-2020-28374,csa159,csa159/pair_162518,CSA,c/c++,torvalds_linux,pair_162518,csa159/tasks/pair_162518 +csa,CVE-2024-26954,csa159,csa159/pair_162526,CSA,c/c++,torvalds_linux,pair_162526,csa159/tasks/pair_162526 +csa,CVE-2023-53166,csa159,csa159/pair_162993,CSA,c/c++,torvalds_linux,pair_162993,csa159/tasks/pair_162993 +csa,CVE-2022-49639,csa159,csa159/pair_163682,CSA,c/c++,torvalds_linux,pair_163682,csa159/tasks/pair_163682 +csa,CVE-2024-38384,csa159,csa159/pair_164279,CSA,c/c++,torvalds_linux,pair_164279,csa159/tasks/pair_164279 +csa,CVE-2025-21719,csa159,csa159/pair_164760,CSA,c/c++,torvalds_linux,pair_164760,csa159/tasks/pair_164760 +csa,CVE-2025-37780,csa159,csa159/pair_165550,CSA,c/c++,torvalds_linux,pair_165550,csa159/tasks/pair_165550 +csa,CVE-2019-11338,csa159,csa159/pair_17613,CSA,c/c++,FFmpeg_FFmpeg,pair_17613,csa159/tasks/pair_17613 +csa,CVE-2023-39562,csa159,csa159/pair_4253,CSA,c/c++,gpac_gpac,pair_4253,csa159/tasks/pair_4253 +csa,CVE-2017-7866,csa159,csa159/pair_4869,CSA,c/c++,FFmpeg_FFmpeg,pair_4869,csa159/tasks/pair_4869 +csa,CVE-2020-9365,csa159,csa159/pair_134943,CSA,c/c++,jedisct1_pure-ftpd,pair_134943,csa159/tasks/pair_134943 +csa,CVE-2016-5824,csa159,csa159/pair_135175,CSA,c/c++,libical_libical,pair_135175,csa159/tasks/pair_135175 +csa,CVE-2020-26148,csa159,csa159/pair_135384,CSA,c/c++,mity_md4c,pair_135384,csa159/tasks/pair_135384 +csa,CVE-2018-1000091,csa159,csa159/pair_135405,CSA,c/c++,mwarning_KadNode,pair_135405,csa159/tasks/pair_135405 +csa,CVE-2021-33930,csa159,csa159/pair_135446,CSA,c/c++,openSUSE_libsolv,pair_135446,csa159/tasks/pair_135446 +csa,CVE-2018-19826,csa159,csa159/pair_135624,CSA,c/c++,sass_libsass,pair_135624,csa159/tasks/pair_135624 +csa,CVE-2017-6309,csa159,csa159/pair_135749,CSA,c/c++,verdammelt_tnef,pair_135749,csa159/tasks/pair_135749 +csa,CVE-2020-11764,csa159,csa159/pair_136251,CSA,c/c++,openexr_openexr,pair_136251,csa159/tasks/pair_136251 +csa,CVE-2020-11764,csa159,csa159/pair_136252,CSA,c/c++,openexr_openexr,pair_136252,csa159/tasks/pair_136252 +csa,CVE-2023-3745,csa159,csa159/pair_136864,CSA,c/c++,ImageMagick_ImageMagick6,pair_136864,csa159/tasks/pair_136864 +csa,CVE-2017-5627,csa159,csa159/pair_137200,CSA,c/c++,ccxvii_mujs,pair_137200,csa159/tasks/pair_137200 +csa,CVE-2020-23306,csa159,csa159/pair_137357,CSA,c/c++,jerryscript-project_jerryscript,pair_137357,csa159/tasks/pair_137357 +csa,CVE-2021-46349,csa159,csa159/pair_137374,CSA,c/c++,jerryscript-project_jerryscript,pair_137374,csa159/tasks/pair_137374 +csa,CVE-2020-23312,csa159,csa159/pair_137377,CSA,c/c++,jerryscript-project_jerryscript,pair_137377,csa159/tasks/pair_137377 +csa,CVE-2021-46350,csa159,csa159/pair_137389,CSA,c/c++,jerryscript-project_jerryscript,pair_137389,csa159/tasks/pair_137389 +csa,CVE-2019-19795,csa159,csa159/pair_137518,CSA,c/c++,michaelforney_samurai,pair_137518,csa159/tasks/pair_137518 +csa,CVE-2014-0146,csa159,csa159/pair_137750,CSA,c/c++,qemu_qemu,pair_137750,csa159/tasks/pair_137750 +csa,CVE-2018-16847,csa159,csa159/pair_137751,CSA,c/c++,qemu_qemu,pair_137751,csa159/tasks/pair_137751 +csa,CVE-2018-17963,csa159,csa159/pair_137769,CSA,c/c++,qemu_qemu,pair_137769,csa159/tasks/pair_137769 +csa,CVE-2019-20396,csa159,csa159/pair_138126,CSA,c/c++,CESNET_libyang,pair_138126,csa159/tasks/pair_138126 +csa,CVE-2026-32854,csa159,csa159/pair_138203,CSA,c/c++,LibVNC_libvncserver,pair_138203,csa159/tasks/pair_138203 +csa,CVE-2020-6611,csa159,csa159/pair_138249,CSA,c/c++,LibreDWG_libredwg,pair_138249,csa159/tasks/pair_138249 +csa,CVE-2021-36080,csa159,csa159/pair_138280,CSA,c/c++,LibreDWG_libredwg,pair_138280,csa159/tasks/pair_138280 +csa,CVE-2019-13115,csa159,csa159/pair_138328,CSA,c/c++,libssh2_libssh2,pair_138328,csa159/tasks/pair_138328 +csa,CVE-2024-28319,csa159,csa159/pair_138462,CSA,c/c++,gpac_gpac,pair_138462,csa159/tasks/pair_138462 +csa,CVE-2018-21232,csa159,csa159/pair_138485,CSA,c/c++,skvadrik_re2c,pair_138485,csa159/tasks/pair_138485 +csa,CVE-2016-1924,csa159,csa159/pair_138650,CSA,c/c++,uclouvain_openjpeg,pair_138650,csa159/tasks/pair_138650 +csa,CVE-2026-40169,csa159,csa159/pair_138728,CSA,c/c++,ImageMagick_ImageMagick,pair_138728,csa159/tasks/pair_138728 +csa,CVE-2025-46393,csa159,csa159/pair_138746,CSA,c/c++,ImageMagick_ImageMagick,pair_138746,csa159/tasks/pair_138746 +csa,CVE-2026-33905,csa159,csa159/pair_138756,CSA,c/c++,ImageMagick_ImageMagick,pair_138756,csa159/tasks/pair_138756 +csa,CVE-2011-2161,csa159,csa159/pair_138800,CSA,c/c++,FFmpeg_FFmpeg,pair_138800,csa159/tasks/pair_138800 +csa,CVE-2021-47583,csa159,csa159/pair_139579,CSA,c/c++,torvalds_linux,pair_139579,csa159/tasks/pair_139579 +csa,CVE-2022-49563,csa159,csa159/pair_140531,CSA,c/c++,torvalds_linux,pair_140531,csa159/tasks/pair_140531 +csa,CVE-2022-49727,csa159,csa159/pair_140691,CSA,c/c++,torvalds_linux,pair_140691,csa159/tasks/pair_140691 +csa,CVE-2022-50138,csa159,csa159/pair_141072,CSA,c/c++,torvalds_linux,pair_141072,csa159/tasks/pair_141072 +csa,CVE-2022-50374,csa159,csa159/pair_141289,CSA,c/c++,torvalds_linux,pair_141289,csa159/tasks/pair_141289 +csa,CVE-2022-50459,csa159,csa159/pair_141364,CSA,c/c++,torvalds_linux,pair_141364,csa159/tasks/pair_141364 +csa,CVE-2023-52471,csa159,csa159/pair_141754,CSA,c/c++,torvalds_linux,pair_141754,csa159/tasks/pair_141754 +csa,CVE-2023-52609,csa159,csa159/pair_141857,CSA,c/c++,torvalds_linux,pair_141857,csa159/tasks/pair_141857 +csa,CVE-2023-53250,csa159,csa159/pair_142376,CSA,c/c++,torvalds_linux,pair_142376,csa159/tasks/pair_142376 +csa,CVE-2023-53679,csa159,csa159/pair_142793,CSA,c/c++,torvalds_linux,pair_142793,csa159/tasks/pair_142793 +csa,CVE-2024-26927,csa159,csa159/pair_143586,CSA,c/c++,torvalds_linux,pair_143586,csa159/tasks/pair_143586 +csa,CVE-2024-38628,csa159,csa159/pair_144169,CSA,c/c++,torvalds_linux,pair_144169,csa159/tasks/pair_144169 +csa,CVE-2024-53117,csa159,csa159/pair_145442,CSA,c/c++,torvalds_linux,pair_145442,csa159/tasks/pair_145442 +csa,CVE-2024-53203,csa159,csa159/pair_145527,CSA,c/c++,torvalds_linux,pair_145527,csa159/tasks/pair_145527 +csa,CVE-2024-56605,csa159,csa159/pair_145663,CSA,c/c++,torvalds_linux,pair_145663,csa159/tasks/pair_145663 +csa,CVE-2024-57953,csa159,csa159/pair_145933,CSA,c/c++,torvalds_linux,pair_145933,csa159/tasks/pair_145933 +csa,CVE-2024-57996,csa159,csa159/pair_145957,CSA,c/c++,torvalds_linux,pair_145957,csa159/tasks/pair_145957 +csa,CVE-2024-58065,csa159,csa159/pair_146000,CSA,c/c++,torvalds_linux,pair_146000,csa159/tasks/pair_146000 +csa,CVE-2025-21986,csa159,csa159/pair_146389,CSA,c/c++,torvalds_linux,pair_146389,csa159/tasks/pair_146389 +csa,CVE-2025-38415,csa159,csa159/pair_147222,CSA,c/c++,torvalds_linux,pair_147222,csa159/tasks/pair_147222 +csa,CVE-2025-38459,csa159,csa159/pair_147266,CSA,c/c++,torvalds_linux,pair_147266,csa159/tasks/pair_147266 +csa,CVE-2025-40313,csa159,csa159/pair_148175,CSA,c/c++,torvalds_linux,pair_148175,csa159/tasks/pair_148175 +csa,CVE-2026-43160,csa159,csa159/pair_149745,CSA,c/c++,torvalds_linux,pair_149745,csa159/tasks/pair_149745 +csa,CVE-2026-43249,csa159,csa159/pair_149834,CSA,c/c++,torvalds_linux,pair_149834,csa159/tasks/pair_149834 +csa,CVE-2026-43376,csa159,csa159/pair_149959,CSA,c/c++,torvalds_linux,pair_149959,csa159/tasks/pair_149959 +csa,CVE-2026-46045,csa159,csa159/pair_150291,CSA,c/c++,torvalds_linux,pair_150291,csa159/tasks/pair_150291 +csa,CVE-2026-46090,csa159,csa159/pair_150336,CSA,c/c++,torvalds_linux,pair_150336,csa159/tasks/pair_150336 +csa,CVE-2022-49007,csa159,csa159/pair_156097,CSA,c/c++,torvalds_linux,pair_156097,csa159/tasks/pair_156097 +csa,CVE-2024-42272,csa159,csa159/pair_156217,CSA,c/c++,torvalds_linux,pair_156217,csa159/tasks/pair_156217 +csa,CVE-2023-52505,csa159,csa159/pair_156267,CSA,c/c++,torvalds_linux,pair_156267,csa159/tasks/pair_156267 +csa,CVE-2024-26664,csa159,csa159/pair_156473,CSA,c/c++,torvalds_linux,pair_156473,csa159/tasks/pair_156473 +csa,CVE-2025-38568,csa159,csa159/pair_156640,CSA,c/c++,torvalds_linux,pair_156640,csa159/tasks/pair_156640 +csa,CVE-2023-53057,csa159,csa159/pair_156704,CSA,c/c++,torvalds_linux,pair_156704,csa159/tasks/pair_156704 +csa,CVE-2023-52865,csa159,csa159/pair_156860,CSA,c/c++,torvalds_linux,pair_156860,csa159/tasks/pair_156860 +csa,CVE-2022-48818,csa159,csa159/pair_156981,CSA,c/c++,torvalds_linux,pair_156981,csa159/tasks/pair_156981 +csa,CVE-2022-49519,csa159,csa159/pair_157153,CSA,c/c++,torvalds_linux,pair_157153,csa159/tasks/pair_157153 +csa,CVE-2022-48665,csa159,csa159/pair_158138,CSA,c/c++,torvalds_linux,pair_158138,csa159/tasks/pair_158138 +csa,CVE-2026-53322,csa159,csa159/pair_158217,CSA,c/c++,torvalds_linux,pair_158217,csa159/tasks/pair_158217 +csa,CVE-2022-50131,csa159,csa159/pair_158385,CSA,c/c++,torvalds_linux,pair_158385,csa159/tasks/pair_158385 +csa,CVE-2023-1078,csa159,csa159/pair_158831,CSA,c/c++,torvalds_linux,pair_158831,csa159/tasks/pair_158831 +csa,CVE-2022-49208,csa159,csa159/pair_159264,CSA,c/c++,torvalds_linux,pair_159264,csa159/tasks/pair_159264 +csa,CVE-2024-36899,csa159,csa159/pair_159377,CSA,c/c++,torvalds_linux,pair_159377,csa159/tasks/pair_159377 +csa,CVE-2025-37812,csa159,csa159/pair_160021,CSA,c/c++,torvalds_linux,pair_160021,csa159/tasks/pair_160021 +csa,CVE-2023-52569,csa159,csa159/pair_160187,CSA,c/c++,torvalds_linux,pair_160187,csa159/tasks/pair_160187 +csa,CVE-2023-52603,csa159,csa159/pair_160364,CSA,c/c++,torvalds_linux,pair_160364,csa159/tasks/pair_160364 +csa,CVE-2023-28464,csa159,csa159/pair_160434,CSA,c/c++,torvalds_linux,pair_160434,csa159/tasks/pair_160434 +csa,CVE-2025-38129,csa159,csa159/pair_160451,CSA,c/c++,torvalds_linux,pair_160451,csa159/tasks/pair_160451 +csa,CVE-2024-45017,csa159,csa159/pair_160603,CSA,c/c++,torvalds_linux,pair_160603,csa159/tasks/pair_160603 +csa,CVE-2022-49123,csa159,csa159/pair_160628,CSA,c/c++,torvalds_linux,pair_160628,csa159/tasks/pair_160628 +csa,CVE-2024-41059,csa159,csa159/pair_160904,CSA,c/c++,torvalds_linux,pair_160904,csa159/tasks/pair_160904 +csa,CVE-2024-42242,csa159,csa159/pair_160912,CSA,c/c++,torvalds_linux,pair_160912,csa159/tasks/pair_160912 +csa,CVE-2024-26585,csa159,csa159/pair_161027,CSA,c/c++,torvalds_linux,pair_161027,csa159/tasks/pair_161027 +csa,CVE-2024-38593,csa159,csa159/pair_161598,CSA,c/c++,torvalds_linux,pair_161598,csa159/tasks/pair_161598 +csa,CVE-2024-26583,csa159,csa159/pair_161667,CSA,c/c++,torvalds_linux,pair_161667,csa159/tasks/pair_161667 +csa,CVE-2025-21811,csa159,csa159/pair_161782,CSA,c/c++,torvalds_linux,pair_161782,csa159/tasks/pair_161782 +csa,CVE-2023-52843,csa159,csa159/pair_161997,CSA,c/c++,torvalds_linux,pair_161997,csa159/tasks/pair_161997 +csa,CVE-2023-53827,csa159,csa159/pair_162003,CSA,c/c++,torvalds_linux,pair_162003,csa159/tasks/pair_162003 +csa,CVE-2022-4095,csa159,csa159/pair_162331,CSA,c/c++,torvalds_linux,pair_162331,csa159/tasks/pair_162331 +csa,CVE-2022-48735,csa159,csa159/pair_162535,CSA,c/c++,torvalds_linux,pair_162535,csa159/tasks/pair_162535 +csa,CVE-2021-47032,csa159,csa159/pair_162672,CSA,c/c++,torvalds_linux,pair_162672,csa159/tasks/pair_162672 +csa,CVE-2024-36016,csa159,csa159/pair_162700,CSA,c/c++,torvalds_linux,pair_162700,csa159/tasks/pair_162700 +csa,CVE-2024-39509,csa159,csa159/pair_163294,CSA,c/c++,torvalds_linux,pair_163294,csa159/tasks/pair_163294 +csa,CVE-2025-38150,csa159,csa159/pair_163698,CSA,c/c++,torvalds_linux,pair_163698,csa159/tasks/pair_163698 +csa,CVE-2024-36484,csa159,csa159/pair_163737,CSA,c/c++,torvalds_linux,pair_163737,csa159/tasks/pair_163737 +csa,CVE-2023-39194,csa159,csa159/pair_163761,CSA,c/c++,torvalds_linux,pair_163761,csa159/tasks/pair_163761 +csa,CVE-2025-68337,csa159,csa159/pair_163824,CSA,c/c++,torvalds_linux,pair_163824,csa159/tasks/pair_163824 +csa,CVE-2024-56584,csa159,csa159/pair_163861,CSA,c/c++,torvalds_linux,pair_163861,csa159/tasks/pair_163861 +csa,CVE-2023-45863,csa159,csa159/pair_163978,CSA,c/c++,torvalds_linux,pair_163978,csa159/tasks/pair_163978 +csa,CVE-2023-52435,csa159,csa159/pair_164140,CSA,c/c++,torvalds_linux,pair_164140,csa159/tasks/pair_164140 +csa,CVE-2022-48893,csa159,csa159/pair_164624,CSA,c/c++,torvalds_linux,pair_164624,csa159/tasks/pair_164624 +csa,CVE-2021-47109,csa159,csa159/pair_164920,CSA,c/c++,torvalds_linux,pair_164920,csa159/tasks/pair_164920 +csa,CVE-2023-52623,csa159,csa159/pair_164974,CSA,c/c++,torvalds_linux,pair_164974,csa159/tasks/pair_164974 +csa,CVE-2022-28796,csa159,csa159/pair_165542,CSA,c/c++,torvalds_linux,pair_165542,csa159/tasks/pair_165542 +csa,CVE-2022-49580,csa159,csa159/pair_165655,CSA,c/c++,torvalds_linux,pair_165655,csa159/tasks/pair_165655 +csa,CVE-2023-45863,csa159,csa159/pair_165738,CSA,c/c++,torvalds_linux,pair_165738,csa159/tasks/pair_165738 +csa,CVE-2021-40572,csa159,csa159/pair_3538,CSA,c/c++,gpac_gpac,pair_3538,csa159/tasks/pair_3538 +csa,CVE-2020-36138,csa159,csa159/pair_4701,CSA,c/c++,FFmpeg_FFmpeg,pair_4701,csa159/tasks/pair_4701 +csa,CVE-2020-11096,csa159,csa159/pair_6060,CSA,c/c++,FreeRDP_FreeRDP,pair_6060,csa159/tasks/pair_6060 +csa,CVE-2018-8784,csa159,csa159/pair_6105,CSA,c/c++,FreeRDP_FreeRDP,pair_6105,csa159/tasks/pair_6105 +csa,CVE-2020-11038,csa159,csa159/pair_6132,CSA,c/c++,FreeRDP_FreeRDP,pair_6132,csa159/tasks/pair_6132 +csa,CVE-2016-5418,csa159,csa159/pair_7278,CSA,c/c++,libarchive_libarchive,pair_7278,csa159/tasks/pair_7278 +csa,CVE-2013-0211,csa159,csa159/pair_7287,CSA,c/c++,libarchive_libarchive,pair_7287,csa159/tasks/pair_7287 diff --git a/dataset/selected_tasks.jsonl b/dataset/selected_tasks.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..5999b97ae02c5942e4d34d4f1d72eb24066f2668 --- /dev/null +++ b/dataset/selected_tasks.jsonl @@ -0,0 +1,300 @@ +{"backend": "codeql", "cve_id": "CVE-2022-4741", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78", "group": "CodeQL go", "language": "go", "project_id": "morefixes__sajari__docconv", "task_id": "morefixes-02cb4e0a6c5aaabd6a78", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-02cb4e0a6c5aaabd6a78"} +{"backend": "codeql", "cve_id": "CVE-2025-47281", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406", "group": "CodeQL go", "language": "go", "project_id": "morefixes__kyverno__kyverno", "task_id": "morefixes-08d699b1f7c72c366406", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-08d699b1f7c72c366406"} +{"backend": "codeql", "cve_id": "CVE-2020-29243", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb", "group": "CodeQL go", "language": "go", "project_id": "morefixes__dhowden__tag", "task_id": "morefixes-096cbfbd1d27f9ce86fb", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-096cbfbd1d27f9ce86fb"} +{"backend": "codeql", "cve_id": "CVE-2023-34236", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f", "group": "CodeQL go", "language": "go", "project_id": "morefixes__weaveworks__tf-controller", "task_id": "morefixes-0adb0a489b07a50d6b2f", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-0adb0a489b07a50d6b2f"} +{"backend": "codeql", "cve_id": "CVE-2022-41939", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28", "group": "CodeQL go", "language": "go", "project_id": "morefixes__knative__func", "task_id": "morefixes-110ab7950a2c0b2c6f28", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-110ab7950a2c0b2c6f28"} +{"backend": "codeql", "cve_id": "CVE-2023-27582", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555", "group": "CodeQL go", "language": "go", "project_id": "morefixes__foxcpp__maddy", "task_id": "morefixes-1218ce956f8120d59555", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-1218ce956f8120d59555"} +{"backend": "codeql", "cve_id": "CVE-2024-39315", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807", "group": "CodeQL go", "language": "go", "project_id": "morefixes__pomerium__pomerium", "task_id": "morefixes-14446e68cdc53bc98807", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-14446e68cdc53bc98807"} +{"backend": "codeql", "cve_id": "CVE-2022-2582", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5", "group": "CodeQL go", "language": "go", "project_id": "morefixes__aws__aws-sdk-go", "task_id": "morefixes-1d20aba9f4be2de73db5", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-1d20aba9f4be2de73db5"} +{"backend": "codeql", "cve_id": "CVE-2025-66626", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460", "group": "CodeQL go", "language": "go", "project_id": "morefixes__argoproj__argo-workflows", "task_id": "morefixes-2331a664751876781460", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-2331a664751876781460"} +{"backend": "codeql", "cve_id": "CVE-2019-12496", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26", "group": "CodeQL go", "language": "go", "project_id": "morefixes__hybridgroup__gobot", "task_id": "morefixes-2cc25dee5f2a118bcb26", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-2cc25dee5f2a118bcb26"} +{"backend": "codeql", "cve_id": "CVE-2026-40890", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b", "group": "CodeQL go", "language": "go", "project_id": "morefixes__gomarkdown__markdown", "task_id": "morefixes-30e495de2402bd4bed4b", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-30e495de2402bd4bed4b"} +{"backend": "codeql", "cve_id": "CVE-2024-7773", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad", "group": "CodeQL go", "language": "go", "project_id": "morefixes__ollama__ollama", "task_id": "morefixes-32ed35a8bd8aba7b47ad", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-32ed35a8bd8aba7b47ad"} +{"backend": "codeql", "cve_id": "CVE-2023-40586", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2", "group": "CodeQL go", "language": "go", "project_id": "morefixes__corazawaf__coraza", "task_id": "morefixes-398ac78e3981b77e4ee2", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-398ac78e3981b77e4ee2"} +{"backend": "codeql", "cve_id": "CVE-2022-41920", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443", "group": "CodeQL go", "language": "go", "project_id": "morefixes__duke-git__lancet", "task_id": "morefixes-461c7bace102119cf443", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-461c7bace102119cf443"} +{"backend": "codeql", "cve_id": "CVE-2026-10722", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e", "group": "CodeQL go", "language": "go", "project_id": "morefixes__cilium__ebpf", "task_id": "morefixes-50b28fbf07dd2d79022e", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-50b28fbf07dd2d79022e"} +{"backend": "codeql", "cve_id": "CVE-2023-47105", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c", "group": "CodeQL go", "language": "go", "project_id": "morefixes__chaosblade-io__chaosblade", "task_id": "morefixes-5ad30634efaa1d03593c", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-5ad30634efaa1d03593c"} +{"backend": "codeql", "cve_id": "CVE-2024-23840", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247", "group": "CodeQL go", "language": "go", "project_id": "morefixes__goreleaser__goreleaser", "task_id": "morefixes-5c2773bb1de86a62a247", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-5c2773bb1de86a62a247"} +{"backend": "codeql", "cve_id": "CVE-2022-30428", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17", "group": "CodeQL go", "language": "go", "project_id": "morefixes__gphper__ginadmin", "task_id": "morefixes-5cfa41b8575717ecee17", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-5cfa41b8575717ecee17"} +{"backend": "codeql", "cve_id": "CVE-2020-36568", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b", "group": "CodeQL go", "language": "go", "project_id": "morefixes__revel__revel", "task_id": "morefixes-6e40429ff01c5ab8b71b", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-6e40429ff01c5ab8b71b"} +{"backend": "codeql", "cve_id": "CVE-2023-33965", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2", "group": "CodeQL go", "language": "go", "project_id": "morefixes__txthinking__brook", "task_id": "morefixes-7c57d35438d22210ced2", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-7c57d35438d22210ced2"} +{"backend": "codeql", "cve_id": "CVE-2026-8275", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a", "group": "CodeQL go", "language": "go", "project_id": "morefixes__bettercap__bettercap", "task_id": "morefixes-7e2af82757795db7f69a", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-7e2af82757795db7f69a"} +{"backend": "codeql", "cve_id": "CVE-2024-41270", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4", "group": "CodeQL go", "language": "go", "project_id": "morefixes__appleboy__gorush", "task_id": "morefixes-9fbea0e4da10bfc882d4", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-9fbea0e4da10bfc882d4"} +{"backend": "codeql", "cve_id": "CVE-2023-46132", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d", "group": "CodeQL go", "language": "go", "project_id": "morefixes__hyperledger__fabric", "task_id": "morefixes-a469597c1a5d38baeb5d", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-a469597c1a5d38baeb5d"} +{"backend": "codeql", "cve_id": "CVE-2023-34105", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1", "group": "CodeQL go", "language": "go", "project_id": "morefixes__ossrs__srs", "task_id": "morefixes-a9ee7c2085f2981a7be1", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-a9ee7c2085f2981a7be1"} +{"backend": "codeql", "cve_id": "CVE-2018-1002207", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1", "group": "CodeQL go", "language": "go", "project_id": "morefixes__mholt__archiver", "task_id": "morefixes-c254bd7b8a82b4ef45c1", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-c254bd7b8a82b4ef45c1"} +{"backend": "codeql", "cve_id": "CVE-2017-1000070", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3", "group": "CodeQL go", "language": "go", "project_id": "morefixes__bitly__oauth2_proxy", "task_id": "morefixes-cd95b2e4d63395291cd3", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-cd95b2e4d63395291cd3"} +{"backend": "codeql", "cve_id": "CVE-2025-67499", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685", "group": "CodeQL go", "language": "go", "project_id": "morefixes__containernetworking__plugins", "task_id": "morefixes-d3400ed5292d19661685", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-d3400ed5292d19661685"} +{"backend": "codeql", "cve_id": "CVE-2022-21698", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f", "group": "CodeQL go", "language": "go", "project_id": "morefixes__prometheus__client_golang", "task_id": "morefixes-e3f3ac87786e2080b81f", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-e3f3ac87786e2080b81f"} +{"backend": "codeql", "cve_id": "CVE-2021-3538", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9", "group": "CodeQL go", "language": "go", "project_id": "morefixes__satori__go.uuid", "task_id": "morefixes-f0d857f4ad82fae5a3a9", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-f0d857f4ad82fae5a3a9"} +{"backend": "codeql", "cve_id": "CVE-2025-32445", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae", "group": "CodeQL go", "language": "go", "project_id": "morefixes__argoproj__argo-events", "task_id": "morefixes-fb75b5c545e3cb24f7ae", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-fb75b5c545e3cb24f7ae"} +{"backend": "codeql", "cve_id": "CVE-2023-2196", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__codedx-plugin", "task_id": "morefixes-02f75a63a6f0b8d6c6c7", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-02f75a63a6f0b8d6c6c7"} +{"backend": "codeql", "cve_id": "CVE-2021-21656", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__xcode-plugin", "task_id": "morefixes-04bdb708bf23aabdc444", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-04bdb708bf23aabdc444"} +{"backend": "codeql", "cve_id": "CVE-2021-21632", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__dependency-track-plugin", "task_id": "morefixes-05d6240fd5a9017a44ec", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-05d6240fd5a9017a44ec"} +{"backend": "codeql", "cve_id": "CVE-2020-2132", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__environment-manager-tools-plugin", "task_id": "morefixes-0608482232bb0119b561", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-0608482232bb0119b561"} +{"backend": "codeql", "cve_id": "CVE-2020-2311", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__aws-global-configuration-plugin", "task_id": "morefixes-0709c903a0f96b124bd5", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-0709c903a0f96b124bd5"} +{"backend": "codeql", "cve_id": "CVE-2020-14297", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__wildfly__jboss-ejb-client", "task_id": "morefixes-09002f4d38e9ecf8238a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-09002f4d38e9ecf8238a"} +{"backend": "codeql", "cve_id": "CVE-2020-25023", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704", "group": "CodeQL java", "language": "java", "project_id": "morefixes__rweather__noise-java", "task_id": "morefixes-13b1b3610eb300ab9704", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-13b1b3610eb300ab9704"} +{"backend": "codeql", "cve_id": "CVE-2023-25141", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3", "group": "CodeQL java", "language": "java", "project_id": "morefixes__apache__sling-org-apache-sling-jcr-base", "task_id": "morefixes-149c5507d76b198944c3", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-149c5507d76b198944c3"} +{"backend": "codeql", "cve_id": "CVE-2022-43183", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493", "group": "CodeQL java", "language": "java", "project_id": "morefixes__xuxueli__xxl-job", "task_id": "morefixes-19d7bda86b839e7fc493", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-19d7bda86b839e7fc493"} +{"backend": "codeql", "cve_id": "CVE-2025-29908", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752", "group": "CodeQL java", "language": "java", "project_id": "morefixes__netty__netty-incubator-codec-quic", "task_id": "morefixes-1f67e1cf382f2e332752", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-1f67e1cf382f2e332752"} +{"backend": "codeql", "cve_id": "CVE-2020-25022", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c", "group": "CodeQL java", "language": "java", "project_id": "morefixes__rweather__noise-java", "task_id": "morefixes-21b89e6983680bd0068c", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-21b89e6983680bd0068c"} +{"backend": "codeql", "cve_id": "CVE-2021-22573", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b", "group": "CodeQL java", "language": "java", "project_id": "morefixes__googleapis__google-oauth-java-client", "task_id": "morefixes-23c03b1bf7a3c44f444b", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-23c03b1bf7a3c44f444b"} +{"backend": "codeql", "cve_id": "CVE-2021-39196", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jdhwpgmbca__pcapture", "task_id": "morefixes-2b14860afe0d3bf8094a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-2b14860afe0d3bf8094a"} +{"backend": "codeql", "cve_id": "CVE-2022-4641", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072", "group": "CodeQL java", "language": "java", "project_id": "morefixes__tdunning__pig-vector", "task_id": "morefixes-35510b21cf51a9acf072", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-35510b21cf51a9acf072"} +{"backend": "codeql", "cve_id": "CVE-2025-67030", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9", "group": "CodeQL java", "language": "java", "project_id": "morefixes__codehaus-plexus__plexus-utils", "task_id": "morefixes-378f408f498b20422fe9", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-378f408f498b20422fe9"} +{"backend": "codeql", "cve_id": "CVE-2024-39118", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71", "group": "CodeQL java", "language": "java", "project_id": "morefixes__mommyheather__advancedbackups", "task_id": "morefixes-3cc69a690ef991c8bd71", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-3cc69a690ef991c8bd71"} +{"backend": "codeql", "cve_id": "CVE-2024-36114", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20", "group": "CodeQL java", "language": "java", "project_id": "morefixes__airlift__aircompressor", "task_id": "morefixes-462566b2f857f458bf20", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-462566b2f857f458bf20"} +{"backend": "codeql", "cve_id": "CVE-2020-36640", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-4a0720656247f4fdd55d", "group": "CodeQL java", "language": "java", "project_id": "morefixes__bonitasoft__bonita-connector-webservice", "task_id": "morefixes-4a0720656247f4fdd55d", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-4a0720656247f4fdd55d"} +{"backend": "codeql", "cve_id": "CVE-2023-48299", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-623c5f3c0558ba463c5a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__pytorch__serve", "task_id": "morefixes-623c5f3c0558ba463c5a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-623c5f3c0558ba463c5a"} +{"backend": "codeql", "cve_id": "CVE-2024-1102", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-6c80dd14ea98e73d8b2e", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jberet__jsr352", "task_id": "morefixes-6c80dd14ea98e73d8b2e", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-6c80dd14ea98e73d8b2e"} +{"backend": "codeql", "cve_id": "CVE-2022-41967", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-76076416f1349da24444", "group": "CodeQL java", "language": "java", "project_id": "morefixes__hyperadev__dragonfly", "task_id": "morefixes-76076416f1349da24444", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-76076416f1349da24444"} +{"backend": "codeql", "cve_id": "CVE-2025-4641", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-80a186235f1faf976a71", "group": "CodeQL java", "language": "java", "project_id": "morefixes__bonigarcia__webdrivermanager", "task_id": "morefixes-80a186235f1faf976a71", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-80a186235f1faf976a71"} +{"backend": "codeql", "cve_id": "CVE-2020-1729", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-8641a4da2de2d0610576", "group": "CodeQL java", "language": "java", "project_id": "morefixes__smallrye__smallrye-config", "task_id": "morefixes-8641a4da2de2d0610576", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-8641a4da2de2d0610576"} +{"backend": "codeql", "cve_id": "CVE-2022-29631", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-8e4d1bd2b930ae852ae1", "group": "CodeQL java", "language": "java", "project_id": "morefixes__oblac__jodd-http", "task_id": "morefixes-8e4d1bd2b930ae852ae1", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-8e4d1bd2b930ae852ae1"} +{"backend": "codeql", "cve_id": "CVE-2020-17534", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-9db4a0f5f07f59debbce", "group": "CodeQL java", "language": "java", "project_id": "morefixes__apache__netbeans-html4j", "task_id": "morefixes-9db4a0f5f07f59debbce", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-9db4a0f5f07f59debbce"} +{"backend": "codeql", "cve_id": "CVE-2025-67721", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-a624a25672727b30851a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__airlift__aircompressor", "task_id": "morefixes-a624a25672727b30851a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-a624a25672727b30851a"} +{"backend": "codeql", "cve_id": "CVE-2022-24913", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-ab625a5d0d2a27547494", "group": "CodeQL java", "language": "java", "project_id": "morefixes__cowtowncoder__java-merge-sort", "task_id": "morefixes-ab625a5d0d2a27547494", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-ab625a5d0d2a27547494"} +{"backend": "codeql", "cve_id": "CVE-2024-57699", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-ac88413b62ef5803c04f", "group": "CodeQL java", "language": "java", "project_id": "morefixes__netplex__json-smart-v2", "task_id": "morefixes-ac88413b62ef5803c04f", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-ac88413b62ef5803c04f"} +{"backend": "codeql", "cve_id": "CVE-2025-67721", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-cf8752e9dc2f57b1d5c8", "group": "CodeQL java", "language": "java", "project_id": "morefixes__airlift__aircompressor", "task_id": "morefixes-cf8752e9dc2f57b1d5c8", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-cf8752e9dc2f57b1d5c8"} +{"backend": "codeql", "cve_id": "CVE-2022-4494", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-f298b6158c5168025365", "group": "CodeQL java", "language": "java", "project_id": "morefixes__bspkrs__mcpmappingviewer", "task_id": "morefixes-f298b6158c5168025365", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-f298b6158c5168025365"} +{"backend": "codeql", "cve_id": "CVE-2023-33194", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-040d724ca8211a3aaf1d", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__craftcms__cms", "task_id": "morefixes-040d724ca8211a3aaf1d", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-040d724ca8211a3aaf1d"} +{"backend": "codeql", "cve_id": "CVE-2026-25642", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__hedgedoc__hedgedoc", "task_id": "morefixes-04314885419e817d3b17", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-04314885419e817d3b17"} +{"backend": "codeql", "cve_id": "CVE-2025-59526", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-08f7e6287de57ef9a5c8", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__eladnava__mailgen", "task_id": "morefixes-08f7e6287de57ef9a5c8", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-08f7e6287de57ef9a5c8"} +{"backend": "codeql", "cve_id": "CVE-2018-3758", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0e82cb4ad70fc2c896ef", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__mrvautin__expresscart", "task_id": "morefixes-0e82cb4ad70fc2c896ef", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0e82cb4ad70fc2c896ef"} +{"backend": "codeql", "cve_id": "CVE-2026-45787", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0e8f49f3d1cc46668f9b", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__electerm__electerm", "task_id": "morefixes-0e8f49f3d1cc46668f9b", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0e8f49f3d1cc46668f9b"} +{"backend": "codeql", "cve_id": "CVE-2021-3801", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0ea8f5f13e7432539721", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__prismjs__prism", "task_id": "morefixes-0ea8f5f13e7432539721", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0ea8f5f13e7432539721"} +{"backend": "codeql", "cve_id": "CVE-2025-49590", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0f4271d4851600835c47", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__cryptpad__cryptpad", "task_id": "morefixes-0f4271d4851600835c47", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0f4271d4851600835c47"} +{"backend": "codeql", "cve_id": "CVE-2024-25981", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-135296414af3a0faf089", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__moodle__moodle", "task_id": "morefixes-135296414af3a0faf089", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-135296414af3a0faf089"} +{"backend": "codeql", "cve_id": "CVE-2014-5273", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-16768fdfa00c963539dc", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__phpmyadmin__phpmyadmin", "task_id": "morefixes-16768fdfa00c963539dc", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-16768fdfa00c963539dc"} +{"backend": "codeql", "cve_id": "CVE-2024-40761", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-17d21311a4f5af9bbc4f", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__apache__incubator-answer", "task_id": "morefixes-17d21311a4f5af9bbc4f", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-17d21311a4f5af9bbc4f"} +{"backend": "codeql", "cve_id": "CVE-2025-46344", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-1cf55be2336b09a515a6", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__auth0__nextjs-auth0", "task_id": "morefixes-1cf55be2336b09a515a6", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-1cf55be2336b09a515a6"} +{"backend": "codeql", "cve_id": "CVE-2026-22819", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__outray-tunnel__outray", "task_id": "morefixes-312479357bdfa998bf6e", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-312479357bdfa998bf6e"} +{"backend": "codeql", "cve_id": "CVE-2025-10044", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-374e3093d6d5875aa960", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__keycloak__keycloak", "task_id": "morefixes-374e3093d6d5875aa960", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-374e3093d6d5875aa960"} +{"backend": "codeql", "cve_id": "CVE-2021-4124", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-4b95de19a5da1e74a747", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__meetecho__janus-gateway", "task_id": "morefixes-4b95de19a5da1e74a747", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-4b95de19a5da1e74a747"} +{"backend": "codeql", "cve_id": "CVE-2021-25990", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-4ffaae63e8f8c0012a0f", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__ifmeorg__ifme", "task_id": "morefixes-4ffaae63e8f8c0012a0f", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-4ffaae63e8f8c0012a0f"} +{"backend": "codeql", "cve_id": "CVE-2023-47635", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-516c6c53716bba29b7f0", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__decidim__decidim", "task_id": "morefixes-516c6c53716bba29b7f0", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-516c6c53716bba29b7f0"} +{"backend": "codeql", "cve_id": "CVE-2010-2273", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-550b9b77dc4d0c01e1fe", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__dojo__dojo", "task_id": "morefixes-550b9b77dc4d0c01e1fe", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-550b9b77dc4d0c01e1fe"} +{"backend": "codeql", "cve_id": "CVE-2024-22411", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-58be9c1811ee7367cce5", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__avo-hq__avo", "task_id": "morefixes-58be9c1811ee7367cce5", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-58be9c1811ee7367cce5"} +{"backend": "codeql", "cve_id": "CVE-2020-11611", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-60205e347d7f83ebc999", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__ofirdagan__cross-domain-local-storage", "task_id": "morefixes-60205e347d7f83ebc999", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-60205e347d7f83ebc999"} +{"backend": "codeql", "cve_id": "CVE-2017-1000189", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-633246d79fea5271cdce", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__mde__ejs", "task_id": "morefixes-633246d79fea5271cdce", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-633246d79fea5271cdce"} +{"backend": "codeql", "cve_id": "CVE-2018-11798", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-88a92b26b3a23d01f412", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__apache__thrift", "task_id": "morefixes-88a92b26b3a23d01f412", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-88a92b26b3a23d01f412"} +{"backend": "codeql", "cve_id": "CVE-2024-28176", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-941abf85c9b7d820de47", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__panva__jose", "task_id": "morefixes-941abf85c9b7d820de47", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-941abf85c9b7d820de47"} +{"backend": "codeql", "cve_id": "CVE-2026-39941", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__churchcrm__crm", "task_id": "morefixes-99aea6539029d3ab985e", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-99aea6539029d3ab985e"} +{"backend": "codeql", "cve_id": "CVE-2024-45312", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-9f8a2d1b597df98c6680", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__overleaf__overleaf", "task_id": "morefixes-9f8a2d1b597df98c6680", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-9f8a2d1b597df98c6680"} +{"backend": "codeql", "cve_id": "CVE-2025-11222", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-b475f3a535ea41bec3ff", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__line__centraldogma", "task_id": "morefixes-b475f3a535ea41bec3ff", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-b475f3a535ea41bec3ff"} +{"backend": "codeql", "cve_id": "CVE-2026-10269", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-b61b3848e076036c7b06", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__decolua__9router", "task_id": "morefixes-b61b3848e076036c7b06", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-b61b3848e076036c7b06"} +{"backend": "codeql", "cve_id": "CVE-2022-39267", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-bd56f8e5b73f132cd962", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__brokercap__bifrost", "task_id": "morefixes-bd56f8e5b73f132cd962", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-bd56f8e5b73f132cd962"} +{"backend": "codeql", "cve_id": "CVE-2020-7729", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-bd86b40955cabdb21c65", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__gruntjs__grunt", "task_id": "morefixes-bd86b40955cabdb21c65", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-bd86b40955cabdb21c65"} +{"backend": "codeql", "cve_id": "CVE-2023-37259", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-f1044573e0d15a82a1d0", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__matrix-org__matrix-react-sdk", "task_id": "morefixes-f1044573e0d15a82a1d0", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-f1044573e0d15a82a1d0"} +{"backend": "codeql", "cve_id": "CVE-2021-21679", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-f37103ca8d19c93116f8", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__jenkinsci__azure-ad-plugin", "task_id": "morefixes-f37103ca8d19c93116f8", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-f37103ca8d19c93116f8"} +{"backend": "codeql", "cve_id": "CVE-2021-21371", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-03252773bde39ba37465", "group": "CodeQL python", "language": "python", "project_id": "pyvul__tenable__integration-jira-cloud", "task_id": "pyvul-03252773bde39ba37465", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-03252773bde39ba37465"} +{"backend": "codeql", "cve_id": "CVE-2023-6977", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-07332271886167133edf", "group": "CodeQL python", "language": "python", "project_id": "pyvul__mlflow__mlflow", "task_id": "pyvul-07332271886167133edf", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-07332271886167133edf"} +{"backend": "codeql", "cve_id": "CVE-2020-12889", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-0e38a9079f90a5ac566e", "group": "CodeQL python", "language": "python", "project_id": "pyvul__misp__misp-maltego", "task_id": "pyvul-0e38a9079f90a5ac566e", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-0e38a9079f90a5ac566e"} +{"backend": "codeql", "cve_id": "CVE-2023-30629", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-10fb77265dc23f305315", "group": "CodeQL python", "language": "python", "project_id": "pyvul__vyperlang__vyper", "task_id": "pyvul-10fb77265dc23f305315", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-10fb77265dc23f305315"} +{"backend": "codeql", "cve_id": "CVE-2019-3830", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-135c7fcada946877931a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__openstack__ceilometer", "task_id": "pyvul-135c7fcada946877931a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-135c7fcada946877931a"} +{"backend": "codeql", "cve_id": "CVE-2020-10799", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19", "group": "CodeQL python", "language": "python", "project_id": "pyvul__deeplook__svglib", "task_id": "pyvul-15c0ad3037992bda1b19", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-15c0ad3037992bda1b19"} +{"backend": "codeql", "cve_id": "CVE-2022-0736", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-1a630dd8f83b2e29740d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__mlflow__mlflow", "task_id": "pyvul-1a630dd8f83b2e29740d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-1a630dd8f83b2e29740d"} +{"backend": "codeql", "cve_id": "CVE-2022-42965", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-1f5068a3fe5ca0192a07", "group": "CodeQL python", "language": "python", "project_id": "pyvul__snowflakedb__snowflake-connector-python", "task_id": "pyvul-1f5068a3fe5ca0192a07", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-1f5068a3fe5ca0192a07"} +{"backend": "codeql", "cve_id": "CVE-2021-46898", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-2ab65d62986b80922362", "group": "CodeQL python", "language": "python", "project_id": "pyvul__sehmaschine__django-grappelli", "task_id": "pyvul-2ab65d62986b80922362", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-2ab65d62986b80922362"} +{"backend": "codeql", "cve_id": "CVE-2023-48224", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3062589ff0b3b95c2ed7", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ethyca__fides", "task_id": "pyvul-3062589ff0b3b95c2ed7", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3062589ff0b3b95c2ed7"} +{"backend": "codeql", "cve_id": "CVE-2020-19001", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3187445bcbbf39128a26", "group": "CodeQL python", "language": "python", "project_id": "pyvul__tankywoo__simiki", "task_id": "pyvul-3187445bcbbf39128a26", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3187445bcbbf39128a26"} +{"backend": "codeql", "cve_id": "CVE-2022-0845", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777", "group": "CodeQL python", "language": "python", "project_id": "pyvul__pytorchlightning__pytorch-lightning", "task_id": "pyvul-36a40541d7c74a9a7777", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-36a40541d7c74a9a7777"} +{"backend": "codeql", "cve_id": "CVE-2023-6395", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3819b1a7530257524a75", "group": "CodeQL python", "language": "python", "project_id": "pyvul__xsuchy__templated-dictionary", "task_id": "pyvul-3819b1a7530257524a75", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3819b1a7530257524a75"} +{"backend": "codeql", "cve_id": "CVE-2020-29128", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-394adf7b067d96b356ca", "group": "CodeQL python", "language": "python", "project_id": "pyvul__petl-developers__petl", "task_id": "pyvul-394adf7b067d96b356ca", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-394adf7b067d96b356ca"} +{"backend": "codeql", "cve_id": "CVE-2021-41127", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3994e3622b21c396ef8a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__rasahq__rasa", "task_id": "pyvul-3994e3622b21c396ef8a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3994e3622b21c396ef8a"} +{"backend": "codeql", "cve_id": "CVE-2014-1932", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-4954e5890cce23c8b03d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__python-imaging__pillow", "task_id": "pyvul-4954e5890cce23c8b03d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-4954e5890cce23c8b03d"} +{"backend": "codeql", "cve_id": "CVE-2023-48700", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-4ac3440b9023e6511a91", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nautobot__nautobot-plugin-device-onboarding", "task_id": "pyvul-4ac3440b9023e6511a91", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-4ac3440b9023e6511a91"} +{"backend": "codeql", "cve_id": "CVE-2021-4315", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-4e31b8fba29687b8d792", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nyuccl__psiturk", "task_id": "pyvul-4e31b8fba29687b8d792", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-4e31b8fba29687b8d792"} +{"backend": "codeql", "cve_id": "CVE-2021-32839", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-509b1de3e2277ac89469", "group": "CodeQL python", "language": "python", "project_id": "pyvul__andialbrecht__sqlparse", "task_id": "pyvul-509b1de3e2277ac89469", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-509b1de3e2277ac89469"} +{"backend": "codeql", "cve_id": "CVE-2022-23530", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-533cc1a8c090c7529184", "group": "CodeQL python", "language": "python", "project_id": "pyvul__datadog__guarddog", "task_id": "pyvul-533cc1a8c090c7529184", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-533cc1a8c090c7529184"} +{"backend": "codeql", "cve_id": "CVE-2023-34540", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-5cffd45f7550a060e2cf", "group": "CodeQL python", "language": "python", "project_id": "pyvul__langchain-ai__langchain", "task_id": "pyvul-5cffd45f7550a060e2cf", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-5cffd45f7550a060e2cf"} +{"backend": "codeql", "cve_id": "CVE-2022-0315", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd", "group": "CodeQL python", "language": "python", "project_id": "pyvul__horovod__horovod", "task_id": "pyvul-6b5cf1b92b87b04c09cd", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-6b5cf1b92b87b04c09cd"} +{"backend": "codeql", "cve_id": "CVE-2021-23393", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-796a152aa965ce44a6db", "group": "CodeQL python", "language": "python", "project_id": "pyvul__briancappello__flask-unchained", "task_id": "pyvul-796a152aa965ce44a6db", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-796a152aa965ce44a6db"} +{"backend": "codeql", "cve_id": "CVE-2021-21274", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-7c3c693e688548564c9a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__matrix-org__synapse", "task_id": "pyvul-7c3c693e688548564c9a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-7c3c693e688548564c9a"} +{"backend": "codeql", "cve_id": "CVE-2017-16616", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-7c7eaf17f0df49603ae4", "group": "CodeQL python", "language": "python", "project_id": "pyvul__stranger6667__pyanyapi", "task_id": "pyvul-7c7eaf17f0df49603ae4", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-7c7eaf17f0df49603ae4"} +{"backend": "codeql", "cve_id": "CVE-2018-25082", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-810ace2bf3e4aa0f04a1", "group": "CodeQL python", "language": "python", "project_id": "pyvul__zwczou__weixin-python", "task_id": "pyvul-810ace2bf3e4aa0f04a1", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-810ace2bf3e4aa0f04a1"} +{"backend": "codeql", "cve_id": "CVE-2022-31605", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-812f35b535c5e549929b", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nvidia__nvflare", "task_id": "pyvul-812f35b535c5e549929b", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-812f35b535c5e549929b"} +{"backend": "codeql", "cve_id": "CVE-2013-4260", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-8297e406660c92268ba5", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ansible__ansible", "task_id": "pyvul-8297e406660c92268ba5", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-8297e406660c92268ba5"} +{"backend": "codeql", "cve_id": "CVE-2022-36082", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-89a9ff0f9cf4f2f4cc91", "group": "CodeQL python", "language": "python", "project_id": "pyvul__mansuf__mangadex-downloader", "task_id": "pyvul-89a9ff0f9cf4f2f4cc91", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-89a9ff0f9cf4f2f4cc91"} +{"backend": "codeql", "cve_id": "CVE-2020-15239", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-8e39d07d2ff863a3f19e", "group": "CodeQL python", "language": "python", "project_id": "pyvul__horazont__xmpp-http-upload", "task_id": "pyvul-8e39d07d2ff863a3f19e", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-8e39d07d2ff863a3f19e"} +{"backend": "codeql", "cve_id": "CVE-2023-29159", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-8f3613497f18d5cf2684", "group": "CodeQL python", "language": "python", "project_id": "pyvul__encode__starlette", "task_id": "pyvul-8f3613497f18d5cf2684", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-8f3613497f18d5cf2684"} +{"backend": "codeql", "cve_id": "CVE-2019-11340", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-98fc634e79976d5b5241", "group": "CodeQL python", "language": "python", "project_id": "pyvul__matrix-org__sydent", "task_id": "pyvul-98fc634e79976d5b5241", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-98fc634e79976d5b5241"} +{"backend": "codeql", "cve_id": "CVE-2019-14806", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-9ba7c665889bf20611cb", "group": "CodeQL python", "language": "python", "project_id": "pyvul__pallets__werkzeug", "task_id": "pyvul-9ba7c665889bf20611cb", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-9ba7c665889bf20611cb"} +{"backend": "codeql", "cve_id": "CVE-2023-49277", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-9c089aba2c203455d420", "group": "CodeQL python", "language": "python", "project_id": "pyvul__darrenofficial__dpaste", "task_id": "pyvul-9c089aba2c203455d420", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-9c089aba2c203455d420"} +{"backend": "codeql", "cve_id": "CVE-2020-15120", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-9dcb85347ac437354c6f", "group": "CodeQL python", "language": "python", "project_id": "pyvul__spiral-project__ihatemoney", "task_id": "pyvul-9dcb85347ac437354c6f", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-9dcb85347ac437354c6f"} +{"backend": "codeql", "cve_id": "CVE-2022-3301", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-a2d122cb9e3a61ddca7a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ikus060__rdiffweb", "task_id": "pyvul-a2d122cb9e3a61ddca7a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-a2d122cb9e3a61ddca7a"} +{"backend": "codeql", "cve_id": "CVE-2020-35653", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-a44d900bae2c75f9ea8d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__python-pillow__pillow", "task_id": "pyvul-a44d900bae2c75f9ea8d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-a44d900bae2c75f9ea8d"} +{"backend": "codeql", "cve_id": "CVE-2021-34363", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-b10e0389c54d164db5b4", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nvbn__thefuck", "task_id": "pyvul-b10e0389c54d164db5b4", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-b10e0389c54d164db5b4"} +{"backend": "codeql", "cve_id": "CVE-2014-1938", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-b5417e7c5b6909a4c5f9", "group": "CodeQL python", "language": "python", "project_id": "pyvul__alex__rply", "task_id": "pyvul-b5417e7c5b6909a4c5f9", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-b5417e7c5b6909a4c5f9"} +{"backend": "codeql", "cve_id": "CVE-2021-21360", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-bae2a9b05bba64edb040", "group": "CodeQL python", "language": "python", "project_id": "pyvul__zopefoundation__products.genericsetup", "task_id": "pyvul-bae2a9b05bba64edb040", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-bae2a9b05bba64edb040"} +{"backend": "codeql", "cve_id": "CVE-2022-24302", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-bf4aded7c76d99f9ef84", "group": "CodeQL python", "language": "python", "project_id": "pyvul__paramiko__paramiko", "task_id": "pyvul-bf4aded7c76d99f9ef84", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-bf4aded7c76d99f9ef84"} +{"backend": "codeql", "cve_id": "CVE-2021-43854", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-c4ca067f7fd871d25376", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nltk__nltk", "task_id": "pyvul-c4ca067f7fd871d25376", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-c4ca067f7fd871d25376"} +{"backend": "codeql", "cve_id": "CVE-2023-2800", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-c52f0447bb0aa65cf9a4", "group": "CodeQL python", "language": "python", "project_id": "pyvul__huggingface__transformers", "task_id": "pyvul-c52f0447bb0aa65cf9a4", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-c52f0447bb0aa65cf9a4"} +{"backend": "codeql", "cve_id": "CVE-2022-4724", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-cb3f3f84ff4550031205", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ikus060__rdiffweb", "task_id": "pyvul-cb3f3f84ff4550031205", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-cb3f3f84ff4550031205"} +{"backend": "codeql", "cve_id": "CVE-2023-49080", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-d005a7cf5935ac7e7aae", "group": "CodeQL python", "language": "python", "project_id": "pyvul__jupyter-server__jupyter_server", "task_id": "pyvul-d005a7cf5935ac7e7aae", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-d005a7cf5935ac7e7aae"} +{"backend": "codeql", "cve_id": "CVE-2021-21386", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-d38a3c1956e86350a0c7", "group": "CodeQL python", "language": "python", "project_id": "pyvul__dwisiswant0__apkleaks", "task_id": "pyvul-d38a3c1956e86350a0c7", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-d38a3c1956e86350a0c7"} +{"backend": "codeql", "cve_id": "CVE-2023-5002", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-dbcc9a178b256c49887e", "group": "CodeQL python", "language": "python", "project_id": "pyvul__pgadmin-org__pgadmin4", "task_id": "pyvul-dbcc9a178b256c49887e", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-dbcc9a178b256c49887e"} +{"backend": "codeql", "cve_id": "CVE-2023-38201", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede", "group": "CodeQL python", "language": "python", "project_id": "pyvul__keylime__keylime", "task_id": "pyvul-e305522c703de57f9ede", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-e305522c703de57f9ede"} +{"backend": "codeql", "cve_id": "CVE-2023-45139", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-e73df8c8998a1ddc180a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__fonttools__fonttools", "task_id": "pyvul-e73df8c8998a1ddc180a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-e73df8c8998a1ddc180a"} +{"backend": "codeql", "cve_id": "CVE-2021-39229", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-f55f7c013a9f5bd1eb0d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__caronc__apprise", "task_id": "pyvul-f55f7c013a9f5bd1eb0d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-f55f7c013a9f5bd1eb0d"} +{"backend": "codeql", "cve_id": "CVE-2023-45813", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-ff1e02f88768f34e43fb", "group": "CodeQL python", "language": "python", "project_id": "pyvul__dedsecinside__torbot", "task_id": "pyvul-ff1e02f88768f34e43fb", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-ff1e02f88768f34e43fb"} +{"backend": "csa", "cve_id": "CVE-2014-0749", "dataset": "csa159", "environment_id": "csa159/pair_134585", "group": "CSA", "language": "c/c++", "project_id": "adaptivecomputing_torque", "task_id": "pair_134585", "task_path": "csa159/tasks/pair_134585"} +{"backend": "csa", "cve_id": "CVE-2017-8911", "dataset": "csa159", "environment_id": "csa159/pair_135745", "group": "CSA", "language": "c/c++", "project_id": "verdammelt_tnef", "task_id": "pair_135745", "task_path": "csa159/tasks/pair_135745"} +{"backend": "csa", "cve_id": "CVE-2014-8127", "dataset": "csa159", "environment_id": "csa159/pair_136342", "group": "CSA", "language": "c/c++", "project_id": "vadz_libtiff", "task_id": "pair_136342", "task_path": "csa159/tasks/pair_136342"} +{"backend": "csa", "cve_id": "CVE-2019-9893", "dataset": "csa159", "environment_id": "csa159/pair_137674", "group": "CSA", "language": "c/c++", "project_id": "seccomp_libseccomp", "task_id": "pair_137674", "task_path": "csa159/tasks/pair_137674"} +{"backend": "csa", "cve_id": "CVE-2014-5388", "dataset": "csa159", "environment_id": "csa159/pair_137782", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137782", "task_path": "csa159/tasks/pair_137782"} +{"backend": "csa", "cve_id": "CVE-2026-9501", "dataset": "csa159", "environment_id": "csa159/pair_138263", "group": "CSA", "language": "c/c++", "project_id": "LibreDWG_libredwg", "task_id": "pair_138263", "task_path": "csa159/tasks/pair_138263"} +{"backend": "csa", "cve_id": "CVE-2019-20022", "dataset": "csa159", "environment_id": "csa159/pair_138473", "group": "CSA", "language": "c/c++", "project_id": "saitoha_libsixel", "task_id": "pair_138473", "task_path": "csa159/tasks/pair_138473"} +{"backend": "csa", "cve_id": "CVE-2026-33165", "dataset": "csa159", "environment_id": "csa159/pair_138511", "group": "CSA", "language": "c/c++", "project_id": "strukturag_libde265", "task_id": "pair_138511", "task_path": "csa159/tasks/pair_138511"} +{"backend": "csa", "cve_id": "CVE-2025-48367", "dataset": "csa159", "environment_id": "csa159/pair_138570", "group": "CSA", "language": "c/c++", "project_id": "redis_redis", "task_id": "pair_138570", "task_path": "csa159/tasks/pair_138570"} +{"backend": "csa", "cve_id": "CVE-2024-25269", "dataset": "csa159", "environment_id": "csa159/pair_138644", "group": "CSA", "language": "c/c++", "project_id": "strukturag_libheif", "task_id": "pair_138644", "task_path": "csa159/tasks/pair_138644"} +{"backend": "csa", "cve_id": "CVE-2025-62171", "dataset": "csa159", "environment_id": "csa159/pair_138710", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138710", "task_path": "csa159/tasks/pair_138710"} +{"backend": "csa", "cve_id": "CVE-2022-48923", "dataset": "csa159", "environment_id": "csa159/pair_139922", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_139922", "task_path": "csa159/tasks/pair_139922"} +{"backend": "csa", "cve_id": "CVE-2022-49375", "dataset": "csa159", "environment_id": "csa159/pair_140347", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_140347", "task_path": "csa159/tasks/pair_140347"} +{"backend": "csa", "cve_id": "CVE-2022-50419", "dataset": "csa159", "environment_id": "csa159/pair_141329", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141329", "task_path": "csa159/tasks/pair_141329"} +{"backend": "csa", "cve_id": "CVE-2023-53148", "dataset": "csa159", "environment_id": "csa159/pair_142288", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142288", "task_path": "csa159/tasks/pair_142288"} +{"backend": "csa", "cve_id": "CVE-2023-53532", "dataset": "csa159", "environment_id": "csa159/pair_142647", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142647", "task_path": "csa159/tasks/pair_142647"} +{"backend": "csa", "cve_id": "CVE-2025-38226", "dataset": "csa159", "environment_id": "csa159/pair_147034", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147034", "task_path": "csa159/tasks/pair_147034"} +{"backend": "csa", "cve_id": "CVE-2025-39773", "dataset": "csa159", "environment_id": "csa159/pair_147640", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147640", "task_path": "csa159/tasks/pair_147640"} +{"backend": "csa", "cve_id": "CVE-2025-39810", "dataset": "csa159", "environment_id": "csa159/pair_147676", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147676", "task_path": "csa159/tasks/pair_147676"} +{"backend": "csa", "cve_id": "CVE-2025-71146", "dataset": "csa159", "environment_id": "csa159/pair_148601", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_148601", "task_path": "csa159/tasks/pair_148601"} +{"backend": "csa", "cve_id": "CVE-2026-23111", "dataset": "csa159", "environment_id": "csa159/pair_148834", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_148834", "task_path": "csa159/tasks/pair_148834"} +{"backend": "csa", "cve_id": "CVE-2026-31747", "dataset": "csa159", "environment_id": "csa159/pair_149548", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149548", "task_path": "csa159/tasks/pair_149548"} +{"backend": "csa", "cve_id": "CVE-2026-43054", "dataset": "csa159", "environment_id": "csa159/pair_149640", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149640", "task_path": "csa159/tasks/pair_149640"} +{"backend": "csa", "cve_id": "CVE-2026-43166", "dataset": "csa159", "environment_id": "csa159/pair_149751", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149751", "task_path": "csa159/tasks/pair_149751"} +{"backend": "csa", "cve_id": "CVE-2026-43185", "dataset": "csa159", "environment_id": "csa159/pair_149770", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149770", "task_path": "csa159/tasks/pair_149770"} +{"backend": "csa", "cve_id": "CVE-2026-45863", "dataset": "csa159", "environment_id": "csa159/pair_150111", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150111", "task_path": "csa159/tasks/pair_150111"} +{"backend": "csa", "cve_id": "CVE-2026-46001", "dataset": "csa159", "environment_id": "csa159/pair_150247", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150247", "task_path": "csa159/tasks/pair_150247"} +{"backend": "csa", "cve_id": "CVE-2026-46180", "dataset": "csa159", "environment_id": "csa159/pair_150426", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150426", "task_path": "csa159/tasks/pair_150426"} +{"backend": "csa", "cve_id": "CVE-2022-48730", "dataset": "csa159", "environment_id": "csa159/pair_156745", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156745", "task_path": "csa159/tasks/pair_156745"} +{"backend": "csa", "cve_id": "CVE-2021-42252", "dataset": "csa159", "environment_id": "csa159/pair_157090", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157090", "task_path": "csa159/tasks/pair_157090"} +{"backend": "csa", "cve_id": "CVE-2022-50010", "dataset": "csa159", "environment_id": "csa159/pair_157305", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157305", "task_path": "csa159/tasks/pair_157305"} +{"backend": "csa", "cve_id": "CVE-2025-38692", "dataset": "csa159", "environment_id": "csa159/pair_157307", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157307", "task_path": "csa159/tasks/pair_157307"} +{"backend": "csa", "cve_id": "CVE-2022-48634", "dataset": "csa159", "environment_id": "csa159/pair_158826", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158826", "task_path": "csa159/tasks/pair_158826"} +{"backend": "csa", "cve_id": "CVE-2021-47437", "dataset": "csa159", "environment_id": "csa159/pair_159680", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_159680", "task_path": "csa159/tasks/pair_159680"} +{"backend": "csa", "cve_id": "CVE-2024-26811", "dataset": "csa159", "environment_id": "csa159/pair_161551", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161551", "task_path": "csa159/tasks/pair_161551"} +{"backend": "csa", "cve_id": "CVE-2026-23299", "dataset": "csa159", "environment_id": "csa159/pair_161587", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161587", "task_path": "csa159/tasks/pair_161587"} +{"backend": "csa", "cve_id": "CVE-2020-28374", "dataset": "csa159", "environment_id": "csa159/pair_162518", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162518", "task_path": "csa159/tasks/pair_162518"} +{"backend": "csa", "cve_id": "CVE-2024-26954", "dataset": "csa159", "environment_id": "csa159/pair_162526", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162526", "task_path": "csa159/tasks/pair_162526"} +{"backend": "csa", "cve_id": "CVE-2023-53166", "dataset": "csa159", "environment_id": "csa159/pair_162993", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162993", "task_path": "csa159/tasks/pair_162993"} +{"backend": "csa", "cve_id": "CVE-2022-49639", "dataset": "csa159", "environment_id": "csa159/pair_163682", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163682", "task_path": "csa159/tasks/pair_163682"} +{"backend": "csa", "cve_id": "CVE-2024-38384", "dataset": "csa159", "environment_id": "csa159/pair_164279", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164279", "task_path": "csa159/tasks/pair_164279"} +{"backend": "csa", "cve_id": "CVE-2025-21719", "dataset": "csa159", "environment_id": "csa159/pair_164760", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164760", "task_path": "csa159/tasks/pair_164760"} +{"backend": "csa", "cve_id": "CVE-2025-37780", "dataset": "csa159", "environment_id": "csa159/pair_165550", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165550", "task_path": "csa159/tasks/pair_165550"} +{"backend": "csa", "cve_id": "CVE-2019-11338", "dataset": "csa159", "environment_id": "csa159/pair_17613", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_17613", "task_path": "csa159/tasks/pair_17613"} +{"backend": "csa", "cve_id": "CVE-2023-39562", "dataset": "csa159", "environment_id": "csa159/pair_4253", "group": "CSA", "language": "c/c++", "project_id": "gpac_gpac", "task_id": "pair_4253", "task_path": "csa159/tasks/pair_4253"} +{"backend": "csa", "cve_id": "CVE-2017-7866", "dataset": "csa159", "environment_id": "csa159/pair_4869", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_4869", "task_path": "csa159/tasks/pair_4869"} +{"backend": "csa", "cve_id": "CVE-2020-9365", "dataset": "csa159", "environment_id": "csa159/pair_134943", "group": "CSA", "language": "c/c++", "project_id": "jedisct1_pure-ftpd", "task_id": "pair_134943", "task_path": "csa159/tasks/pair_134943"} +{"backend": "csa", "cve_id": "CVE-2016-5824", "dataset": "csa159", "environment_id": "csa159/pair_135175", "group": "CSA", "language": "c/c++", "project_id": "libical_libical", "task_id": "pair_135175", "task_path": "csa159/tasks/pair_135175"} +{"backend": "csa", "cve_id": "CVE-2020-26148", "dataset": "csa159", "environment_id": "csa159/pair_135384", "group": "CSA", "language": "c/c++", "project_id": "mity_md4c", "task_id": "pair_135384", "task_path": "csa159/tasks/pair_135384"} +{"backend": "csa", "cve_id": "CVE-2018-1000091", "dataset": "csa159", "environment_id": "csa159/pair_135405", "group": "CSA", "language": "c/c++", "project_id": "mwarning_KadNode", "task_id": "pair_135405", "task_path": "csa159/tasks/pair_135405"} +{"backend": "csa", "cve_id": "CVE-2021-33930", "dataset": "csa159", "environment_id": "csa159/pair_135446", "group": "CSA", "language": "c/c++", "project_id": "openSUSE_libsolv", "task_id": "pair_135446", "task_path": "csa159/tasks/pair_135446"} +{"backend": "csa", "cve_id": "CVE-2018-19826", "dataset": "csa159", "environment_id": "csa159/pair_135624", "group": "CSA", "language": "c/c++", "project_id": "sass_libsass", "task_id": "pair_135624", "task_path": "csa159/tasks/pair_135624"} +{"backend": "csa", "cve_id": "CVE-2017-6309", "dataset": "csa159", "environment_id": "csa159/pair_135749", "group": "CSA", "language": "c/c++", "project_id": "verdammelt_tnef", "task_id": "pair_135749", "task_path": "csa159/tasks/pair_135749"} +{"backend": "csa", "cve_id": "CVE-2020-11764", "dataset": "csa159", "environment_id": "csa159/pair_136251", "group": "CSA", "language": "c/c++", "project_id": "openexr_openexr", "task_id": "pair_136251", "task_path": "csa159/tasks/pair_136251"} +{"backend": "csa", "cve_id": "CVE-2020-11764", "dataset": "csa159", "environment_id": "csa159/pair_136252", "group": "CSA", "language": "c/c++", "project_id": "openexr_openexr", "task_id": "pair_136252", "task_path": "csa159/tasks/pair_136252"} +{"backend": "csa", "cve_id": "CVE-2023-3745", "dataset": "csa159", "environment_id": "csa159/pair_136864", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick6", "task_id": "pair_136864", "task_path": "csa159/tasks/pair_136864"} +{"backend": "csa", "cve_id": "CVE-2017-5627", "dataset": "csa159", "environment_id": "csa159/pair_137200", "group": "CSA", "language": "c/c++", "project_id": "ccxvii_mujs", "task_id": "pair_137200", "task_path": "csa159/tasks/pair_137200"} +{"backend": "csa", "cve_id": "CVE-2020-23306", "dataset": "csa159", "environment_id": "csa159/pair_137357", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137357", "task_path": "csa159/tasks/pair_137357"} +{"backend": "csa", "cve_id": "CVE-2021-46349", "dataset": "csa159", "environment_id": "csa159/pair_137374", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137374", "task_path": "csa159/tasks/pair_137374"} +{"backend": "csa", "cve_id": "CVE-2020-23312", "dataset": "csa159", "environment_id": "csa159/pair_137377", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137377", "task_path": "csa159/tasks/pair_137377"} +{"backend": "csa", "cve_id": "CVE-2021-46350", "dataset": "csa159", "environment_id": "csa159/pair_137389", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137389", "task_path": "csa159/tasks/pair_137389"} +{"backend": "csa", "cve_id": "CVE-2019-19795", "dataset": "csa159", "environment_id": "csa159/pair_137518", "group": "CSA", "language": "c/c++", "project_id": "michaelforney_samurai", "task_id": "pair_137518", "task_path": "csa159/tasks/pair_137518"} +{"backend": "csa", "cve_id": "CVE-2014-0146", "dataset": "csa159", "environment_id": "csa159/pair_137750", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137750", "task_path": "csa159/tasks/pair_137750"} +{"backend": "csa", "cve_id": "CVE-2018-16847", "dataset": "csa159", "environment_id": "csa159/pair_137751", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137751", "task_path": "csa159/tasks/pair_137751"} +{"backend": "csa", "cve_id": "CVE-2018-17963", "dataset": "csa159", "environment_id": "csa159/pair_137769", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137769", "task_path": "csa159/tasks/pair_137769"} +{"backend": "csa", "cve_id": "CVE-2019-20396", "dataset": "csa159", "environment_id": "csa159/pair_138126", "group": "CSA", "language": "c/c++", "project_id": "CESNET_libyang", "task_id": "pair_138126", "task_path": "csa159/tasks/pair_138126"} +{"backend": "csa", "cve_id": "CVE-2026-32854", "dataset": "csa159", "environment_id": "csa159/pair_138203", "group": "CSA", "language": "c/c++", "project_id": "LibVNC_libvncserver", "task_id": "pair_138203", "task_path": "csa159/tasks/pair_138203"} +{"backend": "csa", "cve_id": "CVE-2020-6611", "dataset": "csa159", "environment_id": "csa159/pair_138249", "group": "CSA", "language": "c/c++", "project_id": "LibreDWG_libredwg", "task_id": "pair_138249", "task_path": "csa159/tasks/pair_138249"} +{"backend": "csa", "cve_id": "CVE-2021-36080", "dataset": "csa159", "environment_id": "csa159/pair_138280", "group": "CSA", "language": "c/c++", "project_id": "LibreDWG_libredwg", "task_id": "pair_138280", "task_path": "csa159/tasks/pair_138280"} +{"backend": "csa", "cve_id": "CVE-2019-13115", "dataset": "csa159", "environment_id": "csa159/pair_138328", "group": "CSA", "language": "c/c++", "project_id": "libssh2_libssh2", "task_id": "pair_138328", "task_path": "csa159/tasks/pair_138328"} +{"backend": "csa", "cve_id": "CVE-2024-28319", "dataset": "csa159", "environment_id": "csa159/pair_138462", "group": "CSA", "language": "c/c++", "project_id": "gpac_gpac", "task_id": "pair_138462", "task_path": "csa159/tasks/pair_138462"} +{"backend": "csa", "cve_id": "CVE-2018-21232", "dataset": "csa159", "environment_id": "csa159/pair_138485", "group": "CSA", "language": "c/c++", "project_id": "skvadrik_re2c", "task_id": "pair_138485", "task_path": "csa159/tasks/pair_138485"} +{"backend": "csa", "cve_id": "CVE-2016-1924", "dataset": "csa159", "environment_id": "csa159/pair_138650", "group": "CSA", "language": "c/c++", "project_id": "uclouvain_openjpeg", "task_id": "pair_138650", "task_path": "csa159/tasks/pair_138650"} +{"backend": "csa", "cve_id": "CVE-2026-40169", "dataset": "csa159", "environment_id": "csa159/pair_138728", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138728", "task_path": "csa159/tasks/pair_138728"} +{"backend": "csa", "cve_id": "CVE-2025-46393", "dataset": "csa159", "environment_id": "csa159/pair_138746", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138746", "task_path": "csa159/tasks/pair_138746"} +{"backend": "csa", "cve_id": "CVE-2026-33905", "dataset": "csa159", "environment_id": "csa159/pair_138756", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138756", "task_path": "csa159/tasks/pair_138756"} +{"backend": "csa", "cve_id": "CVE-2011-2161", "dataset": "csa159", "environment_id": "csa159/pair_138800", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_138800", "task_path": "csa159/tasks/pair_138800"} +{"backend": "csa", "cve_id": "CVE-2021-47583", "dataset": "csa159", "environment_id": "csa159/pair_139579", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_139579", "task_path": "csa159/tasks/pair_139579"} +{"backend": "csa", "cve_id": "CVE-2022-49563", "dataset": "csa159", "environment_id": "csa159/pair_140531", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_140531", "task_path": "csa159/tasks/pair_140531"} +{"backend": "csa", "cve_id": "CVE-2022-49727", "dataset": "csa159", "environment_id": "csa159/pair_140691", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_140691", "task_path": "csa159/tasks/pair_140691"} +{"backend": "csa", "cve_id": "CVE-2022-50138", "dataset": "csa159", "environment_id": "csa159/pair_141072", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141072", "task_path": "csa159/tasks/pair_141072"} +{"backend": "csa", "cve_id": "CVE-2022-50374", "dataset": "csa159", "environment_id": "csa159/pair_141289", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141289", "task_path": "csa159/tasks/pair_141289"} +{"backend": "csa", "cve_id": "CVE-2022-50459", "dataset": "csa159", "environment_id": "csa159/pair_141364", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141364", "task_path": "csa159/tasks/pair_141364"} +{"backend": "csa", "cve_id": "CVE-2023-52471", "dataset": "csa159", "environment_id": "csa159/pair_141754", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141754", "task_path": "csa159/tasks/pair_141754"} +{"backend": "csa", "cve_id": "CVE-2023-52609", "dataset": "csa159", "environment_id": "csa159/pair_141857", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141857", "task_path": "csa159/tasks/pair_141857"} +{"backend": "csa", "cve_id": "CVE-2023-53250", "dataset": "csa159", "environment_id": "csa159/pair_142376", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142376", "task_path": "csa159/tasks/pair_142376"} +{"backend": "csa", "cve_id": "CVE-2023-53679", "dataset": "csa159", "environment_id": "csa159/pair_142793", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142793", "task_path": "csa159/tasks/pair_142793"} +{"backend": "csa", "cve_id": "CVE-2024-26927", "dataset": "csa159", "environment_id": "csa159/pair_143586", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_143586", "task_path": "csa159/tasks/pair_143586"} +{"backend": "csa", "cve_id": "CVE-2024-38628", "dataset": "csa159", "environment_id": "csa159/pair_144169", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_144169", "task_path": "csa159/tasks/pair_144169"} +{"backend": "csa", "cve_id": "CVE-2024-53117", "dataset": "csa159", "environment_id": "csa159/pair_145442", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145442", "task_path": "csa159/tasks/pair_145442"} +{"backend": "csa", "cve_id": "CVE-2024-53203", "dataset": "csa159", "environment_id": "csa159/pair_145527", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145527", "task_path": "csa159/tasks/pair_145527"} +{"backend": "csa", "cve_id": "CVE-2024-56605", "dataset": "csa159", "environment_id": "csa159/pair_145663", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145663", "task_path": "csa159/tasks/pair_145663"} +{"backend": "csa", "cve_id": "CVE-2024-57953", "dataset": "csa159", "environment_id": "csa159/pair_145933", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145933", "task_path": "csa159/tasks/pair_145933"} +{"backend": "csa", "cve_id": "CVE-2024-57996", "dataset": "csa159", "environment_id": "csa159/pair_145957", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145957", "task_path": "csa159/tasks/pair_145957"} +{"backend": "csa", "cve_id": "CVE-2024-58065", "dataset": "csa159", "environment_id": "csa159/pair_146000", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_146000", "task_path": "csa159/tasks/pair_146000"} +{"backend": "csa", "cve_id": "CVE-2025-21986", "dataset": "csa159", "environment_id": "csa159/pair_146389", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_146389", "task_path": "csa159/tasks/pair_146389"} +{"backend": "csa", "cve_id": "CVE-2025-38415", "dataset": "csa159", "environment_id": "csa159/pair_147222", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147222", "task_path": "csa159/tasks/pair_147222"} +{"backend": "csa", "cve_id": "CVE-2025-38459", "dataset": "csa159", "environment_id": "csa159/pair_147266", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147266", "task_path": "csa159/tasks/pair_147266"} +{"backend": "csa", "cve_id": "CVE-2025-40313", "dataset": "csa159", "environment_id": "csa159/pair_148175", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_148175", "task_path": "csa159/tasks/pair_148175"} +{"backend": "csa", "cve_id": "CVE-2026-43160", "dataset": "csa159", "environment_id": "csa159/pair_149745", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149745", "task_path": "csa159/tasks/pair_149745"} +{"backend": "csa", "cve_id": "CVE-2026-43249", "dataset": "csa159", "environment_id": "csa159/pair_149834", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149834", "task_path": "csa159/tasks/pair_149834"} +{"backend": "csa", "cve_id": "CVE-2026-43376", "dataset": "csa159", "environment_id": "csa159/pair_149959", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149959", "task_path": "csa159/tasks/pair_149959"} +{"backend": "csa", "cve_id": "CVE-2026-46045", "dataset": "csa159", "environment_id": "csa159/pair_150291", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150291", "task_path": "csa159/tasks/pair_150291"} +{"backend": "csa", "cve_id": "CVE-2026-46090", "dataset": "csa159", "environment_id": "csa159/pair_150336", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150336", "task_path": "csa159/tasks/pair_150336"} +{"backend": "csa", "cve_id": "CVE-2022-49007", "dataset": "csa159", "environment_id": "csa159/pair_156097", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156097", "task_path": "csa159/tasks/pair_156097"} +{"backend": "csa", "cve_id": "CVE-2024-42272", "dataset": "csa159", "environment_id": "csa159/pair_156217", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156217", "task_path": "csa159/tasks/pair_156217"} +{"backend": "csa", "cve_id": "CVE-2023-52505", "dataset": "csa159", "environment_id": "csa159/pair_156267", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156267", "task_path": "csa159/tasks/pair_156267"} +{"backend": "csa", "cve_id": "CVE-2024-26664", "dataset": "csa159", "environment_id": "csa159/pair_156473", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156473", "task_path": "csa159/tasks/pair_156473"} +{"backend": "csa", "cve_id": "CVE-2025-38568", "dataset": "csa159", "environment_id": "csa159/pair_156640", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156640", "task_path": "csa159/tasks/pair_156640"} +{"backend": "csa", "cve_id": "CVE-2023-53057", "dataset": "csa159", "environment_id": "csa159/pair_156704", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156704", "task_path": "csa159/tasks/pair_156704"} +{"backend": "csa", "cve_id": "CVE-2023-52865", "dataset": "csa159", "environment_id": "csa159/pair_156860", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156860", "task_path": "csa159/tasks/pair_156860"} +{"backend": "csa", "cve_id": "CVE-2022-48818", "dataset": "csa159", "environment_id": "csa159/pair_156981", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156981", "task_path": "csa159/tasks/pair_156981"} +{"backend": "csa", "cve_id": "CVE-2022-49519", "dataset": "csa159", "environment_id": "csa159/pair_157153", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157153", "task_path": "csa159/tasks/pair_157153"} +{"backend": "csa", "cve_id": "CVE-2022-48665", "dataset": "csa159", "environment_id": "csa159/pair_158138", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158138", "task_path": "csa159/tasks/pair_158138"} +{"backend": "csa", "cve_id": "CVE-2026-53322", "dataset": "csa159", "environment_id": "csa159/pair_158217", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158217", "task_path": "csa159/tasks/pair_158217"} +{"backend": "csa", "cve_id": "CVE-2022-50131", "dataset": "csa159", "environment_id": "csa159/pair_158385", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158385", "task_path": "csa159/tasks/pair_158385"} +{"backend": "csa", "cve_id": "CVE-2023-1078", "dataset": "csa159", "environment_id": "csa159/pair_158831", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158831", "task_path": "csa159/tasks/pair_158831"} +{"backend": "csa", "cve_id": "CVE-2022-49208", "dataset": "csa159", "environment_id": "csa159/pair_159264", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_159264", "task_path": "csa159/tasks/pair_159264"} +{"backend": "csa", "cve_id": "CVE-2024-36899", "dataset": "csa159", "environment_id": "csa159/pair_159377", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_159377", "task_path": "csa159/tasks/pair_159377"} +{"backend": "csa", "cve_id": "CVE-2025-37812", "dataset": "csa159", "environment_id": "csa159/pair_160021", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160021", "task_path": "csa159/tasks/pair_160021"} +{"backend": "csa", "cve_id": "CVE-2023-52569", "dataset": "csa159", "environment_id": "csa159/pair_160187", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160187", "task_path": "csa159/tasks/pair_160187"} +{"backend": "csa", "cve_id": "CVE-2023-52603", "dataset": "csa159", "environment_id": "csa159/pair_160364", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160364", "task_path": "csa159/tasks/pair_160364"} +{"backend": "csa", "cve_id": "CVE-2023-28464", "dataset": "csa159", "environment_id": "csa159/pair_160434", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160434", "task_path": "csa159/tasks/pair_160434"} +{"backend": "csa", "cve_id": "CVE-2025-38129", "dataset": "csa159", "environment_id": "csa159/pair_160451", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160451", "task_path": "csa159/tasks/pair_160451"} +{"backend": "csa", "cve_id": "CVE-2024-45017", "dataset": "csa159", "environment_id": "csa159/pair_160603", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160603", "task_path": "csa159/tasks/pair_160603"} +{"backend": "csa", "cve_id": "CVE-2022-49123", "dataset": "csa159", "environment_id": "csa159/pair_160628", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160628", "task_path": "csa159/tasks/pair_160628"} +{"backend": "csa", "cve_id": "CVE-2024-41059", "dataset": "csa159", "environment_id": "csa159/pair_160904", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160904", "task_path": "csa159/tasks/pair_160904"} +{"backend": "csa", "cve_id": "CVE-2024-42242", "dataset": "csa159", "environment_id": "csa159/pair_160912", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160912", "task_path": "csa159/tasks/pair_160912"} +{"backend": "csa", "cve_id": "CVE-2024-26585", "dataset": "csa159", "environment_id": "csa159/pair_161027", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161027", "task_path": "csa159/tasks/pair_161027"} +{"backend": "csa", "cve_id": "CVE-2024-38593", "dataset": "csa159", "environment_id": "csa159/pair_161598", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161598", "task_path": "csa159/tasks/pair_161598"} +{"backend": "csa", "cve_id": "CVE-2024-26583", "dataset": "csa159", "environment_id": "csa159/pair_161667", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161667", "task_path": "csa159/tasks/pair_161667"} +{"backend": "csa", "cve_id": "CVE-2025-21811", "dataset": "csa159", "environment_id": "csa159/pair_161782", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161782", "task_path": "csa159/tasks/pair_161782"} +{"backend": "csa", "cve_id": "CVE-2023-52843", "dataset": "csa159", "environment_id": "csa159/pair_161997", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161997", "task_path": "csa159/tasks/pair_161997"} +{"backend": "csa", "cve_id": "CVE-2023-53827", "dataset": "csa159", "environment_id": "csa159/pair_162003", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162003", "task_path": "csa159/tasks/pair_162003"} +{"backend": "csa", "cve_id": "CVE-2022-4095", "dataset": "csa159", "environment_id": "csa159/pair_162331", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162331", "task_path": "csa159/tasks/pair_162331"} +{"backend": "csa", "cve_id": "CVE-2022-48735", "dataset": "csa159", "environment_id": "csa159/pair_162535", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162535", "task_path": "csa159/tasks/pair_162535"} +{"backend": "csa", "cve_id": "CVE-2021-47032", "dataset": "csa159", "environment_id": "csa159/pair_162672", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162672", "task_path": "csa159/tasks/pair_162672"} +{"backend": "csa", "cve_id": "CVE-2024-36016", "dataset": "csa159", "environment_id": "csa159/pair_162700", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162700", "task_path": "csa159/tasks/pair_162700"} +{"backend": "csa", "cve_id": "CVE-2024-39509", "dataset": "csa159", "environment_id": "csa159/pair_163294", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163294", "task_path": "csa159/tasks/pair_163294"} +{"backend": "csa", "cve_id": "CVE-2025-38150", "dataset": "csa159", "environment_id": "csa159/pair_163698", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163698", "task_path": "csa159/tasks/pair_163698"} +{"backend": "csa", "cve_id": "CVE-2024-36484", "dataset": "csa159", "environment_id": "csa159/pair_163737", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163737", "task_path": "csa159/tasks/pair_163737"} +{"backend": "csa", "cve_id": "CVE-2023-39194", "dataset": "csa159", "environment_id": "csa159/pair_163761", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163761", "task_path": "csa159/tasks/pair_163761"} +{"backend": "csa", "cve_id": "CVE-2025-68337", "dataset": "csa159", "environment_id": "csa159/pair_163824", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163824", "task_path": "csa159/tasks/pair_163824"} +{"backend": "csa", "cve_id": "CVE-2024-56584", "dataset": "csa159", "environment_id": "csa159/pair_163861", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163861", "task_path": "csa159/tasks/pair_163861"} +{"backend": "csa", "cve_id": "CVE-2023-45863", "dataset": "csa159", "environment_id": "csa159/pair_163978", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163978", "task_path": "csa159/tasks/pair_163978"} +{"backend": "csa", "cve_id": "CVE-2023-52435", "dataset": "csa159", "environment_id": "csa159/pair_164140", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164140", "task_path": "csa159/tasks/pair_164140"} +{"backend": "csa", "cve_id": "CVE-2022-48893", "dataset": "csa159", "environment_id": "csa159/pair_164624", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164624", "task_path": "csa159/tasks/pair_164624"} +{"backend": "csa", "cve_id": "CVE-2021-47109", "dataset": "csa159", "environment_id": "csa159/pair_164920", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164920", "task_path": "csa159/tasks/pair_164920"} +{"backend": "csa", "cve_id": "CVE-2023-52623", "dataset": "csa159", "environment_id": "csa159/pair_164974", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164974", "task_path": "csa159/tasks/pair_164974"} +{"backend": "csa", "cve_id": "CVE-2022-28796", "dataset": "csa159", "environment_id": "csa159/pair_165542", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165542", "task_path": "csa159/tasks/pair_165542"} +{"backend": "csa", "cve_id": "CVE-2022-49580", "dataset": "csa159", "environment_id": "csa159/pair_165655", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165655", "task_path": "csa159/tasks/pair_165655"} +{"backend": "csa", "cve_id": "CVE-2023-45863", "dataset": "csa159", "environment_id": "csa159/pair_165738", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165738", "task_path": "csa159/tasks/pair_165738"} +{"backend": "csa", "cve_id": "CVE-2021-40572", "dataset": "csa159", "environment_id": "csa159/pair_3538", "group": "CSA", "language": "c/c++", "project_id": "gpac_gpac", "task_id": "pair_3538", "task_path": "csa159/tasks/pair_3538"} +{"backend": "csa", "cve_id": "CVE-2020-36138", "dataset": "csa159", "environment_id": "csa159/pair_4701", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_4701", "task_path": "csa159/tasks/pair_4701"} +{"backend": "csa", "cve_id": "CVE-2020-11096", "dataset": "csa159", "environment_id": "csa159/pair_6060", "group": "CSA", "language": "c/c++", "project_id": "FreeRDP_FreeRDP", "task_id": "pair_6060", "task_path": "csa159/tasks/pair_6060"} +{"backend": "csa", "cve_id": "CVE-2018-8784", "dataset": "csa159", "environment_id": "csa159/pair_6105", "group": "CSA", "language": "c/c++", "project_id": "FreeRDP_FreeRDP", "task_id": "pair_6105", "task_path": "csa159/tasks/pair_6105"} +{"backend": "csa", "cve_id": "CVE-2020-11038", "dataset": "csa159", "environment_id": "csa159/pair_6132", "group": "CSA", "language": "c/c++", "project_id": "FreeRDP_FreeRDP", "task_id": "pair_6132", "task_path": "csa159/tasks/pair_6132"} +{"backend": "csa", "cve_id": "CVE-2016-5418", "dataset": "csa159", "environment_id": "csa159/pair_7278", "group": "CSA", "language": "c/c++", "project_id": "libarchive_libarchive", "task_id": "pair_7278", "task_path": "csa159/tasks/pair_7278"} +{"backend": "csa", "cve_id": "CVE-2013-0211", "dataset": "csa159", "environment_id": "csa159/pair_7287", "group": "CSA", "language": "c/c++", "project_id": "libarchive_libarchive", "task_id": "pair_7287", "task_path": "csa159/tasks/pair_7287"} diff --git a/dataset/tasks.jsonl b/dataset/tasks.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..5999b97ae02c5942e4d34d4f1d72eb24066f2668 --- /dev/null +++ b/dataset/tasks.jsonl @@ -0,0 +1,300 @@ +{"backend": "codeql", "cve_id": "CVE-2022-4741", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78", "group": "CodeQL go", "language": "go", "project_id": "morefixes__sajari__docconv", "task_id": "morefixes-02cb4e0a6c5aaabd6a78", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-02cb4e0a6c5aaabd6a78"} +{"backend": "codeql", "cve_id": "CVE-2025-47281", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406", "group": "CodeQL go", "language": "go", "project_id": "morefixes__kyverno__kyverno", "task_id": "morefixes-08d699b1f7c72c366406", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-08d699b1f7c72c366406"} +{"backend": "codeql", "cve_id": "CVE-2020-29243", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb", "group": "CodeQL go", "language": "go", "project_id": "morefixes__dhowden__tag", "task_id": "morefixes-096cbfbd1d27f9ce86fb", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-096cbfbd1d27f9ce86fb"} +{"backend": "codeql", "cve_id": "CVE-2023-34236", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f", "group": "CodeQL go", "language": "go", "project_id": "morefixes__weaveworks__tf-controller", "task_id": "morefixes-0adb0a489b07a50d6b2f", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-0adb0a489b07a50d6b2f"} +{"backend": "codeql", "cve_id": "CVE-2022-41939", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28", "group": "CodeQL go", "language": "go", "project_id": "morefixes__knative__func", "task_id": "morefixes-110ab7950a2c0b2c6f28", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-110ab7950a2c0b2c6f28"} +{"backend": "codeql", "cve_id": "CVE-2023-27582", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555", "group": "CodeQL go", "language": "go", "project_id": "morefixes__foxcpp__maddy", "task_id": "morefixes-1218ce956f8120d59555", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-1218ce956f8120d59555"} +{"backend": "codeql", "cve_id": "CVE-2024-39315", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807", "group": "CodeQL go", "language": "go", "project_id": "morefixes__pomerium__pomerium", "task_id": "morefixes-14446e68cdc53bc98807", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-14446e68cdc53bc98807"} +{"backend": "codeql", "cve_id": "CVE-2022-2582", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5", "group": "CodeQL go", "language": "go", "project_id": "morefixes__aws__aws-sdk-go", "task_id": "morefixes-1d20aba9f4be2de73db5", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-1d20aba9f4be2de73db5"} +{"backend": "codeql", "cve_id": "CVE-2025-66626", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460", "group": "CodeQL go", "language": "go", "project_id": "morefixes__argoproj__argo-workflows", "task_id": "morefixes-2331a664751876781460", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-2331a664751876781460"} +{"backend": "codeql", "cve_id": "CVE-2019-12496", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26", "group": "CodeQL go", "language": "go", "project_id": "morefixes__hybridgroup__gobot", "task_id": "morefixes-2cc25dee5f2a118bcb26", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-2cc25dee5f2a118bcb26"} +{"backend": "codeql", "cve_id": "CVE-2026-40890", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b", "group": "CodeQL go", "language": "go", "project_id": "morefixes__gomarkdown__markdown", "task_id": "morefixes-30e495de2402bd4bed4b", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-30e495de2402bd4bed4b"} +{"backend": "codeql", "cve_id": "CVE-2024-7773", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad", "group": "CodeQL go", "language": "go", "project_id": "morefixes__ollama__ollama", "task_id": "morefixes-32ed35a8bd8aba7b47ad", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-32ed35a8bd8aba7b47ad"} +{"backend": "codeql", "cve_id": "CVE-2023-40586", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2", "group": "CodeQL go", "language": "go", "project_id": "morefixes__corazawaf__coraza", "task_id": "morefixes-398ac78e3981b77e4ee2", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-398ac78e3981b77e4ee2"} +{"backend": "codeql", "cve_id": "CVE-2022-41920", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443", "group": "CodeQL go", "language": "go", "project_id": "morefixes__duke-git__lancet", "task_id": "morefixes-461c7bace102119cf443", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-461c7bace102119cf443"} +{"backend": "codeql", "cve_id": "CVE-2026-10722", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e", "group": "CodeQL go", "language": "go", "project_id": "morefixes__cilium__ebpf", "task_id": "morefixes-50b28fbf07dd2d79022e", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-50b28fbf07dd2d79022e"} +{"backend": "codeql", "cve_id": "CVE-2023-47105", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c", "group": "CodeQL go", "language": "go", "project_id": "morefixes__chaosblade-io__chaosblade", "task_id": "morefixes-5ad30634efaa1d03593c", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-5ad30634efaa1d03593c"} +{"backend": "codeql", "cve_id": "CVE-2024-23840", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247", "group": "CodeQL go", "language": "go", "project_id": "morefixes__goreleaser__goreleaser", "task_id": "morefixes-5c2773bb1de86a62a247", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-5c2773bb1de86a62a247"} +{"backend": "codeql", "cve_id": "CVE-2022-30428", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17", "group": "CodeQL go", "language": "go", "project_id": "morefixes__gphper__ginadmin", "task_id": "morefixes-5cfa41b8575717ecee17", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-5cfa41b8575717ecee17"} +{"backend": "codeql", "cve_id": "CVE-2020-36568", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b", "group": "CodeQL go", "language": "go", "project_id": "morefixes__revel__revel", "task_id": "morefixes-6e40429ff01c5ab8b71b", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-6e40429ff01c5ab8b71b"} +{"backend": "codeql", "cve_id": "CVE-2023-33965", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2", "group": "CodeQL go", "language": "go", "project_id": "morefixes__txthinking__brook", "task_id": "morefixes-7c57d35438d22210ced2", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-7c57d35438d22210ced2"} +{"backend": "codeql", "cve_id": "CVE-2026-8275", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a", "group": "CodeQL go", "language": "go", "project_id": "morefixes__bettercap__bettercap", "task_id": "morefixes-7e2af82757795db7f69a", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-7e2af82757795db7f69a"} +{"backend": "codeql", "cve_id": "CVE-2024-41270", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4", "group": "CodeQL go", "language": "go", "project_id": "morefixes__appleboy__gorush", "task_id": "morefixes-9fbea0e4da10bfc882d4", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-9fbea0e4da10bfc882d4"} +{"backend": "codeql", "cve_id": "CVE-2023-46132", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d", "group": "CodeQL go", "language": "go", "project_id": "morefixes__hyperledger__fabric", "task_id": "morefixes-a469597c1a5d38baeb5d", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-a469597c1a5d38baeb5d"} +{"backend": "codeql", "cve_id": "CVE-2023-34105", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1", "group": "CodeQL go", "language": "go", "project_id": "morefixes__ossrs__srs", "task_id": "morefixes-a9ee7c2085f2981a7be1", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-a9ee7c2085f2981a7be1"} +{"backend": "codeql", "cve_id": "CVE-2018-1002207", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1", "group": "CodeQL go", "language": "go", "project_id": "morefixes__mholt__archiver", "task_id": "morefixes-c254bd7b8a82b4ef45c1", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-c254bd7b8a82b4ef45c1"} +{"backend": "codeql", "cve_id": "CVE-2017-1000070", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3", "group": "CodeQL go", "language": "go", "project_id": "morefixes__bitly__oauth2_proxy", "task_id": "morefixes-cd95b2e4d63395291cd3", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-cd95b2e4d63395291cd3"} +{"backend": "codeql", "cve_id": "CVE-2025-67499", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685", "group": "CodeQL go", "language": "go", "project_id": "morefixes__containernetworking__plugins", "task_id": "morefixes-d3400ed5292d19661685", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-d3400ed5292d19661685"} +{"backend": "codeql", "cve_id": "CVE-2022-21698", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f", "group": "CodeQL go", "language": "go", "project_id": "morefixes__prometheus__client_golang", "task_id": "morefixes-e3f3ac87786e2080b81f", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-e3f3ac87786e2080b81f"} +{"backend": "codeql", "cve_id": "CVE-2021-3538", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9", "group": "CodeQL go", "language": "go", "project_id": "morefixes__satori__go.uuid", "task_id": "morefixes-f0d857f4ad82fae5a3a9", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-f0d857f4ad82fae5a3a9"} +{"backend": "codeql", "cve_id": "CVE-2025-32445", "dataset": "codeql_go_benchmark_top30_v1", "environment_id": "codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae", "group": "CodeQL go", "language": "go", "project_id": "morefixes__argoproj__argo-events", "task_id": "morefixes-fb75b5c545e3cb24f7ae", "task_path": "codeql_go_benchmark_top30_v1/tasks/morefixes-fb75b5c545e3cb24f7ae"} +{"backend": "codeql", "cve_id": "CVE-2023-2196", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__codedx-plugin", "task_id": "morefixes-02f75a63a6f0b8d6c6c7", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-02f75a63a6f0b8d6c6c7"} +{"backend": "codeql", "cve_id": "CVE-2021-21656", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__xcode-plugin", "task_id": "morefixes-04bdb708bf23aabdc444", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-04bdb708bf23aabdc444"} +{"backend": "codeql", "cve_id": "CVE-2021-21632", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__dependency-track-plugin", "task_id": "morefixes-05d6240fd5a9017a44ec", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-05d6240fd5a9017a44ec"} +{"backend": "codeql", "cve_id": "CVE-2020-2132", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__environment-manager-tools-plugin", "task_id": "morefixes-0608482232bb0119b561", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-0608482232bb0119b561"} +{"backend": "codeql", "cve_id": "CVE-2020-2311", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jenkinsci__aws-global-configuration-plugin", "task_id": "morefixes-0709c903a0f96b124bd5", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-0709c903a0f96b124bd5"} +{"backend": "codeql", "cve_id": "CVE-2020-14297", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__wildfly__jboss-ejb-client", "task_id": "morefixes-09002f4d38e9ecf8238a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-09002f4d38e9ecf8238a"} +{"backend": "codeql", "cve_id": "CVE-2020-25023", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704", "group": "CodeQL java", "language": "java", "project_id": "morefixes__rweather__noise-java", "task_id": "morefixes-13b1b3610eb300ab9704", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-13b1b3610eb300ab9704"} +{"backend": "codeql", "cve_id": "CVE-2023-25141", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3", "group": "CodeQL java", "language": "java", "project_id": "morefixes__apache__sling-org-apache-sling-jcr-base", "task_id": "morefixes-149c5507d76b198944c3", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-149c5507d76b198944c3"} +{"backend": "codeql", "cve_id": "CVE-2022-43183", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493", "group": "CodeQL java", "language": "java", "project_id": "morefixes__xuxueli__xxl-job", "task_id": "morefixes-19d7bda86b839e7fc493", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-19d7bda86b839e7fc493"} +{"backend": "codeql", "cve_id": "CVE-2025-29908", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752", "group": "CodeQL java", "language": "java", "project_id": "morefixes__netty__netty-incubator-codec-quic", "task_id": "morefixes-1f67e1cf382f2e332752", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-1f67e1cf382f2e332752"} +{"backend": "codeql", "cve_id": "CVE-2020-25022", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c", "group": "CodeQL java", "language": "java", "project_id": "morefixes__rweather__noise-java", "task_id": "morefixes-21b89e6983680bd0068c", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-21b89e6983680bd0068c"} +{"backend": "codeql", "cve_id": "CVE-2021-22573", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b", "group": "CodeQL java", "language": "java", "project_id": "morefixes__googleapis__google-oauth-java-client", "task_id": "morefixes-23c03b1bf7a3c44f444b", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-23c03b1bf7a3c44f444b"} +{"backend": "codeql", "cve_id": "CVE-2021-39196", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jdhwpgmbca__pcapture", "task_id": "morefixes-2b14860afe0d3bf8094a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-2b14860afe0d3bf8094a"} +{"backend": "codeql", "cve_id": "CVE-2022-4641", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072", "group": "CodeQL java", "language": "java", "project_id": "morefixes__tdunning__pig-vector", "task_id": "morefixes-35510b21cf51a9acf072", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-35510b21cf51a9acf072"} +{"backend": "codeql", "cve_id": "CVE-2025-67030", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9", "group": "CodeQL java", "language": "java", "project_id": "morefixes__codehaus-plexus__plexus-utils", "task_id": "morefixes-378f408f498b20422fe9", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-378f408f498b20422fe9"} +{"backend": "codeql", "cve_id": "CVE-2024-39118", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71", "group": "CodeQL java", "language": "java", "project_id": "morefixes__mommyheather__advancedbackups", "task_id": "morefixes-3cc69a690ef991c8bd71", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-3cc69a690ef991c8bd71"} +{"backend": "codeql", "cve_id": "CVE-2024-36114", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20", "group": "CodeQL java", "language": "java", "project_id": "morefixes__airlift__aircompressor", "task_id": "morefixes-462566b2f857f458bf20", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-462566b2f857f458bf20"} +{"backend": "codeql", "cve_id": "CVE-2020-36640", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-4a0720656247f4fdd55d", "group": "CodeQL java", "language": "java", "project_id": "morefixes__bonitasoft__bonita-connector-webservice", "task_id": "morefixes-4a0720656247f4fdd55d", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-4a0720656247f4fdd55d"} +{"backend": "codeql", "cve_id": "CVE-2023-48299", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-623c5f3c0558ba463c5a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__pytorch__serve", "task_id": "morefixes-623c5f3c0558ba463c5a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-623c5f3c0558ba463c5a"} +{"backend": "codeql", "cve_id": "CVE-2024-1102", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-6c80dd14ea98e73d8b2e", "group": "CodeQL java", "language": "java", "project_id": "morefixes__jberet__jsr352", "task_id": "morefixes-6c80dd14ea98e73d8b2e", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-6c80dd14ea98e73d8b2e"} +{"backend": "codeql", "cve_id": "CVE-2022-41967", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-76076416f1349da24444", "group": "CodeQL java", "language": "java", "project_id": "morefixes__hyperadev__dragonfly", "task_id": "morefixes-76076416f1349da24444", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-76076416f1349da24444"} +{"backend": "codeql", "cve_id": "CVE-2025-4641", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-80a186235f1faf976a71", "group": "CodeQL java", "language": "java", "project_id": "morefixes__bonigarcia__webdrivermanager", "task_id": "morefixes-80a186235f1faf976a71", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-80a186235f1faf976a71"} +{"backend": "codeql", "cve_id": "CVE-2020-1729", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-8641a4da2de2d0610576", "group": "CodeQL java", "language": "java", "project_id": "morefixes__smallrye__smallrye-config", "task_id": "morefixes-8641a4da2de2d0610576", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-8641a4da2de2d0610576"} +{"backend": "codeql", "cve_id": "CVE-2022-29631", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-8e4d1bd2b930ae852ae1", "group": "CodeQL java", "language": "java", "project_id": "morefixes__oblac__jodd-http", "task_id": "morefixes-8e4d1bd2b930ae852ae1", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-8e4d1bd2b930ae852ae1"} +{"backend": "codeql", "cve_id": "CVE-2020-17534", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-9db4a0f5f07f59debbce", "group": "CodeQL java", "language": "java", "project_id": "morefixes__apache__netbeans-html4j", "task_id": "morefixes-9db4a0f5f07f59debbce", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-9db4a0f5f07f59debbce"} +{"backend": "codeql", "cve_id": "CVE-2025-67721", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-a624a25672727b30851a", "group": "CodeQL java", "language": "java", "project_id": "morefixes__airlift__aircompressor", "task_id": "morefixes-a624a25672727b30851a", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-a624a25672727b30851a"} +{"backend": "codeql", "cve_id": "CVE-2022-24913", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-ab625a5d0d2a27547494", "group": "CodeQL java", "language": "java", "project_id": "morefixes__cowtowncoder__java-merge-sort", "task_id": "morefixes-ab625a5d0d2a27547494", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-ab625a5d0d2a27547494"} +{"backend": "codeql", "cve_id": "CVE-2024-57699", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-ac88413b62ef5803c04f", "group": "CodeQL java", "language": "java", "project_id": "morefixes__netplex__json-smart-v2", "task_id": "morefixes-ac88413b62ef5803c04f", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-ac88413b62ef5803c04f"} +{"backend": "codeql", "cve_id": "CVE-2025-67721", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-cf8752e9dc2f57b1d5c8", "group": "CodeQL java", "language": "java", "project_id": "morefixes__airlift__aircompressor", "task_id": "morefixes-cf8752e9dc2f57b1d5c8", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-cf8752e9dc2f57b1d5c8"} +{"backend": "codeql", "cve_id": "CVE-2022-4494", "dataset": "codeql_java_benchmark_top30_v2", "environment_id": "codeql_java_benchmark_top30_v2/morefixes-f298b6158c5168025365", "group": "CodeQL java", "language": "java", "project_id": "morefixes__bspkrs__mcpmappingviewer", "task_id": "morefixes-f298b6158c5168025365", "task_path": "codeql_java_benchmark_top30_v2/tasks/morefixes-f298b6158c5168025365"} +{"backend": "codeql", "cve_id": "CVE-2023-33194", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-040d724ca8211a3aaf1d", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__craftcms__cms", "task_id": "morefixes-040d724ca8211a3aaf1d", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-040d724ca8211a3aaf1d"} +{"backend": "codeql", "cve_id": "CVE-2026-25642", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__hedgedoc__hedgedoc", "task_id": "morefixes-04314885419e817d3b17", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-04314885419e817d3b17"} +{"backend": "codeql", "cve_id": "CVE-2025-59526", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-08f7e6287de57ef9a5c8", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__eladnava__mailgen", "task_id": "morefixes-08f7e6287de57ef9a5c8", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-08f7e6287de57ef9a5c8"} +{"backend": "codeql", "cve_id": "CVE-2018-3758", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0e82cb4ad70fc2c896ef", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__mrvautin__expresscart", "task_id": "morefixes-0e82cb4ad70fc2c896ef", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0e82cb4ad70fc2c896ef"} +{"backend": "codeql", "cve_id": "CVE-2026-45787", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0e8f49f3d1cc46668f9b", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__electerm__electerm", "task_id": "morefixes-0e8f49f3d1cc46668f9b", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0e8f49f3d1cc46668f9b"} +{"backend": "codeql", "cve_id": "CVE-2021-3801", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0ea8f5f13e7432539721", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__prismjs__prism", "task_id": "morefixes-0ea8f5f13e7432539721", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0ea8f5f13e7432539721"} +{"backend": "codeql", "cve_id": "CVE-2025-49590", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-0f4271d4851600835c47", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__cryptpad__cryptpad", "task_id": "morefixes-0f4271d4851600835c47", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-0f4271d4851600835c47"} +{"backend": "codeql", "cve_id": "CVE-2024-25981", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-135296414af3a0faf089", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__moodle__moodle", "task_id": "morefixes-135296414af3a0faf089", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-135296414af3a0faf089"} +{"backend": "codeql", "cve_id": "CVE-2014-5273", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-16768fdfa00c963539dc", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__phpmyadmin__phpmyadmin", "task_id": "morefixes-16768fdfa00c963539dc", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-16768fdfa00c963539dc"} +{"backend": "codeql", "cve_id": "CVE-2024-40761", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-17d21311a4f5af9bbc4f", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__apache__incubator-answer", "task_id": "morefixes-17d21311a4f5af9bbc4f", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-17d21311a4f5af9bbc4f"} +{"backend": "codeql", "cve_id": "CVE-2025-46344", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-1cf55be2336b09a515a6", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__auth0__nextjs-auth0", "task_id": "morefixes-1cf55be2336b09a515a6", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-1cf55be2336b09a515a6"} +{"backend": "codeql", "cve_id": "CVE-2026-22819", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__outray-tunnel__outray", "task_id": "morefixes-312479357bdfa998bf6e", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-312479357bdfa998bf6e"} +{"backend": "codeql", "cve_id": "CVE-2025-10044", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-374e3093d6d5875aa960", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__keycloak__keycloak", "task_id": "morefixes-374e3093d6d5875aa960", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-374e3093d6d5875aa960"} +{"backend": "codeql", "cve_id": "CVE-2021-4124", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-4b95de19a5da1e74a747", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__meetecho__janus-gateway", "task_id": "morefixes-4b95de19a5da1e74a747", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-4b95de19a5da1e74a747"} +{"backend": "codeql", "cve_id": "CVE-2021-25990", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-4ffaae63e8f8c0012a0f", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__ifmeorg__ifme", "task_id": "morefixes-4ffaae63e8f8c0012a0f", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-4ffaae63e8f8c0012a0f"} +{"backend": "codeql", "cve_id": "CVE-2023-47635", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-516c6c53716bba29b7f0", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__decidim__decidim", "task_id": "morefixes-516c6c53716bba29b7f0", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-516c6c53716bba29b7f0"} +{"backend": "codeql", "cve_id": "CVE-2010-2273", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-550b9b77dc4d0c01e1fe", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__dojo__dojo", "task_id": "morefixes-550b9b77dc4d0c01e1fe", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-550b9b77dc4d0c01e1fe"} +{"backend": "codeql", "cve_id": "CVE-2024-22411", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-58be9c1811ee7367cce5", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__avo-hq__avo", "task_id": "morefixes-58be9c1811ee7367cce5", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-58be9c1811ee7367cce5"} +{"backend": "codeql", "cve_id": "CVE-2020-11611", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-60205e347d7f83ebc999", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__ofirdagan__cross-domain-local-storage", "task_id": "morefixes-60205e347d7f83ebc999", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-60205e347d7f83ebc999"} +{"backend": "codeql", "cve_id": "CVE-2017-1000189", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-633246d79fea5271cdce", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__mde__ejs", "task_id": "morefixes-633246d79fea5271cdce", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-633246d79fea5271cdce"} +{"backend": "codeql", "cve_id": "CVE-2018-11798", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-88a92b26b3a23d01f412", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__apache__thrift", "task_id": "morefixes-88a92b26b3a23d01f412", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-88a92b26b3a23d01f412"} +{"backend": "codeql", "cve_id": "CVE-2024-28176", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-941abf85c9b7d820de47", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__panva__jose", "task_id": "morefixes-941abf85c9b7d820de47", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-941abf85c9b7d820de47"} +{"backend": "codeql", "cve_id": "CVE-2026-39941", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__churchcrm__crm", "task_id": "morefixes-99aea6539029d3ab985e", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-99aea6539029d3ab985e"} +{"backend": "codeql", "cve_id": "CVE-2024-45312", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-9f8a2d1b597df98c6680", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__overleaf__overleaf", "task_id": "morefixes-9f8a2d1b597df98c6680", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-9f8a2d1b597df98c6680"} +{"backend": "codeql", "cve_id": "CVE-2025-11222", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-b475f3a535ea41bec3ff", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__line__centraldogma", "task_id": "morefixes-b475f3a535ea41bec3ff", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-b475f3a535ea41bec3ff"} +{"backend": "codeql", "cve_id": "CVE-2026-10269", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-b61b3848e076036c7b06", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__decolua__9router", "task_id": "morefixes-b61b3848e076036c7b06", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-b61b3848e076036c7b06"} +{"backend": "codeql", "cve_id": "CVE-2022-39267", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-bd56f8e5b73f132cd962", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__brokercap__bifrost", "task_id": "morefixes-bd56f8e5b73f132cd962", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-bd56f8e5b73f132cd962"} +{"backend": "codeql", "cve_id": "CVE-2020-7729", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-bd86b40955cabdb21c65", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__gruntjs__grunt", "task_id": "morefixes-bd86b40955cabdb21c65", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-bd86b40955cabdb21c65"} +{"backend": "codeql", "cve_id": "CVE-2023-37259", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-f1044573e0d15a82a1d0", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__matrix-org__matrix-react-sdk", "task_id": "morefixes-f1044573e0d15a82a1d0", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-f1044573e0d15a82a1d0"} +{"backend": "codeql", "cve_id": "CVE-2021-21679", "dataset": "codeql_javascript_benchmark_top30_v1", "environment_id": "codeql_javascript_benchmark_top30_v1/morefixes-f37103ca8d19c93116f8", "group": "CodeQL javascript", "language": "javascript", "project_id": "morefixes__jenkinsci__azure-ad-plugin", "task_id": "morefixes-f37103ca8d19c93116f8", "task_path": "codeql_javascript_benchmark_top30_v1/tasks/morefixes-f37103ca8d19c93116f8"} +{"backend": "codeql", "cve_id": "CVE-2021-21371", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-03252773bde39ba37465", "group": "CodeQL python", "language": "python", "project_id": "pyvul__tenable__integration-jira-cloud", "task_id": "pyvul-03252773bde39ba37465", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-03252773bde39ba37465"} +{"backend": "codeql", "cve_id": "CVE-2023-6977", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-07332271886167133edf", "group": "CodeQL python", "language": "python", "project_id": "pyvul__mlflow__mlflow", "task_id": "pyvul-07332271886167133edf", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-07332271886167133edf"} +{"backend": "codeql", "cve_id": "CVE-2020-12889", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-0e38a9079f90a5ac566e", "group": "CodeQL python", "language": "python", "project_id": "pyvul__misp__misp-maltego", "task_id": "pyvul-0e38a9079f90a5ac566e", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-0e38a9079f90a5ac566e"} +{"backend": "codeql", "cve_id": "CVE-2023-30629", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-10fb77265dc23f305315", "group": "CodeQL python", "language": "python", "project_id": "pyvul__vyperlang__vyper", "task_id": "pyvul-10fb77265dc23f305315", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-10fb77265dc23f305315"} +{"backend": "codeql", "cve_id": "CVE-2019-3830", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-135c7fcada946877931a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__openstack__ceilometer", "task_id": "pyvul-135c7fcada946877931a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-135c7fcada946877931a"} +{"backend": "codeql", "cve_id": "CVE-2020-10799", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19", "group": "CodeQL python", "language": "python", "project_id": "pyvul__deeplook__svglib", "task_id": "pyvul-15c0ad3037992bda1b19", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-15c0ad3037992bda1b19"} +{"backend": "codeql", "cve_id": "CVE-2022-0736", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-1a630dd8f83b2e29740d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__mlflow__mlflow", "task_id": "pyvul-1a630dd8f83b2e29740d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-1a630dd8f83b2e29740d"} +{"backend": "codeql", "cve_id": "CVE-2022-42965", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-1f5068a3fe5ca0192a07", "group": "CodeQL python", "language": "python", "project_id": "pyvul__snowflakedb__snowflake-connector-python", "task_id": "pyvul-1f5068a3fe5ca0192a07", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-1f5068a3fe5ca0192a07"} +{"backend": "codeql", "cve_id": "CVE-2021-46898", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-2ab65d62986b80922362", "group": "CodeQL python", "language": "python", "project_id": "pyvul__sehmaschine__django-grappelli", "task_id": "pyvul-2ab65d62986b80922362", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-2ab65d62986b80922362"} +{"backend": "codeql", "cve_id": "CVE-2023-48224", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3062589ff0b3b95c2ed7", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ethyca__fides", "task_id": "pyvul-3062589ff0b3b95c2ed7", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3062589ff0b3b95c2ed7"} +{"backend": "codeql", "cve_id": "CVE-2020-19001", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3187445bcbbf39128a26", "group": "CodeQL python", "language": "python", "project_id": "pyvul__tankywoo__simiki", "task_id": "pyvul-3187445bcbbf39128a26", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3187445bcbbf39128a26"} +{"backend": "codeql", "cve_id": "CVE-2022-0845", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777", "group": "CodeQL python", "language": "python", "project_id": "pyvul__pytorchlightning__pytorch-lightning", "task_id": "pyvul-36a40541d7c74a9a7777", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-36a40541d7c74a9a7777"} +{"backend": "codeql", "cve_id": "CVE-2023-6395", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3819b1a7530257524a75", "group": "CodeQL python", "language": "python", "project_id": "pyvul__xsuchy__templated-dictionary", "task_id": "pyvul-3819b1a7530257524a75", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3819b1a7530257524a75"} +{"backend": "codeql", "cve_id": "CVE-2020-29128", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-394adf7b067d96b356ca", "group": "CodeQL python", "language": "python", "project_id": "pyvul__petl-developers__petl", "task_id": "pyvul-394adf7b067d96b356ca", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-394adf7b067d96b356ca"} +{"backend": "codeql", "cve_id": "CVE-2021-41127", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-3994e3622b21c396ef8a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__rasahq__rasa", "task_id": "pyvul-3994e3622b21c396ef8a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-3994e3622b21c396ef8a"} +{"backend": "codeql", "cve_id": "CVE-2014-1932", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-4954e5890cce23c8b03d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__python-imaging__pillow", "task_id": "pyvul-4954e5890cce23c8b03d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-4954e5890cce23c8b03d"} +{"backend": "codeql", "cve_id": "CVE-2023-48700", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-4ac3440b9023e6511a91", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nautobot__nautobot-plugin-device-onboarding", "task_id": "pyvul-4ac3440b9023e6511a91", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-4ac3440b9023e6511a91"} +{"backend": "codeql", "cve_id": "CVE-2021-4315", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-4e31b8fba29687b8d792", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nyuccl__psiturk", "task_id": "pyvul-4e31b8fba29687b8d792", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-4e31b8fba29687b8d792"} +{"backend": "codeql", "cve_id": "CVE-2021-32839", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-509b1de3e2277ac89469", "group": "CodeQL python", "language": "python", "project_id": "pyvul__andialbrecht__sqlparse", "task_id": "pyvul-509b1de3e2277ac89469", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-509b1de3e2277ac89469"} +{"backend": "codeql", "cve_id": "CVE-2022-23530", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-533cc1a8c090c7529184", "group": "CodeQL python", "language": "python", "project_id": "pyvul__datadog__guarddog", "task_id": "pyvul-533cc1a8c090c7529184", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-533cc1a8c090c7529184"} +{"backend": "codeql", "cve_id": "CVE-2023-34540", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-5cffd45f7550a060e2cf", "group": "CodeQL python", "language": "python", "project_id": "pyvul__langchain-ai__langchain", "task_id": "pyvul-5cffd45f7550a060e2cf", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-5cffd45f7550a060e2cf"} +{"backend": "codeql", "cve_id": "CVE-2022-0315", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-6b5cf1b92b87b04c09cd", "group": "CodeQL python", "language": "python", "project_id": "pyvul__horovod__horovod", "task_id": "pyvul-6b5cf1b92b87b04c09cd", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-6b5cf1b92b87b04c09cd"} +{"backend": "codeql", "cve_id": "CVE-2021-23393", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-796a152aa965ce44a6db", "group": "CodeQL python", "language": "python", "project_id": "pyvul__briancappello__flask-unchained", "task_id": "pyvul-796a152aa965ce44a6db", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-796a152aa965ce44a6db"} +{"backend": "codeql", "cve_id": "CVE-2021-21274", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-7c3c693e688548564c9a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__matrix-org__synapse", "task_id": "pyvul-7c3c693e688548564c9a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-7c3c693e688548564c9a"} +{"backend": "codeql", "cve_id": "CVE-2017-16616", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-7c7eaf17f0df49603ae4", "group": "CodeQL python", "language": "python", "project_id": "pyvul__stranger6667__pyanyapi", "task_id": "pyvul-7c7eaf17f0df49603ae4", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-7c7eaf17f0df49603ae4"} +{"backend": "codeql", "cve_id": "CVE-2018-25082", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-810ace2bf3e4aa0f04a1", "group": "CodeQL python", "language": "python", "project_id": "pyvul__zwczou__weixin-python", "task_id": "pyvul-810ace2bf3e4aa0f04a1", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-810ace2bf3e4aa0f04a1"} +{"backend": "codeql", "cve_id": "CVE-2022-31605", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-812f35b535c5e549929b", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nvidia__nvflare", "task_id": "pyvul-812f35b535c5e549929b", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-812f35b535c5e549929b"} +{"backend": "codeql", "cve_id": "CVE-2013-4260", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-8297e406660c92268ba5", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ansible__ansible", "task_id": "pyvul-8297e406660c92268ba5", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-8297e406660c92268ba5"} +{"backend": "codeql", "cve_id": "CVE-2022-36082", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-89a9ff0f9cf4f2f4cc91", "group": "CodeQL python", "language": "python", "project_id": "pyvul__mansuf__mangadex-downloader", "task_id": "pyvul-89a9ff0f9cf4f2f4cc91", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-89a9ff0f9cf4f2f4cc91"} +{"backend": "codeql", "cve_id": "CVE-2020-15239", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-8e39d07d2ff863a3f19e", "group": "CodeQL python", "language": "python", "project_id": "pyvul__horazont__xmpp-http-upload", "task_id": "pyvul-8e39d07d2ff863a3f19e", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-8e39d07d2ff863a3f19e"} +{"backend": "codeql", "cve_id": "CVE-2023-29159", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-8f3613497f18d5cf2684", "group": "CodeQL python", "language": "python", "project_id": "pyvul__encode__starlette", "task_id": "pyvul-8f3613497f18d5cf2684", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-8f3613497f18d5cf2684"} +{"backend": "codeql", "cve_id": "CVE-2019-11340", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-98fc634e79976d5b5241", "group": "CodeQL python", "language": "python", "project_id": "pyvul__matrix-org__sydent", "task_id": "pyvul-98fc634e79976d5b5241", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-98fc634e79976d5b5241"} +{"backend": "codeql", "cve_id": "CVE-2019-14806", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-9ba7c665889bf20611cb", "group": "CodeQL python", "language": "python", "project_id": "pyvul__pallets__werkzeug", "task_id": "pyvul-9ba7c665889bf20611cb", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-9ba7c665889bf20611cb"} +{"backend": "codeql", "cve_id": "CVE-2023-49277", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-9c089aba2c203455d420", "group": "CodeQL python", "language": "python", "project_id": "pyvul__darrenofficial__dpaste", "task_id": "pyvul-9c089aba2c203455d420", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-9c089aba2c203455d420"} +{"backend": "codeql", "cve_id": "CVE-2020-15120", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-9dcb85347ac437354c6f", "group": "CodeQL python", "language": "python", "project_id": "pyvul__spiral-project__ihatemoney", "task_id": "pyvul-9dcb85347ac437354c6f", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-9dcb85347ac437354c6f"} +{"backend": "codeql", "cve_id": "CVE-2022-3301", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-a2d122cb9e3a61ddca7a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ikus060__rdiffweb", "task_id": "pyvul-a2d122cb9e3a61ddca7a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-a2d122cb9e3a61ddca7a"} +{"backend": "codeql", "cve_id": "CVE-2020-35653", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-a44d900bae2c75f9ea8d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__python-pillow__pillow", "task_id": "pyvul-a44d900bae2c75f9ea8d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-a44d900bae2c75f9ea8d"} +{"backend": "codeql", "cve_id": "CVE-2021-34363", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-b10e0389c54d164db5b4", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nvbn__thefuck", "task_id": "pyvul-b10e0389c54d164db5b4", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-b10e0389c54d164db5b4"} +{"backend": "codeql", "cve_id": "CVE-2014-1938", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-b5417e7c5b6909a4c5f9", "group": "CodeQL python", "language": "python", "project_id": "pyvul__alex__rply", "task_id": "pyvul-b5417e7c5b6909a4c5f9", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-b5417e7c5b6909a4c5f9"} +{"backend": "codeql", "cve_id": "CVE-2021-21360", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-bae2a9b05bba64edb040", "group": "CodeQL python", "language": "python", "project_id": "pyvul__zopefoundation__products.genericsetup", "task_id": "pyvul-bae2a9b05bba64edb040", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-bae2a9b05bba64edb040"} +{"backend": "codeql", "cve_id": "CVE-2022-24302", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-bf4aded7c76d99f9ef84", "group": "CodeQL python", "language": "python", "project_id": "pyvul__paramiko__paramiko", "task_id": "pyvul-bf4aded7c76d99f9ef84", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-bf4aded7c76d99f9ef84"} +{"backend": "codeql", "cve_id": "CVE-2021-43854", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-c4ca067f7fd871d25376", "group": "CodeQL python", "language": "python", "project_id": "pyvul__nltk__nltk", "task_id": "pyvul-c4ca067f7fd871d25376", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-c4ca067f7fd871d25376"} +{"backend": "codeql", "cve_id": "CVE-2023-2800", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-c52f0447bb0aa65cf9a4", "group": "CodeQL python", "language": "python", "project_id": "pyvul__huggingface__transformers", "task_id": "pyvul-c52f0447bb0aa65cf9a4", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-c52f0447bb0aa65cf9a4"} +{"backend": "codeql", "cve_id": "CVE-2022-4724", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-cb3f3f84ff4550031205", "group": "CodeQL python", "language": "python", "project_id": "pyvul__ikus060__rdiffweb", "task_id": "pyvul-cb3f3f84ff4550031205", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-cb3f3f84ff4550031205"} +{"backend": "codeql", "cve_id": "CVE-2023-49080", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-d005a7cf5935ac7e7aae", "group": "CodeQL python", "language": "python", "project_id": "pyvul__jupyter-server__jupyter_server", "task_id": "pyvul-d005a7cf5935ac7e7aae", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-d005a7cf5935ac7e7aae"} +{"backend": "codeql", "cve_id": "CVE-2021-21386", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-d38a3c1956e86350a0c7", "group": "CodeQL python", "language": "python", "project_id": "pyvul__dwisiswant0__apkleaks", "task_id": "pyvul-d38a3c1956e86350a0c7", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-d38a3c1956e86350a0c7"} +{"backend": "codeql", "cve_id": "CVE-2023-5002", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-dbcc9a178b256c49887e", "group": "CodeQL python", "language": "python", "project_id": "pyvul__pgadmin-org__pgadmin4", "task_id": "pyvul-dbcc9a178b256c49887e", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-dbcc9a178b256c49887e"} +{"backend": "codeql", "cve_id": "CVE-2023-38201", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede", "group": "CodeQL python", "language": "python", "project_id": "pyvul__keylime__keylime", "task_id": "pyvul-e305522c703de57f9ede", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-e305522c703de57f9ede"} +{"backend": "codeql", "cve_id": "CVE-2023-45139", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-e73df8c8998a1ddc180a", "group": "CodeQL python", "language": "python", "project_id": "pyvul__fonttools__fonttools", "task_id": "pyvul-e73df8c8998a1ddc180a", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-e73df8c8998a1ddc180a"} +{"backend": "codeql", "cve_id": "CVE-2021-39229", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-f55f7c013a9f5bd1eb0d", "group": "CodeQL python", "language": "python", "project_id": "pyvul__caronc__apprise", "task_id": "pyvul-f55f7c013a9f5bd1eb0d", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-f55f7c013a9f5bd1eb0d"} +{"backend": "codeql", "cve_id": "CVE-2023-45813", "dataset": "codeql_python_benchmark51_v2", "environment_id": "codeql_python_benchmark51_v2/pyvul-ff1e02f88768f34e43fb", "group": "CodeQL python", "language": "python", "project_id": "pyvul__dedsecinside__torbot", "task_id": "pyvul-ff1e02f88768f34e43fb", "task_path": "codeql_python_benchmark51_v2/tasks/pyvul-ff1e02f88768f34e43fb"} +{"backend": "csa", "cve_id": "CVE-2014-0749", "dataset": "csa159", "environment_id": "csa159/pair_134585", "group": "CSA", "language": "c/c++", "project_id": "adaptivecomputing_torque", "task_id": "pair_134585", "task_path": "csa159/tasks/pair_134585"} +{"backend": "csa", "cve_id": "CVE-2017-8911", "dataset": "csa159", "environment_id": "csa159/pair_135745", "group": "CSA", "language": "c/c++", "project_id": "verdammelt_tnef", "task_id": "pair_135745", "task_path": "csa159/tasks/pair_135745"} +{"backend": "csa", "cve_id": "CVE-2014-8127", "dataset": "csa159", "environment_id": "csa159/pair_136342", "group": "CSA", "language": "c/c++", "project_id": "vadz_libtiff", "task_id": "pair_136342", "task_path": "csa159/tasks/pair_136342"} +{"backend": "csa", "cve_id": "CVE-2019-9893", "dataset": "csa159", "environment_id": "csa159/pair_137674", "group": "CSA", "language": "c/c++", "project_id": "seccomp_libseccomp", "task_id": "pair_137674", "task_path": "csa159/tasks/pair_137674"} +{"backend": "csa", "cve_id": "CVE-2014-5388", "dataset": "csa159", "environment_id": "csa159/pair_137782", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137782", "task_path": "csa159/tasks/pair_137782"} +{"backend": "csa", "cve_id": "CVE-2026-9501", "dataset": "csa159", "environment_id": "csa159/pair_138263", "group": "CSA", "language": "c/c++", "project_id": "LibreDWG_libredwg", "task_id": "pair_138263", "task_path": "csa159/tasks/pair_138263"} +{"backend": "csa", "cve_id": "CVE-2019-20022", "dataset": "csa159", "environment_id": "csa159/pair_138473", "group": "CSA", "language": "c/c++", "project_id": "saitoha_libsixel", "task_id": "pair_138473", "task_path": "csa159/tasks/pair_138473"} +{"backend": "csa", "cve_id": "CVE-2026-33165", "dataset": "csa159", "environment_id": "csa159/pair_138511", "group": "CSA", "language": "c/c++", "project_id": "strukturag_libde265", "task_id": "pair_138511", "task_path": "csa159/tasks/pair_138511"} +{"backend": "csa", "cve_id": "CVE-2025-48367", "dataset": "csa159", "environment_id": "csa159/pair_138570", "group": "CSA", "language": "c/c++", "project_id": "redis_redis", "task_id": "pair_138570", "task_path": "csa159/tasks/pair_138570"} +{"backend": "csa", "cve_id": "CVE-2024-25269", "dataset": "csa159", "environment_id": "csa159/pair_138644", "group": "CSA", "language": "c/c++", "project_id": "strukturag_libheif", "task_id": "pair_138644", "task_path": "csa159/tasks/pair_138644"} +{"backend": "csa", "cve_id": "CVE-2025-62171", "dataset": "csa159", "environment_id": "csa159/pair_138710", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138710", "task_path": "csa159/tasks/pair_138710"} +{"backend": "csa", "cve_id": "CVE-2022-48923", "dataset": "csa159", "environment_id": "csa159/pair_139922", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_139922", "task_path": "csa159/tasks/pair_139922"} +{"backend": "csa", "cve_id": "CVE-2022-49375", "dataset": "csa159", "environment_id": "csa159/pair_140347", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_140347", "task_path": "csa159/tasks/pair_140347"} +{"backend": "csa", "cve_id": "CVE-2022-50419", "dataset": "csa159", "environment_id": "csa159/pair_141329", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141329", "task_path": "csa159/tasks/pair_141329"} +{"backend": "csa", "cve_id": "CVE-2023-53148", "dataset": "csa159", "environment_id": "csa159/pair_142288", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142288", "task_path": "csa159/tasks/pair_142288"} +{"backend": "csa", "cve_id": "CVE-2023-53532", "dataset": "csa159", "environment_id": "csa159/pair_142647", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142647", "task_path": "csa159/tasks/pair_142647"} +{"backend": "csa", "cve_id": "CVE-2025-38226", "dataset": "csa159", "environment_id": "csa159/pair_147034", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147034", "task_path": "csa159/tasks/pair_147034"} +{"backend": "csa", "cve_id": "CVE-2025-39773", "dataset": "csa159", "environment_id": "csa159/pair_147640", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147640", "task_path": "csa159/tasks/pair_147640"} +{"backend": "csa", "cve_id": "CVE-2025-39810", "dataset": "csa159", "environment_id": "csa159/pair_147676", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147676", "task_path": "csa159/tasks/pair_147676"} +{"backend": "csa", "cve_id": "CVE-2025-71146", "dataset": "csa159", "environment_id": "csa159/pair_148601", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_148601", "task_path": "csa159/tasks/pair_148601"} +{"backend": "csa", "cve_id": "CVE-2026-23111", "dataset": "csa159", "environment_id": "csa159/pair_148834", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_148834", "task_path": "csa159/tasks/pair_148834"} +{"backend": "csa", "cve_id": "CVE-2026-31747", "dataset": "csa159", "environment_id": "csa159/pair_149548", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149548", "task_path": "csa159/tasks/pair_149548"} +{"backend": "csa", "cve_id": "CVE-2026-43054", "dataset": "csa159", "environment_id": "csa159/pair_149640", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149640", "task_path": "csa159/tasks/pair_149640"} +{"backend": "csa", "cve_id": "CVE-2026-43166", "dataset": "csa159", "environment_id": "csa159/pair_149751", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149751", "task_path": "csa159/tasks/pair_149751"} +{"backend": "csa", "cve_id": "CVE-2026-43185", "dataset": "csa159", "environment_id": "csa159/pair_149770", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149770", "task_path": "csa159/tasks/pair_149770"} +{"backend": "csa", "cve_id": "CVE-2026-45863", "dataset": "csa159", "environment_id": "csa159/pair_150111", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150111", "task_path": "csa159/tasks/pair_150111"} +{"backend": "csa", "cve_id": "CVE-2026-46001", "dataset": "csa159", "environment_id": "csa159/pair_150247", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150247", "task_path": "csa159/tasks/pair_150247"} +{"backend": "csa", "cve_id": "CVE-2026-46180", "dataset": "csa159", "environment_id": "csa159/pair_150426", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150426", "task_path": "csa159/tasks/pair_150426"} +{"backend": "csa", "cve_id": "CVE-2022-48730", "dataset": "csa159", "environment_id": "csa159/pair_156745", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156745", "task_path": "csa159/tasks/pair_156745"} +{"backend": "csa", "cve_id": "CVE-2021-42252", "dataset": "csa159", "environment_id": "csa159/pair_157090", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157090", "task_path": "csa159/tasks/pair_157090"} +{"backend": "csa", "cve_id": "CVE-2022-50010", "dataset": "csa159", "environment_id": "csa159/pair_157305", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157305", "task_path": "csa159/tasks/pair_157305"} +{"backend": "csa", "cve_id": "CVE-2025-38692", "dataset": "csa159", "environment_id": "csa159/pair_157307", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157307", "task_path": "csa159/tasks/pair_157307"} +{"backend": "csa", "cve_id": "CVE-2022-48634", "dataset": "csa159", "environment_id": "csa159/pair_158826", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158826", "task_path": "csa159/tasks/pair_158826"} +{"backend": "csa", "cve_id": "CVE-2021-47437", "dataset": "csa159", "environment_id": "csa159/pair_159680", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_159680", "task_path": "csa159/tasks/pair_159680"} +{"backend": "csa", "cve_id": "CVE-2024-26811", "dataset": "csa159", "environment_id": "csa159/pair_161551", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161551", "task_path": "csa159/tasks/pair_161551"} +{"backend": "csa", "cve_id": "CVE-2026-23299", "dataset": "csa159", "environment_id": "csa159/pair_161587", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161587", "task_path": "csa159/tasks/pair_161587"} +{"backend": "csa", "cve_id": "CVE-2020-28374", "dataset": "csa159", "environment_id": "csa159/pair_162518", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162518", "task_path": "csa159/tasks/pair_162518"} +{"backend": "csa", "cve_id": "CVE-2024-26954", "dataset": "csa159", "environment_id": "csa159/pair_162526", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162526", "task_path": "csa159/tasks/pair_162526"} +{"backend": "csa", "cve_id": "CVE-2023-53166", "dataset": "csa159", "environment_id": "csa159/pair_162993", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162993", "task_path": "csa159/tasks/pair_162993"} +{"backend": "csa", "cve_id": "CVE-2022-49639", "dataset": "csa159", "environment_id": "csa159/pair_163682", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163682", "task_path": "csa159/tasks/pair_163682"} +{"backend": "csa", "cve_id": "CVE-2024-38384", "dataset": "csa159", "environment_id": "csa159/pair_164279", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164279", "task_path": "csa159/tasks/pair_164279"} +{"backend": "csa", "cve_id": "CVE-2025-21719", "dataset": "csa159", "environment_id": "csa159/pair_164760", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164760", "task_path": "csa159/tasks/pair_164760"} +{"backend": "csa", "cve_id": "CVE-2025-37780", "dataset": "csa159", "environment_id": "csa159/pair_165550", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165550", "task_path": "csa159/tasks/pair_165550"} +{"backend": "csa", "cve_id": "CVE-2019-11338", "dataset": "csa159", "environment_id": "csa159/pair_17613", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_17613", "task_path": "csa159/tasks/pair_17613"} +{"backend": "csa", "cve_id": "CVE-2023-39562", "dataset": "csa159", "environment_id": "csa159/pair_4253", "group": "CSA", "language": "c/c++", "project_id": "gpac_gpac", "task_id": "pair_4253", "task_path": "csa159/tasks/pair_4253"} +{"backend": "csa", "cve_id": "CVE-2017-7866", "dataset": "csa159", "environment_id": "csa159/pair_4869", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_4869", "task_path": "csa159/tasks/pair_4869"} +{"backend": "csa", "cve_id": "CVE-2020-9365", "dataset": "csa159", "environment_id": "csa159/pair_134943", "group": "CSA", "language": "c/c++", "project_id": "jedisct1_pure-ftpd", "task_id": "pair_134943", "task_path": "csa159/tasks/pair_134943"} +{"backend": "csa", "cve_id": "CVE-2016-5824", "dataset": "csa159", "environment_id": "csa159/pair_135175", "group": "CSA", "language": "c/c++", "project_id": "libical_libical", "task_id": "pair_135175", "task_path": "csa159/tasks/pair_135175"} +{"backend": "csa", "cve_id": "CVE-2020-26148", "dataset": "csa159", "environment_id": "csa159/pair_135384", "group": "CSA", "language": "c/c++", "project_id": "mity_md4c", "task_id": "pair_135384", "task_path": "csa159/tasks/pair_135384"} +{"backend": "csa", "cve_id": "CVE-2018-1000091", "dataset": "csa159", "environment_id": "csa159/pair_135405", "group": "CSA", "language": "c/c++", "project_id": "mwarning_KadNode", "task_id": "pair_135405", "task_path": "csa159/tasks/pair_135405"} +{"backend": "csa", "cve_id": "CVE-2021-33930", "dataset": "csa159", "environment_id": "csa159/pair_135446", "group": "CSA", "language": "c/c++", "project_id": "openSUSE_libsolv", "task_id": "pair_135446", "task_path": "csa159/tasks/pair_135446"} +{"backend": "csa", "cve_id": "CVE-2018-19826", "dataset": "csa159", "environment_id": "csa159/pair_135624", "group": "CSA", "language": "c/c++", "project_id": "sass_libsass", "task_id": "pair_135624", "task_path": "csa159/tasks/pair_135624"} +{"backend": "csa", "cve_id": "CVE-2017-6309", "dataset": "csa159", "environment_id": "csa159/pair_135749", "group": "CSA", "language": "c/c++", "project_id": "verdammelt_tnef", "task_id": "pair_135749", "task_path": "csa159/tasks/pair_135749"} +{"backend": "csa", "cve_id": "CVE-2020-11764", "dataset": "csa159", "environment_id": "csa159/pair_136251", "group": "CSA", "language": "c/c++", "project_id": "openexr_openexr", "task_id": "pair_136251", "task_path": "csa159/tasks/pair_136251"} +{"backend": "csa", "cve_id": "CVE-2020-11764", "dataset": "csa159", "environment_id": "csa159/pair_136252", "group": "CSA", "language": "c/c++", "project_id": "openexr_openexr", "task_id": "pair_136252", "task_path": "csa159/tasks/pair_136252"} +{"backend": "csa", "cve_id": "CVE-2023-3745", "dataset": "csa159", "environment_id": "csa159/pair_136864", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick6", "task_id": "pair_136864", "task_path": "csa159/tasks/pair_136864"} +{"backend": "csa", "cve_id": "CVE-2017-5627", "dataset": "csa159", "environment_id": "csa159/pair_137200", "group": "CSA", "language": "c/c++", "project_id": "ccxvii_mujs", "task_id": "pair_137200", "task_path": "csa159/tasks/pair_137200"} +{"backend": "csa", "cve_id": "CVE-2020-23306", "dataset": "csa159", "environment_id": "csa159/pair_137357", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137357", "task_path": "csa159/tasks/pair_137357"} +{"backend": "csa", "cve_id": "CVE-2021-46349", "dataset": "csa159", "environment_id": "csa159/pair_137374", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137374", "task_path": "csa159/tasks/pair_137374"} +{"backend": "csa", "cve_id": "CVE-2020-23312", "dataset": "csa159", "environment_id": "csa159/pair_137377", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137377", "task_path": "csa159/tasks/pair_137377"} +{"backend": "csa", "cve_id": "CVE-2021-46350", "dataset": "csa159", "environment_id": "csa159/pair_137389", "group": "CSA", "language": "c/c++", "project_id": "jerryscript-project_jerryscript", "task_id": "pair_137389", "task_path": "csa159/tasks/pair_137389"} +{"backend": "csa", "cve_id": "CVE-2019-19795", "dataset": "csa159", "environment_id": "csa159/pair_137518", "group": "CSA", "language": "c/c++", "project_id": "michaelforney_samurai", "task_id": "pair_137518", "task_path": "csa159/tasks/pair_137518"} +{"backend": "csa", "cve_id": "CVE-2014-0146", "dataset": "csa159", "environment_id": "csa159/pair_137750", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137750", "task_path": "csa159/tasks/pair_137750"} +{"backend": "csa", "cve_id": "CVE-2018-16847", "dataset": "csa159", "environment_id": "csa159/pair_137751", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137751", "task_path": "csa159/tasks/pair_137751"} +{"backend": "csa", "cve_id": "CVE-2018-17963", "dataset": "csa159", "environment_id": "csa159/pair_137769", "group": "CSA", "language": "c/c++", "project_id": "qemu_qemu", "task_id": "pair_137769", "task_path": "csa159/tasks/pair_137769"} +{"backend": "csa", "cve_id": "CVE-2019-20396", "dataset": "csa159", "environment_id": "csa159/pair_138126", "group": "CSA", "language": "c/c++", "project_id": "CESNET_libyang", "task_id": "pair_138126", "task_path": "csa159/tasks/pair_138126"} +{"backend": "csa", "cve_id": "CVE-2026-32854", "dataset": "csa159", "environment_id": "csa159/pair_138203", "group": "CSA", "language": "c/c++", "project_id": "LibVNC_libvncserver", "task_id": "pair_138203", "task_path": "csa159/tasks/pair_138203"} +{"backend": "csa", "cve_id": "CVE-2020-6611", "dataset": "csa159", "environment_id": "csa159/pair_138249", "group": "CSA", "language": "c/c++", "project_id": "LibreDWG_libredwg", "task_id": "pair_138249", "task_path": "csa159/tasks/pair_138249"} +{"backend": "csa", "cve_id": "CVE-2021-36080", "dataset": "csa159", "environment_id": "csa159/pair_138280", "group": "CSA", "language": "c/c++", "project_id": "LibreDWG_libredwg", "task_id": "pair_138280", "task_path": "csa159/tasks/pair_138280"} +{"backend": "csa", "cve_id": "CVE-2019-13115", "dataset": "csa159", "environment_id": "csa159/pair_138328", "group": "CSA", "language": "c/c++", "project_id": "libssh2_libssh2", "task_id": "pair_138328", "task_path": "csa159/tasks/pair_138328"} +{"backend": "csa", "cve_id": "CVE-2024-28319", "dataset": "csa159", "environment_id": "csa159/pair_138462", "group": "CSA", "language": "c/c++", "project_id": "gpac_gpac", "task_id": "pair_138462", "task_path": "csa159/tasks/pair_138462"} +{"backend": "csa", "cve_id": "CVE-2018-21232", "dataset": "csa159", "environment_id": "csa159/pair_138485", "group": "CSA", "language": "c/c++", "project_id": "skvadrik_re2c", "task_id": "pair_138485", "task_path": "csa159/tasks/pair_138485"} +{"backend": "csa", "cve_id": "CVE-2016-1924", "dataset": "csa159", "environment_id": "csa159/pair_138650", "group": "CSA", "language": "c/c++", "project_id": "uclouvain_openjpeg", "task_id": "pair_138650", "task_path": "csa159/tasks/pair_138650"} +{"backend": "csa", "cve_id": "CVE-2026-40169", "dataset": "csa159", "environment_id": "csa159/pair_138728", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138728", "task_path": "csa159/tasks/pair_138728"} +{"backend": "csa", "cve_id": "CVE-2025-46393", "dataset": "csa159", "environment_id": "csa159/pair_138746", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138746", "task_path": "csa159/tasks/pair_138746"} +{"backend": "csa", "cve_id": "CVE-2026-33905", "dataset": "csa159", "environment_id": "csa159/pair_138756", "group": "CSA", "language": "c/c++", "project_id": "ImageMagick_ImageMagick", "task_id": "pair_138756", "task_path": "csa159/tasks/pair_138756"} +{"backend": "csa", "cve_id": "CVE-2011-2161", "dataset": "csa159", "environment_id": "csa159/pair_138800", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_138800", "task_path": "csa159/tasks/pair_138800"} +{"backend": "csa", "cve_id": "CVE-2021-47583", "dataset": "csa159", "environment_id": "csa159/pair_139579", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_139579", "task_path": "csa159/tasks/pair_139579"} +{"backend": "csa", "cve_id": "CVE-2022-49563", "dataset": "csa159", "environment_id": "csa159/pair_140531", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_140531", "task_path": "csa159/tasks/pair_140531"} +{"backend": "csa", "cve_id": "CVE-2022-49727", "dataset": "csa159", "environment_id": "csa159/pair_140691", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_140691", "task_path": "csa159/tasks/pair_140691"} +{"backend": "csa", "cve_id": "CVE-2022-50138", "dataset": "csa159", "environment_id": "csa159/pair_141072", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141072", "task_path": "csa159/tasks/pair_141072"} +{"backend": "csa", "cve_id": "CVE-2022-50374", "dataset": "csa159", "environment_id": "csa159/pair_141289", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141289", "task_path": "csa159/tasks/pair_141289"} +{"backend": "csa", "cve_id": "CVE-2022-50459", "dataset": "csa159", "environment_id": "csa159/pair_141364", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141364", "task_path": "csa159/tasks/pair_141364"} +{"backend": "csa", "cve_id": "CVE-2023-52471", "dataset": "csa159", "environment_id": "csa159/pair_141754", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141754", "task_path": "csa159/tasks/pair_141754"} +{"backend": "csa", "cve_id": "CVE-2023-52609", "dataset": "csa159", "environment_id": "csa159/pair_141857", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_141857", "task_path": "csa159/tasks/pair_141857"} +{"backend": "csa", "cve_id": "CVE-2023-53250", "dataset": "csa159", "environment_id": "csa159/pair_142376", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142376", "task_path": "csa159/tasks/pair_142376"} +{"backend": "csa", "cve_id": "CVE-2023-53679", "dataset": "csa159", "environment_id": "csa159/pair_142793", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_142793", "task_path": "csa159/tasks/pair_142793"} +{"backend": "csa", "cve_id": "CVE-2024-26927", "dataset": "csa159", "environment_id": "csa159/pair_143586", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_143586", "task_path": "csa159/tasks/pair_143586"} +{"backend": "csa", "cve_id": "CVE-2024-38628", "dataset": "csa159", "environment_id": "csa159/pair_144169", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_144169", "task_path": "csa159/tasks/pair_144169"} +{"backend": "csa", "cve_id": "CVE-2024-53117", "dataset": "csa159", "environment_id": "csa159/pair_145442", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145442", "task_path": "csa159/tasks/pair_145442"} +{"backend": "csa", "cve_id": "CVE-2024-53203", "dataset": "csa159", "environment_id": "csa159/pair_145527", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145527", "task_path": "csa159/tasks/pair_145527"} +{"backend": "csa", "cve_id": "CVE-2024-56605", "dataset": "csa159", "environment_id": "csa159/pair_145663", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145663", "task_path": "csa159/tasks/pair_145663"} +{"backend": "csa", "cve_id": "CVE-2024-57953", "dataset": "csa159", "environment_id": "csa159/pair_145933", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145933", "task_path": "csa159/tasks/pair_145933"} +{"backend": "csa", "cve_id": "CVE-2024-57996", "dataset": "csa159", "environment_id": "csa159/pair_145957", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_145957", "task_path": "csa159/tasks/pair_145957"} +{"backend": "csa", "cve_id": "CVE-2024-58065", "dataset": "csa159", "environment_id": "csa159/pair_146000", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_146000", "task_path": "csa159/tasks/pair_146000"} +{"backend": "csa", "cve_id": "CVE-2025-21986", "dataset": "csa159", "environment_id": "csa159/pair_146389", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_146389", "task_path": "csa159/tasks/pair_146389"} +{"backend": "csa", "cve_id": "CVE-2025-38415", "dataset": "csa159", "environment_id": "csa159/pair_147222", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147222", "task_path": "csa159/tasks/pair_147222"} +{"backend": "csa", "cve_id": "CVE-2025-38459", "dataset": "csa159", "environment_id": "csa159/pair_147266", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_147266", "task_path": "csa159/tasks/pair_147266"} +{"backend": "csa", "cve_id": "CVE-2025-40313", "dataset": "csa159", "environment_id": "csa159/pair_148175", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_148175", "task_path": "csa159/tasks/pair_148175"} +{"backend": "csa", "cve_id": "CVE-2026-43160", "dataset": "csa159", "environment_id": "csa159/pair_149745", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149745", "task_path": "csa159/tasks/pair_149745"} +{"backend": "csa", "cve_id": "CVE-2026-43249", "dataset": "csa159", "environment_id": "csa159/pair_149834", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149834", "task_path": "csa159/tasks/pair_149834"} +{"backend": "csa", "cve_id": "CVE-2026-43376", "dataset": "csa159", "environment_id": "csa159/pair_149959", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_149959", "task_path": "csa159/tasks/pair_149959"} +{"backend": "csa", "cve_id": "CVE-2026-46045", "dataset": "csa159", "environment_id": "csa159/pair_150291", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150291", "task_path": "csa159/tasks/pair_150291"} +{"backend": "csa", "cve_id": "CVE-2026-46090", "dataset": "csa159", "environment_id": "csa159/pair_150336", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_150336", "task_path": "csa159/tasks/pair_150336"} +{"backend": "csa", "cve_id": "CVE-2022-49007", "dataset": "csa159", "environment_id": "csa159/pair_156097", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156097", "task_path": "csa159/tasks/pair_156097"} +{"backend": "csa", "cve_id": "CVE-2024-42272", "dataset": "csa159", "environment_id": "csa159/pair_156217", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156217", "task_path": "csa159/tasks/pair_156217"} +{"backend": "csa", "cve_id": "CVE-2023-52505", "dataset": "csa159", "environment_id": "csa159/pair_156267", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156267", "task_path": "csa159/tasks/pair_156267"} +{"backend": "csa", "cve_id": "CVE-2024-26664", "dataset": "csa159", "environment_id": "csa159/pair_156473", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156473", "task_path": "csa159/tasks/pair_156473"} +{"backend": "csa", "cve_id": "CVE-2025-38568", "dataset": "csa159", "environment_id": "csa159/pair_156640", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156640", "task_path": "csa159/tasks/pair_156640"} +{"backend": "csa", "cve_id": "CVE-2023-53057", "dataset": "csa159", "environment_id": "csa159/pair_156704", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156704", "task_path": "csa159/tasks/pair_156704"} +{"backend": "csa", "cve_id": "CVE-2023-52865", "dataset": "csa159", "environment_id": "csa159/pair_156860", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156860", "task_path": "csa159/tasks/pair_156860"} +{"backend": "csa", "cve_id": "CVE-2022-48818", "dataset": "csa159", "environment_id": "csa159/pair_156981", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_156981", "task_path": "csa159/tasks/pair_156981"} +{"backend": "csa", "cve_id": "CVE-2022-49519", "dataset": "csa159", "environment_id": "csa159/pair_157153", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_157153", "task_path": "csa159/tasks/pair_157153"} +{"backend": "csa", "cve_id": "CVE-2022-48665", "dataset": "csa159", "environment_id": "csa159/pair_158138", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158138", "task_path": "csa159/tasks/pair_158138"} +{"backend": "csa", "cve_id": "CVE-2026-53322", "dataset": "csa159", "environment_id": "csa159/pair_158217", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158217", "task_path": "csa159/tasks/pair_158217"} +{"backend": "csa", "cve_id": "CVE-2022-50131", "dataset": "csa159", "environment_id": "csa159/pair_158385", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158385", "task_path": "csa159/tasks/pair_158385"} +{"backend": "csa", "cve_id": "CVE-2023-1078", "dataset": "csa159", "environment_id": "csa159/pair_158831", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_158831", "task_path": "csa159/tasks/pair_158831"} +{"backend": "csa", "cve_id": "CVE-2022-49208", "dataset": "csa159", "environment_id": "csa159/pair_159264", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_159264", "task_path": "csa159/tasks/pair_159264"} +{"backend": "csa", "cve_id": "CVE-2024-36899", "dataset": "csa159", "environment_id": "csa159/pair_159377", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_159377", "task_path": "csa159/tasks/pair_159377"} +{"backend": "csa", "cve_id": "CVE-2025-37812", "dataset": "csa159", "environment_id": "csa159/pair_160021", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160021", "task_path": "csa159/tasks/pair_160021"} +{"backend": "csa", "cve_id": "CVE-2023-52569", "dataset": "csa159", "environment_id": "csa159/pair_160187", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160187", "task_path": "csa159/tasks/pair_160187"} +{"backend": "csa", "cve_id": "CVE-2023-52603", "dataset": "csa159", "environment_id": "csa159/pair_160364", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160364", "task_path": "csa159/tasks/pair_160364"} +{"backend": "csa", "cve_id": "CVE-2023-28464", "dataset": "csa159", "environment_id": "csa159/pair_160434", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160434", "task_path": "csa159/tasks/pair_160434"} +{"backend": "csa", "cve_id": "CVE-2025-38129", "dataset": "csa159", "environment_id": "csa159/pair_160451", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160451", "task_path": "csa159/tasks/pair_160451"} +{"backend": "csa", "cve_id": "CVE-2024-45017", "dataset": "csa159", "environment_id": "csa159/pair_160603", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160603", "task_path": "csa159/tasks/pair_160603"} +{"backend": "csa", "cve_id": "CVE-2022-49123", "dataset": "csa159", "environment_id": "csa159/pair_160628", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160628", "task_path": "csa159/tasks/pair_160628"} +{"backend": "csa", "cve_id": "CVE-2024-41059", "dataset": "csa159", "environment_id": "csa159/pair_160904", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160904", "task_path": "csa159/tasks/pair_160904"} +{"backend": "csa", "cve_id": "CVE-2024-42242", "dataset": "csa159", "environment_id": "csa159/pair_160912", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_160912", "task_path": "csa159/tasks/pair_160912"} +{"backend": "csa", "cve_id": "CVE-2024-26585", "dataset": "csa159", "environment_id": "csa159/pair_161027", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161027", "task_path": "csa159/tasks/pair_161027"} +{"backend": "csa", "cve_id": "CVE-2024-38593", "dataset": "csa159", "environment_id": "csa159/pair_161598", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161598", "task_path": "csa159/tasks/pair_161598"} +{"backend": "csa", "cve_id": "CVE-2024-26583", "dataset": "csa159", "environment_id": "csa159/pair_161667", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161667", "task_path": "csa159/tasks/pair_161667"} +{"backend": "csa", "cve_id": "CVE-2025-21811", "dataset": "csa159", "environment_id": "csa159/pair_161782", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161782", "task_path": "csa159/tasks/pair_161782"} +{"backend": "csa", "cve_id": "CVE-2023-52843", "dataset": "csa159", "environment_id": "csa159/pair_161997", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_161997", "task_path": "csa159/tasks/pair_161997"} +{"backend": "csa", "cve_id": "CVE-2023-53827", "dataset": "csa159", "environment_id": "csa159/pair_162003", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162003", "task_path": "csa159/tasks/pair_162003"} +{"backend": "csa", "cve_id": "CVE-2022-4095", "dataset": "csa159", "environment_id": "csa159/pair_162331", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162331", "task_path": "csa159/tasks/pair_162331"} +{"backend": "csa", "cve_id": "CVE-2022-48735", "dataset": "csa159", "environment_id": "csa159/pair_162535", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162535", "task_path": "csa159/tasks/pair_162535"} +{"backend": "csa", "cve_id": "CVE-2021-47032", "dataset": "csa159", "environment_id": "csa159/pair_162672", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162672", "task_path": "csa159/tasks/pair_162672"} +{"backend": "csa", "cve_id": "CVE-2024-36016", "dataset": "csa159", "environment_id": "csa159/pair_162700", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_162700", "task_path": "csa159/tasks/pair_162700"} +{"backend": "csa", "cve_id": "CVE-2024-39509", "dataset": "csa159", "environment_id": "csa159/pair_163294", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163294", "task_path": "csa159/tasks/pair_163294"} +{"backend": "csa", "cve_id": "CVE-2025-38150", "dataset": "csa159", "environment_id": "csa159/pair_163698", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163698", "task_path": "csa159/tasks/pair_163698"} +{"backend": "csa", "cve_id": "CVE-2024-36484", "dataset": "csa159", "environment_id": "csa159/pair_163737", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163737", "task_path": "csa159/tasks/pair_163737"} +{"backend": "csa", "cve_id": "CVE-2023-39194", "dataset": "csa159", "environment_id": "csa159/pair_163761", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163761", "task_path": "csa159/tasks/pair_163761"} +{"backend": "csa", "cve_id": "CVE-2025-68337", "dataset": "csa159", "environment_id": "csa159/pair_163824", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163824", "task_path": "csa159/tasks/pair_163824"} +{"backend": "csa", "cve_id": "CVE-2024-56584", "dataset": "csa159", "environment_id": "csa159/pair_163861", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163861", "task_path": "csa159/tasks/pair_163861"} +{"backend": "csa", "cve_id": "CVE-2023-45863", "dataset": "csa159", "environment_id": "csa159/pair_163978", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_163978", "task_path": "csa159/tasks/pair_163978"} +{"backend": "csa", "cve_id": "CVE-2023-52435", "dataset": "csa159", "environment_id": "csa159/pair_164140", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164140", "task_path": "csa159/tasks/pair_164140"} +{"backend": "csa", "cve_id": "CVE-2022-48893", "dataset": "csa159", "environment_id": "csa159/pair_164624", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164624", "task_path": "csa159/tasks/pair_164624"} +{"backend": "csa", "cve_id": "CVE-2021-47109", "dataset": "csa159", "environment_id": "csa159/pair_164920", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164920", "task_path": "csa159/tasks/pair_164920"} +{"backend": "csa", "cve_id": "CVE-2023-52623", "dataset": "csa159", "environment_id": "csa159/pair_164974", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_164974", "task_path": "csa159/tasks/pair_164974"} +{"backend": "csa", "cve_id": "CVE-2022-28796", "dataset": "csa159", "environment_id": "csa159/pair_165542", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165542", "task_path": "csa159/tasks/pair_165542"} +{"backend": "csa", "cve_id": "CVE-2022-49580", "dataset": "csa159", "environment_id": "csa159/pair_165655", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165655", "task_path": "csa159/tasks/pair_165655"} +{"backend": "csa", "cve_id": "CVE-2023-45863", "dataset": "csa159", "environment_id": "csa159/pair_165738", "group": "CSA", "language": "c/c++", "project_id": "torvalds_linux", "task_id": "pair_165738", "task_path": "csa159/tasks/pair_165738"} +{"backend": "csa", "cve_id": "CVE-2021-40572", "dataset": "csa159", "environment_id": "csa159/pair_3538", "group": "CSA", "language": "c/c++", "project_id": "gpac_gpac", "task_id": "pair_3538", "task_path": "csa159/tasks/pair_3538"} +{"backend": "csa", "cve_id": "CVE-2020-36138", "dataset": "csa159", "environment_id": "csa159/pair_4701", "group": "CSA", "language": "c/c++", "project_id": "FFmpeg_FFmpeg", "task_id": "pair_4701", "task_path": "csa159/tasks/pair_4701"} +{"backend": "csa", "cve_id": "CVE-2020-11096", "dataset": "csa159", "environment_id": "csa159/pair_6060", "group": "CSA", "language": "c/c++", "project_id": "FreeRDP_FreeRDP", "task_id": "pair_6060", "task_path": "csa159/tasks/pair_6060"} +{"backend": "csa", "cve_id": "CVE-2018-8784", "dataset": "csa159", "environment_id": "csa159/pair_6105", "group": "CSA", "language": "c/c++", "project_id": "FreeRDP_FreeRDP", "task_id": "pair_6105", "task_path": "csa159/tasks/pair_6105"} +{"backend": "csa", "cve_id": "CVE-2020-11038", "dataset": "csa159", "environment_id": "csa159/pair_6132", "group": "CSA", "language": "c/c++", "project_id": "FreeRDP_FreeRDP", "task_id": "pair_6132", "task_path": "csa159/tasks/pair_6132"} +{"backend": "csa", "cve_id": "CVE-2016-5418", "dataset": "csa159", "environment_id": "csa159/pair_7278", "group": "CSA", "language": "c/c++", "project_id": "libarchive_libarchive", "task_id": "pair_7278", "task_path": "csa159/tasks/pair_7278"} +{"backend": "csa", "cve_id": "CVE-2013-0211", "dataset": "csa159", "environment_id": "csa159/pair_7287", "group": "CSA", "language": "c/c++", "project_id": "libarchive_libarchive", "task_id": "pair_7287", "task_path": "csa159/tasks/pair_7287"} diff --git a/docs/environment.md b/docs/environment.md new file mode 100644 index 0000000000000000000000000000000000000000..e5160411fb0e6aeedf3c0cc71c0c83d55cad73f4 --- /dev/null +++ b/docs/environment.md @@ -0,0 +1,32 @@ +# Runtime environment + +The release contains **300 tasks: CSA 159 and CodeQL 141**. All provided archives use neutral names and reproducible file metadata. + +## Toolchain + +Import the provided Docker archive with `scripts/restore.py --load-image`. The image is tagged `checkerbench-runtime:review-v1` and targets Linux amd64. Toolchain versions are listed in `environment/versions.json`. + +The image contains LLVM/Clang, CodeQL, language dependencies, the Python environment, and the MCP adapter needed for task preparation and scanning. Model-service credentials are supplied separately by the operator. + +## Task preparation + +`scripts/prepare.py` accepts only tasks in the release roster. It creates writable workspaces from the bundled task inputs and captured runtime assets. It rewrites the scan paths for the requested workspace and applies the source-evidenced compiler compatibility adjustments recorded in `runtime-adjustments.json`. + +CSA workspaces share immutable Git objects with the extracted dataset. Keep `/data` mounted at the same path when reopening them. CodeQL copies its before, after, and refinement databases into the writable output directory. + +## Refinement assets + +CSA source snapshots, refinement overlays, compilation databases, and restoration scripts are included. Full refinement restoration is available through: + +```bash +python /data/csa159/scripts/rehydrate_benchmark_env.py \ + --pair-id 134943 --output-workdir /work/refinement-example +``` + +Some captured refinement assets use absolute symbolic links or generated build files. Their original source-relative mappings must be preserved when restoring those environments. Before/after workspace checks and full refinement replay have separate validation scopes; `reports/validation.json` identifies the checks actually performed. + +## Integrity + +Each dataset archive contains `integrity.json`, which hashes regular files and records symbolic-link targets. `release-manifest.json` additionally records complete archive and split-part SHA-256 checksums. + +The reviewer distribution retains task inputs, executable runtime assets, reference implementations, and evaluation evidence. Operator run logs, account configurations, and trajectory administration records are omitted. Upstream project source files and licenses retain their original content. diff --git a/environment/versions.json b/environment/versions.json new file mode 100644 index 0000000000000000000000000000000000000000..92a0f68d1852c8ee8a68f2b98997dac819439125 --- /dev/null +++ b/environment/versions.json @@ -0,0 +1,11 @@ +{ + "platform": "linux/amd64", + "image": "checkerbench-runtime:review-v1", + "ubuntu": "24.04", + "llvm": "18.1.8", + "codeql": "2.26.4", + "jdk": "17", + "gcc": "11", + "node": "22.23.1", + "python": "3.12" +} diff --git a/release-manifest.json b/release-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..8287d2a0f56262605f03c109eba1beb808cb4c1d --- /dev/null +++ b/release-manifest.json @@ -0,0 +1,134 @@ +{ + "schema_version": 1, + "tag": "checkerbench-300-v1", + "task_count": 300, + "packages": [ + { + "key": "codeql_go_benchmark_top30_v1", + "kind": "dataset", + "archive": "codeql_go_benchmark_top30_v1.tar.gz", + "bytes": 1255620410, + "sha256": "f1c061beb65d425414f8d20938b8918e521c6c908a706cbcdab2db568e269bd2", + "parts": [ + { + "name": "codeql_go_benchmark_top30_v1.tar.gz", + "bytes": 1255620410, + "sha256": "f1c061beb65d425414f8d20938b8918e521c6c908a706cbcdab2db568e269bd2" + } + ], + "root": "codeql_go_benchmark_top30_v1", + "task_count": 30 + }, + { + "key": "codeql_java_benchmark_top30_v2", + "kind": "dataset", + "archive": "codeql_java_benchmark_top30_v2.tar.gz", + "bytes": 258511734, + "sha256": "94584869e15e944bdf4b48df044debff02a4607a60ba360ccc9db554037595bb", + "parts": [ + { + "name": "codeql_java_benchmark_top30_v2.tar.gz", + "bytes": 258511734, + "sha256": "94584869e15e944bdf4b48df044debff02a4607a60ba360ccc9db554037595bb" + } + ], + "root": "codeql_java_benchmark_top30_v2", + "task_count": 30 + }, + { + "key": "codeql_javascript_benchmark_top30_v1", + "kind": "dataset", + "archive": "codeql_javascript_benchmark_top30_v1.tar.gz", + "bytes": 2879812908, + "sha256": "57bacbb732adfd1afc499afb561604afbffbd54f6b74c0fe7ec49c3432652292", + "parts": [ + { + "name": "codeql_javascript_benchmark_top30_v1.tar.gz.part000", + "bytes": 1572864000, + "sha256": "229fcbf134d2df605599a341245bef39dbce57d44b3e15a612bedb2e2fc21607" + }, + { + "name": "codeql_javascript_benchmark_top30_v1.tar.gz.part001", + "bytes": 1306948908, + "sha256": "f47cfe368d0f645445f5abc4b35c900640f0e97f5303a3e4704dce2178421183" + } + ], + "root": "codeql_javascript_benchmark_top30_v1", + "task_count": 30 + }, + { + "key": "codeql_python_benchmark51_v2", + "kind": "dataset", + "archive": "codeql_python_benchmark51_v2.tar.gz", + "bytes": 1652172553, + "sha256": "167a9b7225a969fe5a053a7bdbda59765bc97beaf6ec8fef09ba7257fbd2c4c6", + "parts": [ + { + "name": "codeql_python_benchmark51_v2.tar.gz.part000", + "bytes": 1572864000, + "sha256": "c19e99879456b637ded3ad3b8b524f0d7cf29d81af261fdb5d1086e57d7ae78c" + }, + { + "name": "codeql_python_benchmark51_v2.tar.gz.part001", + "bytes": 79308553, + "sha256": "37c12d1e099d89f65fdcb69677adca1e9f94e35f7372fb89ae92ea6dcee72d42" + } + ], + "root": "codeql_python_benchmark51_v2", + "task_count": 51 + }, + { + "key": "csa159", + "kind": "dataset", + "archive": "checkerbench-csa159.tar.gz", + "bytes": 5195950032, + "sha256": "9700929add77ea04bd171fb0946ae9910e6d1a14067199ce7e10d232d647366f", + "parts": [ + { + "name": "checkerbench-csa159.tar.gz.part000", + "bytes": 1572864000, + "sha256": "7fddb3afd80e67d8eec2694e9704e24e65ce318dfb5d1260b8058dbc84c23830" + }, + { + "name": "checkerbench-csa159.tar.gz.part001", + "bytes": 1572864000, + "sha256": "0615ba64af1cb7e526c741eca523c1dd2a98ef9214b4834e229c92f7d6113706" + }, + { + "name": "checkerbench-csa159.tar.gz.part002", + "bytes": 1572864000, + "sha256": "54d83cf819a8d0777f1bcded9848cfe96605a7201878cbc563205880ab5ae85a" + }, + { + "name": "checkerbench-csa159.tar.gz.part003", + "bytes": 477358032, + "sha256": "b483ff23fcb3a303032ce2f7956e3e5280849491d917d8e565333077b818ba43" + } + ], + "root": "csa159", + "task_count": 159 + }, + { + "key": "environment", + "kind": "docker-image", + "archive": "checkerbench-environment-linux-amd64.tar.gz", + "bytes": 2046492607, + "sha256": "1c7778d6e92e5acd97469d644ff81c4bf4cb8819205794c6c98111c38c0c63f7", + "parts": [ + { + "name": "checkerbench-environment-linux-amd64.tar.gz.part000", + "bytes": 1572864000, + "sha256": "6dcc402d563e599525e9fb748244d754a983a48318ec6c871a85cfa18c854976" + }, + { + "name": "checkerbench-environment-linux-amd64.tar.gz.part001", + "bytes": 473628607, + "sha256": "976c8e16a733cd76540f5374756c155a122edef44585b0eea12589d6f0ac09b9" + } + ], + "image": "checkerbench-runtime:review-v1", + "image_id": "sha256:6b6aff6ee4502aac70a6d518965fa63a8953483ff506a5cbd8d7b06faa18f9b6", + "platform": "linux/amd64" + } + ] +} diff --git a/reports/archive-validation.json b/reports/archive-validation.json new file mode 100644 index 0000000000000000000000000000000000000000..2fa175ff46f713ad05db92eaca8212c36979382a --- /dev/null +++ b/reports/archive-validation.json @@ -0,0 +1,45 @@ +{ + "task_count": 300, + "packages": [ + { + "package": "codeql_go_benchmark_top30_v1", + "task_count": 30, + "regular_files": 30505, + "logical_bytes": 2962723420, + "file_checksums_verified": true, + "fixture_task": "morefixes-02cb4e0a6c5aaabd6a78" + }, + { + "package": "codeql_java_benchmark_top30_v2", + "task_count": 30, + "regular_files": 42278, + "logical_bytes": 957672106, + "file_checksums_verified": true, + "fixture_task": "morefixes-02f75a63a6f0b8d6c6c7" + }, + { + "package": "codeql_javascript_benchmark_top30_v1", + "task_count": 30, + "regular_files": 48500, + "logical_bytes": 6232335624, + "file_checksums_verified": true, + "fixture_task": "morefixes-040d724ca8211a3aaf1d" + }, + { + "package": "codeql_python_benchmark51_v2", + "task_count": 51, + "regular_files": 69002, + "logical_bytes": 5307115528, + "file_checksums_verified": true, + "fixture_task": "pyvul-03252773bde39ba37465" + }, + { + "package": "csa159", + "task_count": 159, + "regular_files": 185075, + "logical_bytes": 12551690467, + "file_checksums_verified": true, + "fixture_task": "pair_134943" + } + ] +} diff --git a/reports/huggingface-validation.json b/reports/huggingface-validation.json new file mode 100644 index 0000000000000000000000000000000000000000..aa77cbb4ee6446e45abfa211dd9459a35e3590a3 --- /dev/null +++ b/reports/huggingface-validation.json @@ -0,0 +1,33 @@ +{ + "task_count": 300, + "backend_counts": { + "codeql": 141, + "csa": 159 + }, + "language_counts": { + "go": 30, + "java": 30, + "javascript": 30, + "python": 51, + "c/c++": 159 + }, + "parquet_roundtrip": "All fields in all 300 rows match the browsable task inputs", + "table_columns": [ + "backend", + "cve_id", + "dataset", + "environment_id", + "group", + "language", + "project_id", + "task_id", + "task_path", + "task_prompt", + "patch", + "before_context", + "after_context", + "task_metadata_json", + "checker_template" + ], + "table_sha256": "cf6583507a74e33e53515bfdfd3bfb00acd4878f8e9e3772972e549f4fdfdf4e" +} diff --git a/reports/privacy-check.json b/reports/privacy-check.json new file mode 100644 index 0000000000000000000000000000000000000000..d1673754cf30f0822946090912624a09b023ec5e --- /dev/null +++ b/reports/privacy-check.json @@ -0,0 +1,8 @@ +{ + "operator_identity_matches": [], + "task_count": 300, + "git_history": "Single neutral-author commit", + "archive_headers": "Neutral uid/gid and fixed mtimes", + "operator_logs_and_account_configuration": "omitted", + "upstream_source_and_license_notices": "preserved" +} diff --git a/reports/validation.json b/reports/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..5dbf9fd0822e9e623c2f9eab42670cf1174e8ffa --- /dev/null +++ b/reports/validation.json @@ -0,0 +1,62 @@ +{ + "task_count": 300, + "backend_counts": { + "csa": 159, + "codeql": 141 + }, + "archive_regular_files_verified": 375360, + "validation_scope": { + "archive_integrity": "All regular archived files checked against per-file SHA-256 manifests", + "task_roster": "All 300 task directories checked against the release roster", + "restoration": "Complete Java archive restored with scripts/restore.py", + "download": "Java release asset downloaded again and its SHA-256 verified", + "runtime": "One reference task per backend/language; compilation and before/after scans in the distributed environment" + }, + "smoke_results": [ + { + "backend": "codeql", + "language": "go", + "task_id": "morefixes-02cb4e0a6c5aaabd6a78", + "exit_code": 0, + "passed": true, + "seconds": 49.1 + }, + { + "backend": "codeql", + "language": "java", + "task_id": "morefixes-02f75a63a6f0b8d6c6c7", + "exit_code": 0, + "passed": true, + "seconds": 34.6 + }, + { + "backend": "codeql", + "language": "javascript", + "task_id": "morefixes-040d724ca8211a3aaf1d", + "exit_code": 0, + "passed": true, + "seconds": 114.0 + }, + { + "backend": "codeql", + "language": "python", + "task_id": "pyvul-03252773bde39ba37465", + "exit_code": 0, + "passed": true, + "seconds": 36.9 + }, + { + "backend": "csa", + "language": "c/c++", + "task_id": "pair_134943", + "passed": true, + "exit_code": 0, + "seconds": 8.0, + "checker": "security.PureMemcmpOobRead" + } + ], + "limitations": [ + "Runtime smoke checks cover 5 representative tasks, not a new complete 300-task score evaluation.", + "Full CSA refinement replay is not covered by these before/after smoke checks." + ] +} diff --git a/scripts/download.py b/scripts/download.py new file mode 100644 index 0000000000000000000000000000000000000000..9000636cf93686784009a6bcd0ae0f9e2b617286 --- /dev/null +++ b/scripts/download.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +"""Download verified CheckerBench archives from the Hugging Face dataset repository.""" +import argparse +import hashlib +import json +from pathlib import Path + +from huggingface_hub import hf_hub_download + + +def valid(path, entry): + if not path.is_file() or path.stat().st_size != entry["bytes"]: + return False + digest = hashlib.sha256() + with path.open("rb") as stream: + for block in iter(lambda: stream.read(8 * 1024**2), b""): + digest.update(block) + return digest.hexdigest() == entry["sha256"] + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--repo", default="Benchanything/checkerbench") + parser.add_argument("--revision", default="main") + parser.add_argument("--output", type=Path, default=Path("assets")) + parser.add_argument("--manifest", type=Path, default=Path(__file__).resolve().parents[1] / "release-manifest.json") + parser.add_argument("--kind", choices=["all", "dataset", "docker-image"], default="all") + args = parser.parse_args() + manifest = json.loads(args.manifest.read_text()) + args.output.mkdir(parents=True, exist_ok=True) + for package in manifest["packages"]: + if args.kind != "all" and package["kind"] != args.kind: + continue + for part in package["parts"]: + target = args.output / part["name"] + if not valid(target, part): + downloaded = Path(hf_hub_download( + repo_id=args.repo, + repo_type="dataset", + revision=args.revision, + filename="assets/" + part["name"], + local_dir=args.output / ".hub-download", + )) + if not valid(downloaded, part): + raise SystemExit("Checksum mismatch: " + part["name"]) + downloaded.replace(target) + print("verified " + part["name"], flush=True) + + +if __name__ == "__main__": + main() diff --git a/scripts/prepare.py b/scripts/prepare.py new file mode 100644 index 0000000000000000000000000000000000000000..b4caec7db5b3e81531b2357c3035dd99961f7753 --- /dev/null +++ b/scripts/prepare.py @@ -0,0 +1,239 @@ +#!/usr/bin/env python3 +"""Create a writable checker workspace from the immutable benchmark export.""" +import argparse +import json +import os +import re +import hashlib +import shlex +from pathlib import Path +import shutil +import subprocess + +ROOT = Path(os.environ.get('CHECKERBENCH_DATA_ROOT', '/data')) +CSA = ROOT / 'csa159' +CODEQL = os.environ.get('CODEQL_BIN', '/opt/checkerbench/codeql-2.26.4/codeql') + + +def restore_rv_monitor_config(worktree): + """Restore a missing generated integer from this tree's config evidence.""" + header = worktree/'include/generated/autoconf.h' + kconfig = worktree/'kernel/trace/rv/Kconfig' + if not header.is_file() or not kconfig.is_file(): + return None + text = header.read_text() + symbol = 'CONFIG_RV_PER_TASK_MONITORS' + if not re.search(r'^#define CONFIG_RV 1$', text, re.M) or re.search(r'^#define '+symbol+r'\b', text, re.M): + return None + source = kconfig.read_text() + block = re.search(r'(?ms)^config RV_PER_TASK_MONITORS\n(.*?)(?=^(?:config|menuconfig|source|endif|endmenu)\b|\Z)', source) + if not block or not re.search(r'^[ \t]+depends on RV[ \t]*$', block[1], re.M): + return None + bounds = re.findall(r'^[ \t]+range ([0-9]+) ([0-9]+)[ \t]*$', block[1], re.M) + if not re.search(r'^[ \t]+int(?:[ \t]|$)', block[1], re.M) or len(bounds) != 1: + return None + config_path = worktree/'.config' + config = config_path.read_text() if config_path.is_file() else '' + explicit = re.search(r'^'+symbol+r'=([^\n]+)$', config, re.M) + if explicit: + value_text = explicit[1].strip() + origin = '.config' + else: + defaults = re.findall(r'^[ \t]+default ([^\n]+)$', block[1], re.M) + if len(defaults) != 1: + return None + value_text = defaults[0].strip() + origin = 'kernel/trace/rv/Kconfig unconditional default' + if not re.fullmatch(r'[0-9]+', value_text): + return None + value = int(value_text) + if not int(bounds[0][0]) <= value <= int(bounds[0][1]): + raise RuntimeError('RV monitor configuration outside source Kconfig range') + updated = text + '\n/* checkerbench replay: restored from this source tree configuration. */\n#define '+symbol+' '+str(value)+'\n' + header.write_text(updated) + return dict(kind='restore_rv_monitor_config', worktree=worktree.name, symbol=symbol, + value=value, value_origin=origin, original_sha256=hashlib.sha256(text.encode()).hexdigest(), + repaired_sha256=hashlib.sha256(updated.encode()).hexdigest(), + kconfig_sha256=hashlib.sha256(source.encode()).hexdigest(), + config_sha256=hashlib.sha256(config.encode()).hexdigest()) + +def restore_linux_anonymous_struct_flags(output): + """Restore the required C extension for captured tagged anonymous structs.""" + env_path = output/'scan/envs.json' + if not env_path.is_file(): + return [] + original_env = env_path.read_text() + envs = json.loads(original_env) + required = {} + for entries in envs.values(): + for entry in entries.values(): + name = Path(entry.get('worktree_path') or entry.get('work_dir') or '').name + wt = output/'scan/tmp'/name + makefile = wt/'Makefile' + header = wt/'include/linux/ns/ns_common_types.h' + if not makefile.is_file() or not header.is_file(): + continue + make_text, header_text = makefile.read_text(), header.read_text() + if (re.search(r'^KBUILD_CFLAGS[ \t]*\+=[ \t]*-fms-extensions[ \t]*$', make_text, re.M) + and re.search(r'^[ \t]*struct ns_tree;[ \t]*$', header_text, re.M)): + required[name] = dict(worktree=name, makefile_sha256=hashlib.sha256(make_text.encode()).hexdigest(), + header_sha256=hashlib.sha256(header_text.encode()).hexdigest()) + if not required: + return [] + changes = {} + env_changed = False + for entries in envs.values(): + for entry in entries.values(): + name = Path(entry.get('worktree_path') or entry.get('work_dir') or '').name + if name in required and '-fms-extensions' not in shlex.split(entry['compile_flags']): + entry['compile_flags'] = '-fms-extensions ' + entry['compile_flags'] + env_changed = True + if env_changed: + changes[env_path] = (original_env, json.dumps(envs, indent=2)+'\n') + for path in (output/'scan').glob('*.sh'): + old = path.read_text() + lines = [] + for line in old.splitlines(keepends=True): + if any(name in line for name in required) and '/opt/llvm/bin/clang --analyze' in line and '-fms-extensions' not in line: + line = line.replace('/opt/llvm/bin/clang --analyze', '/opt/llvm/bin/clang -fms-extensions --analyze') + lines.append(line) + new = ''.join(lines) + if old != new: + changes[path] = (old, new) + for path in (output/'scan').glob('flags_*.txt'): + old = path.read_text() + if any(name in old for name in required) and '-fms-extensions' not in shlex.split(old): + changes[path] = (old, '-fms-extensions '+old) + if not changes: + return [] + files = [] + for path, (old, new) in changes.items(): + backup = output/'runtime-originals/required-linux-build-flags'/path.name + backup.parent.mkdir(parents=True, exist_ok=True) + if not backup.exists(): + backup.write_text(old) + path.write_text(new) + files.append(dict(path=str(path.relative_to(output)), original_sha256=hashlib.sha256(old.encode()).hexdigest(), + repaired_sha256=hashlib.sha256(new.encode()).hexdigest(), backup=str(backup.relative_to(output)))) + return [dict(kind='restore_required_linux_build_flag', flag='-fms-extensions', + reason='Source Makefile requires this flag for tagged anonymous structs used in ns_common.', + source_evidence=list(required.values()), files=files)] + + +def repair_csa_runtime(output, project_id): + """Apply evidenced compatibility fixes only to writable replay assets.""" + adjustments = [] + if project_id == 'openexr_openexr': + gcc_dir = '/usr/lib/gcc/x86_64-linux-gnu/11' + if not Path(gcc_dir).is_dir(): raise RuntimeError('GCC 11 development headers are required for OpenEXR replay') + for p in (output/'scan').glob('scan_*.sh'): + text = p.read_text() + updated = text.replace('/opt/llvm/bin/clang --analyze', f'/opt/llvm/bin/clang --gcc-install-dir={gcc_dir} --analyze') + if updated != text: p.write_text(updated) + adjustments.append({'kind':'gcc_header_version','project':project_id,'gcc_install_dir':gcc_dir,'reason':'Old OpenEXR source requires the original GCC 11 C++ header transitive includes.'}) + for wt in (output/'scan/tmp').glob('wt_*'): + kconfig = wt/'init/Kconfig' + header = wt/'include/generated/autoconf.h' + if not kconfig.is_file() or not header.is_file(): continue + block = re.search(r'(?ms)^config MEMCG\n(.*?)(?=^(?:config|menuconfig|endmenu|endif)\b|\Z)', kconfig.read_text()) + text = header.read_text() + if block and re.search(r'^\s+select SLAB_OBJ_EXT\s*$', block[1], re.M) and '#define CONFIG_MEMCG 1' in text and not re.search(r'^#define CONFIG_SLAB_OBJ_EXT\b',text,re.M): + updated = text + '\n/* checkerbench replay: selected by MEMCG in this source tree Kconfig. */\n#define CONFIG_SLAB_OBJ_EXT 1\n' + header.write_text(updated) + adjustments.append({'kind':'restore_selected_kconfig_symbol','worktree':wt.name,'symbol':'CONFIG_SLAB_OBJ_EXT','value':1,'reason':'Source init/Kconfig: MEMCG selects SLAB_OBJ_EXT; exported autoconf omitted this required symbol.','original_sha256':hashlib.sha256(text.encode()).hexdigest(),'repaired_sha256':hashlib.sha256(updated.encode()).hexdigest()}) + rv_adjustment = restore_rv_monitor_config(wt) + if rv_adjustment: + adjustments.append(rv_adjustment) + if project_id == 'torvalds_linux': + adjustments.extend(restore_linux_anonymous_struct_flags(output)) + (output/'runtime-adjustments.json').write_text(json.dumps(adjustments,indent=2)) + return adjustments + + +def prepare_csa(task_id, output, reference=False): + pair_id = int(task_id.removeprefix('pair_')) + task_id = f'pair_{pair_id}' + index = json.loads((CSA / 'runtime/index.json').read_text()) + info = index['pairs'][str(pair_id)] + selected = next(json.loads(line) for line in (CSA/'selected_results.jsonl').read_text().splitlines() if json.loads(line)['pair_id'] == pair_id) + task_result = json.loads((CSA/'references'/task_id/'task_result.json').read_text()) + subprocess.run(['python3', str(CSA/'scripts/rehydrate_scan_env.py'), '--pair-id', str(pair_id), '--output-workdir', str(output)], check=True) + replacements = {task_result['success_workdir']: str(output)} + for side, side_info in info['sides'].items(): + wt = output/'scan/tmp'/side_info['worktree_basename'] + snap = output/'.benchmark-runtime/snapshots'/side_info['snapshot_key'] + replacements[side_info['original_worktree_path']] = str(wt) + replacements[side_info['original_snapshot_path']] = str(snap) + files = list((output/'scan').glob('*.sh')) + list((output/'scan').glob('*.txt')) + [output/'scan/envs.json', output/'config.json'] + files += list((output/'.benchmark-runtime/snapshots').glob('*/compile_commands.json')) + for path in files: + if not path.is_file(): continue + text = path.read_text(errors='replace') + for old, new in sorted(replacements.items(), key=lambda item: -len(item[0])): + text = text.replace(old, new) + path.write_text(text) + config_path = output/'config.json' + config = json.loads(config_path.read_text()) + config['repo_path'] = str(output/'scan/tmp'/info['sides']['before']['worktree_basename']) + config['llvm_build_dir'] = '/opt/llvm' + config_path.write_text(json.dumps(config, indent=2, ensure_ascii=False)) + repair_csa_runtime(output, config['project_id']) + (output/'.mcp.json').write_text(json.dumps({'mcpServers': {'csa-tools': {'type':'stdio', 'command':'/opt/checkerbench/venv/bin/python', 'args':['/opt/checkerbench/mcp-server.py'], 'env':{'LLVM_BUILD_DIR':'/opt/llvm','CHECKERBENCH_WORK_ROOT':str(output)}}}}, indent=2)) + if reference: + shutil.copy2(CSA/selected['reference_success_workdir']/'checker.cpp', output/'checker.cpp') + (output/'checkerbench-workspace.json').write_text(json.dumps({'backend':'csa','task_id':task_id,'reference_loaded':reference,'llvm_version':'18.1.8'}, indent=2)) + return output + + +def prepare_codeql(language, task_id, output, reference=False): + roots = [p for p in ROOT.glob(f'codeql_{language}_*') if p.is_dir()] + if len(roots) != 1: raise RuntimeError(f'Expected one benchmark for {language}') + root = roots[0] + item = next(t for t in json.loads((root/'manifest.json').read_text())['tasks'] if t['dataset_item_id'] == task_id) + output.mkdir(parents=True, exist_ok=False) + task_dir = output/'tasks'/task_id + shutil.copytree(root/'tasks'/task_id, task_dir) + # Exported API-search helpers reference the original machine's bundle path. + for script in (task_dir/'scripts').glob('*.sh'): + text = script.read_text() + text = text.replace('/workspace/checkerGym/codeql-tools/codeql-bundle-v2.26.4', str(Path(CODEQL).parent)) + script.write_text(text) + # Databases are copied: query caches must not modify the exported originals. + for asset in item['assets'].values(): + relative = Path(asset['database']) + dest = output/relative + if not dest.exists(): + dest.parent.mkdir(parents=True,exist_ok=True) + subprocess.run(['cp','-a','--reflink=auto',str(root/relative),str(dest)],check=True) + if reference: + shutil.copytree(root/item['reference']/'query', task_dir/'query', dirs_exist_ok=True) + (output/'env.sh').write_text(f'export CODEQL_BIN={CODEQL}\nexport LLVM_BUILD_DIR=/opt/llvm\n') + (output/'checkerbench-workspace.json').write_text(json.dumps({'backend':'codeql','language':language,'task_id':task_id,'reference_loaded':reference,'codeql_version':'2.26.4'},indent=2)) + return task_dir + + +def main(): + global ROOT, CSA + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('backend',choices=['csa','codeql']) + parser.add_argument('task_id') + parser.add_argument('--language',choices=['go','java','javascript','python']) + parser.add_argument('--output',type=Path,required=True) + parser.add_argument('--data-root', type=Path, default=ROOT) + parser.add_argument('--roster', type=Path, default=Path(__file__).resolve().parents[1]/'dataset/tasks.jsonl') + parser.add_argument('--reference',action='store_true',help='Maintainer validation only: copy the successful reference checker into the workspace.') + args=parser.parse_args();out=args.output.expanduser().resolve() + ROOT=args.data_root.expanduser().resolve();CSA=ROOT/'csa159' + rows=[json.loads(line) for line in args.roster.read_text().splitlines() if line.strip()] + matches=[r for r in rows if r['backend']==args.backend and r['task_id']==args.task_id + and (args.backend=='csa' or r['language']==args.language)] + if len(matches)!=1:parser.error('Task is not in the fixed 300-task roster') + if out.exists():parser.error(f'Output already exists: {out}') + if args.backend=='codeql' and not args.language:parser.error('--language is required for codeql') + out.parent.mkdir(parents=True,exist_ok=True) + if args.backend=='csa':dest=prepare_csa(args.task_id,out,args.reference) + else:dest=prepare_codeql(args.language,args.task_id,out,args.reference) + print(f'WORKSPACE={dest}') + + +if __name__=='__main__':main() diff --git a/scripts/restore.py b/scripts/restore.py new file mode 100644 index 0000000000000000000000000000000000000000..3ae33175f3956891e58833b4c1f87c69c909977e --- /dev/null +++ b/scripts/restore.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +"""Verify split archives, extract datasets, and optionally import the Docker image.""" +import argparse +import hashlib +import io +import json +import os +from pathlib import Path, PurePosixPath +import shutil +import subprocess +import tarfile + +from download import valid + +class Parts(io.RawIOBase): + def __init__(self,paths): + self.paths=iter(paths);self.current=None + def readable(self):return True + def readinto(self,b): + while True: + if self.current is None: + try:self.current=next(self.paths).open('rb') + except StopIteration:return 0 + n=self.current.readinto(b) + if n:return n + self.current.close();self.current=None + def close(self): + if self.current:self.current.close() + super().close() + +def path_within(base,name,root): + name=PurePosixPath(name) + if name.is_absolute() or '..' in name.parts or not name.parts or name.parts[0]!=root: + raise ValueError('Unexpected archive path: '+str(name)) + path=base/str(name) + if not path.parent.resolve().is_relative_to(base.resolve()):raise ValueError('External archive parent') + return path + +def extract(stream,base,root): + links=[];directories=[] + with tarfile.open(fileobj=stream,mode='r|gz') as tar: + for member in tar: + target=path_within(base,member.name,root) + target.parent.mkdir(parents=True,exist_ok=True) + if member.issym() or member.islnk():links.append(member);continue + if member.isdir():target.mkdir(exist_ok=True);directories.append((target,member.mode));continue + if not member.isfile():raise ValueError('Special file in archive: '+member.name) + with tar.extractfile(member) as src,target.open('xb') as dst:shutil.copyfileobj(src,dst,8*1024**2) + target.chmod(member.mode & 0o777) + # Historical absolute symlinks are preserved as data, after all file writes. + for member in links: + target=path_within(base,member.name,root) + if member.issym():target.symlink_to(member.linkname) + else: + source=path_within(base,member.linkname,root) + if source.is_symlink() or not source.is_file():raise ValueError('Invalid hard link') + os.link(source,target) + for target,mode in reversed(directories):target.chmod(mode & 0o777) + +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--assets',type=Path,default=Path('downloads')) + p.add_argument('--data',type=Path,default=Path('data')) + p.add_argument('--manifest',type=Path,default=Path(__file__).resolve().parents[1]/'release-manifest.json') + p.add_argument('--load-image',action='store_true') + p.add_argument('--image-only',action='store_true') + a=p.parse_args();manifest=json.loads(a.manifest.read_text());a.data.mkdir(parents=True,exist_ok=True) + for package in manifest['packages']: + if package['kind']=='docker-image' and not (a.load_image or a.image_only):continue + if package['kind']=='dataset' and a.image_only:continue + paths=[a.assets/x['name'] for x in package['parts']] + full=hashlib.sha256() + for path,part in zip(paths,package['parts']): + if not valid(path,part):raise SystemExit('Missing or corrupt asset: '+str(path)) + with path.open('rb') as f: + for b in iter(lambda:f.read(8*1024**2),b''):full.update(b) + if full.hexdigest()!=package['sha256']:raise SystemExit('Archive checksum mismatch: '+package['archive']) + with io.BufferedReader(Parts(paths),buffer_size=8*1024**2) as stream: + if package['kind']=='docker-image': + process=subprocess.Popen(['docker','load'],stdin=subprocess.PIPE) + shutil.copyfileobj(stream,process.stdin,8*1024**2);process.stdin.close() + if process.wait():raise SystemExit('docker load failed') + else: + receipt=a.data/(package['root']+'.restored.json') + if receipt.exists() and json.loads(receipt.read_text())['sha256']==package['sha256']: + print('already restored '+package['root']);continue + if (a.data/package['root']).exists():raise SystemExit('Use a fresh data directory or move incomplete extraction: '+package['root']) + extract(stream,a.data,package['root']) + receipt.write_text(json.dumps(dict(sha256=package['sha256'],task_count=package['task_count']))+'\n') + print('restored '+package['key'],flush=True) + +if __name__=='__main__':main() diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..14d05b8f0fb10c54f7ee233d0b5b81cfc1dcc23b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/patch.diff @@ -0,0 +1,70 @@ +diff --git a/docx.go b/docx.go +index 0b3c2e6..f9f276a 100644 +--- a/docx.go ++++ b/docx.go +@@ -40,7 +40,7 @@ func ConvertDocx(r io.Reader) (string, map[string]string, error) { + size = si.Size() + ra = f + } else { +- b, err := ioutil.ReadAll(r) ++ b, err := ioutil.ReadAll(io.LimitReader(r, maxBytes)) + if err != nil { + return "", nil, nil + } +diff --git a/limit.go b/limit.go +new file mode 100644 +index 0000000..8ef2940 +--- /dev/null ++++ b/limit.go +@@ -0,0 +1,3 @@ ++package docconv ++ ++const maxBytes = 20 << 20 // 20MB +diff --git a/odt.go b/odt.go +index 68dd968..ad93d07 100644 +--- a/odt.go ++++ b/odt.go +@@ -14,7 +14,7 @@ func ConvertODT(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + var textBody string + +- b, err := ioutil.ReadAll(r) ++ b, err := ioutil.ReadAll(io.LimitReader(r, maxBytes)) + if err != nil { + return "", nil, err + } +diff --git a/pages.go b/pages.go +index 5325ecf..54a2b03 100644 +--- a/pages.go ++++ b/pages.go +@@ -21,7 +21,7 @@ func ConvertPages(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + var textBody string + +- b, err := ioutil.ReadAll(r) ++ b, err := ioutil.ReadAll(io.LimitReader(r, maxBytes)) + if err != nil { + return "", nil, fmt.Errorf("error reading data: %v", err) + } +diff --git a/xml.go b/xml.go +index 8f422a3..28da02e 100644 +--- a/xml.go ++++ b/xml.go +@@ -25,7 +25,7 @@ func ConvertXML(r io.Reader) (string, map[string]string, error) { + func XMLToText(r io.Reader, breaks []string, skip []string, strict bool) (string, error) { + var result string + +- dec := xml.NewDecoder(r) ++ dec := xml.NewDecoder(io.LimitReader(r, maxBytes)) + dec.Strict = strict + for { + t, err := dec.Token() +@@ -76,7 +76,7 @@ func XMLToText(r io.Reader, breaks []string, skip []string, strict bool) (string + // XMLToMap converts XML to a nested string map. + func XMLToMap(r io.Reader) (map[string]string, error) { + m := make(map[string]string) +- dec := xml.NewDecoder(r) ++ dec := xml.NewDecoder(io.LimitReader(r, maxBytes)) + var tagName string + for { + t, err := dec.Token() diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..396513a8d534da674eece48df1cd1bebff9e8851 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/post_context.md @@ -0,0 +1,420 @@ +# Patch-overlapping Go context after the fix + +## `docx.go` (changed lines (43,)) + +```go +package docconv + +import ( + "archive/zip" + "bytes" + "encoding/xml" + "fmt" + "io" + "io/ioutil" + "os" + "time" +) + +type typeOverride struct { + XMLName xml.Name `xml:"Override"` + ContentType string `xml:"ContentType,attr"` + PartName string `xml:"PartName,attr"` +} + +type contentTypeDefinition struct { + XMLName xml.Name `xml:"Types"` + Overrides []typeOverride `xml:"Override"` +} + +// ConvertDocx converts an MS Word docx file to text. +func ConvertDocx(r io.Reader) (string, map[string]string, error) { + var size int64 + + // Common case: if the reader is a file (or trivial wrapper), avoid + // loading it all into memory. + var ra io.ReaderAt + if f, ok := r.(interface { + io.ReaderAt + Stat() (os.FileInfo, error) + }); ok { + si, err := f.Stat() + if err != nil { + return "", nil, err + } + size = si.Size() + ra = f + } else { + b, err := ioutil.ReadAll(io.LimitReader(r, maxBytes)) + if err != nil { + return "", nil, nil + } + size = int64(len(b)) + ra = bytes.NewReader(b) + } + + zr, err := zip.NewReader(ra, size) + if err != nil { + return "", nil, fmt.Errorf("error unzipping data: %v", err) + } + + zipFiles := mapZipFiles(zr.File) + + contentTypeDefinition, err := getContentTypeDefinition(zipFiles["[Content_Types].xml"]) + if err != nil { + return "", nil, err + } + + meta := make(map[string]string) + var textHeader, textBody, textFooter string + for _, override := range contentTypeDefinition.Overrides { + f := zipFiles[override.PartName] + + switch { + case override.ContentType == "application/vnd.openxmlformats-package.core-properties+xml": + rc, err := f.Open() + if err != nil { + return "", nil, fmt.Errorf("error opening '%v' from archive: %v", f.Name, err) + } + defer rc.Close() + + meta, err = XMLToMap(rc) + if err != nil { + return "", nil, fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + + if tmp, ok := meta["modified"]; ok { + if t, err := time.Parse(time.RFC3339, tmp); err == nil { + meta["ModifiedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + if tmp, ok := meta["created"]; ok { + if t, err := time.Parse(time.RFC3339, tmp); err == nil { + meta["CreatedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + case override.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": + body, err := parseDocxText(f) + if err != nil { + return "", nil, err + } + textBody += body + "\n" + case override.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": + footer, err := parseDocxText(f) + if err != nil { + return "", nil, err + } + textFooter += footer + "\n" + case override.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml": + header, err := parseDocxText(f) + if err != nil { + return "", nil, err + } + textHeader += header + "\n" + } + + } + return textHeader + "\n" + textBody + "\n" + textFooter, meta, nil +} + +func getContentTypeDefinition(zf *zip.File) (*contentTypeDefinition, error) { + f, err := zf.Open() + if err != nil { + return nil, err + } + defer f.Close() + + x := &contentTypeDefinition{} + if err := xml.NewDecoder(f).Decode(x); err != nil { + return nil, err + } + return x, nil +} + +func mapZipFiles(files []*zip.File) map[string]*zip.File { + filesMap := make(map[string]*zip.File, 2*len(files)) + for _, f := range files { + filesMap[f.Name] = f + filesMap["/"+f.Name] = f + } + return filesMap +} + +func parseDocxText(f *zip.File) (string, error) { + r, err := f.Open() + if err != nil { + return "", fmt.Errorf("error opening '%v' from archive: %v", f.Name, err) + } + defer r.Close() + + text, err := DocxXMLToText(r) + if err != nil { + return "", fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + return text, nil +} + +// DocxXMLToText converts Docx XML into plain text. +func DocxXMLToText(r io.Reader) (string, error) { + return XMLToText(r, []string{"br", "p", "tab"}, []string{"instrText", "script"}, true) +} +``` + +## `limit.go` (changed lines (1, 2, 3)) + +```go +package docconv + +const maxBytes = 20 << 20 // 20MB +``` + +## `odt.go` (changed lines (17,)) + +```go +package docconv + +import ( + "archive/zip" + "bytes" + "fmt" + "io" + "io/ioutil" + "time" +) + +// ConvertODT converts a ODT file to text +func ConvertODT(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + var textBody string + + b, err := ioutil.ReadAll(io.LimitReader(r, maxBytes)) + if err != nil { + return "", nil, err + } + zr, err := zip.NewReader(bytes.NewReader(b), int64(len(b))) + if err != nil { + return "", nil, fmt.Errorf("error unzipping data: %v", err) + } + + for _, f := range zr.File { + switch f.Name { + case "meta.xml": + rc, err := f.Open() + if err != nil { + return "", nil, fmt.Errorf("error extracting '%v' from archive: %v", f.Name, err) + } + defer rc.Close() + + info, err := XMLToMap(rc) + if err != nil { + return "", nil, fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + + if tmp, ok := info["creator"]; ok { + meta["Author"] = tmp + } + if tmp, ok := info["date"]; ok { + if t, err := time.Parse("2006-01-02T15:04:05", tmp); err == nil { + meta["ModifiedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + if tmp, ok := info["creation-date"]; ok { + if t, err := time.Parse("2006-01-02T15:04:05", tmp); err == nil { + meta["CreatedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + + case "content.xml": + rc, err := f.Open() + if err != nil { + return "", nil, fmt.Errorf("error extracting '%v' from archive: %v", f.Name, err) + } + defer rc.Close() + + textBody, err = XMLToText(rc, []string{"br", "p", "tab"}, []string{}, true) + if err != nil { + return "", nil, fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + } + } + + return textBody, meta, nil +} +``` + +## `pages.go` (changed lines (24,)) + +```go +package docconv + +import ( + "archive/zip" + "bufio" + "bytes" + "encoding/binary" + "fmt" + "io" + "io/ioutil" + "strings" + + "google.golang.org/protobuf/proto" + + TSP "code.sajari.com/docconv/iWork" + "code.sajari.com/docconv/snappy" +) + +// ConvertPages converts a Pages file to text. +func ConvertPages(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + var textBody string + + b, err := ioutil.ReadAll(io.LimitReader(r, maxBytes)) + if err != nil { + return "", nil, fmt.Errorf("error reading data: %v", err) + } + + zr, err := zip.NewReader(bytes.NewReader(b), int64(len(b))) + if err != nil { + return "", nil, fmt.Errorf("error unzipping data: %v", err) + } + + for _, f := range zr.File { + if strings.HasSuffix(f.Name, "Preview.pdf") { + // There is a preview PDF version we can use + if rc, err := f.Open(); err == nil { + return ConvertPDF(rc) + } + } + if f.Name == "index.xml" { + // There's an XML version we can use + if rc, err := f.Open(); err == nil { + return ConvertXML(rc) + } + } + if f.Name == "Index/Document.iwa" { + rc, _ := f.Open() + defer rc.Close() + bReader := bufio.NewReader(snappy.NewReader(io.MultiReader(strings.NewReader("\xff\x06\x00\x00sNaPpY"), rc))) + + // Ignore error. + // NOTE: This error was unchecked. Need to revisit this to see if it + // should be acted on. + archiveLength, _ := binary.ReadVarint(bReader) + + // Ignore error. + // NOTE: This error was unchecked. Need to revisit this to see if it + // should be acted on. + archiveInfoData, _ := ioutil.ReadAll(io.LimitReader(bReader, archiveLength)) + + archiveInfo := &TSP.ArchiveInfo{} + err = proto.Unmarshal(archiveInfoData, archiveInfo) + fmt.Println("archiveInfo:", archiveInfo, err) + } + } + + return textBody, meta, nil +} +``` + +## `xml.go` (changed lines (28, 79)) + +```go +package docconv + +import ( + "bytes" + "encoding/xml" + "fmt" + "io" +) + +// ConvertXML converts an XML file to text. +func ConvertXML(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + cleanXML, err := Tidy(r, true) + if err != nil { + return "", nil, fmt.Errorf("tidy error: %v", err) + } + result, err := XMLToText(bytes.NewReader(cleanXML), []string{}, []string{}, true) + if err != nil { + return "", nil, fmt.Errorf("error from XMLToText: %v", err) + } + return result, meta, nil +} + +// XMLToText converts XML to plain text given how to treat elements. +func XMLToText(r io.Reader, breaks []string, skip []string, strict bool) (string, error) { + var result string + + dec := xml.NewDecoder(io.LimitReader(r, maxBytes)) + dec.Strict = strict + for { + t, err := dec.Token() + if err != nil { + if err == io.EOF { + break + } + return "", err + } + + switch v := t.(type) { + case xml.CharData: + result += string(v) + case xml.StartElement: + for _, breakElement := range breaks { + if v.Name.Local == breakElement { + result += "\n" + } + } + for _, skipElement := range skip { + if v.Name.Local == skipElement { + depth := 1 + for { + t, err := dec.Token() + if err != nil { + // An io.EOF here is actually an error. + return "", err + } + + switch t.(type) { + case xml.StartElement: + depth++ + case xml.EndElement: + depth-- + } + + if depth == 0 { + break + } + } + } + } + } + } + return result, nil +} + +// XMLToMap converts XML to a nested string map. +func XMLToMap(r io.Reader) (map[string]string, error) { + m := make(map[string]string) + dec := xml.NewDecoder(io.LimitReader(r, maxBytes)) + var tagName string + for { + t, err := dec.Token() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + + switch v := t.(type) { + case xml.StartElement: + tagName = string(v.Name.Local) + case xml.CharData: + m[tagName] = string(v) + } + } + return m, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..d92ac9324cfb6c19c1770a23c68917f4b0b9ad52 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/pre_context.md @@ -0,0 +1,412 @@ +# Patch-overlapping Go context before the fix + +## `docx.go` (changed lines (43, 44)) + +```go +package docconv + +import ( + "archive/zip" + "bytes" + "encoding/xml" + "fmt" + "io" + "io/ioutil" + "os" + "time" +) + +type typeOverride struct { + XMLName xml.Name `xml:"Override"` + ContentType string `xml:"ContentType,attr"` + PartName string `xml:"PartName,attr"` +} + +type contentTypeDefinition struct { + XMLName xml.Name `xml:"Types"` + Overrides []typeOverride `xml:"Override"` +} + +// ConvertDocx converts an MS Word docx file to text. +func ConvertDocx(r io.Reader) (string, map[string]string, error) { + var size int64 + + // Common case: if the reader is a file (or trivial wrapper), avoid + // loading it all into memory. + var ra io.ReaderAt + if f, ok := r.(interface { + io.ReaderAt + Stat() (os.FileInfo, error) + }); ok { + si, err := f.Stat() + if err != nil { + return "", nil, err + } + size = si.Size() + ra = f + } else { + b, err := ioutil.ReadAll(r) + if err != nil { + return "", nil, nil + } + size = int64(len(b)) + ra = bytes.NewReader(b) + } + + zr, err := zip.NewReader(ra, size) + if err != nil { + return "", nil, fmt.Errorf("error unzipping data: %v", err) + } + + zipFiles := mapZipFiles(zr.File) + + contentTypeDefinition, err := getContentTypeDefinition(zipFiles["[Content_Types].xml"]) + if err != nil { + return "", nil, err + } + + meta := make(map[string]string) + var textHeader, textBody, textFooter string + for _, override := range contentTypeDefinition.Overrides { + f := zipFiles[override.PartName] + + switch { + case override.ContentType == "application/vnd.openxmlformats-package.core-properties+xml": + rc, err := f.Open() + if err != nil { + return "", nil, fmt.Errorf("error opening '%v' from archive: %v", f.Name, err) + } + defer rc.Close() + + meta, err = XMLToMap(rc) + if err != nil { + return "", nil, fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + + if tmp, ok := meta["modified"]; ok { + if t, err := time.Parse(time.RFC3339, tmp); err == nil { + meta["ModifiedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + if tmp, ok := meta["created"]; ok { + if t, err := time.Parse(time.RFC3339, tmp); err == nil { + meta["CreatedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + case override.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": + body, err := parseDocxText(f) + if err != nil { + return "", nil, err + } + textBody += body + "\n" + case override.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": + footer, err := parseDocxText(f) + if err != nil { + return "", nil, err + } + textFooter += footer + "\n" + case override.ContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml": + header, err := parseDocxText(f) + if err != nil { + return "", nil, err + } + textHeader += header + "\n" + } + + } + return textHeader + "\n" + textBody + "\n" + textFooter, meta, nil +} + +func getContentTypeDefinition(zf *zip.File) (*contentTypeDefinition, error) { + f, err := zf.Open() + if err != nil { + return nil, err + } + defer f.Close() + + x := &contentTypeDefinition{} + if err := xml.NewDecoder(f).Decode(x); err != nil { + return nil, err + } + return x, nil +} + +func mapZipFiles(files []*zip.File) map[string]*zip.File { + filesMap := make(map[string]*zip.File, 2*len(files)) + for _, f := range files { + filesMap[f.Name] = f + filesMap["/"+f.Name] = f + } + return filesMap +} + +func parseDocxText(f *zip.File) (string, error) { + r, err := f.Open() + if err != nil { + return "", fmt.Errorf("error opening '%v' from archive: %v", f.Name, err) + } + defer r.Close() + + text, err := DocxXMLToText(r) + if err != nil { + return "", fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + return text, nil +} + +// DocxXMLToText converts Docx XML into plain text. +func DocxXMLToText(r io.Reader) (string, error) { + return XMLToText(r, []string{"br", "p", "tab"}, []string{"instrText", "script"}, true) +} +``` + +## `odt.go` (changed lines (17, 18)) + +```go +package docconv + +import ( + "archive/zip" + "bytes" + "fmt" + "io" + "io/ioutil" + "time" +) + +// ConvertODT converts a ODT file to text +func ConvertODT(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + var textBody string + + b, err := ioutil.ReadAll(r) + if err != nil { + return "", nil, err + } + zr, err := zip.NewReader(bytes.NewReader(b), int64(len(b))) + if err != nil { + return "", nil, fmt.Errorf("error unzipping data: %v", err) + } + + for _, f := range zr.File { + switch f.Name { + case "meta.xml": + rc, err := f.Open() + if err != nil { + return "", nil, fmt.Errorf("error extracting '%v' from archive: %v", f.Name, err) + } + defer rc.Close() + + info, err := XMLToMap(rc) + if err != nil { + return "", nil, fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + + if tmp, ok := info["creator"]; ok { + meta["Author"] = tmp + } + if tmp, ok := info["date"]; ok { + if t, err := time.Parse("2006-01-02T15:04:05", tmp); err == nil { + meta["ModifiedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + if tmp, ok := info["creation-date"]; ok { + if t, err := time.Parse("2006-01-02T15:04:05", tmp); err == nil { + meta["CreatedDate"] = fmt.Sprintf("%d", t.Unix()) + } + } + + case "content.xml": + rc, err := f.Open() + if err != nil { + return "", nil, fmt.Errorf("error extracting '%v' from archive: %v", f.Name, err) + } + defer rc.Close() + + textBody, err = XMLToText(rc, []string{"br", "p", "tab"}, []string{}, true) + if err != nil { + return "", nil, fmt.Errorf("error parsing '%v': %v", f.Name, err) + } + } + } + + return textBody, meta, nil +} +``` + +## `pages.go` (changed lines (24, 25)) + +```go +package docconv + +import ( + "archive/zip" + "bufio" + "bytes" + "encoding/binary" + "fmt" + "io" + "io/ioutil" + "strings" + + "google.golang.org/protobuf/proto" + + TSP "code.sajari.com/docconv/iWork" + "code.sajari.com/docconv/snappy" +) + +// ConvertPages converts a Pages file to text. +func ConvertPages(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + var textBody string + + b, err := ioutil.ReadAll(r) + if err != nil { + return "", nil, fmt.Errorf("error reading data: %v", err) + } + + zr, err := zip.NewReader(bytes.NewReader(b), int64(len(b))) + if err != nil { + return "", nil, fmt.Errorf("error unzipping data: %v", err) + } + + for _, f := range zr.File { + if strings.HasSuffix(f.Name, "Preview.pdf") { + // There is a preview PDF version we can use + if rc, err := f.Open(); err == nil { + return ConvertPDF(rc) + } + } + if f.Name == "index.xml" { + // There's an XML version we can use + if rc, err := f.Open(); err == nil { + return ConvertXML(rc) + } + } + if f.Name == "Index/Document.iwa" { + rc, _ := f.Open() + defer rc.Close() + bReader := bufio.NewReader(snappy.NewReader(io.MultiReader(strings.NewReader("\xff\x06\x00\x00sNaPpY"), rc))) + + // Ignore error. + // NOTE: This error was unchecked. Need to revisit this to see if it + // should be acted on. + archiveLength, _ := binary.ReadVarint(bReader) + + // Ignore error. + // NOTE: This error was unchecked. Need to revisit this to see if it + // should be acted on. + archiveInfoData, _ := ioutil.ReadAll(io.LimitReader(bReader, archiveLength)) + + archiveInfo := &TSP.ArchiveInfo{} + err = proto.Unmarshal(archiveInfoData, archiveInfo) + fmt.Println("archiveInfo:", archiveInfo, err) + } + } + + return textBody, meta, nil +} +``` + +## `xml.go` (changed lines (28, 29, 79, 80)) + +```go +package docconv + +import ( + "bytes" + "encoding/xml" + "fmt" + "io" +) + +// ConvertXML converts an XML file to text. +func ConvertXML(r io.Reader) (string, map[string]string, error) { + meta := make(map[string]string) + cleanXML, err := Tidy(r, true) + if err != nil { + return "", nil, fmt.Errorf("tidy error: %v", err) + } + result, err := XMLToText(bytes.NewReader(cleanXML), []string{}, []string{}, true) + if err != nil { + return "", nil, fmt.Errorf("error from XMLToText: %v", err) + } + return result, meta, nil +} + +// XMLToText converts XML to plain text given how to treat elements. +func XMLToText(r io.Reader, breaks []string, skip []string, strict bool) (string, error) { + var result string + + dec := xml.NewDecoder(r) + dec.Strict = strict + for { + t, err := dec.Token() + if err != nil { + if err == io.EOF { + break + } + return "", err + } + + switch v := t.(type) { + case xml.CharData: + result += string(v) + case xml.StartElement: + for _, breakElement := range breaks { + if v.Name.Local == breakElement { + result += "\n" + } + } + for _, skipElement := range skip { + if v.Name.Local == skipElement { + depth := 1 + for { + t, err := dec.Token() + if err != nil { + // An io.EOF here is actually an error. + return "", err + } + + switch t.(type) { + case xml.StartElement: + depth++ + case xml.EndElement: + depth-- + } + + if depth == 0 { + break + } + } + } + } + } + } + return result, nil +} + +// XMLToMap converts XML to a nested string map. +func XMLToMap(r io.Reader) (map[string]string, error) { + m := make(map[string]string) + dec := xml.NewDecoder(r) + var tagName string + for { + t, err := dec.Token() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + + switch v := t.(type) { + case xml.StartElement: + tagName = string(v.Name.Local) + case xml.CharData: + m[tagName] = string(v) + } + } + return m, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/task.json new file mode 100644 index 0000000000000000000000000000000000000000..815a4e9934b9f95bdbded41185e7e3be981edf91 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/task.json @@ -0,0 +1,55 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-02cb4e0a6c5aaabd6a78", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-02cb4e0a6c5aaabd6a78", + "project_id": "morefixes__sajari__docconv", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "docx.go", + "limit.go", + "odt.go", + "pages.go", + "xml.go" + ], + "patch_units": { + "before": [ + "docx.go", + "odt.go", + "pages.go", + "xml.go" + ], + "after": [ + "docx.go", + "limit.go", + "odt.go", + "pages.go", + "xml.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/0f2dd7f22cb39edf425e31c73ad68abc097ae1a4227101bae0ef970834d7c195/database", + "cache_key": "0f2dd7f22cb39edf425e31c73ad68abc097ae1a4227101bae0ef970834d7c195", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/be9479e3777ab6ce5fb6fa038c81bdab6f5dfbef376d50e51366dfb28a5c116d/database", + "cache_key": "be9479e3777ab6ce5fb6fa038c81bdab6f5dfbef376d50e51366dfb28a5c116d", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/d7101a87feb72cf67fc571c338a8eac59c3ad369e8babe871b5052fda7970114/database", + "cache_key": "d7101a87feb72cf67fc571c338a8eac59c3ad369e8babe871b5052fda7970114", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-02cb4e0a6c5aaabd6a78/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-02cb4e0a6c5aaabd6a78/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-02cb4e0a6c5aaabd6a78/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..7367f78efb5c8781aa5b5cca09dab56c5899b047 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/patch.diff @@ -0,0 +1,277 @@ +diff --git a/pkg/engine/wildcards/wildcards.go b/pkg/engine/wildcards/wildcards.go +index 730d82529..a21ad08f9 100644 +--- a/pkg/engine/wildcards/wildcards.go ++++ b/pkg/engine/wildcards/wildcards.go +@@ -135,7 +135,16 @@ func getValueAsStringMap(key string, data interface{}) (string, map[string]strin + } + + for k, v := range valMap { +- result[k] = v.(string) ++ if v == nil { ++ continue ++ } ++ ++ switch typedVal := v.(type) { ++ case string: ++ result[k] = typedVal ++ default: ++ continue ++ } + } + + return patternKey, result +diff --git a/pkg/engine/wildcards/wildcards_test.go b/pkg/engine/wildcards/wildcards_test.go +index 52dcddc43..5c13f6cf9 100644 +--- a/pkg/engine/wildcards/wildcards_test.go ++++ b/pkg/engine/wildcards/wildcards_test.go +@@ -3,6 +3,8 @@ package wildcards + import ( + "reflect" + "testing" ++ ++ "github.com/stretchr/testify/assert" + ) + + func TestExpandInMetadata(t *testing.T) { +@@ -25,3 +27,241 @@ func testExpand(t *testing.T, patternMap, resourceMap map[string]string, expecte + t.Errorf("expected %v but received %v", expectedMap, result) + } + } ++ ++func TestGetValueAsStringMap_NilHandling(t *testing.T) { ++ tests := []struct { ++ name string ++ key string ++ data interface{} ++ expectedKey string ++ expectedResult map[string]string ++ }{ ++ { ++ name: "nil data", ++ key: "test", ++ data: nil, ++ expectedKey: "", ++ expectedResult: nil, ++ }, ++ { ++ name: "data is not a map", ++ key: "test", ++ data: "not a map", ++ expectedKey: "", ++ expectedResult: nil, ++ }, ++ { ++ name: "key not found", ++ key: "nonexistent", ++ data: map[string]interface{}{"otherKey": "value"}, ++ expectedKey: "", ++ expectedResult: nil, ++ }, ++ { ++ name: "value is nil", ++ key: "test", ++ data: map[string]interface{}{"test": nil}, ++ expectedKey: "", ++ expectedResult: nil, ++ }, ++ { ++ name: "value is not a map", ++ key: "test", ++ data: map[string]interface{}{"test": "not a map"}, ++ expectedKey: "", ++ expectedResult: nil, ++ }, ++ { ++ name: "handles nil value in map", ++ key: "test", ++ data: map[string]interface{}{ ++ "test": map[string]interface{}{ ++ "key1": "value1", ++ "key2": nil, ++ "key3": "value3", ++ }, ++ }, ++ expectedKey: "test", ++ expectedResult: map[string]string{ ++ "key1": "value1", ++ // key2 should be skipped ++ "key3": "value3", ++ }, ++ }, ++ { ++ name: "handles non-string value in map", ++ key: "test", ++ data: map[string]interface{}{ ++ "test": map[string]interface{}{ ++ "key1": "value1", ++ "key2": 123, ++ "key3": map[string]string{ ++ "nested": "value", ++ }, ++ "key4": "value4", ++ }, ++ }, ++ expectedKey: "test", ++ expectedResult: map[string]string{ ++ "key1": "value1", ++ // key2 should be skipped (non-string) ++ // key3 should be skipped (complex) ++ "key4": "value4", ++ }, ++ }, ++ { ++ name: "normal case - all strings", ++ key: "test", ++ data: map[string]interface{}{ ++ "test": map[string]interface{}{ ++ "key1": "value1", ++ "key2": "value2", ++ }, ++ }, ++ expectedKey: "test", ++ expectedResult: map[string]string{ ++ "key1": "value1", ++ "key2": "value2", ++ }, ++ }, ++ } ++ ++ for _, test := range tests { ++ t.Run(test.name, func(t *testing.T) { ++ key, result := getValueAsStringMap(test.key, test.data) ++ assert.Equal(t, test.expectedKey, key) ++ assert.Equal(t, test.expectedResult, result) ++ }) ++ } ++} ++ ++func TestExpandInMetadata_NilSafety(t *testing.T) { ++ testCases := []struct { ++ name string ++ patternMap map[string]interface{} ++ resourceMap map[string]interface{} ++ shouldPanic bool ++ }{ ++ { ++ name: "nil value in annotation should not panic", ++ patternMap: map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "annotations": map[string]interface{}{ ++ "some-key": nil, ++ }, ++ }, ++ }, ++ resourceMap: map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "annotations": map[string]interface{}{ ++ "real-key": "real-value", ++ }, ++ }, ++ }, ++ shouldPanic: false, ++ }, ++ { ++ name: "complex value in annotation should not panic", ++ patternMap: map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "annotations": map[string]interface{}{ ++ "some-key": map[string]interface{}{ ++ "nested": "value", ++ }, ++ }, ++ }, ++ }, ++ resourceMap: map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "annotations": map[string]interface{}{ ++ "real-key": "real-value", ++ }, ++ }, ++ }, ++ shouldPanic: false, ++ }, ++ { ++ name: "simulated jmespath nil result", ++ patternMap: map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "annotations": map[string]interface{}{ ++ "test": nil, // Simulating what happens when {{@ | foo}} evaluates with undefined 'foo' ++ }, ++ }, ++ }, ++ resourceMap: map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "annotations": map[string]interface{}{ ++ "real-key": "real-value", ++ }, ++ }, ++ }, ++ shouldPanic: false, ++ }, ++ } ++ ++ for _, tc := range testCases { ++ t.Run(tc.name, func(t *testing.T) { ++ defer func() { ++ r := recover() ++ if tc.shouldPanic { ++ assert.NotNil(t, r, "Expected function to panic, but it didn't") ++ } else { ++ assert.Nil(t, r, "Function panicked unexpectedly") ++ } ++ }() ++ ++ ExpandInMetadata(tc.patternMap, tc.resourceMap) ++ }) ++ } ++} ++ ++func TestJMESPathNil(t *testing.T) { ++ // Create a pattern with a nil value in labels or annotations ++ // to simulate what happens after a JMESPath expression like {{@ | foo}} ++ // (where 'foo' is not a defined function) is evaluated and results in nil. ++ patternMap := map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "labels": map[string]interface{}{ ++ "normal": "value", ++ "nil-value": nil, // This represents the result of {{@ | foo}} substitution ++ }, ++ "annotations": map[string]interface{}{ ++ "another-normal": "value", ++ "complex-value": map[string]interface{}{ // And this represents a complex structure ++ "nested": "value", ++ }, ++ }, ++ }, ++ } ++ ++ resourceMap := map[string]interface{}{ ++ "metadata": map[string]interface{}{ ++ "labels": map[string]interface{}{ ++ "app": "test", ++ }, ++ "annotations": map[string]interface{}{ ++ "test": "value", ++ }, ++ }, ++ } ++ ++ defer func() { ++ r := recover() ++ assert.Nil(t, r, "ExpandInMetadata should not panic with nil values, but it did: %v", r) ++ }() ++ ++ result := ExpandInMetadata(patternMap, resourceMap) ++ ++ // Additional verification that the function works correctly ++ metadataResult := result["metadata"].(map[string]interface{}) ++ labelsResult, ok := metadataResult["labels"].(map[string]interface{}) ++ ++ assert.True(t, ok, "Expected labels to be a map[string]interface{}") ++ assert.Contains(t, labelsResult, "normal") ++ ++ // Annotations with complex values should also be handled properly ++ annotationsResult, ok := metadataResult["annotations"].(map[string]interface{}) ++ assert.True(t, ok, "Expected annotations to be a map[string]interface{}") ++ assert.Contains(t, annotationsResult, "another-normal") ++} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..c68581278af556aa6b2ba50b9930256cb353e5a3 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/post_context.md @@ -0,0 +1,449 @@ +# Patch-overlapping Go context after the fix + +## `pkg/engine/wildcards/wildcards.go` (changed lines (138, 139, 140, 141, 142, 143, 144, 145, 146, 147)) + +```go +package wildcards + +import ( + "strings" + + "github.com/kyverno/kyverno/ext/wildcard" + "github.com/kyverno/kyverno/pkg/engine/anchor" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ReplaceInSelector replaces label selector keys and values containing +// wildcard characters with matching keys and values from the resource labels. +func ReplaceInSelector(labelSelector *metav1.LabelSelector, resourceLabels map[string]string) *metav1.LabelSelector { + labelSelector = labelSelector.DeepCopy() + result := replaceWildcardsInMapKeyValues(labelSelector.MatchLabels, resourceLabels) + labelSelector.MatchLabels = result + return labelSelector +} + +// replaceWildcardsInMapKeyValues will expand the "key" and "value" and will replace wildcard characters +// It also does not handle anchors as these are not expected in selectors +func replaceWildcardsInMapKeyValues(patternMap map[string]string, resourceMap map[string]string) map[string]string { + result := map[string]string{} + for k, v := range patternMap { + if wildcard.ContainsWildcard(k) || wildcard.ContainsWildcard(v) { + matchK, matchV := expandWildcards(k, v, resourceMap, true, true) + result[matchK] = matchV + } else { + result[k] = v + } + } + return result +} + +func expandWildcards(k, v string, resourceMap map[string]string, matchValue, replace bool) (key string, val string) { + for k1, v1 := range resourceMap { + if wildcard.Match(k, k1) { + if !matchValue { + return k1, v1 + } else if wildcard.Match(v, v1) { + return k1, v1 + } + } + } + if replace { + k = replaceWildCardChars(k) + v = replaceWildCardChars(v) + } + return k, v +} + +// replaceWildCardChars will replace '*' and '?' characters which are not +// supported by Kubernetes with a '0'. +func replaceWildCardChars(s string) string { + s = strings.ReplaceAll(s, "*", "0") + s = strings.ReplaceAll(s, "?", "0") + return s +} + +// ExpandInMetadata substitutes wildcard characters in map keys for metadata.labels and +// metadata.annotations that are present in a validation pattern. Values are not substituted +// here, as they are evaluated separately while processing the validation pattern. Anchors +// on the tags (e.g. "=(kubernetes.io/*)" will be preserved when the values are expanded. +func ExpandInMetadata(patternMap, resourceMap map[string]interface{}) map[string]interface{} { + _, patternMetadata := getPatternValue("metadata", patternMap) + if patternMetadata == nil { + return patternMap + } + + resourceMetadata := resourceMap["metadata"] + if resourceMetadata == nil { + return patternMap + } + + metadata := patternMetadata.(map[string]interface{}) + labelsKey, labels := expandWildcardsInTag("labels", patternMetadata, resourceMetadata) + if labels != nil { + metadata[labelsKey] = labels + } + annotationsKey, annotations := expandWildcardsInTag("annotations", patternMetadata, resourceMetadata) + if annotations != nil { + metadata[annotationsKey] = annotations + } + return patternMap +} + +func getPatternValue(tag string, pattern map[string]interface{}) (string, interface{}) { + for k, v := range pattern { + if k == tag { + return k, v + } + if a := anchor.Parse(k); a != nil && a.Key() == tag { + return k, v + } + } + return "", nil +} + +// expandWildcardsInTag +func expandWildcardsInTag(tag string, patternMetadata, resourceMetadata interface{}) (string, map[string]interface{}) { + patternKey, patternData := getValueAsStringMap(tag, patternMetadata) + if patternData == nil { + return "", nil + } + + _, resourceData := getValueAsStringMap(tag, resourceMetadata) + if resourceData == nil { + return "", nil + } + + results := replaceWildcardsInMapKeys(patternData, resourceData) + return patternKey, results +} + +func getValueAsStringMap(key string, data interface{}) (string, map[string]string) { + if data == nil { + return "", nil + } + + dataMap, ok := data.(map[string]interface{}) + if !ok { + return "", nil + } + patternKey, val := getPatternValue(key, dataMap) + + if val == nil { + return "", nil + } + + result := map[string]string{} + + valMap, ok := val.(map[string]interface{}) + if !ok { + return "", nil + } + + for k, v := range valMap { + if v == nil { + continue + } + + switch typedVal := v.(type) { + case string: + result[k] = typedVal + default: + continue + } + } + + return patternKey, result +} + +// replaceWildcardsInMapKeys will expand only the "key" and not replace wildcard characters in the key or values +// It also preserves anchors in keys +func replaceWildcardsInMapKeys(patternData, resourceData map[string]string) map[string]interface{} { + results := map[string]interface{}{} + for k, v := range patternData { + if wildcard.ContainsWildcard(k) { + if a := anchor.Parse(k); a != nil { + matchK, _ := expandWildcards(a.Key(), v, resourceData, false, false) + results[anchor.String(a.Type(), matchK)] = v + } else { + matchK, _ := expandWildcards(k, v, resourceData, false, false) + results[matchK] = v + } + } else { + results[k] = v + } + } + return results +} +``` + +## `pkg/engine/wildcards/wildcards_test.go` (changed lines (6, 7, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267)) + +```go +package wildcards + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestExpandInMetadata(t *testing.T) { + // testExpand(t, map[string]string{"test/*": "*"}, map[string]string{}, + // map[string]string{"test/0": "0"}) + + testExpand(t, map[string]string{"test/*": "*"}, map[string]string{"test/test": "test"}, + map[string]interface{}{"test/test": "*"}) + + testExpand(t, map[string]string{"=(test/*)": "test"}, map[string]string{"test/test": "test"}, + map[string]interface{}{"=(test/test)": "test"}) + + testExpand(t, map[string]string{"test/*": "*"}, map[string]string{"test/test1": "test1"}, + map[string]interface{}{"test/test1": "*"}) +} + +func testExpand(t *testing.T, patternMap, resourceMap map[string]string, expectedMap map[string]interface{}) { + result := replaceWildcardsInMapKeys(patternMap, resourceMap) + if !reflect.DeepEqual(expectedMap, result) { + t.Errorf("expected %v but received %v", expectedMap, result) + } +} + +func TestGetValueAsStringMap_NilHandling(t *testing.T) { + tests := []struct { + name string + key string + data interface{} + expectedKey string + expectedResult map[string]string + }{ + { + name: "nil data", + key: "test", + data: nil, + expectedKey: "", + expectedResult: nil, + }, + { + name: "data is not a map", + key: "test", + data: "not a map", + expectedKey: "", + expectedResult: nil, + }, + { + name: "key not found", + key: "nonexistent", + data: map[string]interface{}{"otherKey": "value"}, + expectedKey: "", + expectedResult: nil, + }, + { + name: "value is nil", + key: "test", + data: map[string]interface{}{"test": nil}, + expectedKey: "", + expectedResult: nil, + }, + { + name: "value is not a map", + key: "test", + data: map[string]interface{}{"test": "not a map"}, + expectedKey: "", + expectedResult: nil, + }, + { + name: "handles nil value in map", + key: "test", + data: map[string]interface{}{ + "test": map[string]interface{}{ + "key1": "value1", + "key2": nil, + "key3": "value3", + }, + }, + expectedKey: "test", + expectedResult: map[string]string{ + "key1": "value1", + // key2 should be skipped + "key3": "value3", + }, + }, + { + name: "handles non-string value in map", + key: "test", + data: map[string]interface{}{ + "test": map[string]interface{}{ + "key1": "value1", + "key2": 123, + "key3": map[string]string{ + "nested": "value", + }, + "key4": "value4", + }, + }, + expectedKey: "test", + expectedResult: map[string]string{ + "key1": "value1", + // key2 should be skipped (non-string) + // key3 should be skipped (complex) + "key4": "value4", + }, + }, + { + name: "normal case - all strings", + key: "test", + data: map[string]interface{}{ + "test": map[string]interface{}{ + "key1": "value1", + "key2": "value2", + }, + }, + expectedKey: "test", + expectedResult: map[string]string{ + "key1": "value1", + "key2": "value2", + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + key, result := getValueAsStringMap(test.key, test.data) + assert.Equal(t, test.expectedKey, key) + assert.Equal(t, test.expectedResult, result) + }) + } +} + +func TestExpandInMetadata_NilSafety(t *testing.T) { + testCases := []struct { + name string + patternMap map[string]interface{} + resourceMap map[string]interface{} + shouldPanic bool + }{ + { + name: "nil value in annotation should not panic", + patternMap: map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "some-key": nil, + }, + }, + }, + resourceMap: map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "real-key": "real-value", + }, + }, + }, + shouldPanic: false, + }, + { + name: "complex value in annotation should not panic", + patternMap: map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "some-key": map[string]interface{}{ + "nested": "value", + }, + }, + }, + }, + resourceMap: map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "real-key": "real-value", + }, + }, + }, + shouldPanic: false, + }, + { + name: "simulated jmespath nil result", + patternMap: map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "test": nil, // Simulating what happens when {{@ | foo}} evaluates with undefined 'foo' + }, + }, + }, + resourceMap: map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "real-key": "real-value", + }, + }, + }, + shouldPanic: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer func() { + r := recover() + if tc.shouldPanic { + assert.NotNil(t, r, "Expected function to panic, but it didn't") + } else { + assert.Nil(t, r, "Function panicked unexpectedly") + } + }() + + ExpandInMetadata(tc.patternMap, tc.resourceMap) + }) + } +} + +func TestJMESPathNil(t *testing.T) { + // Create a pattern with a nil value in labels or annotations + // to simulate what happens after a JMESPath expression like {{@ | foo}} + // (where 'foo' is not a defined function) is evaluated and results in nil. + patternMap := map[string]interface{}{ + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "normal": "value", + "nil-value": nil, // This represents the result of {{@ | foo}} substitution + }, + "annotations": map[string]interface{}{ + "another-normal": "value", + "complex-value": map[string]interface{}{ // And this represents a complex structure + "nested": "value", + }, + }, + }, + } + + resourceMap := map[string]interface{}{ + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "test", + }, + "annotations": map[string]interface{}{ + "test": "value", + }, + }, + } + + defer func() { + r := recover() + assert.Nil(t, r, "ExpandInMetadata should not panic with nil values, but it did: %v", r) + }() + + result := ExpandInMetadata(patternMap, resourceMap) + + // Additional verification that the function works correctly + metadataResult := result["metadata"].(map[string]interface{}) + labelsResult, ok := metadataResult["labels"].(map[string]interface{}) + + assert.True(t, ok, "Expected labels to be a map[string]interface{}") + assert.Contains(t, labelsResult, "normal") + + // Annotations with complex values should also be handled properly + annotationsResult, ok := metadataResult["annotations"].(map[string]interface{}) + assert.True(t, ok, "Expected annotations to be a map[string]interface{}") + assert.Contains(t, annotationsResult, "another-normal") +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..21f13e096240545797ac51b48136f6d0bea7c9e8 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/pre_context.md @@ -0,0 +1,200 @@ +# Patch-overlapping Go context before the fix + +## `pkg/engine/wildcards/wildcards.go` (changed lines (138, 139)) + +```go +package wildcards + +import ( + "strings" + + "github.com/kyverno/kyverno/ext/wildcard" + "github.com/kyverno/kyverno/pkg/engine/anchor" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ReplaceInSelector replaces label selector keys and values containing +// wildcard characters with matching keys and values from the resource labels. +func ReplaceInSelector(labelSelector *metav1.LabelSelector, resourceLabels map[string]string) *metav1.LabelSelector { + labelSelector = labelSelector.DeepCopy() + result := replaceWildcardsInMapKeyValues(labelSelector.MatchLabels, resourceLabels) + labelSelector.MatchLabels = result + return labelSelector +} + +// replaceWildcardsInMapKeyValues will expand the "key" and "value" and will replace wildcard characters +// It also does not handle anchors as these are not expected in selectors +func replaceWildcardsInMapKeyValues(patternMap map[string]string, resourceMap map[string]string) map[string]string { + result := map[string]string{} + for k, v := range patternMap { + if wildcard.ContainsWildcard(k) || wildcard.ContainsWildcard(v) { + matchK, matchV := expandWildcards(k, v, resourceMap, true, true) + result[matchK] = matchV + } else { + result[k] = v + } + } + return result +} + +func expandWildcards(k, v string, resourceMap map[string]string, matchValue, replace bool) (key string, val string) { + for k1, v1 := range resourceMap { + if wildcard.Match(k, k1) { + if !matchValue { + return k1, v1 + } else if wildcard.Match(v, v1) { + return k1, v1 + } + } + } + if replace { + k = replaceWildCardChars(k) + v = replaceWildCardChars(v) + } + return k, v +} + +// replaceWildCardChars will replace '*' and '?' characters which are not +// supported by Kubernetes with a '0'. +func replaceWildCardChars(s string) string { + s = strings.ReplaceAll(s, "*", "0") + s = strings.ReplaceAll(s, "?", "0") + return s +} + +// ExpandInMetadata substitutes wildcard characters in map keys for metadata.labels and +// metadata.annotations that are present in a validation pattern. Values are not substituted +// here, as they are evaluated separately while processing the validation pattern. Anchors +// on the tags (e.g. "=(kubernetes.io/*)" will be preserved when the values are expanded. +func ExpandInMetadata(patternMap, resourceMap map[string]interface{}) map[string]interface{} { + _, patternMetadata := getPatternValue("metadata", patternMap) + if patternMetadata == nil { + return patternMap + } + + resourceMetadata := resourceMap["metadata"] + if resourceMetadata == nil { + return patternMap + } + + metadata := patternMetadata.(map[string]interface{}) + labelsKey, labels := expandWildcardsInTag("labels", patternMetadata, resourceMetadata) + if labels != nil { + metadata[labelsKey] = labels + } + annotationsKey, annotations := expandWildcardsInTag("annotations", patternMetadata, resourceMetadata) + if annotations != nil { + metadata[annotationsKey] = annotations + } + return patternMap +} + +func getPatternValue(tag string, pattern map[string]interface{}) (string, interface{}) { + for k, v := range pattern { + if k == tag { + return k, v + } + if a := anchor.Parse(k); a != nil && a.Key() == tag { + return k, v + } + } + return "", nil +} + +// expandWildcardsInTag +func expandWildcardsInTag(tag string, patternMetadata, resourceMetadata interface{}) (string, map[string]interface{}) { + patternKey, patternData := getValueAsStringMap(tag, patternMetadata) + if patternData == nil { + return "", nil + } + + _, resourceData := getValueAsStringMap(tag, resourceMetadata) + if resourceData == nil { + return "", nil + } + + results := replaceWildcardsInMapKeys(patternData, resourceData) + return patternKey, results +} + +func getValueAsStringMap(key string, data interface{}) (string, map[string]string) { + if data == nil { + return "", nil + } + + dataMap, ok := data.(map[string]interface{}) + if !ok { + return "", nil + } + patternKey, val := getPatternValue(key, dataMap) + + if val == nil { + return "", nil + } + + result := map[string]string{} + + valMap, ok := val.(map[string]interface{}) + if !ok { + return "", nil + } + + for k, v := range valMap { + result[k] = v.(string) + } + + return patternKey, result +} + +// replaceWildcardsInMapKeys will expand only the "key" and not replace wildcard characters in the key or values +// It also preserves anchors in keys +func replaceWildcardsInMapKeys(patternData, resourceData map[string]string) map[string]interface{} { + results := map[string]interface{}{} + for k, v := range patternData { + if wildcard.ContainsWildcard(k) { + if a := anchor.Parse(k); a != nil { + matchK, _ := expandWildcards(a.Key(), v, resourceData, false, false) + results[anchor.String(a.Type(), matchK)] = v + } else { + matchK, _ := expandWildcards(k, v, resourceData, false, false) + results[matchK] = v + } + } else { + results[k] = v + } + } + return results +} +``` + +## `pkg/engine/wildcards/wildcards_test.go` (changed lines (6, 28)) + +```go +package wildcards + +import ( + "reflect" + "testing" +) + +func TestExpandInMetadata(t *testing.T) { + // testExpand(t, map[string]string{"test/*": "*"}, map[string]string{}, + // map[string]string{"test/0": "0"}) + + testExpand(t, map[string]string{"test/*": "*"}, map[string]string{"test/test": "test"}, + map[string]interface{}{"test/test": "*"}) + + testExpand(t, map[string]string{"=(test/*)": "test"}, map[string]string{"test/test": "test"}, + map[string]interface{}{"=(test/test)": "test"}) + + testExpand(t, map[string]string{"test/*": "*"}, map[string]string{"test/test1": "test1"}, + map[string]interface{}{"test/test1": "*"}) +} + +func testExpand(t *testing.T, patternMap, resourceMap map[string]string, expectedMap map[string]interface{}) { + result := replaceWildcardsInMapKeys(patternMap, resourceMap) + if !reflect.DeepEqual(expectedMap, result) { + t.Errorf("expected %v but received %v", expectedMap, result) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c9a6bd2cff8f713383cbbb0c3a158e1a060e6c62 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-08d699b1f7c72c366406", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-08d699b1f7c72c366406", + "project_id": "morefixes__kyverno__kyverno", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "pkg/engine/wildcards/wildcards.go", + "pkg/engine/wildcards/wildcards_test.go" + ], + "patch_units": { + "before": [ + "pkg/engine/wildcards/wildcards.go", + "pkg/engine/wildcards/wildcards_test.go" + ], + "after": [ + "pkg/engine/wildcards/wildcards.go", + "pkg/engine/wildcards/wildcards_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/83b670f1115034b4433e483663960bd3f562a7c09fe5cb6dcf140d5048a6ce8f/database", + "cache_key": "83b670f1115034b4433e483663960bd3f562a7c09fe5cb6dcf140d5048a6ce8f", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/c094a82c89630463a6d0fa86a16ba5c7492fab7051a11261cac1808586525ee0/database", + "cache_key": "c094a82c89630463a6d0fa86a16ba5c7492fab7051a11261cac1808586525ee0", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/ca9672e6600175c72d388571605401118ec17d7e51613ef932b9e2ac55a0c8e9/database", + "cache_key": "ca9672e6600175c72d388571605401118ec17d7e51613ef932b9e2ac55a0c8e9", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-08d699b1f7c72c366406/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-08d699b1f7c72c366406/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-08d699b1f7c72c366406/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..e2a2cc15e52e622eaf3cf57680d33925da24b794 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/patch.diff @@ -0,0 +1,15 @@ +diff --git a/mp4.go b/mp4.go +index bc0286b..6523397 100644 +--- a/mp4.go ++++ b/mp4.go +@@ -149,8 +149,8 @@ func (m metadataMP4) readAtomData(r io.ReadSeeker, name string, size uint32, pro + // "data" + size (4 bytes each) + b = b[8:] + +- if len(b) < 3 { +- return fmt.Errorf("invalid encoding: expected at least %d bytes, for class, got %d", 3, len(b)) ++ if len(b) < 4 { ++ return fmt.Errorf("invalid encoding: expected at least %d bytes, for class, got %d", 4, len(b)) + } + class := getInt(b[1:4]) + var ok bool diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..45b38c8b494f5be8af11d6319237f6090a94c08f --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/post_context.md @@ -0,0 +1,378 @@ +# Patch-overlapping Go context after the fix + +## `mp4.go` (changed lines (152, 153)) + +```go +// Copyright 2015, David Howden +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tag + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "strconv" + "strings" +) + +var atomTypes = map[int]string{ + 0: "implicit", // automatic based on atom name + 1: "text", + 13: "jpeg", + 14: "png", + 21: "uint8", +} + +// NB: atoms does not include "----", this is handled separately +var atoms = atomNames(map[string]string{ + "\xa9alb": "album", + "\xa9art": "artist", + "\xa9ART": "artist", + "aART": "album_artist", + "\xa9day": "year", + "\xa9nam": "title", + "\xa9gen": "genre", + "trkn": "track", + "\xa9wrt": "composer", + "\xa9too": "encoder", + "cprt": "copyright", + "covr": "picture", + "\xa9grp": "grouping", + "keyw": "keyword", + "\xa9lyr": "lyrics", + "\xa9cmt": "comment", + "tmpo": "tempo", + "cpil": "compilation", + "disk": "disc", +}) + +// Detect PNG image if "implicit" class is used +var pngHeader = []byte{137, 80, 78, 71, 13, 10, 26, 10} + +type atomNames map[string]string + +func (f atomNames) Name(n string) []string { + res := make([]string, 1) + for k, v := range f { + if v == n { + res = append(res, k) + } + } + return res +} + +// metadataMP4 is the implementation of Metadata for MP4 tag (atom) data. +type metadataMP4 struct { + fileType FileType + data map[string]interface{} +} + +// ReadAtoms reads MP4 metadata atoms from the io.ReadSeeker into a Metadata, returning +// non-nil error if there was a problem. +func ReadAtoms(r io.ReadSeeker) (Metadata, error) { + m := metadataMP4{ + data: make(map[string]interface{}), + fileType: UnknownFileType, + } + err := m.readAtoms(r) + return m, err +} + +func (m metadataMP4) readAtoms(r io.ReadSeeker) error { + for { + name, size, err := readAtomHeader(r) + if err != nil { + if err == io.EOF { + return nil + } + return err + } + + switch name { + case "meta": + // next_item_id (int32) + _, err := readBytes(r, 4) + if err != nil { + return err + } + fallthrough + + case "moov", "udta", "ilst": + return m.readAtoms(r) + } + + _, ok := atoms[name] + var data []string + if name == "----" { + name, data, err = readCustomAtom(r, size) + if err != nil { + return err + } + + if name != "----" { + ok = true + size = 0 // already read data + } + } + + if !ok { + _, err := r.Seek(int64(size-8), io.SeekCurrent) + if err != nil { + return err + } + continue + } + + err = m.readAtomData(r, name, size-8, data) + if err != nil { + return err + } + } +} + +func (m metadataMP4) readAtomData(r io.ReadSeeker, name string, size uint32, processedData []string) error { + var b []byte + var err error + var contentType string + if len(processedData) > 0 { + b = []byte(strings.Join(processedData, ";")) // add delimiter if multiple data fields + contentType = "text" + } else { + // read the data + b, err = readBytes(r, uint(size)) + if err != nil { + return err + } + if len(b) < 8 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, got %d", 8, len(b)) + } + + // "data" + size (4 bytes each) + b = b[8:] + + if len(b) < 4 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for class, got %d", 4, len(b)) + } + class := getInt(b[1:4]) + var ok bool + contentType, ok = atomTypes[class] + if !ok { + return fmt.Errorf("invalid content type: %v (%x) (%x)", class, b[1:4], b) + } + + // 4: atom version (1 byte) + atom flags (3 bytes) + // 4: NULL (usually locale indicator) + if len(b) < 8 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for atom version and flags, got %d", 8, len(b)) + } + b = b[8:] + } + + if name == "trkn" || name == "disk" { + if len(b) < 6 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for track and disk numbers, got %d", 6, len(b)) + } + + m.data[name] = int(b[3]) + m.data[name+"_count"] = int(b[5]) + return nil + } + + if contentType == "implicit" { + if name == "covr" { + if bytes.HasPrefix(b, pngHeader) { + contentType = "png" + } + // TODO(dhowden): Detect JPEG formats too (harder). + } + } + + var data interface{} + switch contentType { + case "implicit": + if _, ok := atoms[name]; ok { + return fmt.Errorf("unhandled implicit content type for required atom: %q", name) + } + return nil + + case "text": + data = string(b) + + case "uint8": + if len(b) < 1 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for integer tag data, got %d", 1, len(b)) + } + data = getInt(b[:1]) + + case "jpeg", "png": + data = &Picture{ + Ext: contentType, + MIMEType: "image/" + contentType, + Data: b, + } + } + m.data[name] = data + + return nil +} + +func readAtomHeader(r io.ReadSeeker) (name string, size uint32, err error) { + err = binary.Read(r, binary.BigEndian, &size) + if err != nil { + return + } + name, err = readString(r, 4) + return +} + +// Generic atom. +// Should have 3 sub atoms : mean, name and data. +// We check that mean is "com.apple.iTunes" and we use the subname as +// the name, and move to the data atom. +// Data atom could have multiple data values, each with a header. +// If anything goes wrong, we jump at the end of the "----" atom. +func readCustomAtom(r io.ReadSeeker, size uint32) (_ string, data []string, _ error) { + subNames := make(map[string]string) + + for size > 8 { + subName, subSize, err := readAtomHeader(r) + if err != nil { + return "", nil, err + } + + // Remove the size of the atom from the size counter + if size >= subSize { + size -= subSize + } else { + return "", nil, errors.New("--- invalid size") + } + + b, err := readBytes(r, uint(subSize-8)) + if err != nil { + return "", nil, err + } + + if len(b) < 4 { + return "", nil, fmt.Errorf("invalid encoding: expected at least %d bytes, got %d", 4, len(b)) + } + switch subName { + case "mean", "name": + subNames[subName] = string(b[4:]) + case "data": + data = append(data, string(b[4:])) + } + } + + // there should remain only the header size + if size != 8 { + err := errors.New("---- atom out of bounds") + return "", nil, err + } + + if subNames["mean"] != "com.apple.iTunes" || subNames["name"] == "" || len(data) == 0 { + return "----", nil, nil + } + return subNames["name"], data, nil +} + +func (metadataMP4) Format() Format { return MP4 } +func (m metadataMP4) FileType() FileType { return m.fileType } + +func (m metadataMP4) Raw() map[string]interface{} { return m.data } + +func (m metadataMP4) getString(n []string) string { + for _, k := range n { + if x, ok := m.data[k]; ok { + return x.(string) + } + } + return "" +} + +func (m metadataMP4) getInt(n []string) int { + for _, k := range n { + if x, ok := m.data[k]; ok { + return x.(int) + } + } + return 0 +} + +func (m metadataMP4) Title() string { + return m.getString(atoms.Name("title")) +} + +func (m metadataMP4) Artist() string { + return m.getString(atoms.Name("artist")) +} + +func (m metadataMP4) Album() string { + return m.getString(atoms.Name("album")) +} + +func (m metadataMP4) AlbumArtist() string { + return m.getString(atoms.Name("album_artist")) +} + +func (m metadataMP4) Composer() string { + return m.getString(atoms.Name("composer")) +} + +func (m metadataMP4) Genre() string { + return m.getString(atoms.Name("genre")) +} + +func (m metadataMP4) Year() int { + date := m.getString(atoms.Name("year")) + if len(date) >= 4 { + year, _ := strconv.Atoi(date[:4]) + return year + } + return 0 +} + +func (m metadataMP4) Track() (int, int) { + x := m.getInt([]string{"trkn"}) + if n, ok := m.data["trkn_count"]; ok { + return x, n.(int) + } + return x, 0 +} + +func (m metadataMP4) Disc() (int, int) { + x := m.getInt([]string{"disk"}) + if n, ok := m.data["disk_count"]; ok { + return x, n.(int) + } + return x, 0 +} + +func (m metadataMP4) Lyrics() string { + t, ok := m.data["\xa9lyr"] + if !ok { + return "" + } + return t.(string) +} + +func (m metadataMP4) Comment() string { + t, ok := m.data["\xa9cmt"] + if !ok { + return "" + } + return t.(string) +} + +func (m metadataMP4) Picture() *Picture { + v, ok := m.data["covr"] + if !ok { + return nil + } + p, _ := v.(*Picture) + return p +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..3bb74e475998d58fb5dc0b6209635be49f10f196 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/pre_context.md @@ -0,0 +1,378 @@ +# Patch-overlapping Go context before the fix + +## `mp4.go` (changed lines (152, 153, 154)) + +```go +// Copyright 2015, David Howden +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tag + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "strconv" + "strings" +) + +var atomTypes = map[int]string{ + 0: "implicit", // automatic based on atom name + 1: "text", + 13: "jpeg", + 14: "png", + 21: "uint8", +} + +// NB: atoms does not include "----", this is handled separately +var atoms = atomNames(map[string]string{ + "\xa9alb": "album", + "\xa9art": "artist", + "\xa9ART": "artist", + "aART": "album_artist", + "\xa9day": "year", + "\xa9nam": "title", + "\xa9gen": "genre", + "trkn": "track", + "\xa9wrt": "composer", + "\xa9too": "encoder", + "cprt": "copyright", + "covr": "picture", + "\xa9grp": "grouping", + "keyw": "keyword", + "\xa9lyr": "lyrics", + "\xa9cmt": "comment", + "tmpo": "tempo", + "cpil": "compilation", + "disk": "disc", +}) + +// Detect PNG image if "implicit" class is used +var pngHeader = []byte{137, 80, 78, 71, 13, 10, 26, 10} + +type atomNames map[string]string + +func (f atomNames) Name(n string) []string { + res := make([]string, 1) + for k, v := range f { + if v == n { + res = append(res, k) + } + } + return res +} + +// metadataMP4 is the implementation of Metadata for MP4 tag (atom) data. +type metadataMP4 struct { + fileType FileType + data map[string]interface{} +} + +// ReadAtoms reads MP4 metadata atoms from the io.ReadSeeker into a Metadata, returning +// non-nil error if there was a problem. +func ReadAtoms(r io.ReadSeeker) (Metadata, error) { + m := metadataMP4{ + data: make(map[string]interface{}), + fileType: UnknownFileType, + } + err := m.readAtoms(r) + return m, err +} + +func (m metadataMP4) readAtoms(r io.ReadSeeker) error { + for { + name, size, err := readAtomHeader(r) + if err != nil { + if err == io.EOF { + return nil + } + return err + } + + switch name { + case "meta": + // next_item_id (int32) + _, err := readBytes(r, 4) + if err != nil { + return err + } + fallthrough + + case "moov", "udta", "ilst": + return m.readAtoms(r) + } + + _, ok := atoms[name] + var data []string + if name == "----" { + name, data, err = readCustomAtom(r, size) + if err != nil { + return err + } + + if name != "----" { + ok = true + size = 0 // already read data + } + } + + if !ok { + _, err := r.Seek(int64(size-8), io.SeekCurrent) + if err != nil { + return err + } + continue + } + + err = m.readAtomData(r, name, size-8, data) + if err != nil { + return err + } + } +} + +func (m metadataMP4) readAtomData(r io.ReadSeeker, name string, size uint32, processedData []string) error { + var b []byte + var err error + var contentType string + if len(processedData) > 0 { + b = []byte(strings.Join(processedData, ";")) // add delimiter if multiple data fields + contentType = "text" + } else { + // read the data + b, err = readBytes(r, uint(size)) + if err != nil { + return err + } + if len(b) < 8 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, got %d", 8, len(b)) + } + + // "data" + size (4 bytes each) + b = b[8:] + + if len(b) < 3 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for class, got %d", 3, len(b)) + } + class := getInt(b[1:4]) + var ok bool + contentType, ok = atomTypes[class] + if !ok { + return fmt.Errorf("invalid content type: %v (%x) (%x)", class, b[1:4], b) + } + + // 4: atom version (1 byte) + atom flags (3 bytes) + // 4: NULL (usually locale indicator) + if len(b) < 8 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for atom version and flags, got %d", 8, len(b)) + } + b = b[8:] + } + + if name == "trkn" || name == "disk" { + if len(b) < 6 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for track and disk numbers, got %d", 6, len(b)) + } + + m.data[name] = int(b[3]) + m.data[name+"_count"] = int(b[5]) + return nil + } + + if contentType == "implicit" { + if name == "covr" { + if bytes.HasPrefix(b, pngHeader) { + contentType = "png" + } + // TODO(dhowden): Detect JPEG formats too (harder). + } + } + + var data interface{} + switch contentType { + case "implicit": + if _, ok := atoms[name]; ok { + return fmt.Errorf("unhandled implicit content type for required atom: %q", name) + } + return nil + + case "text": + data = string(b) + + case "uint8": + if len(b) < 1 { + return fmt.Errorf("invalid encoding: expected at least %d bytes, for integer tag data, got %d", 1, len(b)) + } + data = getInt(b[:1]) + + case "jpeg", "png": + data = &Picture{ + Ext: contentType, + MIMEType: "image/" + contentType, + Data: b, + } + } + m.data[name] = data + + return nil +} + +func readAtomHeader(r io.ReadSeeker) (name string, size uint32, err error) { + err = binary.Read(r, binary.BigEndian, &size) + if err != nil { + return + } + name, err = readString(r, 4) + return +} + +// Generic atom. +// Should have 3 sub atoms : mean, name and data. +// We check that mean is "com.apple.iTunes" and we use the subname as +// the name, and move to the data atom. +// Data atom could have multiple data values, each with a header. +// If anything goes wrong, we jump at the end of the "----" atom. +func readCustomAtom(r io.ReadSeeker, size uint32) (_ string, data []string, _ error) { + subNames := make(map[string]string) + + for size > 8 { + subName, subSize, err := readAtomHeader(r) + if err != nil { + return "", nil, err + } + + // Remove the size of the atom from the size counter + if size >= subSize { + size -= subSize + } else { + return "", nil, errors.New("--- invalid size") + } + + b, err := readBytes(r, uint(subSize-8)) + if err != nil { + return "", nil, err + } + + if len(b) < 4 { + return "", nil, fmt.Errorf("invalid encoding: expected at least %d bytes, got %d", 4, len(b)) + } + switch subName { + case "mean", "name": + subNames[subName] = string(b[4:]) + case "data": + data = append(data, string(b[4:])) + } + } + + // there should remain only the header size + if size != 8 { + err := errors.New("---- atom out of bounds") + return "", nil, err + } + + if subNames["mean"] != "com.apple.iTunes" || subNames["name"] == "" || len(data) == 0 { + return "----", nil, nil + } + return subNames["name"], data, nil +} + +func (metadataMP4) Format() Format { return MP4 } +func (m metadataMP4) FileType() FileType { return m.fileType } + +func (m metadataMP4) Raw() map[string]interface{} { return m.data } + +func (m metadataMP4) getString(n []string) string { + for _, k := range n { + if x, ok := m.data[k]; ok { + return x.(string) + } + } + return "" +} + +func (m metadataMP4) getInt(n []string) int { + for _, k := range n { + if x, ok := m.data[k]; ok { + return x.(int) + } + } + return 0 +} + +func (m metadataMP4) Title() string { + return m.getString(atoms.Name("title")) +} + +func (m metadataMP4) Artist() string { + return m.getString(atoms.Name("artist")) +} + +func (m metadataMP4) Album() string { + return m.getString(atoms.Name("album")) +} + +func (m metadataMP4) AlbumArtist() string { + return m.getString(atoms.Name("album_artist")) +} + +func (m metadataMP4) Composer() string { + return m.getString(atoms.Name("composer")) +} + +func (m metadataMP4) Genre() string { + return m.getString(atoms.Name("genre")) +} + +func (m metadataMP4) Year() int { + date := m.getString(atoms.Name("year")) + if len(date) >= 4 { + year, _ := strconv.Atoi(date[:4]) + return year + } + return 0 +} + +func (m metadataMP4) Track() (int, int) { + x := m.getInt([]string{"trkn"}) + if n, ok := m.data["trkn_count"]; ok { + return x, n.(int) + } + return x, 0 +} + +func (m metadataMP4) Disc() (int, int) { + x := m.getInt([]string{"disk"}) + if n, ok := m.data["disk_count"]; ok { + return x, n.(int) + } + return x, 0 +} + +func (m metadataMP4) Lyrics() string { + t, ok := m.data["\xa9lyr"] + if !ok { + return "" + } + return t.(string) +} + +func (m metadataMP4) Comment() string { + t, ok := m.data["\xa9cmt"] + if !ok { + return "" + } + return t.(string) +} + +func (m metadataMP4) Picture() *Picture { + v, ok := m.data["covr"] + if !ok { + return nil + } + p, _ := v.(*Picture) + return p +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f9ba92024ff78803ae4fdaa0ea9f8e3d666dd9b1 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-096cbfbd1d27f9ce86fb", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-096cbfbd1d27f9ce86fb", + "project_id": "morefixes__dhowden__tag", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "mp4.go" + ], + "patch_units": { + "before": [ + "mp4.go" + ], + "after": [ + "mp4.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/391a1c81d692310e5ae3636a97b2879393733e65f81685f511f30da49159f9b9/database", + "cache_key": "391a1c81d692310e5ae3636a97b2879393733e65f81685f511f30da49159f9b9", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/fc2da4211ada3581bfb0f77ccd391196020c61b65d2c26538b9a6f38c2000f4d/database", + "cache_key": "fc2da4211ada3581bfb0f77ccd391196020c61b65d2c26538b9a6f38c2000f4d", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/5034c6be0a7fca193c94d67f77de78677ea27023f2dc08ce50008c3e40174168/database", + "cache_key": "5034c6be0a7fca193c94d67f77de78677ea27023f2dc08ce50008c3e40174168", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-096cbfbd1d27f9ce86fb/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-096cbfbd1d27f9ce86fb/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-096cbfbd1d27f9ce86fb/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..b46320ea108de04b4ac0c193deaab02c02acefd9 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/patch.diff @@ -0,0 +1,161 @@ +diff --git a/runner/server.go b/runner/server.go +index 5a5db655..676ef756 100644 +--- a/runner/server.go ++++ b/runner/server.go +@@ -170,6 +170,18 @@ func (r *TerraformRunnerServer) ProcessCliConfig(ctx context.Context, req *Proce + return &ProcessCliConfigReply{FilePath: tfrcFilepath}, nil + } + ++// initLogger sets up the logger for the terraform runner ++func (r *TerraformRunnerServer) initLogger(log logr.Logger) { ++ disableTestLogging := os.Getenv("DISABLE_TF_LOGS") == "1" ++ if !disableTestLogging { ++ r.tf.SetStdout(os.Stdout) ++ r.tf.SetStderr(os.Stderr) ++ if os.Getenv("ENABLE_SENSITIVE_TF_LOGS") == "1" { ++ r.tf.SetLogger(&LocalPrintfer{logger: log}) ++ } ++ } ++} ++ + func (r *TerraformRunnerServer) NewTerraform(ctx context.Context, req *NewTerraformRequest) (*NewTerraformReply, error) { + r.InstanceID = req.GetInstanceID() + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) +@@ -191,14 +203,8 @@ func (r *TerraformRunnerServer) NewTerraform(ctx context.Context, req *NewTerraf + // cache the Terraform resource when initializing + r.terraform = &terraform + +- disableTestLogging := os.Getenv("DISABLE_TF_LOGS") == "1" +- if !disableTestLogging { +- r.tf.SetStdout(os.Stdout) +- r.tf.SetStderr(os.Stderr) +- if os.Getenv("ENABLE_SENSITIVE_TF_LOGS") == "1" { +- r.tf.SetLogger(&LocalPrintfer{logger: log}) +- } +- } ++ // init default logger ++ r.initLogger(log) + + return &NewTerraformReply{Id: r.InstanceID}, nil + } +diff --git a/runner/server_plan.go b/runner/server_plan.go +index 46e0e701..0012ecaa 100644 +--- a/runner/server_plan.go ++++ b/runner/server_plan.go +@@ -4,12 +4,40 @@ import ( + "context" + "errors" + "fmt" ++ "io" ++ + "github.com/hashicorp/terraform-exec/tfexec" ++ tfjson "github.com/hashicorp/terraform-json" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "sigs.k8s.io/controller-runtime" ++ ctrl "sigs.k8s.io/controller-runtime" + ) + ++func (r *TerraformRunnerServer) tfShowPlanFile(ctx context.Context, planPath string, opts ...tfexec.ShowOption) (*tfjson.Plan, error) { ++ log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) ++ ++ // This is the only place where we disable the logger ++ r.tf.SetStdout(io.Discard) ++ r.tf.SetStderr(io.Discard) ++ ++ defer r.initLogger(log) ++ ++ return r.tf.ShowPlanFile(ctx, planPath, opts...) ++} ++ ++func (r *TerraformRunnerServer) tfShowPlanFileRaw(ctx context.Context, planPath string, opts ...tfexec.ShowOption) (string, error) { ++ log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) ++ ++ // This is the only place where we disable the logger ++ r.tf.SetStdout(io.Discard) ++ r.tf.SetStderr(io.Discard) ++ ++ defer r.initLogger(log) ++ ++ return r.tf.ShowPlanFileRaw(ctx, planPath, opts...) ++} ++ + func (r *TerraformRunnerServer) Plan(ctx context.Context, req *PlanRequest) (*PlanReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating a plan") +@@ -68,7 +96,8 @@ func (r *TerraformRunnerServer) Plan(ctx context.Context, req *PlanRequest) (*Pl + planCreated := false + if req.Out != "" { + planCreated = true +- plan, err := r.tf.ShowPlanFile(ctx, req.Out) ++ ++ plan, err := r.tfShowPlanFile(ctx, req.Out) + if err != nil { + return nil, err + } +@@ -81,6 +110,7 @@ func (r *TerraformRunnerServer) Plan(ctx context.Context, req *PlanRequest) (*Pl + plan.OutputChanges == nil { + planCreated = false + } ++ + } + + return &PlanReply{Message: "ok", Drifted: drifted, PlanCreated: planCreated}, nil +diff --git a/runner/server_save_tfplan.go b/runner/server_save_tfplan.go +index 3951596b..dfd95bbf 100644 +--- a/runner/server_save_tfplan.go ++++ b/runner/server_save_tfplan.go +@@ -15,11 +15,11 @@ import ( + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +- "sigs.k8s.io/controller-runtime" ++ ctrl "sigs.k8s.io/controller-runtime" + ) + + func (r *TerraformRunnerServer) SaveTFPlan(ctx context.Context, req *SaveTFPlanRequest) (*SaveTFPlanReply, error) { +- log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) ++ log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("save the plan") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") +@@ -47,7 +47,7 @@ func (r *TerraformRunnerServer) SaveTFPlan(ctx context.Context, req *SaveTFPlanR + } + + if r.terraform.Spec.StoreReadablePlan == "json" { +- planObj, err := r.tf.ShowPlanFile(ctx, TFPlanName) ++ planObj, err := r.tfShowPlanFile(ctx, TFPlanName) + if err != nil { + log.Error(err, "unable to get the plan output for json") + return nil, err +@@ -63,7 +63,7 @@ func (r *TerraformRunnerServer) SaveTFPlan(ctx context.Context, req *SaveTFPlanR + } + + } else if r.terraform.Spec.StoreReadablePlan == "human" { +- rawOutput, err := r.tf.ShowPlanFileRaw(ctx, TFPlanName) ++ rawOutput, err := r.tfShowPlanFileRaw(ctx, TFPlanName) + if err != nil { + log.Error(err, "unable to get the plan output for human") + return nil, err +diff --git a/runner/server_show_plan.go b/runner/server_show_plan.go +index b7d64fc8..532e3d95 100644 +--- a/runner/server_show_plan.go ++++ b/runner/server_show_plan.go +@@ -16,7 +16,7 @@ func (r *TerraformRunnerServer) ShowPlanFileRaw(ctx context.Context, req *ShowPl + return nil, err + } + +- rawOutput, err := r.tf.ShowPlanFileRaw(ctx, req.Filename) ++ rawOutput, err := r.tfShowPlanFileRaw(ctx, req.Filename) + if err != nil { + log.Error(err, "unable to get the raw plan output") + return nil, err +@@ -34,7 +34,7 @@ func (r *TerraformRunnerServer) ShowPlanFile(ctx context.Context, req *ShowPlanF + return nil, err + } + +- plan, err := r.tf.ShowPlanFile(ctx, req.Filename) ++ plan, err := r.tfShowPlanFile(ctx, req.Filename) + if err != nil { + log.Error(err, "unable to get the json plan output") + return nil, err diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..9549b91d1cfd2a8522de867787ef215f58f23337 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/post_context.md @@ -0,0 +1,1034 @@ +# Patch-overlapping Go context after the fix + +## `runner/server.go` (changed lines (173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 206, 207)) + +```go +package runner + +import ( + "bytes" + "context" + "errors" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + + securejoin "github.com/cyphar/filepath-securejoin" + "github.com/fluxcd/pkg/untar" + "github.com/go-logr/logr" + "github.com/hashicorp/terraform-exec/tfexec" + tfjson "github.com/hashicorp/terraform-json" + infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + "github.com/weaveworks/tf-controller/utils" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + TFPlanName = "tfplan" + SavedPlanSecretAnnotation = "savedPlan" + runnerFileMappingLocationHome = "home" + runnerFileMappingLocationWorkspace = "workspace" + runnerFileMappingDirectoryPermissions = 0700 + runnerFileMappingFilePermissions = 0600 + HomePath = "/home/runner" +) + +type LocalPrintfer struct { + logger logr.Logger +} + +func (l LocalPrintfer) Printf(format string, v ...interface{}) { + l.logger.Info(fmt.Sprintf(format, v...)) +} + +type TerraformRunnerServer struct { + UnimplementedRunnerServer + tf *tfexec.Terraform + client.Client + Scheme *runtime.Scheme + Done chan os.Signal + terraform *infrav1.Terraform + InstanceID string +} + +const loggerName = "runner.terraform" + +func (r *TerraformRunnerServer) LookPath(ctx context.Context, req *LookPathRequest) (*LookPathReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("looking for path", "file", req.File) + execPath, err := exec.LookPath(req.File) + if err != nil { + log.Error(err, "unable to look for path", "file", req.File) + return nil, err + } + return &LookPathReply{ExecPath: execPath}, nil +} + +func (r *TerraformRunnerServer) UploadAndExtract(ctx context.Context, req *UploadAndExtractRequest) (*UploadAndExtractReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("preparing for Upload and Extraction") + tmpDir, err := securejoin.SecureJoin(os.TempDir(), fmt.Sprintf("%s-%s", req.Namespace, req.Name)) + if err != nil { + log.Error(err, "unable to join securely", "tmpDir", os.TempDir(), "namespace", req.Namespace, "name", req.Name) + return nil, err + } + + buf := bytes.NewBuffer(req.TarGz) + if _, err = untar.Untar(buf, tmpDir); err != nil { + log.Error(err, "unable to extract tar file", "namespace", req.Namespace, "name", req.Name) + return nil, fmt.Errorf("failed to untar artifact, error: %w", err) + } + + dirPath, err := securejoin.SecureJoin(tmpDir, req.Path) + if err != nil { + log.Error(err, "unable to join securely", "tmpDir", tmpDir, "path", req.Path) + return nil, err + } + + if _, err := os.Stat(dirPath); err != nil { + log.Error(err, "path not found", "dirPath", dirPath) + err = fmt.Errorf("terraform path not found: %w", err) + return nil, err + } + + return &UploadAndExtractReply{WorkingDir: dirPath, TmpDir: tmpDir}, nil +} + +func (r *TerraformRunnerServer) CleanupDir(ctx context.Context, req *CleanupDirRequest) (*CleanupDirReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("cleanup TmpDir", "tmpDir", req.TmpDir) + err := os.RemoveAll(req.TmpDir) + if err != nil { + log.Error(err, "error cleaning up TmpDir", "tmpDir", req.TmpDir) + return nil, err + } + + return &CleanupDirReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) WriteBackendConfig(ctx context.Context, req *WriteBackendConfigRequest) (*WriteBackendConfigReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + const backendConfigPath = "backend_override.tf" + log.Info("write backend config", "path", req.DirPath, "config", backendConfigPath) + filePath, err := securejoin.SecureJoin(req.DirPath, backendConfigPath) + if err != nil { + log.Error(err, "unable to join securely", "dirPath", req.DirPath, "config", backendConfigPath) + return nil, err + } + + log.Info("write config to file", "filePath", filePath) + err = os.WriteFile(filePath, req.BackendConfig, 0644) + if err != nil { + log.Error(err, "unable to write file", "filePath", filePath) + return nil, err + } + + return &WriteBackendConfigReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) ProcessCliConfig(ctx context.Context, req *ProcessCliConfigRequest) (*ProcessCliConfigReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("processing configuration", "namespace", req.Namespace, "name", req.Name) + cliConfigKey := types.NamespacedName{Namespace: req.Namespace, Name: req.Name} + var cliConfig corev1.Secret + if err := r.Get(ctx, cliConfigKey, &cliConfig); err != nil { + log.Error(err, "unable to get secret", "namespace", req.Namespace, "name", req.Name) + return nil, err + } + + if len(cliConfig.Data) != 1 { + err := fmt.Errorf("expect the secret to contain 1 data") + log.Error(err, "secret missing data", "namespace", req.Namespace, "name", req.Name) + return nil, err + } + + var tfrcFilepath string + for tfrcFilename, v := range cliConfig.Data { + if strings.HasSuffix(tfrcFilename, ".tfrc") { + var err error + tfrcFilepath, err = securejoin.SecureJoin(req.DirPath, tfrcFilename) + if err != nil { + log.Error(err, "secure join error", "dirPath", req.DirPath, "tfrcFilename", tfrcFilename) + return nil, err + } + err = os.WriteFile(tfrcFilepath, v, 0644) + if err != nil { + log.Error(err, "write file error", "tfrcFilename", tfrcFilename, "fileMode", "0644") + return nil, err + } + } else { + err := fmt.Errorf("expect the secret key to end with .tfrc") + log.Error(err, "file extension error", "tfrcFilename", tfrcFilename) + return nil, err + } + } + return &ProcessCliConfigReply{FilePath: tfrcFilepath}, nil +} + +// initLogger sets up the logger for the terraform runner +func (r *TerraformRunnerServer) initLogger(log logr.Logger) { + disableTestLogging := os.Getenv("DISABLE_TF_LOGS") == "1" + if !disableTestLogging { + r.tf.SetStdout(os.Stdout) + r.tf.SetStderr(os.Stderr) + if os.Getenv("ENABLE_SENSITIVE_TF_LOGS") == "1" { + r.tf.SetLogger(&LocalPrintfer{logger: log}) + } + } +} + +func (r *TerraformRunnerServer) NewTerraform(ctx context.Context, req *NewTerraformRequest) (*NewTerraformReply, error) { + r.InstanceID = req.GetInstanceID() + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating new terraform", "workingDir", req.WorkingDir, "execPath", req.ExecPath) + tf, err := tfexec.NewTerraform(req.WorkingDir, req.ExecPath) + if err != nil { + log.Error(err, "unable to create new terraform", "workingDir", req.WorkingDir, "execPath", req.ExecPath) + return nil, err + } + + // hold only 1 instance + r.tf = tf + + var terraform infrav1.Terraform + if err := terraform.FromBytes(req.Terraform, r.Scheme); err != nil { + log.Error(err, "there was a problem getting the terraform resource") + return nil, err + } + // cache the Terraform resource when initializing + r.terraform = &terraform + + // init default logger + r.initLogger(log) + + return &NewTerraformReply{Id: r.InstanceID}, nil +} + +func (r *TerraformRunnerServer) SetEnv(ctx context.Context, req *SetEnvRequest) (*SetEnvReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("setting envvars") + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + log.Info("getting envvars from os environments") + envs := utils.EnvMap(os.Environ()) + for k, v := range req.Envs { + envs[k] = v + } + err := r.tf.SetEnv(envs) + if err != nil { + log.Error(err, "unable to set envvars", "envvars", envs) + return nil, err + } + + return &SetEnvReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) CreateFileMappings(ctx context.Context, req *CreateFileMappingsRequest) (*CreateFileMappingsReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating file mappings") + + for _, fileMapping := range req.FileMappings { + var fileFullPath string + var err error + switch fileMapping.Location { + case runnerFileMappingLocationHome: + fileFullPath, err = securejoin.SecureJoin(HomePath, fileMapping.Path) + if err != nil { + log.Error(err, "insecure file path", "path", fileMapping.Path) + return nil, err + } + case runnerFileMappingLocationWorkspace: + fileFullPath, err = securejoin.SecureJoin(req.WorkingDir, fileMapping.Path) + if err != nil { + log.Error(err, "insecure file path", "path", fileMapping.Path) + return nil, err + } + default: + err := fmt.Errorf("unknown file mapping location") + log.Error(err, "unknown file mapping location", "location", fileMapping.Location) + return nil, err + } + + log.Info("prepare to write file", "fileFullPath", fileFullPath) + dir := filepath.Dir(fileFullPath) + if _, err := os.Stat(dir); os.IsNotExist(err) { + // create dir + err := os.MkdirAll(dir, runnerFileMappingDirectoryPermissions) + if err != nil { + log.Error(err, "unable to create dir", "dir", dir) + return nil, err + } + } + + if err := os.WriteFile(fileFullPath, fileMapping.Content, runnerFileMappingFilePermissions); err != nil { + log.Error(err, "Unable to create file from file mapping", "file", fileFullPath) + return nil, err + } + } + + return &CreateFileMappingsReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) Init(ctx context.Context, req *InitRequest) (*InitReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("initializing") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + terraform := r.terraform + + log.Info("mapping the Spec.BackendConfigsFrom") + backendConfigsOpts := []tfexec.InitOption{} + for _, bf := range terraform.Spec.BackendConfigsFrom { + objectKey := types.NamespacedName{ + Namespace: terraform.Namespace, + Name: bf.Name, + } + if bf.Kind == "Secret" { + var s corev1.Secret + err := r.Get(ctx, objectKey, &s) + if err != nil && bf.Optional == false { + log.Error(err, "unable to get object key", "objectKey", objectKey, "secret", s.ObjectMeta.Name) + return nil, err + } + // if VarsKeys is null, use all + if bf.Keys == nil { + for key, val := range s.Data { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(val))) + } + } else { + for _, key := range bf.Keys { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(s.Data[key]))) + } + } + } else if bf.Kind == "ConfigMap" { + var cm corev1.ConfigMap + err := r.Get(ctx, objectKey, &cm) + if err != nil && bf.Optional == false { + log.Error(err, "unable to get object key", "objectKey", objectKey, "configmap", cm.ObjectMeta.Name) + return nil, err + } + + // if Keys is null, use all + if bf.Keys == nil { + for key, val := range cm.Data { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+val)) + } + for key, val := range cm.BinaryData { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(val))) + } + } else { + for _, key := range bf.Keys { + if val, ok := cm.Data[key]; ok { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+val)) + } + if val, ok := cm.BinaryData[key]; ok { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(val))) + } + } + } + } + } + + initOpts := []tfexec.InitOption{tfexec.Upgrade(req.Upgrade), tfexec.ForceCopy(req.ForceCopy)} + initOpts = append(initOpts, backendConfigsOpts...) + if err := r.tf.Init(ctx, initOpts...); err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&InitReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "unable to initialize") + return nil, st.Err() + } + + return &InitReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) SelectWorkspace(ctx context.Context, req *WorkspaceRequest) (*WorkspaceReply, error) { + log := ctrl.LoggerFrom(ctx).WithName(loggerName) + log.Info("workspace select") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + terraform := r.terraform + + if terraform.WorkspaceName() != infrav1.DefaultWorkspaceName { + wsOpts := []tfexec.WorkspaceNewCmdOption{} + ws := terraform.Spec.Workspace + if err := r.tf.WorkspaceNew(ctx, ws, wsOpts...); err != nil { + log.Info(fmt.Sprintf("workspace new:, %s", err.Error())) + } + if err := r.tf.WorkspaceSelect(ctx, ws); err != nil { + err := fmt.Errorf("failed to select workspace %s", ws) + log.Error(err, "workspace select error") + return nil, err + } + } + + return &WorkspaceReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) LoadTFPlan(ctx context.Context, req *LoadTFPlanRequest) (*LoadTFPlanReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("loading plan from secret") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + tfplanSecretKey := types.NamespacedName{Namespace: req.Namespace, Name: "tfplan-" + r.terraform.WorkspaceName() + "-" + req.Name} + tfplanSecret := corev1.Secret{} + err := r.Get(ctx, tfplanSecretKey, &tfplanSecret) + if err != nil { + err = fmt.Errorf("error getting plan secret: %s", err) + log.Error(err, "unable to get secret") + return nil, err + } + + if tfplanSecret.Annotations[SavedPlanSecretAnnotation] != req.PendingPlan { + err = fmt.Errorf("error pending plan and plan's name in the secret are not matched: %s != %s", + req.PendingPlan, + tfplanSecret.Annotations[SavedPlanSecretAnnotation]) + log.Error(err, "plan name mismatch") + return nil, err + } + + if req.BackendCompletelyDisable { + // do nothing + } else { + tfplan := tfplanSecret.Data[TFPlanName] + tfplan, err = utils.GzipDecode(tfplan) + if err != nil { + log.Error(err, "unable to decode the plan") + return nil, err + } + err = ioutil.WriteFile(filepath.Join(r.tf.WorkingDir(), TFPlanName), tfplan, 0644) + if err != nil { + err = fmt.Errorf("error saving plan file to disk: %s", err) + log.Error(err, "unable to write the plan to disk") + return nil, err + } + } + + return &LoadTFPlanReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) Destroy(ctx context.Context, req *DestroyRequest) (*DestroyReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("running destroy") + ctx, cancel := context.WithCancel(ctx) + go func() { + select { + case <-r.Done: + cancel() + case <-ctx.Done(): + } + }() + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var destroyOpt []tfexec.DestroyOption + for _, target := range req.Targets { + destroyOpt = append(destroyOpt, tfexec.Target(target)) + } + + if err := r.tf.Destroy(ctx, destroyOpt...); err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&DestroyReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "unable to destroy") + return nil, st.Err() + } + + return &DestroyReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) Apply(ctx context.Context, req *ApplyRequest) (*ApplyReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("running apply") + ctx, cancel := context.WithCancel(ctx) + go func() { + select { + case <-r.Done: + cancel() + case <-ctx.Done(): + } + }() + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var applyOpt []tfexec.ApplyOption + if req.DirOrPlan != "" { + applyOpt = []tfexec.ApplyOption{tfexec.DirOrPlan(req.DirOrPlan)} + } + + if req.RefreshBeforeApply { + applyOpt = []tfexec.ApplyOption{tfexec.Refresh(true)} + } + + for _, target := range req.Targets { + applyOpt = append(applyOpt, tfexec.Target(target)) + } + + if req.Parallelism > 0 { + applyOpt = append(applyOpt, tfexec.Parallelism(int(req.Parallelism))) + } + + if err := r.tf.Apply(ctx, applyOpt...); err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&ApplyReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "unable to apply plan") + return nil, st.Err() + } + + return &ApplyReply{Message: "ok"}, nil +} + +func getInventoryFromTerraformModule(m *tfjson.StateModule) []*Inventory { + var result []*Inventory + for _, r := range m.Resources { + var id string + // TODO ARN is AWS-specific. Will need to support other cloud identifiers in the future. + if val, ok := r.AttributeValues["arn"]; ok { + id = val.(string) + } else if val, ok := r.AttributeValues["id"]; ok { + id = val.(string) + } + result = append(result, &Inventory{ + Name: r.Name, + Type: r.Type, + Identifier: id, + }) + } + + // recursively get all resources from submodules + for _, childModule := range m.ChildModules { + childInventory := getInventoryFromTerraformModule(childModule) + result = append(result, childInventory...) + } + + return result +} + +func (r *TerraformRunnerServer) GetInventory(ctx context.Context, req *GetInventoryRequest) (*GetInventoryReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("get inventory") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "get inventory: no terraform") + return nil, err + } + state, err := r.tf.Show(ctx) + if err != nil { + log.Error(err, "get inventory: unable to get state via show command") + return nil, err + } + + // state contains no values after resource destruction for example + if state.Values == nil { + log.Info("get inventory: state values is nil") + return &GetInventoryReply{Inventories: []*Inventory{}}, nil + } + + if state.Values.RootModule == nil { + log.Info("get inventory: root module is nil") + return &GetInventoryReply{Inventories: []*Inventory{}}, nil + } + + return &GetInventoryReply{Inventories: getInventoryFromTerraformModule(state.Values.RootModule)}, nil +} + +func (r *TerraformRunnerServer) FinalizeSecrets(ctx context.Context, req *FinalizeSecretsRequest) (*FinalizeSecretsReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("finalize the output secrets") + // nil dereference bug here + planObjectKey := types.NamespacedName{Namespace: req.Namespace, Name: "tfplan-" + req.Workspace + "-" + req.Name} + var planSecret corev1.Secret + if err := r.Client.Get(ctx, planObjectKey, &planSecret); err == nil { + if err := r.Client.Delete(ctx, &planSecret); err != nil { + // transient failure + log.Error(err, "unable to delete the plan secret") + return nil, status.Error(codes.Internal, err.Error()) + } + } else if apierrors.IsNotFound(err) { + log.Error(err, "plan secret not found") + return nil, status.Error(codes.NotFound, err.Error()) + } else { + // transient failure + log.Error(err, "unable to get the plan secret") + return nil, status.Error(codes.Internal, err.Error()) + } + + if req.HasSpecifiedOutputSecret { + outputsObjectKey := types.NamespacedName{Namespace: req.Namespace, Name: req.OutputSecretName} + var outputsSecret corev1.Secret + if err := r.Client.Get(ctx, outputsObjectKey, &outputsSecret); err == nil { + if err := r.Client.Delete(ctx, &outputsSecret); err != nil { + // transient failure + log.Error(err, "unable to delete the output secret") + return nil, status.Error(codes.Internal, err.Error()) + } + } else if apierrors.IsNotFound(err) { + log.Error(err, "output secret not found") + return nil, status.Error(codes.NotFound, err.Error()) + } else { + // transient failure + log.Error(err, "unable to get the output secret") + return nil, status.Error(codes.Internal, err.Error()) + } + } + + return &FinalizeSecretsReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) ForceUnlock(ctx context.Context, req *ForceUnlockRequest) (*ForceUnlockReply, error) { + reply := &ForceUnlockReply{ + Success: true, + Message: fmt.Sprintf("Successfully unlocked state with lock identifier: %s", req.GetLockIdentifier()), + } + err := r.tf.ForceUnlock(ctx, req.LockIdentifier) + + if err != nil { + reply.Success = false + reply.Message = fmt.Sprintf("Error unlocking the state: %s", err) + } + + return reply, err +} +``` + +## `runner/server_plan.go` (changed lines (7, 8, 10, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 99, 100, 113)) + +```go +package runner + +import ( + "context" + "errors" + "fmt" + "io" + + "github.com/hashicorp/terraform-exec/tfexec" + tfjson "github.com/hashicorp/terraform-json" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "sigs.k8s.io/controller-runtime" + ctrl "sigs.k8s.io/controller-runtime" +) + +func (r *TerraformRunnerServer) tfShowPlanFile(ctx context.Context, planPath string, opts ...tfexec.ShowOption) (*tfjson.Plan, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + + // This is the only place where we disable the logger + r.tf.SetStdout(io.Discard) + r.tf.SetStderr(io.Discard) + + defer r.initLogger(log) + + return r.tf.ShowPlanFile(ctx, planPath, opts...) +} + +func (r *TerraformRunnerServer) tfShowPlanFileRaw(ctx context.Context, planPath string, opts ...tfexec.ShowOption) (string, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + + // This is the only place where we disable the logger + r.tf.SetStdout(io.Discard) + r.tf.SetStderr(io.Discard) + + defer r.initLogger(log) + + return r.tf.ShowPlanFileRaw(ctx, planPath, opts...) +} + +func (r *TerraformRunnerServer) Plan(ctx context.Context, req *PlanRequest) (*PlanReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating a plan") + ctx, cancel := context.WithCancel(ctx) + go func() { + select { + case <-r.Done: + cancel() + case <-ctx.Done(): + } + }() + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var planOpt []tfexec.PlanOption + if req.Out != "" { + planOpt = append(planOpt, tfexec.Out(req.Out)) + } else { + // if backend is disabled completely, there will be no plan output file (req.Out = "") + log.Info("backend seems to be disabled completely, so there will be no plan output file") + } + + if req.Refresh == false { + planOpt = append(planOpt, tfexec.Refresh(req.Refresh)) + } + + if req.Destroy { + planOpt = append(planOpt, tfexec.Destroy(req.Destroy)) + } + + for _, target := range req.Targets { + planOpt = append(planOpt, tfexec.Target(target)) + } + + drifted, err := r.tf.Plan(ctx, planOpt...) + if err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&PlanReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "error creating the plan") + return nil, st.Err() + } + + planCreated := false + if req.Out != "" { + planCreated = true + + plan, err := r.tfShowPlanFile(ctx, req.Out) + if err != nil { + return nil, err + } + + // This is the case when the plan is empty. + if plan.PlannedValues.Outputs == nil && + plan.PlannedValues.RootModule.Resources == nil && + plan.ResourceChanges == nil && + plan.PriorState == nil && + plan.OutputChanges == nil { + planCreated = false + } + + } + + return &PlanReply{Message: "ok", Drifted: drifted, PlanCreated: planCreated}, nil +} +``` + +## `runner/server_save_tfplan.go` (changed lines (18, 22, 50, 66)) + +```go +package runner + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "path/filepath" + "strings" + + "github.com/go-logr/logr" + infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + "github.com/weaveworks/tf-controller/utils" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" +) + +func (r *TerraformRunnerServer) SaveTFPlan(ctx context.Context, req *SaveTFPlanRequest) (*SaveTFPlanReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("save the plan") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var tfplan []byte + if req.BackendCompletelyDisable { + tfplan = []byte("dummy plan") + } else { + var err error + tfplan, err = ioutil.ReadFile(filepath.Join(r.tf.WorkingDir(), TFPlanName)) + if err != nil { + err = fmt.Errorf("error reading plan file: %s", err) + log.Error(err, "unable to complete SaveTFPlan function") + return nil, err + } + } + + planRev := strings.Replace(req.Revision, "/", "-", 1) + planName := "plan-" + planRev + if err := r.writePlanAsSecret(ctx, req.Name, req.Namespace, log, planName, tfplan, "", req.Uuid); err != nil { + return nil, err + } + + if r.terraform.Spec.StoreReadablePlan == "json" { + planObj, err := r.tfShowPlanFile(ctx, TFPlanName) + if err != nil { + log.Error(err, "unable to get the plan output for json") + return nil, err + } + jsonBytes, err := json.Marshal(planObj) + if err != nil { + log.Error(err, "unable to marshal the plan to json") + return nil, err + } + + if err := r.writePlanAsSecret(ctx, req.Name, req.Namespace, log, planName, jsonBytes, ".json", req.Uuid); err != nil { + return nil, err + } + + } else if r.terraform.Spec.StoreReadablePlan == "human" { + rawOutput, err := r.tfShowPlanFileRaw(ctx, TFPlanName) + if err != nil { + log.Error(err, "unable to get the plan output for human") + return nil, err + } + + if err := r.writePlanAsConfigMap(ctx, req.Name, req.Namespace, log, planName, rawOutput, "", req.Uuid); err != nil { + return nil, err + } + } + + return &SaveTFPlanReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) writePlanAsSecret(ctx context.Context, name string, namespace string, log logr.Logger, planName string, tfplan []byte, suffix string, uuid string) error { + secretName := "tfplan-" + r.terraform.WorkspaceName() + "-" + name + suffix + tfplanObjectKey := types.NamespacedName{Name: secretName, Namespace: namespace} + var tfplanSecret v1.Secret + tfplanSecretExists := true + + if err := r.Client.Get(ctx, tfplanObjectKey, &tfplanSecret); err != nil { + if errors.IsNotFound(err) { + tfplanSecretExists = false + } else { + err = fmt.Errorf("error getting tfplanSecret: %s", err) + log.Error(err, "unable to get the plan secret") + return err + } + } + + if tfplanSecretExists { + if err := r.Client.Delete(ctx, &tfplanSecret); err != nil { + err = fmt.Errorf("error deleting tfplanSecret: %s", err) + log.Error(err, "unable to delete the plan secret") + return err + } + } + + tfplan, err := utils.GzipEncode(tfplan) + if err != nil { + log.Error(err, "unable to encode the plan revision", "planName", planName) + return err + } + + tfplanData := map[string][]byte{TFPlanName: tfplan} + tfplanSecret = v1.Secret{ + TypeMeta: metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: secretName, + Namespace: namespace, + Annotations: map[string]string{ + "encoding": "gzip", + SavedPlanSecretAnnotation: planName, + }, + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: infrav1.GroupVersion.Group + "/" + infrav1.GroupVersion.Version, + Kind: infrav1.TerraformKind, + Name: name, + UID: types.UID(uuid), + }, + }, + }, + Type: v1.SecretTypeOpaque, + Data: tfplanData, + } + + if err := r.Client.Create(ctx, &tfplanSecret); err != nil { + err = fmt.Errorf("error recording plan status: %s", err) + log.Error(err, "unable to create plan secret") + return err + } + + return nil +} + +func (r *TerraformRunnerServer) writePlanAsConfigMap(ctx context.Context, name string, namespace string, log logr.Logger, planName string, tfplan string, suffix string, uuid string) error { + configMapName := "tfplan-" + r.terraform.WorkspaceName() + "-" + name + suffix + tfplanObjectKey := types.NamespacedName{Name: configMapName, Namespace: namespace} + var tfplanCM v1.ConfigMap + tfplanCMExists := true + + if err := r.Client.Get(ctx, tfplanObjectKey, &tfplanCM); err != nil { + if errors.IsNotFound(err) { + tfplanCMExists = false + } else { + err = fmt.Errorf("error getting tfplanSecret: %s", err) + log.Error(err, "unable to get the plan configmap") + return err + } + } + + if tfplanCMExists { + if err := r.Client.Delete(ctx, &tfplanCM); err != nil { + err = fmt.Errorf("error deleting tfplanSecret: %s", err) + log.Error(err, "unable to delete the plan configmap") + return err + } + } + + tfplanData := map[string]string{TFPlanName: tfplan} + tfplanCM = v1.ConfigMap{ + TypeMeta: metav1.TypeMeta{ + Kind: "ConfigMap", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: configMapName, + Namespace: namespace, + Annotations: map[string]string{ + SavedPlanSecretAnnotation: planName, + }, + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: infrav1.GroupVersion.Group + "/" + infrav1.GroupVersion.Version, + Kind: infrav1.TerraformKind, + Name: name, + UID: types.UID(uuid), + }, + }, + }, + Data: tfplanData, + } + + if err := r.Client.Create(ctx, &tfplanCM); err != nil { + err = fmt.Errorf("error recording plan status: %s", err) + log.Error(err, "unable to create plan configmap") + return err + } + + return nil +} +``` + +## `runner/server_show_plan.go` (changed lines (19, 37)) + +```go +package runner + +import ( + "context" + "encoding/json" + "fmt" + "sigs.k8s.io/controller-runtime" +) + +func (r *TerraformRunnerServer) ShowPlanFileRaw(ctx context.Context, req *ShowPlanFileRawRequest) (*ShowPlanFileRawReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("show the raw plan file") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + rawOutput, err := r.tfShowPlanFileRaw(ctx, req.Filename) + if err != nil { + log.Error(err, "unable to get the raw plan output") + return nil, err + } + + return &ShowPlanFileRawReply{RawOutput: rawOutput}, nil +} + +func (r *TerraformRunnerServer) ShowPlanFile(ctx context.Context, req *ShowPlanFileRequest) (*ShowPlanFileReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("show the raw plan file") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + plan, err := r.tfShowPlanFile(ctx, req.Filename) + if err != nil { + log.Error(err, "unable to get the json plan output") + return nil, err + } + + jsonBytes, err := json.Marshal(plan) + if err != nil { + log.Error(err, "unable to marshal the plan to json") + return nil, err + } + + return &ShowPlanFileReply{JsonOutput: jsonBytes}, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..4fd7c5ebf6d4ed59bfd501780750312cca688b61 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/pre_context.md @@ -0,0 +1,998 @@ +# Patch-overlapping Go context before the fix + +## `runner/server.go` (changed lines (173, 194, 195, 196, 197, 198, 199, 200, 201, 202)) + +```go +package runner + +import ( + "bytes" + "context" + "errors" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + + securejoin "github.com/cyphar/filepath-securejoin" + "github.com/fluxcd/pkg/untar" + "github.com/go-logr/logr" + "github.com/hashicorp/terraform-exec/tfexec" + tfjson "github.com/hashicorp/terraform-json" + infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + "github.com/weaveworks/tf-controller/utils" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + TFPlanName = "tfplan" + SavedPlanSecretAnnotation = "savedPlan" + runnerFileMappingLocationHome = "home" + runnerFileMappingLocationWorkspace = "workspace" + runnerFileMappingDirectoryPermissions = 0700 + runnerFileMappingFilePermissions = 0600 + HomePath = "/home/runner" +) + +type LocalPrintfer struct { + logger logr.Logger +} + +func (l LocalPrintfer) Printf(format string, v ...interface{}) { + l.logger.Info(fmt.Sprintf(format, v...)) +} + +type TerraformRunnerServer struct { + UnimplementedRunnerServer + tf *tfexec.Terraform + client.Client + Scheme *runtime.Scheme + Done chan os.Signal + terraform *infrav1.Terraform + InstanceID string +} + +const loggerName = "runner.terraform" + +func (r *TerraformRunnerServer) LookPath(ctx context.Context, req *LookPathRequest) (*LookPathReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("looking for path", "file", req.File) + execPath, err := exec.LookPath(req.File) + if err != nil { + log.Error(err, "unable to look for path", "file", req.File) + return nil, err + } + return &LookPathReply{ExecPath: execPath}, nil +} + +func (r *TerraformRunnerServer) UploadAndExtract(ctx context.Context, req *UploadAndExtractRequest) (*UploadAndExtractReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("preparing for Upload and Extraction") + tmpDir, err := securejoin.SecureJoin(os.TempDir(), fmt.Sprintf("%s-%s", req.Namespace, req.Name)) + if err != nil { + log.Error(err, "unable to join securely", "tmpDir", os.TempDir(), "namespace", req.Namespace, "name", req.Name) + return nil, err + } + + buf := bytes.NewBuffer(req.TarGz) + if _, err = untar.Untar(buf, tmpDir); err != nil { + log.Error(err, "unable to extract tar file", "namespace", req.Namespace, "name", req.Name) + return nil, fmt.Errorf("failed to untar artifact, error: %w", err) + } + + dirPath, err := securejoin.SecureJoin(tmpDir, req.Path) + if err != nil { + log.Error(err, "unable to join securely", "tmpDir", tmpDir, "path", req.Path) + return nil, err + } + + if _, err := os.Stat(dirPath); err != nil { + log.Error(err, "path not found", "dirPath", dirPath) + err = fmt.Errorf("terraform path not found: %w", err) + return nil, err + } + + return &UploadAndExtractReply{WorkingDir: dirPath, TmpDir: tmpDir}, nil +} + +func (r *TerraformRunnerServer) CleanupDir(ctx context.Context, req *CleanupDirRequest) (*CleanupDirReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("cleanup TmpDir", "tmpDir", req.TmpDir) + err := os.RemoveAll(req.TmpDir) + if err != nil { + log.Error(err, "error cleaning up TmpDir", "tmpDir", req.TmpDir) + return nil, err + } + + return &CleanupDirReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) WriteBackendConfig(ctx context.Context, req *WriteBackendConfigRequest) (*WriteBackendConfigReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + const backendConfigPath = "backend_override.tf" + log.Info("write backend config", "path", req.DirPath, "config", backendConfigPath) + filePath, err := securejoin.SecureJoin(req.DirPath, backendConfigPath) + if err != nil { + log.Error(err, "unable to join securely", "dirPath", req.DirPath, "config", backendConfigPath) + return nil, err + } + + log.Info("write config to file", "filePath", filePath) + err = os.WriteFile(filePath, req.BackendConfig, 0644) + if err != nil { + log.Error(err, "unable to write file", "filePath", filePath) + return nil, err + } + + return &WriteBackendConfigReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) ProcessCliConfig(ctx context.Context, req *ProcessCliConfigRequest) (*ProcessCliConfigReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("processing configuration", "namespace", req.Namespace, "name", req.Name) + cliConfigKey := types.NamespacedName{Namespace: req.Namespace, Name: req.Name} + var cliConfig corev1.Secret + if err := r.Get(ctx, cliConfigKey, &cliConfig); err != nil { + log.Error(err, "unable to get secret", "namespace", req.Namespace, "name", req.Name) + return nil, err + } + + if len(cliConfig.Data) != 1 { + err := fmt.Errorf("expect the secret to contain 1 data") + log.Error(err, "secret missing data", "namespace", req.Namespace, "name", req.Name) + return nil, err + } + + var tfrcFilepath string + for tfrcFilename, v := range cliConfig.Data { + if strings.HasSuffix(tfrcFilename, ".tfrc") { + var err error + tfrcFilepath, err = securejoin.SecureJoin(req.DirPath, tfrcFilename) + if err != nil { + log.Error(err, "secure join error", "dirPath", req.DirPath, "tfrcFilename", tfrcFilename) + return nil, err + } + err = os.WriteFile(tfrcFilepath, v, 0644) + if err != nil { + log.Error(err, "write file error", "tfrcFilename", tfrcFilename, "fileMode", "0644") + return nil, err + } + } else { + err := fmt.Errorf("expect the secret key to end with .tfrc") + log.Error(err, "file extension error", "tfrcFilename", tfrcFilename) + return nil, err + } + } + return &ProcessCliConfigReply{FilePath: tfrcFilepath}, nil +} + +func (r *TerraformRunnerServer) NewTerraform(ctx context.Context, req *NewTerraformRequest) (*NewTerraformReply, error) { + r.InstanceID = req.GetInstanceID() + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating new terraform", "workingDir", req.WorkingDir, "execPath", req.ExecPath) + tf, err := tfexec.NewTerraform(req.WorkingDir, req.ExecPath) + if err != nil { + log.Error(err, "unable to create new terraform", "workingDir", req.WorkingDir, "execPath", req.ExecPath) + return nil, err + } + + // hold only 1 instance + r.tf = tf + + var terraform infrav1.Terraform + if err := terraform.FromBytes(req.Terraform, r.Scheme); err != nil { + log.Error(err, "there was a problem getting the terraform resource") + return nil, err + } + // cache the Terraform resource when initializing + r.terraform = &terraform + + disableTestLogging := os.Getenv("DISABLE_TF_LOGS") == "1" + if !disableTestLogging { + r.tf.SetStdout(os.Stdout) + r.tf.SetStderr(os.Stderr) + if os.Getenv("ENABLE_SENSITIVE_TF_LOGS") == "1" { + r.tf.SetLogger(&LocalPrintfer{logger: log}) + } + } + + return &NewTerraformReply{Id: r.InstanceID}, nil +} + +func (r *TerraformRunnerServer) SetEnv(ctx context.Context, req *SetEnvRequest) (*SetEnvReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("setting envvars") + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + log.Info("getting envvars from os environments") + envs := utils.EnvMap(os.Environ()) + for k, v := range req.Envs { + envs[k] = v + } + err := r.tf.SetEnv(envs) + if err != nil { + log.Error(err, "unable to set envvars", "envvars", envs) + return nil, err + } + + return &SetEnvReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) CreateFileMappings(ctx context.Context, req *CreateFileMappingsRequest) (*CreateFileMappingsReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating file mappings") + + for _, fileMapping := range req.FileMappings { + var fileFullPath string + var err error + switch fileMapping.Location { + case runnerFileMappingLocationHome: + fileFullPath, err = securejoin.SecureJoin(HomePath, fileMapping.Path) + if err != nil { + log.Error(err, "insecure file path", "path", fileMapping.Path) + return nil, err + } + case runnerFileMappingLocationWorkspace: + fileFullPath, err = securejoin.SecureJoin(req.WorkingDir, fileMapping.Path) + if err != nil { + log.Error(err, "insecure file path", "path", fileMapping.Path) + return nil, err + } + default: + err := fmt.Errorf("unknown file mapping location") + log.Error(err, "unknown file mapping location", "location", fileMapping.Location) + return nil, err + } + + log.Info("prepare to write file", "fileFullPath", fileFullPath) + dir := filepath.Dir(fileFullPath) + if _, err := os.Stat(dir); os.IsNotExist(err) { + // create dir + err := os.MkdirAll(dir, runnerFileMappingDirectoryPermissions) + if err != nil { + log.Error(err, "unable to create dir", "dir", dir) + return nil, err + } + } + + if err := os.WriteFile(fileFullPath, fileMapping.Content, runnerFileMappingFilePermissions); err != nil { + log.Error(err, "Unable to create file from file mapping", "file", fileFullPath) + return nil, err + } + } + + return &CreateFileMappingsReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) Init(ctx context.Context, req *InitRequest) (*InitReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("initializing") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + terraform := r.terraform + + log.Info("mapping the Spec.BackendConfigsFrom") + backendConfigsOpts := []tfexec.InitOption{} + for _, bf := range terraform.Spec.BackendConfigsFrom { + objectKey := types.NamespacedName{ + Namespace: terraform.Namespace, + Name: bf.Name, + } + if bf.Kind == "Secret" { + var s corev1.Secret + err := r.Get(ctx, objectKey, &s) + if err != nil && bf.Optional == false { + log.Error(err, "unable to get object key", "objectKey", objectKey, "secret", s.ObjectMeta.Name) + return nil, err + } + // if VarsKeys is null, use all + if bf.Keys == nil { + for key, val := range s.Data { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(val))) + } + } else { + for _, key := range bf.Keys { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(s.Data[key]))) + } + } + } else if bf.Kind == "ConfigMap" { + var cm corev1.ConfigMap + err := r.Get(ctx, objectKey, &cm) + if err != nil && bf.Optional == false { + log.Error(err, "unable to get object key", "objectKey", objectKey, "configmap", cm.ObjectMeta.Name) + return nil, err + } + + // if Keys is null, use all + if bf.Keys == nil { + for key, val := range cm.Data { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+val)) + } + for key, val := range cm.BinaryData { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(val))) + } + } else { + for _, key := range bf.Keys { + if val, ok := cm.Data[key]; ok { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+val)) + } + if val, ok := cm.BinaryData[key]; ok { + backendConfigsOpts = append(backendConfigsOpts, tfexec.BackendConfig(key+"="+string(val))) + } + } + } + } + } + + initOpts := []tfexec.InitOption{tfexec.Upgrade(req.Upgrade), tfexec.ForceCopy(req.ForceCopy)} + initOpts = append(initOpts, backendConfigsOpts...) + if err := r.tf.Init(ctx, initOpts...); err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&InitReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "unable to initialize") + return nil, st.Err() + } + + return &InitReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) SelectWorkspace(ctx context.Context, req *WorkspaceRequest) (*WorkspaceReply, error) { + log := ctrl.LoggerFrom(ctx).WithName(loggerName) + log.Info("workspace select") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + terraform := r.terraform + + if terraform.WorkspaceName() != infrav1.DefaultWorkspaceName { + wsOpts := []tfexec.WorkspaceNewCmdOption{} + ws := terraform.Spec.Workspace + if err := r.tf.WorkspaceNew(ctx, ws, wsOpts...); err != nil { + log.Info(fmt.Sprintf("workspace new:, %s", err.Error())) + } + if err := r.tf.WorkspaceSelect(ctx, ws); err != nil { + err := fmt.Errorf("failed to select workspace %s", ws) + log.Error(err, "workspace select error") + return nil, err + } + } + + return &WorkspaceReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) LoadTFPlan(ctx context.Context, req *LoadTFPlanRequest) (*LoadTFPlanReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("loading plan from secret") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + tfplanSecretKey := types.NamespacedName{Namespace: req.Namespace, Name: "tfplan-" + r.terraform.WorkspaceName() + "-" + req.Name} + tfplanSecret := corev1.Secret{} + err := r.Get(ctx, tfplanSecretKey, &tfplanSecret) + if err != nil { + err = fmt.Errorf("error getting plan secret: %s", err) + log.Error(err, "unable to get secret") + return nil, err + } + + if tfplanSecret.Annotations[SavedPlanSecretAnnotation] != req.PendingPlan { + err = fmt.Errorf("error pending plan and plan's name in the secret are not matched: %s != %s", + req.PendingPlan, + tfplanSecret.Annotations[SavedPlanSecretAnnotation]) + log.Error(err, "plan name mismatch") + return nil, err + } + + if req.BackendCompletelyDisable { + // do nothing + } else { + tfplan := tfplanSecret.Data[TFPlanName] + tfplan, err = utils.GzipDecode(tfplan) + if err != nil { + log.Error(err, "unable to decode the plan") + return nil, err + } + err = ioutil.WriteFile(filepath.Join(r.tf.WorkingDir(), TFPlanName), tfplan, 0644) + if err != nil { + err = fmt.Errorf("error saving plan file to disk: %s", err) + log.Error(err, "unable to write the plan to disk") + return nil, err + } + } + + return &LoadTFPlanReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) Destroy(ctx context.Context, req *DestroyRequest) (*DestroyReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("running destroy") + ctx, cancel := context.WithCancel(ctx) + go func() { + select { + case <-r.Done: + cancel() + case <-ctx.Done(): + } + }() + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var destroyOpt []tfexec.DestroyOption + for _, target := range req.Targets { + destroyOpt = append(destroyOpt, tfexec.Target(target)) + } + + if err := r.tf.Destroy(ctx, destroyOpt...); err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&DestroyReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "unable to destroy") + return nil, st.Err() + } + + return &DestroyReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) Apply(ctx context.Context, req *ApplyRequest) (*ApplyReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("running apply") + ctx, cancel := context.WithCancel(ctx) + go func() { + select { + case <-r.Done: + cancel() + case <-ctx.Done(): + } + }() + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var applyOpt []tfexec.ApplyOption + if req.DirOrPlan != "" { + applyOpt = []tfexec.ApplyOption{tfexec.DirOrPlan(req.DirOrPlan)} + } + + if req.RefreshBeforeApply { + applyOpt = []tfexec.ApplyOption{tfexec.Refresh(true)} + } + + for _, target := range req.Targets { + applyOpt = append(applyOpt, tfexec.Target(target)) + } + + if req.Parallelism > 0 { + applyOpt = append(applyOpt, tfexec.Parallelism(int(req.Parallelism))) + } + + if err := r.tf.Apply(ctx, applyOpt...); err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&ApplyReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "unable to apply plan") + return nil, st.Err() + } + + return &ApplyReply{Message: "ok"}, nil +} + +func getInventoryFromTerraformModule(m *tfjson.StateModule) []*Inventory { + var result []*Inventory + for _, r := range m.Resources { + var id string + // TODO ARN is AWS-specific. Will need to support other cloud identifiers in the future. + if val, ok := r.AttributeValues["arn"]; ok { + id = val.(string) + } else if val, ok := r.AttributeValues["id"]; ok { + id = val.(string) + } + result = append(result, &Inventory{ + Name: r.Name, + Type: r.Type, + Identifier: id, + }) + } + + // recursively get all resources from submodules + for _, childModule := range m.ChildModules { + childInventory := getInventoryFromTerraformModule(childModule) + result = append(result, childInventory...) + } + + return result +} + +func (r *TerraformRunnerServer) GetInventory(ctx context.Context, req *GetInventoryRequest) (*GetInventoryReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("get inventory") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "get inventory: no terraform") + return nil, err + } + state, err := r.tf.Show(ctx) + if err != nil { + log.Error(err, "get inventory: unable to get state via show command") + return nil, err + } + + // state contains no values after resource destruction for example + if state.Values == nil { + log.Info("get inventory: state values is nil") + return &GetInventoryReply{Inventories: []*Inventory{}}, nil + } + + if state.Values.RootModule == nil { + log.Info("get inventory: root module is nil") + return &GetInventoryReply{Inventories: []*Inventory{}}, nil + } + + return &GetInventoryReply{Inventories: getInventoryFromTerraformModule(state.Values.RootModule)}, nil +} + +func (r *TerraformRunnerServer) FinalizeSecrets(ctx context.Context, req *FinalizeSecretsRequest) (*FinalizeSecretsReply, error) { + log := ctrl.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("finalize the output secrets") + // nil dereference bug here + planObjectKey := types.NamespacedName{Namespace: req.Namespace, Name: "tfplan-" + req.Workspace + "-" + req.Name} + var planSecret corev1.Secret + if err := r.Client.Get(ctx, planObjectKey, &planSecret); err == nil { + if err := r.Client.Delete(ctx, &planSecret); err != nil { + // transient failure + log.Error(err, "unable to delete the plan secret") + return nil, status.Error(codes.Internal, err.Error()) + } + } else if apierrors.IsNotFound(err) { + log.Error(err, "plan secret not found") + return nil, status.Error(codes.NotFound, err.Error()) + } else { + // transient failure + log.Error(err, "unable to get the plan secret") + return nil, status.Error(codes.Internal, err.Error()) + } + + if req.HasSpecifiedOutputSecret { + outputsObjectKey := types.NamespacedName{Namespace: req.Namespace, Name: req.OutputSecretName} + var outputsSecret corev1.Secret + if err := r.Client.Get(ctx, outputsObjectKey, &outputsSecret); err == nil { + if err := r.Client.Delete(ctx, &outputsSecret); err != nil { + // transient failure + log.Error(err, "unable to delete the output secret") + return nil, status.Error(codes.Internal, err.Error()) + } + } else if apierrors.IsNotFound(err) { + log.Error(err, "output secret not found") + return nil, status.Error(codes.NotFound, err.Error()) + } else { + // transient failure + log.Error(err, "unable to get the output secret") + return nil, status.Error(codes.Internal, err.Error()) + } + } + + return &FinalizeSecretsReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) ForceUnlock(ctx context.Context, req *ForceUnlockRequest) (*ForceUnlockReply, error) { + reply := &ForceUnlockReply{ + Success: true, + Message: fmt.Sprintf("Successfully unlocked state with lock identifier: %s", req.GetLockIdentifier()), + } + err := r.tf.ForceUnlock(ctx, req.LockIdentifier) + + if err != nil { + reply.Success = false + reply.Message = fmt.Sprintf("Error unlocking the state: %s", err) + } + + return reply, err +} +``` + +## `runner/server_plan.go` (changed lines (7, 8, 11, 13, 71, 72, 84)) + +```go +package runner + +import ( + "context" + "errors" + "fmt" + "github.com/hashicorp/terraform-exec/tfexec" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "sigs.k8s.io/controller-runtime" +) + +func (r *TerraformRunnerServer) Plan(ctx context.Context, req *PlanRequest) (*PlanReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("creating a plan") + ctx, cancel := context.WithCancel(ctx) + go func() { + select { + case <-r.Done: + cancel() + case <-ctx.Done(): + } + }() + + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var planOpt []tfexec.PlanOption + if req.Out != "" { + planOpt = append(planOpt, tfexec.Out(req.Out)) + } else { + // if backend is disabled completely, there will be no plan output file (req.Out = "") + log.Info("backend seems to be disabled completely, so there will be no plan output file") + } + + if req.Refresh == false { + planOpt = append(planOpt, tfexec.Refresh(req.Refresh)) + } + + if req.Destroy { + planOpt = append(planOpt, tfexec.Destroy(req.Destroy)) + } + + for _, target := range req.Targets { + planOpt = append(planOpt, tfexec.Target(target)) + } + + drifted, err := r.tf.Plan(ctx, planOpt...) + if err != nil { + st := status.New(codes.Internal, err.Error()) + var stateErr *tfexec.ErrStateLocked + + if errors.As(err, &stateErr) { + st, err = st.WithDetails(&PlanReply{Message: "not ok", StateLockIdentifier: stateErr.ID}) + + if err != nil { + return nil, err + } + } + + log.Error(err, "error creating the plan") + return nil, st.Err() + } + + planCreated := false + if req.Out != "" { + planCreated = true + plan, err := r.tf.ShowPlanFile(ctx, req.Out) + if err != nil { + return nil, err + } + + // This is the case when the plan is empty. + if plan.PlannedValues.Outputs == nil && + plan.PlannedValues.RootModule.Resources == nil && + plan.ResourceChanges == nil && + plan.PriorState == nil && + plan.OutputChanges == nil { + planCreated = false + } + } + + return &PlanReply{Message: "ok", Drifted: drifted, PlanCreated: planCreated}, nil +} +``` + +## `runner/server_save_tfplan.go` (changed lines (18, 19, 22, 23, 50, 51, 66, 67)) + +```go +package runner + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "path/filepath" + "strings" + + "github.com/go-logr/logr" + infrav1 "github.com/weaveworks/tf-controller/api/v1alpha2" + "github.com/weaveworks/tf-controller/utils" + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime" +) + +func (r *TerraformRunnerServer) SaveTFPlan(ctx context.Context, req *SaveTFPlanRequest) (*SaveTFPlanReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("save the plan") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + var tfplan []byte + if req.BackendCompletelyDisable { + tfplan = []byte("dummy plan") + } else { + var err error + tfplan, err = ioutil.ReadFile(filepath.Join(r.tf.WorkingDir(), TFPlanName)) + if err != nil { + err = fmt.Errorf("error reading plan file: %s", err) + log.Error(err, "unable to complete SaveTFPlan function") + return nil, err + } + } + + planRev := strings.Replace(req.Revision, "/", "-", 1) + planName := "plan-" + planRev + if err := r.writePlanAsSecret(ctx, req.Name, req.Namespace, log, planName, tfplan, "", req.Uuid); err != nil { + return nil, err + } + + if r.terraform.Spec.StoreReadablePlan == "json" { + planObj, err := r.tf.ShowPlanFile(ctx, TFPlanName) + if err != nil { + log.Error(err, "unable to get the plan output for json") + return nil, err + } + jsonBytes, err := json.Marshal(planObj) + if err != nil { + log.Error(err, "unable to marshal the plan to json") + return nil, err + } + + if err := r.writePlanAsSecret(ctx, req.Name, req.Namespace, log, planName, jsonBytes, ".json", req.Uuid); err != nil { + return nil, err + } + + } else if r.terraform.Spec.StoreReadablePlan == "human" { + rawOutput, err := r.tf.ShowPlanFileRaw(ctx, TFPlanName) + if err != nil { + log.Error(err, "unable to get the plan output for human") + return nil, err + } + + if err := r.writePlanAsConfigMap(ctx, req.Name, req.Namespace, log, planName, rawOutput, "", req.Uuid); err != nil { + return nil, err + } + } + + return &SaveTFPlanReply{Message: "ok"}, nil +} + +func (r *TerraformRunnerServer) writePlanAsSecret(ctx context.Context, name string, namespace string, log logr.Logger, planName string, tfplan []byte, suffix string, uuid string) error { + secretName := "tfplan-" + r.terraform.WorkspaceName() + "-" + name + suffix + tfplanObjectKey := types.NamespacedName{Name: secretName, Namespace: namespace} + var tfplanSecret v1.Secret + tfplanSecretExists := true + + if err := r.Client.Get(ctx, tfplanObjectKey, &tfplanSecret); err != nil { + if errors.IsNotFound(err) { + tfplanSecretExists = false + } else { + err = fmt.Errorf("error getting tfplanSecret: %s", err) + log.Error(err, "unable to get the plan secret") + return err + } + } + + if tfplanSecretExists { + if err := r.Client.Delete(ctx, &tfplanSecret); err != nil { + err = fmt.Errorf("error deleting tfplanSecret: %s", err) + log.Error(err, "unable to delete the plan secret") + return err + } + } + + tfplan, err := utils.GzipEncode(tfplan) + if err != nil { + log.Error(err, "unable to encode the plan revision", "planName", planName) + return err + } + + tfplanData := map[string][]byte{TFPlanName: tfplan} + tfplanSecret = v1.Secret{ + TypeMeta: metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: secretName, + Namespace: namespace, + Annotations: map[string]string{ + "encoding": "gzip", + SavedPlanSecretAnnotation: planName, + }, + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: infrav1.GroupVersion.Group + "/" + infrav1.GroupVersion.Version, + Kind: infrav1.TerraformKind, + Name: name, + UID: types.UID(uuid), + }, + }, + }, + Type: v1.SecretTypeOpaque, + Data: tfplanData, + } + + if err := r.Client.Create(ctx, &tfplanSecret); err != nil { + err = fmt.Errorf("error recording plan status: %s", err) + log.Error(err, "unable to create plan secret") + return err + } + + return nil +} + +func (r *TerraformRunnerServer) writePlanAsConfigMap(ctx context.Context, name string, namespace string, log logr.Logger, planName string, tfplan string, suffix string, uuid string) error { + configMapName := "tfplan-" + r.terraform.WorkspaceName() + "-" + name + suffix + tfplanObjectKey := types.NamespacedName{Name: configMapName, Namespace: namespace} + var tfplanCM v1.ConfigMap + tfplanCMExists := true + + if err := r.Client.Get(ctx, tfplanObjectKey, &tfplanCM); err != nil { + if errors.IsNotFound(err) { + tfplanCMExists = false + } else { + err = fmt.Errorf("error getting tfplanSecret: %s", err) + log.Error(err, "unable to get the plan configmap") + return err + } + } + + if tfplanCMExists { + if err := r.Client.Delete(ctx, &tfplanCM); err != nil { + err = fmt.Errorf("error deleting tfplanSecret: %s", err) + log.Error(err, "unable to delete the plan configmap") + return err + } + } + + tfplanData := map[string]string{TFPlanName: tfplan} + tfplanCM = v1.ConfigMap{ + TypeMeta: metav1.TypeMeta{ + Kind: "ConfigMap", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: configMapName, + Namespace: namespace, + Annotations: map[string]string{ + SavedPlanSecretAnnotation: planName, + }, + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: infrav1.GroupVersion.Group + "/" + infrav1.GroupVersion.Version, + Kind: infrav1.TerraformKind, + Name: name, + UID: types.UID(uuid), + }, + }, + }, + Data: tfplanData, + } + + if err := r.Client.Create(ctx, &tfplanCM); err != nil { + err = fmt.Errorf("error recording plan status: %s", err) + log.Error(err, "unable to create plan configmap") + return err + } + + return nil +} +``` + +## `runner/server_show_plan.go` (changed lines (19, 20, 37, 38)) + +```go +package runner + +import ( + "context" + "encoding/json" + "fmt" + "sigs.k8s.io/controller-runtime" +) + +func (r *TerraformRunnerServer) ShowPlanFileRaw(ctx context.Context, req *ShowPlanFileRawRequest) (*ShowPlanFileRawReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("show the raw plan file") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + rawOutput, err := r.tf.ShowPlanFileRaw(ctx, req.Filename) + if err != nil { + log.Error(err, "unable to get the raw plan output") + return nil, err + } + + return &ShowPlanFileRawReply{RawOutput: rawOutput}, nil +} + +func (r *TerraformRunnerServer) ShowPlanFile(ctx context.Context, req *ShowPlanFileRequest) (*ShowPlanFileReply, error) { + log := controllerruntime.LoggerFrom(ctx, "instance-id", r.InstanceID).WithName(loggerName) + log.Info("show the raw plan file") + if req.TfInstance != r.InstanceID { + err := fmt.Errorf("no TF instance found") + log.Error(err, "no terraform") + return nil, err + } + + plan, err := r.tf.ShowPlanFile(ctx, req.Filename) + if err != nil { + log.Error(err, "unable to get the json plan output") + return nil, err + } + + jsonBytes, err := json.Marshal(plan) + if err != nil { + log.Error(err, "unable to marshal the plan to json") + return nil, err + } + + return &ShowPlanFileReply{JsonOutput: jsonBytes}, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..1570e82e66a6cdc39a9e8c104d9384d34d389d94 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/task.json @@ -0,0 +1,53 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-0adb0a489b07a50d6b2f", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-0adb0a489b07a50d6b2f", + "project_id": "morefixes__weaveworks__tf-controller", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "runner/server.go", + "runner/server_plan.go", + "runner/server_save_tfplan.go", + "runner/server_show_plan.go" + ], + "patch_units": { + "before": [ + "runner/server.go", + "runner/server_plan.go", + "runner/server_save_tfplan.go", + "runner/server_show_plan.go" + ], + "after": [ + "runner/server.go", + "runner/server_plan.go", + "runner/server_save_tfplan.go", + "runner/server_show_plan.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/526bd22241fda08aa14f3aff637753e5a43fbb91c6797071cb3459ad1b5c5977/database", + "cache_key": "526bd22241fda08aa14f3aff637753e5a43fbb91c6797071cb3459ad1b5c5977", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/9ed4d3837482420c6ba2d63dce2e8616009a054f4fbc06d4e97455bd3bbebd32/database", + "cache_key": "9ed4d3837482420c6ba2d63dce2e8616009a054f4fbc06d4e97455bd3bbebd32", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/ceaf049c8c906e9fc480038bd793145a9875fb9cfb427cf067b39438de42a041/database", + "cache_key": "ceaf049c8c906e9fc480038bd793145a9875fb9cfb427cf067b39438de42a041", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-0adb0a489b07a50d6b2f/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-0adb0a489b07a50d6b2f/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-0adb0a489b07a50d6b2f/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..b2b5736e9ddbd70974f73aaf1dc8e6842eaf4215 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/patch.diff @@ -0,0 +1,128 @@ +diff --git a/cmd/root.go b/cmd/root.go +index 8fefcb37..b062eba2 100644 +--- a/cmd/root.go ++++ b/cmd/root.go +@@ -9,6 +9,7 @@ import ( + "time" + + "knative.dev/func/cmd/templates" ++ "knative.dev/func/k8s" + + "github.com/ory/viper" + "github.com/spf13/cobra" +@@ -361,7 +362,12 @@ func (v Version) StringVerbose() string { + if date == "" { + date = time.Now().Format(time.RFC3339) + } +- return fmt.Sprintf("%s-%s-%s", vers, hash, date) ++ funcVersion := fmt.Sprintf("%s-%s-%s", vers, hash, date) ++ return fmt.Sprintf("Version: %s\n"+ ++ "SocatImage: %s\n"+ ++ "TarImage: %s", funcVersion, ++ k8s.SocatImage, ++ k8s.TarImage) + } + + // surveySelectDefault returns 'value' if defined and exists in 'options'. +diff --git a/cmd/root_test.go b/cmd/root_test.go +index 25f73c24..89569cfb 100644 +--- a/cmd/root_test.go ++++ b/cmd/root_test.go +@@ -209,24 +209,28 @@ func TestRoot_CommandNameParameterized(t *testing.T) { + + func TestVerbose(t *testing.T) { + tests := []struct { +- name string +- args []string +- want string ++ name string ++ args []string ++ want string ++ wantLF int + }{ + { +- name: "verbose as version's flag", +- args: []string{"version", "-v"}, +- want: "v0.42.0-cafe-1970-01-01\n", ++ name: "verbose as version's flag", ++ args: []string{"version", "-v"}, ++ want: "Version: v0.42.0-cafe-1970-01-01", ++ wantLF: 3, + }, + { +- name: "no verbose", +- args: []string{"version"}, +- want: "v0.42.0\n", ++ name: "no verbose", ++ args: []string{"version"}, ++ want: "v0.42.0", ++ wantLF: 1, + }, + { +- name: "verbose as root's flag", +- args: []string{"--verbose", "version"}, +- want: "v0.42.0-cafe-1970-01-01\n", ++ name: "verbose as root's flag", ++ args: []string{"--verbose", "version"}, ++ want: "Version: v0.42.0-cafe-1970-01-01", ++ wantLF: 3, + }, + } + for _, tt := range tests { +@@ -249,8 +253,12 @@ func TestVerbose(t *testing.T) { + t.Fatal(err) + } + +- if out.String() != tt.want { +- t.Errorf("expected output: %q but got: %q", tt.want, out.String()) ++ outLines := strings.Split(out.String(), "\n") ++ if len(outLines)-1 != tt.wantLF { ++ t.Errorf("expected output with %v line breaks but got %v:", tt.wantLF, len(outLines)-1) ++ } ++ if outLines[0] != tt.want { ++ t.Errorf("expected output: %q but got: %q", tt.want, outLines[0]) + } + }) + } +diff --git a/k8s/dialer.go b/k8s/dialer.go +index d11116d3..b2551837 100644 +--- a/k8s/dialer.go ++++ b/k8s/dialer.go +@@ -7,7 +7,6 @@ import ( + "fmt" + "io" + "net" +- "os" + "sync" + "time" + +@@ -23,7 +22,7 @@ import ( + "k8s.io/client-go/tools/remotecommand" + ) + +-var socatImage = "quay.io/boson/alpine-socat:1.7.4.3-r1-non-root" ++var SocatImage = "quay.io/boson/alpine-socat:1.7.4.3-r1-non-root" + + // NewInClusterDialer creates context dialer that will dial TCP connections via POD running in k8s cluster. + // This is useful when accessing k8s services that are not exposed outside cluster (e.g. openshift image registry). +@@ -129,11 +128,6 @@ func (c *contextDialer) startDialerPod(ctx context.Context) (err error) { + } + }() + +- img := socatImage +- if i, ok := os.LookupEnv("SOCAT_IMAGE"); ok { +- img = i +- } +- + pod := &coreV1.Pod{ + ObjectMeta: metaV1.ObjectMeta{ + Name: c.podName, +@@ -144,7 +138,7 @@ func (c *contextDialer) startDialerPod(ctx context.Context) (err error) { + Containers: []coreV1.Container{ + { + Name: c.podName, +- Image: img, ++ Image: SocatImage, + Stdin: true, + StdinOnce: true, + Command: []string{"socat", "-u", "-", "OPEN:/dev/null"}, diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..40aa855bb114c39005a2eb5fc05f2f612de1795e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/post_context.md @@ -0,0 +1,1177 @@ +# Patch-overlapping Go context after the fix + +## `cmd/root.go` (changed lines (12, 365, 366, 367, 368, 369, 370)) + +```go +package cmd + +import ( + "fmt" + "os" + "path/filepath" + "strings" + "text/template" + "time" + + "knative.dev/func/cmd/templates" + "knative.dev/func/k8s" + + "github.com/ory/viper" + "github.com/spf13/cobra" + "golang.org/x/term" + "k8s.io/apimachinery/pkg/util/sets" + "knative.dev/client/pkg/util" + fn "knative.dev/func" +) + +type RootCommandConfig struct { + Name string // usually `func` or `kn func` + Version + NewClient ClientFactory +} + +// NewRootCmd creates the root of the command tree defines the command name, description, globally +// available flags, etc. It has no action of its own, such that running the +// resultant binary with no arguments prints the help/usage text. +func NewRootCmd(config RootCommandConfig) *cobra.Command { + cmd := &cobra.Command{ + // Use must be set to exactly config.Name, as this field is overloaded to + // be used in subcommand help text as the command with possible prefix: + Use: config.Name, + Short: "Serverless functions", + SilenceErrors: true, // we explicitly handle errors in Execute() + SilenceUsage: true, // no usage dump on error + Long: `Knative serverless functions + + Create, build and deploy Knative functions + +SYNOPSIS + {{.Use}} [-v|--verbose] [args] + +EXAMPLES + + o Create a Node function in the current directory + $ {{.Use}} create --language node . + + o Deploy the function defined in the current working directory to the + currently connected cluster, specifying a container registry in place of + quay.io/user for the function's container. + $ {{.Use}} deploy --registry quay.io.user + + o Invoke the function defined in the current working directory with an example + request. + $ {{.Use}} invoke + + For more examples, see '{{.Use}} [command] --help'.`, + } + + // Environment Variables + // Evaluated first after static defaults, set all flags to be associated with + // a version prefixed by "FUNC_" + viper.AutomaticEnv() // read in environment variables for FUNC_ + viper.SetEnvPrefix("func") // ensure that all have the prefix + + // Flags + // persistent flags are available to all subcommands implicitly + // Note they are bound immediately here as opposed to other subcommands + // because this root command is not actually executed during tests, and + // therefore PreRunE and other event-based listeners are not invoked. + cmd.PersistentFlags().BoolP("verbose", "v", false, "Print verbose logs ($FUNC_VERBOSE)") + if err := viper.BindPFlag("verbose", cmd.PersistentFlags().Lookup("verbose")); err != nil { + fmt.Fprintf(os.Stderr, "error binding flag: %v\n", err) + } + cmd.PersistentFlags().StringP("namespace", "n", "", "The namespace on the cluster used for remote commands. By default, the namespace func.yaml is used or the currently active namespace if not set in the configuration. (Env: $FUNC_NAMESPACE)") + if err := viper.BindPFlag("namespace", cmd.PersistentFlags().Lookup("namespace")); err != nil { + fmt.Fprintf(os.Stderr, "error binding flag: %v\n", err) + } + + // Version + cmd.Version = config.Version.String() + cmd.SetVersionTemplate(`{{printf "%s\n" .Version}}`) + + // Client + // Use the provided ClientFactory or default to NewClient + newClient := config.NewClient + if newClient == nil { + newClient = NewClient + } + + // Grouped commands + groups := templates.CommandGroups{ + { + Header: "Main Commands:", + Commands: []*cobra.Command{ + NewBuildCmd(newClient), + NewConfigCmd(defaultLoaderSaver), + NewCreateCmd(newClient), + NewDeleteCmd(newClient), + NewDeployCmd(newClient), + NewInfoCmd(newClient), + NewInvokeCmd(newClient), + NewLanguagesCmd(newClient), + NewListCmd(newClient), + NewRepositoryCmd(newClient), + NewRunCmd(newClient), + NewTemplatesCmd(newClient), + }, + }, + { + Header: "Other Commands:", + Commands: []*cobra.Command{ + NewCompletionCmd(), + NewVersionCmd(config.Version), + }, + }, + } + + // Add all commands to the root command, and initialize + groups.AddTo(cmd) + groups.SetRootUsage(cmd, nil) + + return cmd +} + +// Helpers +// ------------------------------------------ + +// interactiveTerminal returns whether or not the currently attached process +// terminal is interactive. Used for determining whether or not to +// interactively prompt the user to confirm default choices, etc. +func interactiveTerminal() bool { + return term.IsTerminal(int(os.Stdin.Fd())) +} + +// bindFunc which conforms to the cobra PreRunE method signature +type bindFunc func(*cobra.Command, []string) error + +// bindEnv returns a bindFunc that binds env vars to the named flags. +func bindEnv(flags ...string) bindFunc { + return func(cmd *cobra.Command, args []string) (err error) { + for _, flag := range flags { + if err = viper.BindPFlag(flag, cmd.Flags().Lookup(flag)); err != nil { + return + } + } + return + } +} + +// deriveName returns the explicit value (if provided) or attempts to derive +// from the given path. Path is defaulted to current working directory, where +// a function configuration, if it exists and contains a name, is used. +func deriveName(explicitName string, path string) string { + // If the name was explicitly provided, use it. + if explicitName != "" { + return explicitName + } + + // If the directory at path contains an initialized function, use the name therein + f, err := fn.NewFunction(path) + if err == nil && f.Name != "" { + return f.Name + } + + return "" +} + +// deriveNameAndAbsolutePathFromPath returns resolved function name and absolute path +// to the function project root. The input parameter path could be one of: +// 'relative/path/to/foo', '/absolute/path/to/foo', 'foo' or ”. +func deriveNameAndAbsolutePathFromPath(path string) (string, string) { + var absPath string + + // If path is not specified, we would like to use current working dir + if path == "" { + path = cwd() + } + + // Expand the passed function name to its absolute path + absPath, err := filepath.Abs(path) + if err != nil { + return "", "" + } + + // Get the name of the function, which equals to name of the current directory + pathParts := strings.Split(strings.TrimRight(path, string(os.PathSeparator)), string(os.PathSeparator)) + return pathParts[len(pathParts)-1], absPath +} + +// deriveImage returns the same image name which will be used. +// I.e. if the explicit name is empty, derive one from the configured registry +// (registry plus username) and the function's name. +// +// This is calculated preemptively here in the CLI (prior to invoking the +// client), only in order to provide information to the user via the prompt. +// The client will calculate this same value if the image override is not +// provided. +// +// Derivation logic: +// deriveImage attempts to arrive at a final, full image name: +// +// format: [registry]/[username]/[functionName]:[tag] +// example: quay.io/myname/my.function.name:tag. +// +// Registry can optionally be omitted, in which case DefaultRegistry +// will be prepended. +// +// If the image flag is provided, this value is used directly (the user supplied +// --image or $FUNC_IMAGE). Otherwise, the function at 'path' is loaded, and +// the Image name therein is used (i.e. it was previously calculated). +// Finally, the default registry is used, which is prepended to the function +// name, and appended with ':latest': +func deriveImage(explicitImage, defaultRegistry, path string) string { + if explicitImage != "" { + return explicitImage // use the explicit value provided. + } + f, err := fn.NewFunction(path) + if err != nil { + return "" // unable to derive due to load error (uninitialized?) + } + if f.Image != "" { + return f.Image // use value previously provided or derived. + } + // Use the func system's derivation logic. + // Errors deriving result in an empty return + derivedValue, _ := f.ImageName() + return derivedValue +} + +func envFromCmd(cmd *cobra.Command) (*util.OrderedMap, []string, error) { + if cmd.Flags().Changed("env") { + env, err := cmd.Flags().GetStringArray("env") + if err != nil { + return nil, []string{}, fmt.Errorf("Invalid --env: %w", err) + } + return util.OrderedMapAndRemovalListFromArray(env, "=") + } + return util.NewOrderedMap(), []string{}, nil +} + +func mergeEnvs(envs []fn.Env, envToUpdate *util.OrderedMap, envToRemove []string) ([]fn.Env, int, error) { + updated := sets.NewString() + + var counter int + + for i := range envs { + if envs[i].Name != nil { + value, present := envToUpdate.GetString(*envs[i].Name) + if present { + envs[i].Value = &value + updated.Insert(*envs[i].Name) + counter++ + } + } + } + + it := envToUpdate.Iterator() + for name, value, ok := it.NextString(); ok; name, value, ok = it.NextString() { + if !updated.Has(name) { + n := name + v := value + envs = append(envs, fn.Env{Name: &n, Value: &v}) + counter++ + } + } + + for _, name := range envToRemove { + for i, envVar := range envs { + if *envVar.Name == name { + envs = append(envs[:i], envs[i+1:]...) + counter++ + break + } + } + } + + errMsg := fn.ValidateEnvs(envs) + if len(errMsg) > 0 { + return []fn.Env{}, 0, fmt.Errorf(strings.Join(errMsg, "\n")) + } + + return envs, counter, nil +} + +// setPathFlag ensures common text/wording when the --path flag is used +func setPathFlag(cmd *cobra.Command) { + cmd.Flags().StringP("path", "p", ".", "Path to the project directory (Env: $FUNC_PATH)") +} + +// getPathFlag returns the value of the --path flag. +// The special value '.' is returned as the abolute path to the current +// working directory. +func getPathFlag() string { + path := viper.GetString("path") + if path == "." { + path = cwd() + } + return path +} + +// cwd returns the current working directory or exits 1 printing the error. +func cwd() (cwd string) { + cwd, err := os.Getwd() + if err != nil { + panic(fmt.Sprintf("Unable to determine current working directory: %v", err)) + } + return cwd +} + +type Version struct { + // Date of compilation + Date string + // Version tag of the git commit, or 'tip' if no tag. + Vers string + // Hash of the currently active git commit on build. + Hash string + // Verbose printing enabled for the string representation. + Verbose bool +} + +// Return the stringification of the Version struct, which takes into account +// the verbosity setting. +func (v Version) String() string { + if v.Verbose { + return v.StringVerbose() + } + + // Ensure that the value returned is parseable as a semver, with the special + // value v0.0.0 as the default indicating there is no version information + // available. + if strings.HasPrefix(v.Vers, "v") { + // TODO: this is the naive approach, perhaps consider actually parse it + // using the semver lib + return v.Vers + } + + // Any non-semver value is invalid, and thus indistinguishable from a + // nonexistent version value, so the default zero value of v0.0.0 is used. + return "v0.0.0" +} + +// StringVerbose returns the verbose version of the version stringification. +// The format returned is [semver]-[hash]-[date] where the special value +// 'v0.0.0' and 'source' are used when version is not available and/or the +// libray has been built from source, respectively. +func (v Version) StringVerbose() string { + var ( + vers = v.Vers + hash = v.Hash + date = v.Date + ) + if vers == "" { + vers = "v0.0.0" + } + if hash == "" { + hash = "source" + } + if date == "" { + date = time.Now().Format(time.RFC3339) + } + funcVersion := fmt.Sprintf("%s-%s-%s", vers, hash, date) + return fmt.Sprintf("Version: %s\n"+ + "SocatImage: %s\n"+ + "TarImage: %s", funcVersion, + k8s.SocatImage, + k8s.TarImage) +} + +// surveySelectDefault returns 'value' if defined and exists in 'options'. +// Otherwise, options[0] is returned if it exists. Empty string otherwise. +// +// Usage Example: +// +// languages := []string{ "go", "node", "rust" }, +// survey.Select{ +// Options: options, +// Default: surveySelectDefaut(cfg.Language, languages), +// } +// +// Summary: +// +// This protects against an incorrectly initialized survey.Select when the user +// has provided a nonexistant option (validation is handled elsewhere) or +// when a value is required but there exists no defaults (no default value on +// the associated flag). +// +// Explanation: +// +// The above example chooses the default for the Survey (--confirm) question +// in a way that works with user-provided flag and environment variable values. +// +// `cfg.Language` is the current value set in the config struct, which is +// populated from (in ascending order of precedence): +// static flag default, associated environment variable, or command flag. +// `languages` are the options which are being used by the survey select. +// +// This cascade allows for the Survey questions to be properly pre-initialzed +// with their associated environment variables or flags. For example, +// A user whose default language is set to 'node' using the global environment +// variable FUNC_LANGUAGE will have that option pre-selected when running +// `func create -c`. +// +// The 'survey' package expects the value of the Default member to exist +// in the 'Options' member. This is not possible when user-provided data is +// allowed for the default, hence this logic is necessary. +// +// For example, when the user is using prompts (--confirm) to select from a set +// of options, but the associated flag either has an unrecognized value, or no +// value at all, without this logic the resulting select prompt would be +// initialized with this as the default value, and the act of what appears to +// be choose the first option displayed does not overwrite the invalid default. +// It could perhaps be argued this is a shortcoming in the survey package, but +// it is also clearly an error to provide invalid data for a default. +func surveySelectDefault(value string, options []string) string { + for _, v := range options { + if value == v { + return v // The provided value is acceptable + } + } + if len(options) > 0 { + return options[0] // Sync with the option which will be shown by the UX + } + // Either the value is not an option or there are no options. Either of + // which should fail proper validation + return "" +} + +// defaultTemplatedHelp evaluates the given command's help text as a template +// some commands define their own help command when additional values are +// required beyond these basics. +func defaultTemplatedHelp(cmd *cobra.Command, args []string) { + var ( + body = cmd.Long + "\n\n" + cmd.UsageString() + t = template.New("help") + tpl = template.Must(t.Parse(body)) + ) + var data = struct{ Name string }{Name: cmd.Root().Use} + + if err := tpl.Execute(cmd.OutOrStdout(), data); err != nil { + fmt.Fprintf(cmd.ErrOrStderr(), "unable to display help text: %v", err) + } +} +``` + +## `cmd/root_test.go` (changed lines (212, 213, 214, 215, 218, 219, 220, 221, 224, 225, 226, 227, 230, 231, 232, 233, 256, 257, 258, 259, 260, 261)) + +```go +package cmd + +import ( + "bytes" + "fmt" + "io" + "os" + "reflect" + "strings" + "testing" + + "github.com/ory/viper" + "knative.dev/client/pkg/util" + + fn "knative.dev/func" + . "knative.dev/func/testing" +) + +func TestRoot_PersistentFlags(t *testing.T) { + tests := []struct { + name string + args []string + skipNamespace bool + }{ + { + name: "provided as root flags", + args: []string{"--verbose", "--namespace=namespace", "list"}, + }, + { + name: "provided as sub-command flags", + args: []string{"list", "--verbose", "--namespace=namespace"}, + }, + { + name: "provided as sub-sub-command flags", + args: []string{"repositories", "list", "--verbose"}, + skipNamespace: true, // NOTE: no sub-sub commands yet use namespace, so it is not checked. + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _ = fromTempDirectory(t) + + cmd := NewCreateCmd(NewClient) // Create a function + cmd.SetArgs([]string{"--language", "go", "myfunc"}) // providing language + if err := cmd.Execute(); err != nil { // fail on any errors + t.Fatal(err) + } + + // Assert the persistent variables were propagated to the Client constructor + // when the command is actually invoked. + cmd = NewRootCmd(RootCommandConfig{NewClient: func(cfg ClientConfig, _ ...fn.Option) (*fn.Client, func()) { + if cfg.Namespace != "namespace" && !tt.skipNamespace { + t.Fatal("namespace not propagated") + } + if cfg.Verbose != true { + t.Fatal("verbose not propagated") + } + return fn.New(), func() {} + }}) + cmd.SetArgs(tt.args) + if err := cmd.Execute(); err != nil { + t.Fatal(err) + } + }) + } +} + +func TestRoot_mergeEnvMaps(t *testing.T) { + + a := "A" + b := "B" + v1 := "x" + v2 := "y" + + type args struct { + envs []fn.Env + toUpdate *util.OrderedMap + toRemove []string + } + tests := []struct { + name string + args args + want []fn.Env + }{ + { + "add new var to empty list", + args{ + []fn.Env{}, + util.NewOrderedMapWithKVStrings([][]string{{a, v1}}), + []string{}, + }, + []fn.Env{{Name: &a, Value: &v1}}, + }, + { + "add new var", + args{ + []fn.Env{{Name: &b, Value: &v2}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v1}}), + []string{}, + }, + []fn.Env{{Name: &b, Value: &v2}, {Name: &a, Value: &v1}}, + }, + { + "update var", + args{ + []fn.Env{{Name: &a, Value: &v1}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v2}}), + []string{}, + }, + []fn.Env{{Name: &a, Value: &v2}}, + }, + { + "update multiple vars", + args{ + []fn.Env{{Name: &a, Value: &v1}, {Name: &b, Value: &v2}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v2}, {b, v1}}), + []string{}, + }, + []fn.Env{{Name: &a, Value: &v2}, {Name: &b, Value: &v1}}, + }, + { + "remove var", + args{ + []fn.Env{{Name: &a, Value: &v1}}, + util.NewOrderedMap(), + []string{a}, + }, + []fn.Env{}, + }, + { + "remove multiple vars", + args{ + []fn.Env{{Name: &a, Value: &v1}, {Name: &b, Value: &v2}}, + util.NewOrderedMap(), + []string{a, b}, + }, + []fn.Env{}, + }, + { + "update and remove vars", + args{ + []fn.Env{{Name: &a, Value: &v1}, {Name: &b, Value: &v2}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v2}}), + []string{b}, + }, + []fn.Env{{Name: &a, Value: &v2}}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, _, err := mergeEnvs(tt.args.envs, tt.args.toUpdate, tt.args.toRemove) + if err != nil { + t.Errorf("mergeEnvs() for initial vars %v and toUpdate %v and toRemove %v got error %v", + tt.args.envs, tt.args.toUpdate, tt.args.toRemove, err) + } + if !reflect.DeepEqual(got, tt.want) { + + gotString := "{ " + for _, e := range got { + gotString += fmt.Sprintf("{ %s: %s } ", *e.Name, *e.Value) + } + gotString += "}" + + wantString := "{ " + for _, e := range tt.want { + wantString += fmt.Sprintf("{ %s: %s } ", *e.Name, *e.Value) + } + wantString += "}" + + t.Errorf("mergeEnvs() = got: %s, want %s", gotString, wantString) + } + }) + } +} + +// TestRoot_CommandNameParameterized confirmst that the command name, as +// printed in help text, is parameterized based on the constructor parameters +// of the root command. This allows, for example, to have help text correct +// when both embedded as a plugin or standalone. +func TestRoot_CommandNameParameterized(t *testing.T) { + expectedSynopsis := "%v [-v|--verbose] [args]" + + tests := []string{ + "func", // standalone + "kn func", // kn plugin + } + + for _, testName := range tests { + var ( + cmd = NewRootCmd(RootCommandConfig{Name: testName}) + out = strings.Builder{} + ) + cmd.SetArgs([]string{}) // Do not use test command args + cmd.SetOut(&out) + if err := cmd.Help(); err != nil { + t.Fatal(err) + } + if cmd.Use != testName { + t.Fatalf("expected command Use '%v', got '%v'", testName, cmd.Use) + } + if !strings.Contains(out.String(), fmt.Sprintf(expectedSynopsis, testName)) { + t.Logf("Testing '%v'\n", testName) + t.Log(out.String()) + t.Fatalf("Help text does not include substituted name '%v'", testName) + } + } +} + +func TestVerbose(t *testing.T) { + tests := []struct { + name string + args []string + want string + wantLF int + }{ + { + name: "verbose as version's flag", + args: []string{"version", "-v"}, + want: "Version: v0.42.0-cafe-1970-01-01", + wantLF: 3, + }, + { + name: "no verbose", + args: []string{"version"}, + want: "v0.42.0", + wantLF: 1, + }, + { + name: "verbose as root's flag", + args: []string{"--verbose", "version"}, + want: "Version: v0.42.0-cafe-1970-01-01", + wantLF: 3, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + viper.Reset() + + var out bytes.Buffer + + cmd := NewRootCmd(RootCommandConfig{ + Name: "func", + Version: Version{ + Date: "1970-01-01", + Vers: "v0.42.0", + Hash: "cafe", + }}) + + cmd.SetArgs(tt.args) + cmd.SetOut(&out) + if err := cmd.Execute(); err != nil { + t.Fatal(err) + } + + outLines := strings.Split(out.String(), "\n") + if len(outLines)-1 != tt.wantLF { + t.Errorf("expected output with %v line breaks but got %v:", tt.wantLF, len(outLines)-1) + } + if outLines[0] != tt.want { + t.Errorf("expected output: %q but got: %q", tt.want, outLines[0]) + } + }) + } +} + +// Helpers +// ------- + +// pipe the output of stdout to a buffer whose value is returned +// from the returned function. Call pipe() to start piping output +// to the buffer, call the returned function to access the data in +// the buffer. +func piped(t *testing.T) func() string { + t.Helper() + var ( + o = os.Stdout + c = make(chan error, 1) + b strings.Builder + ) + + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + + os.Stdout = w + + go func() { + _, err := io.Copy(&b, r) + r.Close() + c <- err + }() + + return func() string { + os.Stdout = o + w.Close() + err := <-c + if err != nil { + t.Fatal(err) + } + return strings.TrimSpace(b.String()) + } +} + +// fromTempDirectory is a cli-specific test helper which +// - creates a temp directory and changes to it as the new working directory +// - creates a temp directory and uses it for XDG_CONFIG_HOME +// - removes temp directories on cleanup +// - resets viper on cleanup (the reason this is "cli-specific") +func fromTempDirectory(t *testing.T) string { + t.Helper() + t.Setenv("XDG_CONFIG_HOME", t.TempDir()) + d, done := Mktemp(t) // creates and CDs to 'tmp' + t.Cleanup(func() { done(); viper.Reset() }) + return d +} +``` + +## `k8s/dialer.go` (changed lines (10, 25, 131, 141)) + +```go +package k8s + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "net" + "sync" + "time" + + coreV1 "k8s.io/api/core/v1" + metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/scheme" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" + restclient "k8s.io/client-go/rest" + "k8s.io/client-go/tools/remotecommand" +) + +var SocatImage = "quay.io/boson/alpine-socat:1.7.4.3-r1-non-root" + +// NewInClusterDialer creates context dialer that will dial TCP connections via POD running in k8s cluster. +// This is useful when accessing k8s services that are not exposed outside cluster (e.g. openshift image registry). +// +// Usage: +// +// dialer, err := k8s.NewInClusterDialer(ctx) +// if err != nil { +// return err +// } +// defer dialer.Close() +// +// transport := &http.Transport{ +// DialContext: dialer.DialContext, +// } +// +// var client = http.Client{ +// Transport: transport, +// } +func NewInClusterDialer(ctx context.Context) (*contextDialer, error) { + c := &contextDialer{ + detachChan: make(chan struct{}), + } + err := c.startDialerPod(ctx) + if err != nil { + return nil, err + } + return c, nil +} + +type contextDialer struct { + coreV1 v1.CoreV1Interface + restConf *restclient.Config + podName string + namespace string + detachChan chan struct{} +} + +func (c *contextDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error) { + if !(network == "tcp" || network == "tcp4" || network == "tcp6") { + return nil, fmt.Errorf("unsupported network: %q", network) + } + + execDone := make(chan struct{}) + pr, pw, conn := newConn(execDone) + + go func() { + defer close(execDone) + errOut := bytes.NewBuffer(nil) + err := c.exec(addr, pr, pw, errOut) + if err != nil { + err = fmt.Errorf("failed to exec in pod: %w (stderr: %q)", err, errOut.String()) + _ = pr.CloseWithError(err) + _ = pw.CloseWithError(err) + } + }() + + return conn, nil +} + +func (c *contextDialer) Close() error { + // closing the channel will cause stdin of the attached container to return EOF + // as a result the pod exits -- it transits to Completed state + close(c.detachChan) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*1) + defer cancel() + delOpts := metaV1.DeleteOptions{} + + return c.coreV1.Pods(c.namespace).Delete(ctx, c.podName, delOpts) +} + +func (c *contextDialer) startDialerPod(ctx context.Context) (err error) { + cliConf := GetClientConfig() + c.restConf, err = cliConf.ClientConfig() + if err != nil { + return + } + c.restConf.WarningHandler = restclient.NoWarnings{} + + err = setConfigDefaults(c.restConf) + if err != nil { + return + } + + client, err := kubernetes.NewForConfig(c.restConf) + if err != nil { + return + } + c.coreV1 = client.CoreV1() + + c.namespace, err = GetNamespace("") + if err != nil { + return + } + + pods := client.CoreV1().Pods(c.namespace) + + c.podName = "in-cluster-dialer-" + rand.String(5) + + defer func() { + if err != nil { + c.Close() + } + }() + + pod := &coreV1.Pod{ + ObjectMeta: metaV1.ObjectMeta{ + Name: c.podName, + Labels: nil, + Annotations: nil, + }, + Spec: coreV1.PodSpec{ + Containers: []coreV1.Container{ + { + Name: c.podName, + Image: SocatImage, + Stdin: true, + StdinOnce: true, + Command: []string{"socat", "-u", "-", "OPEN:/dev/null"}, + SecurityContext: defaultSecurityContext(), + }, + }, + DNSPolicy: coreV1.DNSClusterFirst, + RestartPolicy: coreV1.RestartPolicyNever, + }, + } + creatOpts := metaV1.CreateOptions{} + + ready := podReady(ctx, c.coreV1, c.podName, c.namespace) + + _, err = pods.Create(ctx, pod, creatOpts) + if err != nil { + return + } + + select { + case err = <-ready: + case <-ctx.Done(): + err = ctx.Err() + case <-time.After(time.Minute * 1): + err = errors.New("timeout") + } + + if err != nil { + return fmt.Errorf("failed to start dialer container: %w", err) + } + + // attaching to the stdin to automatically Complete the pod on exit + go func() { + _ = attach(c.coreV1.RESTClient(), c.restConf, c.podName, c.namespace, emptyBlockingReader(c.detachChan), io.Discard, io.Discard) + }() + + return nil +} + +// reader that returns no data and blocks until +// the channel is closed or data are sent to the channel +type emptyBlockingReader chan struct{} + +func (e emptyBlockingReader) Read(p []byte) (n int, err error) { + <-e + return 0, io.EOF +} + +func (c *contextDialer) exec(hostPort string, in io.Reader, out, errOut io.Writer) error { + + restClient := c.coreV1.RESTClient() + req := restClient.Post(). + Resource("pods"). + Name(c.podName). + Namespace(c.namespace). + SubResource("exec") + req.VersionedParams(&coreV1.PodExecOptions{ + Command: []string{"socat", "-", fmt.Sprintf("TCP:%s", hostPort)}, + Container: c.podName, + Stdin: true, + Stdout: true, + Stderr: true, + TTY: false, + }, scheme.ParameterCodec) + + executor, err := remotecommand.NewSPDYExecutor(c.restConf, "POST", req.URL()) + if err != nil { + return err + } + + return executor.Stream(remotecommand.StreamOptions{ + Stdin: in, + Stdout: out, + Stderr: errOut, + Tty: false, + }) +} + +func attach(restClient restclient.Interface, restConf *restclient.Config, podName, namespace string, in io.Reader, out, errOut io.Writer) error { + req := restClient.Post(). + Resource("pods"). + Name(podName). + Namespace(namespace). + SubResource("attach") + req.VersionedParams(&coreV1.PodAttachOptions{ + Container: podName, + Stdin: true, + Stdout: true, + Stderr: true, + TTY: false, + }, scheme.ParameterCodec) + + executor, err := remotecommand.NewSPDYExecutor(restConf, "POST", req.URL()) + if err != nil { + return err + } + + return executor.Stream(remotecommand.StreamOptions{ + Stdin: in, + Stdout: out, + Stderr: errOut, + Tty: false, + }) +} + +func podReady(ctx context.Context, core v1.CoreV1Interface, podName, namespace string) (errChan <-chan error) { + d := make(chan error) + errChan = d + + pods := core.Pods(namespace) + + nameSelector := fields.OneTermEqualSelector("metadata.name", podName).String() + listOpts := metaV1.ListOptions{ + Watch: true, + FieldSelector: nameSelector, + } + watcher, err := pods.Watch(ctx, listOpts) + if err != nil { + return + } + + go func() { + defer watcher.Stop() + ch := watcher.ResultChan() + for event := range ch { + pod, ok := event.Object.(*coreV1.Pod) + if !ok { + continue + } + + if event.Type == watch.Modified { + for _, status := range pod.Status.ContainerStatuses { + if status.Ready { + d <- nil + return + } + if status.State.Waiting != nil { + switch status.State.Waiting.Reason { + case "ErrImagePull", + "CreateContainerError", + "CreateContainerConfigError", + "InvalidImageName", + "CrashLoopBackOff", + "ImagePullBackOff": + d <- fmt.Errorf("reason: %v, message: %v", + status.State.Waiting.Reason, + status.State.Waiting.Message) + return + default: + continue + } + } + } + } + } + }() + + return +} + +func setConfigDefaults(config *restclient.Config) error { + gv := coreV1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/api" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = restclient.DefaultKubernetesUserAgent() + } + + return nil +} + +type addr struct{} + +func (a addr) Network() string { + return "pod-stdio" +} + +func (a addr) String() string { + return "pod-stdio" +} + +type conn struct { + pr *io.PipeReader + pw *io.PipeWriter + execDone <-chan struct{} +} + +func (c conn) Read(b []byte) (n int, err error) { + return c.pr.Read(b) +} + +func (c conn) Write(b []byte) (n int, err error) { + return c.pw.Write(b) +} + +func (c conn) Close() error { + err := c.pw.Close() + if err != nil { + return fmt.Errorf("failed to close writer: %w", err) + } + <-c.execDone + err = c.pr.Close() + if err != nil { + return fmt.Errorf("failed to close reader: %w", err) + } + return nil +} + +func (c conn) LocalAddr() net.Addr { + return addr{} +} + +func (c conn) RemoteAddr() net.Addr { + return addr{} +} + +func (c conn) SetDeadline(t time.Time) error { return nil } + +func (c conn) SetReadDeadline(t time.Time) error { return nil } + +func (c conn) SetWriteDeadline(t time.Time) error { return nil } + +func newConn(execDone <-chan struct{}) (*io.PipeReader, *io.PipeWriter, conn) { + pr0, pw0 := io.Pipe() + pr1, pw1 := io.Pipe() + rwc := conn{pr: pr0, pw: pw1, execDone: execDone} + return pr1, pw0, rwc +} + +func NewLazyInitInClusterDialer() *lazyInitInClusterDialer { + return &lazyInitInClusterDialer{} +} + +type lazyInitInClusterDialer struct { + contextDialer *contextDialer + initErr error + o sync.Once +} + +func (l *lazyInitInClusterDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error) { + l.o.Do(func() { + l.contextDialer, l.initErr = NewInClusterDialer(ctx) + }) + if l.initErr != nil { + return nil, l.initErr + } + return l.contextDialer.DialContext(ctx, network, addr) +} + +func (l *lazyInitInClusterDialer) Close() error { + if l.contextDialer != nil { + return l.contextDialer.Close() + } + return nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..9a274294aeb8ac0a6f1e55273c0b92bb1b9c664f --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/pre_context.md @@ -0,0 +1,1169 @@ +# Patch-overlapping Go context before the fix + +## `cmd/root.go` (changed lines (12, 364, 365)) + +```go +package cmd + +import ( + "fmt" + "os" + "path/filepath" + "strings" + "text/template" + "time" + + "knative.dev/func/cmd/templates" + + "github.com/ory/viper" + "github.com/spf13/cobra" + "golang.org/x/term" + "k8s.io/apimachinery/pkg/util/sets" + "knative.dev/client/pkg/util" + fn "knative.dev/func" +) + +type RootCommandConfig struct { + Name string // usually `func` or `kn func` + Version + NewClient ClientFactory +} + +// NewRootCmd creates the root of the command tree defines the command name, description, globally +// available flags, etc. It has no action of its own, such that running the +// resultant binary with no arguments prints the help/usage text. +func NewRootCmd(config RootCommandConfig) *cobra.Command { + cmd := &cobra.Command{ + // Use must be set to exactly config.Name, as this field is overloaded to + // be used in subcommand help text as the command with possible prefix: + Use: config.Name, + Short: "Serverless functions", + SilenceErrors: true, // we explicitly handle errors in Execute() + SilenceUsage: true, // no usage dump on error + Long: `Knative serverless functions + + Create, build and deploy Knative functions + +SYNOPSIS + {{.Use}} [-v|--verbose] [args] + +EXAMPLES + + o Create a Node function in the current directory + $ {{.Use}} create --language node . + + o Deploy the function defined in the current working directory to the + currently connected cluster, specifying a container registry in place of + quay.io/user for the function's container. + $ {{.Use}} deploy --registry quay.io.user + + o Invoke the function defined in the current working directory with an example + request. + $ {{.Use}} invoke + + For more examples, see '{{.Use}} [command] --help'.`, + } + + // Environment Variables + // Evaluated first after static defaults, set all flags to be associated with + // a version prefixed by "FUNC_" + viper.AutomaticEnv() // read in environment variables for FUNC_ + viper.SetEnvPrefix("func") // ensure that all have the prefix + + // Flags + // persistent flags are available to all subcommands implicitly + // Note they are bound immediately here as opposed to other subcommands + // because this root command is not actually executed during tests, and + // therefore PreRunE and other event-based listeners are not invoked. + cmd.PersistentFlags().BoolP("verbose", "v", false, "Print verbose logs ($FUNC_VERBOSE)") + if err := viper.BindPFlag("verbose", cmd.PersistentFlags().Lookup("verbose")); err != nil { + fmt.Fprintf(os.Stderr, "error binding flag: %v\n", err) + } + cmd.PersistentFlags().StringP("namespace", "n", "", "The namespace on the cluster used for remote commands. By default, the namespace func.yaml is used or the currently active namespace if not set in the configuration. (Env: $FUNC_NAMESPACE)") + if err := viper.BindPFlag("namespace", cmd.PersistentFlags().Lookup("namespace")); err != nil { + fmt.Fprintf(os.Stderr, "error binding flag: %v\n", err) + } + + // Version + cmd.Version = config.Version.String() + cmd.SetVersionTemplate(`{{printf "%s\n" .Version}}`) + + // Client + // Use the provided ClientFactory or default to NewClient + newClient := config.NewClient + if newClient == nil { + newClient = NewClient + } + + // Grouped commands + groups := templates.CommandGroups{ + { + Header: "Main Commands:", + Commands: []*cobra.Command{ + NewBuildCmd(newClient), + NewConfigCmd(defaultLoaderSaver), + NewCreateCmd(newClient), + NewDeleteCmd(newClient), + NewDeployCmd(newClient), + NewInfoCmd(newClient), + NewInvokeCmd(newClient), + NewLanguagesCmd(newClient), + NewListCmd(newClient), + NewRepositoryCmd(newClient), + NewRunCmd(newClient), + NewTemplatesCmd(newClient), + }, + }, + { + Header: "Other Commands:", + Commands: []*cobra.Command{ + NewCompletionCmd(), + NewVersionCmd(config.Version), + }, + }, + } + + // Add all commands to the root command, and initialize + groups.AddTo(cmd) + groups.SetRootUsage(cmd, nil) + + return cmd +} + +// Helpers +// ------------------------------------------ + +// interactiveTerminal returns whether or not the currently attached process +// terminal is interactive. Used for determining whether or not to +// interactively prompt the user to confirm default choices, etc. +func interactiveTerminal() bool { + return term.IsTerminal(int(os.Stdin.Fd())) +} + +// bindFunc which conforms to the cobra PreRunE method signature +type bindFunc func(*cobra.Command, []string) error + +// bindEnv returns a bindFunc that binds env vars to the named flags. +func bindEnv(flags ...string) bindFunc { + return func(cmd *cobra.Command, args []string) (err error) { + for _, flag := range flags { + if err = viper.BindPFlag(flag, cmd.Flags().Lookup(flag)); err != nil { + return + } + } + return + } +} + +// deriveName returns the explicit value (if provided) or attempts to derive +// from the given path. Path is defaulted to current working directory, where +// a function configuration, if it exists and contains a name, is used. +func deriveName(explicitName string, path string) string { + // If the name was explicitly provided, use it. + if explicitName != "" { + return explicitName + } + + // If the directory at path contains an initialized function, use the name therein + f, err := fn.NewFunction(path) + if err == nil && f.Name != "" { + return f.Name + } + + return "" +} + +// deriveNameAndAbsolutePathFromPath returns resolved function name and absolute path +// to the function project root. The input parameter path could be one of: +// 'relative/path/to/foo', '/absolute/path/to/foo', 'foo' or ”. +func deriveNameAndAbsolutePathFromPath(path string) (string, string) { + var absPath string + + // If path is not specified, we would like to use current working dir + if path == "" { + path = cwd() + } + + // Expand the passed function name to its absolute path + absPath, err := filepath.Abs(path) + if err != nil { + return "", "" + } + + // Get the name of the function, which equals to name of the current directory + pathParts := strings.Split(strings.TrimRight(path, string(os.PathSeparator)), string(os.PathSeparator)) + return pathParts[len(pathParts)-1], absPath +} + +// deriveImage returns the same image name which will be used. +// I.e. if the explicit name is empty, derive one from the configured registry +// (registry plus username) and the function's name. +// +// This is calculated preemptively here in the CLI (prior to invoking the +// client), only in order to provide information to the user via the prompt. +// The client will calculate this same value if the image override is not +// provided. +// +// Derivation logic: +// deriveImage attempts to arrive at a final, full image name: +// +// format: [registry]/[username]/[functionName]:[tag] +// example: quay.io/myname/my.function.name:tag. +// +// Registry can optionally be omitted, in which case DefaultRegistry +// will be prepended. +// +// If the image flag is provided, this value is used directly (the user supplied +// --image or $FUNC_IMAGE). Otherwise, the function at 'path' is loaded, and +// the Image name therein is used (i.e. it was previously calculated). +// Finally, the default registry is used, which is prepended to the function +// name, and appended with ':latest': +func deriveImage(explicitImage, defaultRegistry, path string) string { + if explicitImage != "" { + return explicitImage // use the explicit value provided. + } + f, err := fn.NewFunction(path) + if err != nil { + return "" // unable to derive due to load error (uninitialized?) + } + if f.Image != "" { + return f.Image // use value previously provided or derived. + } + // Use the func system's derivation logic. + // Errors deriving result in an empty return + derivedValue, _ := f.ImageName() + return derivedValue +} + +func envFromCmd(cmd *cobra.Command) (*util.OrderedMap, []string, error) { + if cmd.Flags().Changed("env") { + env, err := cmd.Flags().GetStringArray("env") + if err != nil { + return nil, []string{}, fmt.Errorf("Invalid --env: %w", err) + } + return util.OrderedMapAndRemovalListFromArray(env, "=") + } + return util.NewOrderedMap(), []string{}, nil +} + +func mergeEnvs(envs []fn.Env, envToUpdate *util.OrderedMap, envToRemove []string) ([]fn.Env, int, error) { + updated := sets.NewString() + + var counter int + + for i := range envs { + if envs[i].Name != nil { + value, present := envToUpdate.GetString(*envs[i].Name) + if present { + envs[i].Value = &value + updated.Insert(*envs[i].Name) + counter++ + } + } + } + + it := envToUpdate.Iterator() + for name, value, ok := it.NextString(); ok; name, value, ok = it.NextString() { + if !updated.Has(name) { + n := name + v := value + envs = append(envs, fn.Env{Name: &n, Value: &v}) + counter++ + } + } + + for _, name := range envToRemove { + for i, envVar := range envs { + if *envVar.Name == name { + envs = append(envs[:i], envs[i+1:]...) + counter++ + break + } + } + } + + errMsg := fn.ValidateEnvs(envs) + if len(errMsg) > 0 { + return []fn.Env{}, 0, fmt.Errorf(strings.Join(errMsg, "\n")) + } + + return envs, counter, nil +} + +// setPathFlag ensures common text/wording when the --path flag is used +func setPathFlag(cmd *cobra.Command) { + cmd.Flags().StringP("path", "p", ".", "Path to the project directory (Env: $FUNC_PATH)") +} + +// getPathFlag returns the value of the --path flag. +// The special value '.' is returned as the abolute path to the current +// working directory. +func getPathFlag() string { + path := viper.GetString("path") + if path == "." { + path = cwd() + } + return path +} + +// cwd returns the current working directory or exits 1 printing the error. +func cwd() (cwd string) { + cwd, err := os.Getwd() + if err != nil { + panic(fmt.Sprintf("Unable to determine current working directory: %v", err)) + } + return cwd +} + +type Version struct { + // Date of compilation + Date string + // Version tag of the git commit, or 'tip' if no tag. + Vers string + // Hash of the currently active git commit on build. + Hash string + // Verbose printing enabled for the string representation. + Verbose bool +} + +// Return the stringification of the Version struct, which takes into account +// the verbosity setting. +func (v Version) String() string { + if v.Verbose { + return v.StringVerbose() + } + + // Ensure that the value returned is parseable as a semver, with the special + // value v0.0.0 as the default indicating there is no version information + // available. + if strings.HasPrefix(v.Vers, "v") { + // TODO: this is the naive approach, perhaps consider actually parse it + // using the semver lib + return v.Vers + } + + // Any non-semver value is invalid, and thus indistinguishable from a + // nonexistent version value, so the default zero value of v0.0.0 is used. + return "v0.0.0" +} + +// StringVerbose returns the verbose version of the version stringification. +// The format returned is [semver]-[hash]-[date] where the special value +// 'v0.0.0' and 'source' are used when version is not available and/or the +// libray has been built from source, respectively. +func (v Version) StringVerbose() string { + var ( + vers = v.Vers + hash = v.Hash + date = v.Date + ) + if vers == "" { + vers = "v0.0.0" + } + if hash == "" { + hash = "source" + } + if date == "" { + date = time.Now().Format(time.RFC3339) + } + return fmt.Sprintf("%s-%s-%s", vers, hash, date) +} + +// surveySelectDefault returns 'value' if defined and exists in 'options'. +// Otherwise, options[0] is returned if it exists. Empty string otherwise. +// +// Usage Example: +// +// languages := []string{ "go", "node", "rust" }, +// survey.Select{ +// Options: options, +// Default: surveySelectDefaut(cfg.Language, languages), +// } +// +// Summary: +// +// This protects against an incorrectly initialized survey.Select when the user +// has provided a nonexistant option (validation is handled elsewhere) or +// when a value is required but there exists no defaults (no default value on +// the associated flag). +// +// Explanation: +// +// The above example chooses the default for the Survey (--confirm) question +// in a way that works with user-provided flag and environment variable values. +// +// `cfg.Language` is the current value set in the config struct, which is +// populated from (in ascending order of precedence): +// static flag default, associated environment variable, or command flag. +// `languages` are the options which are being used by the survey select. +// +// This cascade allows for the Survey questions to be properly pre-initialzed +// with their associated environment variables or flags. For example, +// A user whose default language is set to 'node' using the global environment +// variable FUNC_LANGUAGE will have that option pre-selected when running +// `func create -c`. +// +// The 'survey' package expects the value of the Default member to exist +// in the 'Options' member. This is not possible when user-provided data is +// allowed for the default, hence this logic is necessary. +// +// For example, when the user is using prompts (--confirm) to select from a set +// of options, but the associated flag either has an unrecognized value, or no +// value at all, without this logic the resulting select prompt would be +// initialized with this as the default value, and the act of what appears to +// be choose the first option displayed does not overwrite the invalid default. +// It could perhaps be argued this is a shortcoming in the survey package, but +// it is also clearly an error to provide invalid data for a default. +func surveySelectDefault(value string, options []string) string { + for _, v := range options { + if value == v { + return v // The provided value is acceptable + } + } + if len(options) > 0 { + return options[0] // Sync with the option which will be shown by the UX + } + // Either the value is not an option or there are no options. Either of + // which should fail proper validation + return "" +} + +// defaultTemplatedHelp evaluates the given command's help text as a template +// some commands define their own help command when additional values are +// required beyond these basics. +func defaultTemplatedHelp(cmd *cobra.Command, args []string) { + var ( + body = cmd.Long + "\n\n" + cmd.UsageString() + t = template.New("help") + tpl = template.Must(t.Parse(body)) + ) + var data = struct{ Name string }{Name: cmd.Root().Use} + + if err := tpl.Execute(cmd.OutOrStdout(), data); err != nil { + fmt.Fprintf(cmd.ErrOrStderr(), "unable to display help text: %v", err) + } +} +``` + +## `cmd/root_test.go` (changed lines (212, 213, 214, 215, 217, 218, 219, 220, 222, 223, 224, 225, 227, 228, 229, 230, 252, 253, 254)) + +```go +package cmd + +import ( + "bytes" + "fmt" + "io" + "os" + "reflect" + "strings" + "testing" + + "github.com/ory/viper" + "knative.dev/client/pkg/util" + + fn "knative.dev/func" + . "knative.dev/func/testing" +) + +func TestRoot_PersistentFlags(t *testing.T) { + tests := []struct { + name string + args []string + skipNamespace bool + }{ + { + name: "provided as root flags", + args: []string{"--verbose", "--namespace=namespace", "list"}, + }, + { + name: "provided as sub-command flags", + args: []string{"list", "--verbose", "--namespace=namespace"}, + }, + { + name: "provided as sub-sub-command flags", + args: []string{"repositories", "list", "--verbose"}, + skipNamespace: true, // NOTE: no sub-sub commands yet use namespace, so it is not checked. + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _ = fromTempDirectory(t) + + cmd := NewCreateCmd(NewClient) // Create a function + cmd.SetArgs([]string{"--language", "go", "myfunc"}) // providing language + if err := cmd.Execute(); err != nil { // fail on any errors + t.Fatal(err) + } + + // Assert the persistent variables were propagated to the Client constructor + // when the command is actually invoked. + cmd = NewRootCmd(RootCommandConfig{NewClient: func(cfg ClientConfig, _ ...fn.Option) (*fn.Client, func()) { + if cfg.Namespace != "namespace" && !tt.skipNamespace { + t.Fatal("namespace not propagated") + } + if cfg.Verbose != true { + t.Fatal("verbose not propagated") + } + return fn.New(), func() {} + }}) + cmd.SetArgs(tt.args) + if err := cmd.Execute(); err != nil { + t.Fatal(err) + } + }) + } +} + +func TestRoot_mergeEnvMaps(t *testing.T) { + + a := "A" + b := "B" + v1 := "x" + v2 := "y" + + type args struct { + envs []fn.Env + toUpdate *util.OrderedMap + toRemove []string + } + tests := []struct { + name string + args args + want []fn.Env + }{ + { + "add new var to empty list", + args{ + []fn.Env{}, + util.NewOrderedMapWithKVStrings([][]string{{a, v1}}), + []string{}, + }, + []fn.Env{{Name: &a, Value: &v1}}, + }, + { + "add new var", + args{ + []fn.Env{{Name: &b, Value: &v2}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v1}}), + []string{}, + }, + []fn.Env{{Name: &b, Value: &v2}, {Name: &a, Value: &v1}}, + }, + { + "update var", + args{ + []fn.Env{{Name: &a, Value: &v1}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v2}}), + []string{}, + }, + []fn.Env{{Name: &a, Value: &v2}}, + }, + { + "update multiple vars", + args{ + []fn.Env{{Name: &a, Value: &v1}, {Name: &b, Value: &v2}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v2}, {b, v1}}), + []string{}, + }, + []fn.Env{{Name: &a, Value: &v2}, {Name: &b, Value: &v1}}, + }, + { + "remove var", + args{ + []fn.Env{{Name: &a, Value: &v1}}, + util.NewOrderedMap(), + []string{a}, + }, + []fn.Env{}, + }, + { + "remove multiple vars", + args{ + []fn.Env{{Name: &a, Value: &v1}, {Name: &b, Value: &v2}}, + util.NewOrderedMap(), + []string{a, b}, + }, + []fn.Env{}, + }, + { + "update and remove vars", + args{ + []fn.Env{{Name: &a, Value: &v1}, {Name: &b, Value: &v2}}, + util.NewOrderedMapWithKVStrings([][]string{{a, v2}}), + []string{b}, + }, + []fn.Env{{Name: &a, Value: &v2}}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, _, err := mergeEnvs(tt.args.envs, tt.args.toUpdate, tt.args.toRemove) + if err != nil { + t.Errorf("mergeEnvs() for initial vars %v and toUpdate %v and toRemove %v got error %v", + tt.args.envs, tt.args.toUpdate, tt.args.toRemove, err) + } + if !reflect.DeepEqual(got, tt.want) { + + gotString := "{ " + for _, e := range got { + gotString += fmt.Sprintf("{ %s: %s } ", *e.Name, *e.Value) + } + gotString += "}" + + wantString := "{ " + for _, e := range tt.want { + wantString += fmt.Sprintf("{ %s: %s } ", *e.Name, *e.Value) + } + wantString += "}" + + t.Errorf("mergeEnvs() = got: %s, want %s", gotString, wantString) + } + }) + } +} + +// TestRoot_CommandNameParameterized confirmst that the command name, as +// printed in help text, is parameterized based on the constructor parameters +// of the root command. This allows, for example, to have help text correct +// when both embedded as a plugin or standalone. +func TestRoot_CommandNameParameterized(t *testing.T) { + expectedSynopsis := "%v [-v|--verbose] [args]" + + tests := []string{ + "func", // standalone + "kn func", // kn plugin + } + + for _, testName := range tests { + var ( + cmd = NewRootCmd(RootCommandConfig{Name: testName}) + out = strings.Builder{} + ) + cmd.SetArgs([]string{}) // Do not use test command args + cmd.SetOut(&out) + if err := cmd.Help(); err != nil { + t.Fatal(err) + } + if cmd.Use != testName { + t.Fatalf("expected command Use '%v', got '%v'", testName, cmd.Use) + } + if !strings.Contains(out.String(), fmt.Sprintf(expectedSynopsis, testName)) { + t.Logf("Testing '%v'\n", testName) + t.Log(out.String()) + t.Fatalf("Help text does not include substituted name '%v'", testName) + } + } +} + +func TestVerbose(t *testing.T) { + tests := []struct { + name string + args []string + want string + }{ + { + name: "verbose as version's flag", + args: []string{"version", "-v"}, + want: "v0.42.0-cafe-1970-01-01\n", + }, + { + name: "no verbose", + args: []string{"version"}, + want: "v0.42.0\n", + }, + { + name: "verbose as root's flag", + args: []string{"--verbose", "version"}, + want: "v0.42.0-cafe-1970-01-01\n", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + viper.Reset() + + var out bytes.Buffer + + cmd := NewRootCmd(RootCommandConfig{ + Name: "func", + Version: Version{ + Date: "1970-01-01", + Vers: "v0.42.0", + Hash: "cafe", + }}) + + cmd.SetArgs(tt.args) + cmd.SetOut(&out) + if err := cmd.Execute(); err != nil { + t.Fatal(err) + } + + if out.String() != tt.want { + t.Errorf("expected output: %q but got: %q", tt.want, out.String()) + } + }) + } +} + +// Helpers +// ------- + +// pipe the output of stdout to a buffer whose value is returned +// from the returned function. Call pipe() to start piping output +// to the buffer, call the returned function to access the data in +// the buffer. +func piped(t *testing.T) func() string { + t.Helper() + var ( + o = os.Stdout + c = make(chan error, 1) + b strings.Builder + ) + + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + + os.Stdout = w + + go func() { + _, err := io.Copy(&b, r) + r.Close() + c <- err + }() + + return func() string { + os.Stdout = o + w.Close() + err := <-c + if err != nil { + t.Fatal(err) + } + return strings.TrimSpace(b.String()) + } +} + +// fromTempDirectory is a cli-specific test helper which +// - creates a temp directory and changes to it as the new working directory +// - creates a temp directory and uses it for XDG_CONFIG_HOME +// - removes temp directories on cleanup +// - resets viper on cleanup (the reason this is "cli-specific") +func fromTempDirectory(t *testing.T) string { + t.Helper() + t.Setenv("XDG_CONFIG_HOME", t.TempDir()) + d, done := Mktemp(t) // creates and CDs to 'tmp' + t.Cleanup(func() { done(); viper.Reset() }) + return d +} +``` + +## `k8s/dialer.go` (changed lines (10, 26, 27, 132, 133, 134, 135, 136, 147, 148)) + +```go +package k8s + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "net" + "os" + "sync" + "time" + + coreV1 "k8s.io/api/core/v1" + metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/scheme" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" + restclient "k8s.io/client-go/rest" + "k8s.io/client-go/tools/remotecommand" +) + +var socatImage = "quay.io/boson/alpine-socat:1.7.4.3-r1-non-root" + +// NewInClusterDialer creates context dialer that will dial TCP connections via POD running in k8s cluster. +// This is useful when accessing k8s services that are not exposed outside cluster (e.g. openshift image registry). +// +// Usage: +// +// dialer, err := k8s.NewInClusterDialer(ctx) +// if err != nil { +// return err +// } +// defer dialer.Close() +// +// transport := &http.Transport{ +// DialContext: dialer.DialContext, +// } +// +// var client = http.Client{ +// Transport: transport, +// } +func NewInClusterDialer(ctx context.Context) (*contextDialer, error) { + c := &contextDialer{ + detachChan: make(chan struct{}), + } + err := c.startDialerPod(ctx) + if err != nil { + return nil, err + } + return c, nil +} + +type contextDialer struct { + coreV1 v1.CoreV1Interface + restConf *restclient.Config + podName string + namespace string + detachChan chan struct{} +} + +func (c *contextDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error) { + if !(network == "tcp" || network == "tcp4" || network == "tcp6") { + return nil, fmt.Errorf("unsupported network: %q", network) + } + + execDone := make(chan struct{}) + pr, pw, conn := newConn(execDone) + + go func() { + defer close(execDone) + errOut := bytes.NewBuffer(nil) + err := c.exec(addr, pr, pw, errOut) + if err != nil { + err = fmt.Errorf("failed to exec in pod: %w (stderr: %q)", err, errOut.String()) + _ = pr.CloseWithError(err) + _ = pw.CloseWithError(err) + } + }() + + return conn, nil +} + +func (c *contextDialer) Close() error { + // closing the channel will cause stdin of the attached container to return EOF + // as a result the pod exits -- it transits to Completed state + close(c.detachChan) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*1) + defer cancel() + delOpts := metaV1.DeleteOptions{} + + return c.coreV1.Pods(c.namespace).Delete(ctx, c.podName, delOpts) +} + +func (c *contextDialer) startDialerPod(ctx context.Context) (err error) { + cliConf := GetClientConfig() + c.restConf, err = cliConf.ClientConfig() + if err != nil { + return + } + c.restConf.WarningHandler = restclient.NoWarnings{} + + err = setConfigDefaults(c.restConf) + if err != nil { + return + } + + client, err := kubernetes.NewForConfig(c.restConf) + if err != nil { + return + } + c.coreV1 = client.CoreV1() + + c.namespace, err = GetNamespace("") + if err != nil { + return + } + + pods := client.CoreV1().Pods(c.namespace) + + c.podName = "in-cluster-dialer-" + rand.String(5) + + defer func() { + if err != nil { + c.Close() + } + }() + + img := socatImage + if i, ok := os.LookupEnv("SOCAT_IMAGE"); ok { + img = i + } + + pod := &coreV1.Pod{ + ObjectMeta: metaV1.ObjectMeta{ + Name: c.podName, + Labels: nil, + Annotations: nil, + }, + Spec: coreV1.PodSpec{ + Containers: []coreV1.Container{ + { + Name: c.podName, + Image: img, + Stdin: true, + StdinOnce: true, + Command: []string{"socat", "-u", "-", "OPEN:/dev/null"}, + SecurityContext: defaultSecurityContext(), + }, + }, + DNSPolicy: coreV1.DNSClusterFirst, + RestartPolicy: coreV1.RestartPolicyNever, + }, + } + creatOpts := metaV1.CreateOptions{} + + ready := podReady(ctx, c.coreV1, c.podName, c.namespace) + + _, err = pods.Create(ctx, pod, creatOpts) + if err != nil { + return + } + + select { + case err = <-ready: + case <-ctx.Done(): + err = ctx.Err() + case <-time.After(time.Minute * 1): + err = errors.New("timeout") + } + + if err != nil { + return fmt.Errorf("failed to start dialer container: %w", err) + } + + // attaching to the stdin to automatically Complete the pod on exit + go func() { + _ = attach(c.coreV1.RESTClient(), c.restConf, c.podName, c.namespace, emptyBlockingReader(c.detachChan), io.Discard, io.Discard) + }() + + return nil +} + +// reader that returns no data and blocks until +// the channel is closed or data are sent to the channel +type emptyBlockingReader chan struct{} + +func (e emptyBlockingReader) Read(p []byte) (n int, err error) { + <-e + return 0, io.EOF +} + +func (c *contextDialer) exec(hostPort string, in io.Reader, out, errOut io.Writer) error { + + restClient := c.coreV1.RESTClient() + req := restClient.Post(). + Resource("pods"). + Name(c.podName). + Namespace(c.namespace). + SubResource("exec") + req.VersionedParams(&coreV1.PodExecOptions{ + Command: []string{"socat", "-", fmt.Sprintf("TCP:%s", hostPort)}, + Container: c.podName, + Stdin: true, + Stdout: true, + Stderr: true, + TTY: false, + }, scheme.ParameterCodec) + + executor, err := remotecommand.NewSPDYExecutor(c.restConf, "POST", req.URL()) + if err != nil { + return err + } + + return executor.Stream(remotecommand.StreamOptions{ + Stdin: in, + Stdout: out, + Stderr: errOut, + Tty: false, + }) +} + +func attach(restClient restclient.Interface, restConf *restclient.Config, podName, namespace string, in io.Reader, out, errOut io.Writer) error { + req := restClient.Post(). + Resource("pods"). + Name(podName). + Namespace(namespace). + SubResource("attach") + req.VersionedParams(&coreV1.PodAttachOptions{ + Container: podName, + Stdin: true, + Stdout: true, + Stderr: true, + TTY: false, + }, scheme.ParameterCodec) + + executor, err := remotecommand.NewSPDYExecutor(restConf, "POST", req.URL()) + if err != nil { + return err + } + + return executor.Stream(remotecommand.StreamOptions{ + Stdin: in, + Stdout: out, + Stderr: errOut, + Tty: false, + }) +} + +func podReady(ctx context.Context, core v1.CoreV1Interface, podName, namespace string) (errChan <-chan error) { + d := make(chan error) + errChan = d + + pods := core.Pods(namespace) + + nameSelector := fields.OneTermEqualSelector("metadata.name", podName).String() + listOpts := metaV1.ListOptions{ + Watch: true, + FieldSelector: nameSelector, + } + watcher, err := pods.Watch(ctx, listOpts) + if err != nil { + return + } + + go func() { + defer watcher.Stop() + ch := watcher.ResultChan() + for event := range ch { + pod, ok := event.Object.(*coreV1.Pod) + if !ok { + continue + } + + if event.Type == watch.Modified { + for _, status := range pod.Status.ContainerStatuses { + if status.Ready { + d <- nil + return + } + if status.State.Waiting != nil { + switch status.State.Waiting.Reason { + case "ErrImagePull", + "CreateContainerError", + "CreateContainerConfigError", + "InvalidImageName", + "CrashLoopBackOff", + "ImagePullBackOff": + d <- fmt.Errorf("reason: %v, message: %v", + status.State.Waiting.Reason, + status.State.Waiting.Message) + return + default: + continue + } + } + } + } + } + }() + + return +} + +func setConfigDefaults(config *restclient.Config) error { + gv := coreV1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/api" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = restclient.DefaultKubernetesUserAgent() + } + + return nil +} + +type addr struct{} + +func (a addr) Network() string { + return "pod-stdio" +} + +func (a addr) String() string { + return "pod-stdio" +} + +type conn struct { + pr *io.PipeReader + pw *io.PipeWriter + execDone <-chan struct{} +} + +func (c conn) Read(b []byte) (n int, err error) { + return c.pr.Read(b) +} + +func (c conn) Write(b []byte) (n int, err error) { + return c.pw.Write(b) +} + +func (c conn) Close() error { + err := c.pw.Close() + if err != nil { + return fmt.Errorf("failed to close writer: %w", err) + } + <-c.execDone + err = c.pr.Close() + if err != nil { + return fmt.Errorf("failed to close reader: %w", err) + } + return nil +} + +func (c conn) LocalAddr() net.Addr { + return addr{} +} + +func (c conn) RemoteAddr() net.Addr { + return addr{} +} + +func (c conn) SetDeadline(t time.Time) error { return nil } + +func (c conn) SetReadDeadline(t time.Time) error { return nil } + +func (c conn) SetWriteDeadline(t time.Time) error { return nil } + +func newConn(execDone <-chan struct{}) (*io.PipeReader, *io.PipeWriter, conn) { + pr0, pw0 := io.Pipe() + pr1, pw1 := io.Pipe() + rwc := conn{pr: pr0, pw: pw1, execDone: execDone} + return pr1, pw0, rwc +} + +func NewLazyInitInClusterDialer() *lazyInitInClusterDialer { + return &lazyInitInClusterDialer{} +} + +type lazyInitInClusterDialer struct { + contextDialer *contextDialer + initErr error + o sync.Once +} + +func (l *lazyInitInClusterDialer) DialContext(ctx context.Context, network string, addr string) (net.Conn, error) { + l.o.Do(func() { + l.contextDialer, l.initErr = NewInClusterDialer(ctx) + }) + if l.initErr != nil { + return nil, l.initErr + } + return l.contextDialer.DialContext(ctx, network, addr) +} + +func (l *lazyInitInClusterDialer) Close() error { + if l.contextDialer != nil { + return l.contextDialer.Close() + } + return nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8e517949ad666dc8903ab00d011496629e833f17 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/task.json @@ -0,0 +1,50 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-110ab7950a2c0b2c6f28", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-110ab7950a2c0b2c6f28", + "project_id": "morefixes__knative__func", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "cmd/root.go", + "cmd/root_test.go", + "k8s/dialer.go" + ], + "patch_units": { + "before": [ + "cmd/root.go", + "cmd/root_test.go", + "k8s/dialer.go" + ], + "after": [ + "cmd/root.go", + "cmd/root_test.go", + "k8s/dialer.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/08284f23afbd2e56b5f3944acdb0c0975290472be54b872e2c20886e0b65c32f/database", + "cache_key": "08284f23afbd2e56b5f3944acdb0c0975290472be54b872e2c20886e0b65c32f", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/a8bac0a3442c882bbb51475fbca20f21b952efe6c1c0ac256b33e3ba4f4ea70c/database", + "cache_key": "a8bac0a3442c882bbb51475fbca20f21b952efe6c1c0ac256b33e3ba4f4ea70c", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/b6216b5c2d77b05bec8f32b5782769a2951f4c42109340ba350a5ccabd90b13d/database", + "cache_key": "b6216b5c2d77b05bec8f32b5782769a2951f4c42109340ba350a5ccabd90b13d", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-110ab7950a2c0b2c6f28/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-110ab7950a2c0b2c6f28/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-110ab7950a2c0b2c6f28/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..e7924704f80761ab5befe4dd731ef8110dc33a6e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/patch.diff @@ -0,0 +1,34 @@ +diff --git a/internal/auth/sasl.go b/internal/auth/sasl.go +index 06417ce..2103ab7 100644 +--- a/internal/auth/sasl.go ++++ b/internal/auth/sasl.go +@@ -81,6 +81,9 @@ func (s *SASLAuth) CreateSASL(mech string, remoteAddr net.Addr, successCb func(i + if identity == "" { + identity = username + } ++ if identity != username { ++ return ErrInvalidAuthCred ++ } + + err := s.AuthPlain(username, password) + if err != nil { +diff --git a/internal/auth/sasl_test.go b/internal/auth/sasl_test.go +index 625f0bb..fcc193a 100644 +--- a/internal/auth/sasl_test.go ++++ b/internal/auth/sasl_test.go +@@ -75,13 +75,13 @@ func TestCreateSASL(t *testing.T) { + + t.Run("PLAIN with authorization identity", func(t *testing.T) { + srv := a.CreateSASL("PLAIN", &net.TCPAddr{}, func(id string) error { +- if id != "user1a" { ++ if id != "user1" { + t.Fatal("Wrong authorization identity passed:", id) + } + return nil + }) + +- _, _, err := srv.Next([]byte("user1a\x00user1\x00aa")) ++ _, _, err := srv.Next([]byte("user1\x00user1\x00aa")) + if err != nil { + t.Error("Unexpected error:", err) + } diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..7e493fa9cbef936c953629357cf7a25878689349 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/post_context.md @@ -0,0 +1,234 @@ +# Patch-overlapping Go context after the fix + +## `internal/auth/sasl.go` (changed lines (84, 85, 86)) + +```go +/* +Maddy Mail Server - Composable all-in-one email server. +Copyright © 2019-2020 Max Mazurov , Maddy Mail Server contributors + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +package auth + +import ( + "errors" + "fmt" + "net" + + "github.com/emersion/go-sasl" + "github.com/foxcpp/maddy/framework/config" + modconfig "github.com/foxcpp/maddy/framework/config/module" + "github.com/foxcpp/maddy/framework/log" + "github.com/foxcpp/maddy/framework/module" +) + +var ( + ErrUnsupportedMech = errors.New("Unsupported SASL mechanism") + ErrInvalidAuthCred = errors.New("auth: invalid credentials") +) + +// SASLAuth is a wrapper that initializes sasl.Server using authenticators that +// call maddy module objects. +// +// It supports reporting of multiple authorization identities so multiple +// accounts can be associated with a single set of credentials. +type SASLAuth struct { + Log log.Logger + OnlyFirstID bool + + Plain []module.PlainAuth +} + +func (s *SASLAuth) SASLMechanisms() []string { + var mechs []string + + if len(s.Plain) != 0 { + mechs = append(mechs, sasl.Plain, sasl.Login) + } + + return mechs +} + +func (s *SASLAuth) AuthPlain(username, password string) error { + if len(s.Plain) == 0 { + return ErrUnsupportedMech + } + + var lastErr error + for _, p := range s.Plain { + lastErr = p.AuthPlain(username, password) + if lastErr == nil { + return nil + } + } + + return fmt.Errorf("no auth. provider accepted creds, last err: %w", lastErr) +} + +// CreateSASL creates the sasl.Server instance for the corresponding mechanism. +func (s *SASLAuth) CreateSASL(mech string, remoteAddr net.Addr, successCb func(identity string) error) sasl.Server { + switch mech { + case sasl.Plain: + return sasl.NewPlainServer(func(identity, username, password string) error { + if identity == "" { + identity = username + } + if identity != username { + return ErrInvalidAuthCred + } + + err := s.AuthPlain(username, password) + if err != nil { + s.Log.Error("authentication failed", err, "username", username, "src_ip", remoteAddr) + return ErrInvalidAuthCred + } + + return successCb(identity) + }) + case sasl.Login: + return sasl.NewLoginServer(func(username, password string) error { + err := s.AuthPlain(username, password) + if err != nil { + s.Log.Error("authentication failed", err, "username", username, "src_ip", remoteAddr) + return ErrInvalidAuthCred + } + + return successCb(username) + }) + } + return FailingSASLServ{Err: ErrUnsupportedMech} +} + +// AddProvider adds the SASL authentication provider to its mapping by parsing +// the 'auth' configuration directive. +func (s *SASLAuth) AddProvider(m *config.Map, node config.Node) error { + var any interface{} + if err := modconfig.ModuleFromNode("auth", node.Args, node, m.Globals, &any); err != nil { + return err + } + + hasAny := false + if plainAuth, ok := any.(module.PlainAuth); ok { + s.Plain = append(s.Plain, plainAuth) + hasAny = true + } + + if !hasAny { + return config.NodeErr(node, "auth: specified module does not provide any SASL mechanism") + } + return nil +} + +type FailingSASLServ struct{ Err error } + +func (s FailingSASLServ) Next([]byte) ([]byte, bool, error) { + return nil, true, s.Err +} +``` + +## `internal/auth/sasl_test.go` (changed lines (78, 84)) + +```go +/* +Maddy Mail Server - Composable all-in-one email server. +Copyright © 2019-2020 Max Mazurov , Maddy Mail Server contributors + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +package auth + +import ( + "errors" + "net" + "testing" + + "github.com/foxcpp/maddy/framework/module" + "github.com/foxcpp/maddy/internal/testutils" +) + +type mockAuth struct { + db map[string]bool +} + +func (m mockAuth) AuthPlain(username, _ string) error { + ok := m.db[username] + if !ok { + return errors.New("invalid creds") + } + return nil +} + +func TestCreateSASL(t *testing.T) { + a := SASLAuth{ + Log: testutils.Logger(t, "saslauth"), + Plain: []module.PlainAuth{ + &mockAuth{ + db: map[string]bool{ + "user1": true, + }, + }, + }, + } + + t.Run("XWHATEVER", func(t *testing.T) { + srv := a.CreateSASL("XWHATEVER", &net.TCPAddr{}, func(string) error { return nil }) + _, _, err := srv.Next([]byte("")) + if err == nil { + t.Error("No error for XWHATEVER use") + } + }) + + t.Run("PLAIN", func(t *testing.T) { + srv := a.CreateSASL("PLAIN", &net.TCPAddr{}, func(id string) error { + if id != "user1" { + t.Fatal("Wrong auth. identities passed to callback:", id) + } + return nil + }) + + _, _, err := srv.Next([]byte("\x00user1\x00aa")) + if err != nil { + t.Error("Unexpected error:", err) + } + }) + + t.Run("PLAIN with authorization identity", func(t *testing.T) { + srv := a.CreateSASL("PLAIN", &net.TCPAddr{}, func(id string) error { + if id != "user1" { + t.Fatal("Wrong authorization identity passed:", id) + } + return nil + }) + + _, _, err := srv.Next([]byte("user1\x00user1\x00aa")) + if err != nil { + t.Error("Unexpected error:", err) + } + }) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..a5419bc6ae7b2261aaff4184f038151d485a4058 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/pre_context.md @@ -0,0 +1,231 @@ +# Patch-overlapping Go context before the fix + +## `internal/auth/sasl.go` (changed lines (84,)) + +```go +/* +Maddy Mail Server - Composable all-in-one email server. +Copyright © 2019-2020 Max Mazurov , Maddy Mail Server contributors + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +package auth + +import ( + "errors" + "fmt" + "net" + + "github.com/emersion/go-sasl" + "github.com/foxcpp/maddy/framework/config" + modconfig "github.com/foxcpp/maddy/framework/config/module" + "github.com/foxcpp/maddy/framework/log" + "github.com/foxcpp/maddy/framework/module" +) + +var ( + ErrUnsupportedMech = errors.New("Unsupported SASL mechanism") + ErrInvalidAuthCred = errors.New("auth: invalid credentials") +) + +// SASLAuth is a wrapper that initializes sasl.Server using authenticators that +// call maddy module objects. +// +// It supports reporting of multiple authorization identities so multiple +// accounts can be associated with a single set of credentials. +type SASLAuth struct { + Log log.Logger + OnlyFirstID bool + + Plain []module.PlainAuth +} + +func (s *SASLAuth) SASLMechanisms() []string { + var mechs []string + + if len(s.Plain) != 0 { + mechs = append(mechs, sasl.Plain, sasl.Login) + } + + return mechs +} + +func (s *SASLAuth) AuthPlain(username, password string) error { + if len(s.Plain) == 0 { + return ErrUnsupportedMech + } + + var lastErr error + for _, p := range s.Plain { + lastErr = p.AuthPlain(username, password) + if lastErr == nil { + return nil + } + } + + return fmt.Errorf("no auth. provider accepted creds, last err: %w", lastErr) +} + +// CreateSASL creates the sasl.Server instance for the corresponding mechanism. +func (s *SASLAuth) CreateSASL(mech string, remoteAddr net.Addr, successCb func(identity string) error) sasl.Server { + switch mech { + case sasl.Plain: + return sasl.NewPlainServer(func(identity, username, password string) error { + if identity == "" { + identity = username + } + + err := s.AuthPlain(username, password) + if err != nil { + s.Log.Error("authentication failed", err, "username", username, "src_ip", remoteAddr) + return ErrInvalidAuthCred + } + + return successCb(identity) + }) + case sasl.Login: + return sasl.NewLoginServer(func(username, password string) error { + err := s.AuthPlain(username, password) + if err != nil { + s.Log.Error("authentication failed", err, "username", username, "src_ip", remoteAddr) + return ErrInvalidAuthCred + } + + return successCb(username) + }) + } + return FailingSASLServ{Err: ErrUnsupportedMech} +} + +// AddProvider adds the SASL authentication provider to its mapping by parsing +// the 'auth' configuration directive. +func (s *SASLAuth) AddProvider(m *config.Map, node config.Node) error { + var any interface{} + if err := modconfig.ModuleFromNode("auth", node.Args, node, m.Globals, &any); err != nil { + return err + } + + hasAny := false + if plainAuth, ok := any.(module.PlainAuth); ok { + s.Plain = append(s.Plain, plainAuth) + hasAny = true + } + + if !hasAny { + return config.NodeErr(node, "auth: specified module does not provide any SASL mechanism") + } + return nil +} + +type FailingSASLServ struct{ Err error } + +func (s FailingSASLServ) Next([]byte) ([]byte, bool, error) { + return nil, true, s.Err +} +``` + +## `internal/auth/sasl_test.go` (changed lines (78, 79, 84, 85)) + +```go +/* +Maddy Mail Server - Composable all-in-one email server. +Copyright © 2019-2020 Max Mazurov , Maddy Mail Server contributors + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +package auth + +import ( + "errors" + "net" + "testing" + + "github.com/foxcpp/maddy/framework/module" + "github.com/foxcpp/maddy/internal/testutils" +) + +type mockAuth struct { + db map[string]bool +} + +func (m mockAuth) AuthPlain(username, _ string) error { + ok := m.db[username] + if !ok { + return errors.New("invalid creds") + } + return nil +} + +func TestCreateSASL(t *testing.T) { + a := SASLAuth{ + Log: testutils.Logger(t, "saslauth"), + Plain: []module.PlainAuth{ + &mockAuth{ + db: map[string]bool{ + "user1": true, + }, + }, + }, + } + + t.Run("XWHATEVER", func(t *testing.T) { + srv := a.CreateSASL("XWHATEVER", &net.TCPAddr{}, func(string) error { return nil }) + _, _, err := srv.Next([]byte("")) + if err == nil { + t.Error("No error for XWHATEVER use") + } + }) + + t.Run("PLAIN", func(t *testing.T) { + srv := a.CreateSASL("PLAIN", &net.TCPAddr{}, func(id string) error { + if id != "user1" { + t.Fatal("Wrong auth. identities passed to callback:", id) + } + return nil + }) + + _, _, err := srv.Next([]byte("\x00user1\x00aa")) + if err != nil { + t.Error("Unexpected error:", err) + } + }) + + t.Run("PLAIN with authorization identity", func(t *testing.T) { + srv := a.CreateSASL("PLAIN", &net.TCPAddr{}, func(id string) error { + if id != "user1a" { + t.Fatal("Wrong authorization identity passed:", id) + } + return nil + }) + + _, _, err := srv.Next([]byte("user1a\x00user1\x00aa")) + if err != nil { + t.Error("Unexpected error:", err) + } + }) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c023a0465186d9854169396b9e145d68c35b63e3 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-1218ce956f8120d59555", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-1218ce956f8120d59555", + "project_id": "morefixes__foxcpp__maddy", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/auth/sasl.go", + "internal/auth/sasl_test.go" + ], + "patch_units": { + "before": [ + "internal/auth/sasl.go", + "internal/auth/sasl_test.go" + ], + "after": [ + "internal/auth/sasl.go", + "internal/auth/sasl_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/297a2997b5dbaf0c3f2ec5bd076a5c48f0f78f39868fa1885a46527d767c2b57/database", + "cache_key": "297a2997b5dbaf0c3f2ec5bd076a5c48f0f78f39868fa1885a46527d767c2b57", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/7100a54fd5d68f59a609a4c488783ac815450be284e9be4fcbcf7bec2f8f9ff2/database", + "cache_key": "7100a54fd5d68f59a609a4c488783ac815450be284e9be4fcbcf7bec2f8f9ff2", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/4d3b2f52ade6fd693fb89b668e2930cde2c10d683d8746040152bcbd1b0c9b08/database", + "cache_key": "4d3b2f52ade6fd693fb89b668e2930cde2c10d683d8746040152bcbd1b0c9b08", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-1218ce956f8120d59555/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-1218ce956f8120d59555/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1218ce956f8120d59555/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..5001bd21d592f3d35d68963d880649f0af28143d --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/patch.diff @@ -0,0 +1,98 @@ +diff --git a/internal/handlers/userinfo.go b/internal/handlers/userinfo.go +index c430d4f85..fa30e5683 100644 +--- a/internal/handlers/userinfo.go ++++ b/internal/handlers/userinfo.go +@@ -1,11 +1,8 @@ + package handlers + + import ( +- "encoding/json" + "net/http" + +- "google.golang.org/protobuf/encoding/protojson" +- + "github.com/pomerium/datasource/pkg/directory" + "github.com/pomerium/pomerium/internal/httputil" + "github.com/pomerium/pomerium/pkg/grpc/identity" +@@ -39,15 +36,9 @@ func (data UserInfoData) ToJSON() map[string]any { + m := map[string]any{} + m["csrfToken"] = data.CSRFToken + m["isImpersonated"] = data.IsImpersonated +- if bs, err := protojson.Marshal(data.Session); err == nil { +- m["session"] = json.RawMessage(bs) +- } +- if bs, err := protojson.Marshal(data.User); err == nil { +- m["user"] = json.RawMessage(bs) +- } +- if bs, err := protojson.Marshal(data.Profile); err == nil { +- m["profile"] = json.RawMessage(bs) +- } ++ m["session"] = data.sessionJSON() ++ m["user"] = data.userJSON() ++ m["profile"] = data.profileJSON() + m["isEnterprise"] = data.IsEnterprise + if data.DirectoryUser != nil { + m["directoryUser"] = data.DirectoryUser +@@ -62,6 +53,62 @@ func (data UserInfoData) ToJSON() map[string]any { + return m + } + ++func (data UserInfoData) profileJSON() map[string]any { ++ if data.Profile == nil { ++ return nil ++ } ++ ++ m := map[string]any{} ++ claims := make(map[string]any) ++ for k, v := range data.Profile.GetClaims().AsMap() { ++ claims[k] = v ++ } ++ m["claims"] = m ++ return m ++} ++ ++func (data UserInfoData) sessionJSON() map[string]any { ++ if data.Session == nil { ++ return nil ++ } ++ ++ m := map[string]any{} ++ claims := make(map[string]any) ++ for k, vs := range data.Session.GetClaims() { ++ claims[k] = vs.AsSlice() ++ } ++ m["claims"] = claims ++ var deviceCredentials []any ++ for _, dc := range data.Session.GetDeviceCredentials() { ++ deviceCredentials = append(deviceCredentials, map[string]any{ ++ "typeId": dc.GetTypeId(), ++ "id": dc.GetId(), ++ }) ++ } ++ m["deviceCredentials"] = deviceCredentials ++ m["expiresAt"] = data.Session.GetExpiresAt().AsTime() ++ m["id"] = data.Session.GetId() ++ m["userId"] = data.Session.GetUserId() ++ return m ++} ++ ++func (data UserInfoData) userJSON() map[string]any { ++ if data.User == nil { ++ return nil ++ } ++ ++ m := map[string]any{} ++ claims := make(map[string]any) ++ for k, vs := range data.User.GetClaims() { ++ claims[k] = vs.AsSlice() ++ } ++ m["claims"] = claims ++ m["deviceCredentialIds"] = data.User.GetDeviceCredentialIds() ++ m["id"] = data.User.GetId() ++ m["name"] = data.User.GetName() ++ return m ++} ++ + // UserInfo returns a handler that renders the user info page. + func UserInfo(data UserInfoData) http.Handler { + return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..24698bd8f1b99b2066b8724eab8d6bb4caf932d7 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/post_context.md @@ -0,0 +1,123 @@ +# Patch-overlapping Go context after the fix + +## `internal/handlers/userinfo.go` (changed lines (4, 6, 39, 40, 41, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111)) + +```go +package handlers + +import ( + "net/http" + + "github.com/pomerium/datasource/pkg/directory" + "github.com/pomerium/pomerium/internal/httputil" + "github.com/pomerium/pomerium/pkg/grpc/identity" + "github.com/pomerium/pomerium/pkg/grpc/session" + "github.com/pomerium/pomerium/pkg/grpc/user" + "github.com/pomerium/pomerium/ui" + "github.com/pomerium/webauthn" +) + +// UserInfoData is the data for the UserInfo page. +type UserInfoData struct { + CSRFToken string + IsImpersonated bool + Session *session.Session + User *user.User + Profile *identity.Profile + + IsEnterprise bool + DirectoryUser *directory.User + DirectoryGroups []*directory.Group + + WebAuthnCreationOptions *webauthn.PublicKeyCredentialCreationOptions + WebAuthnRequestOptions *webauthn.PublicKeyCredentialRequestOptions + WebAuthnURL string + + BrandingOptions httputil.BrandingOptions +} + +// ToJSON converts the data into a JSON map. +func (data UserInfoData) ToJSON() map[string]any { + m := map[string]any{} + m["csrfToken"] = data.CSRFToken + m["isImpersonated"] = data.IsImpersonated + m["session"] = data.sessionJSON() + m["user"] = data.userJSON() + m["profile"] = data.profileJSON() + m["isEnterprise"] = data.IsEnterprise + if data.DirectoryUser != nil { + m["directoryUser"] = data.DirectoryUser + } + if len(data.DirectoryGroups) > 0 { + m["directoryGroups"] = data.DirectoryGroups + } + m["webAuthnCreationOptions"] = data.WebAuthnCreationOptions + m["webAuthnRequestOptions"] = data.WebAuthnRequestOptions + m["webAuthnUrl"] = data.WebAuthnURL + httputil.AddBrandingOptionsToMap(m, data.BrandingOptions) + return m +} + +func (data UserInfoData) profileJSON() map[string]any { + if data.Profile == nil { + return nil + } + + m := map[string]any{} + claims := make(map[string]any) + for k, v := range data.Profile.GetClaims().AsMap() { + claims[k] = v + } + m["claims"] = m + return m +} + +func (data UserInfoData) sessionJSON() map[string]any { + if data.Session == nil { + return nil + } + + m := map[string]any{} + claims := make(map[string]any) + for k, vs := range data.Session.GetClaims() { + claims[k] = vs.AsSlice() + } + m["claims"] = claims + var deviceCredentials []any + for _, dc := range data.Session.GetDeviceCredentials() { + deviceCredentials = append(deviceCredentials, map[string]any{ + "typeId": dc.GetTypeId(), + "id": dc.GetId(), + }) + } + m["deviceCredentials"] = deviceCredentials + m["expiresAt"] = data.Session.GetExpiresAt().AsTime() + m["id"] = data.Session.GetId() + m["userId"] = data.Session.GetUserId() + return m +} + +func (data UserInfoData) userJSON() map[string]any { + if data.User == nil { + return nil + } + + m := map[string]any{} + claims := make(map[string]any) + for k, vs := range data.User.GetClaims() { + claims[k] = vs.AsSlice() + } + m["claims"] = claims + m["deviceCredentialIds"] = data.User.GetDeviceCredentialIds() + m["id"] = data.User.GetId() + m["name"] = data.User.GetName() + return m +} + +// UserInfo returns a handler that renders the user info page. +func UserInfo(data UserInfoData) http.Handler { + return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { + return ui.ServePage(w, r, "UserInfo", "User Info Dashboard", data.ToJSON()) + }) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..b068818478c77e36b3962b81cdc8042c6e64b700 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/pre_context.md @@ -0,0 +1,76 @@ +# Patch-overlapping Go context before the fix + +## `internal/handlers/userinfo.go` (changed lines (4, 7, 8, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 65)) + +```go +package handlers + +import ( + "encoding/json" + "net/http" + + "google.golang.org/protobuf/encoding/protojson" + + "github.com/pomerium/datasource/pkg/directory" + "github.com/pomerium/pomerium/internal/httputil" + "github.com/pomerium/pomerium/pkg/grpc/identity" + "github.com/pomerium/pomerium/pkg/grpc/session" + "github.com/pomerium/pomerium/pkg/grpc/user" + "github.com/pomerium/pomerium/ui" + "github.com/pomerium/webauthn" +) + +// UserInfoData is the data for the UserInfo page. +type UserInfoData struct { + CSRFToken string + IsImpersonated bool + Session *session.Session + User *user.User + Profile *identity.Profile + + IsEnterprise bool + DirectoryUser *directory.User + DirectoryGroups []*directory.Group + + WebAuthnCreationOptions *webauthn.PublicKeyCredentialCreationOptions + WebAuthnRequestOptions *webauthn.PublicKeyCredentialRequestOptions + WebAuthnURL string + + BrandingOptions httputil.BrandingOptions +} + +// ToJSON converts the data into a JSON map. +func (data UserInfoData) ToJSON() map[string]any { + m := map[string]any{} + m["csrfToken"] = data.CSRFToken + m["isImpersonated"] = data.IsImpersonated + if bs, err := protojson.Marshal(data.Session); err == nil { + m["session"] = json.RawMessage(bs) + } + if bs, err := protojson.Marshal(data.User); err == nil { + m["user"] = json.RawMessage(bs) + } + if bs, err := protojson.Marshal(data.Profile); err == nil { + m["profile"] = json.RawMessage(bs) + } + m["isEnterprise"] = data.IsEnterprise + if data.DirectoryUser != nil { + m["directoryUser"] = data.DirectoryUser + } + if len(data.DirectoryGroups) > 0 { + m["directoryGroups"] = data.DirectoryGroups + } + m["webAuthnCreationOptions"] = data.WebAuthnCreationOptions + m["webAuthnRequestOptions"] = data.WebAuthnRequestOptions + m["webAuthnUrl"] = data.WebAuthnURL + httputil.AddBrandingOptionsToMap(m, data.BrandingOptions) + return m +} + +// UserInfo returns a handler that renders the user info page. +func UserInfo(data UserInfoData) http.Handler { + return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { + return ui.ServePage(w, r, "UserInfo", "User Info Dashboard", data.ToJSON()) + }) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c526f4f154ace30befbc27eb5d3bbbba460ef69a --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-14446e68cdc53bc98807", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-14446e68cdc53bc98807", + "project_id": "morefixes__pomerium__pomerium", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/handlers/userinfo.go" + ], + "patch_units": { + "before": [ + "internal/handlers/userinfo.go" + ], + "after": [ + "internal/handlers/userinfo.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/30b12dbc66d88a2240ac17aa6df9b1cbbf0c42289f5a9f28161e54298bf0d075/database", + "cache_key": "30b12dbc66d88a2240ac17aa6df9b1cbbf0c42289f5a9f28161e54298bf0d075", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/d93afcca831fd8d8766c03cbbe6eb9cc10ef6a719beccd51eb47d9adab12a43c/database", + "cache_key": "d93afcca831fd8d8766c03cbbe6eb9cc10ef6a719beccd51eb47d9adab12a43c", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/51bdadbf5e05ed9db6f1f8d5de305f1c0d8b5d798275295665fd59f953daf756/database", + "cache_key": "51bdadbf5e05ed9db6f1f8d5de305f1c0d8b5d798275295665fd59f953daf756", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-14446e68cdc53bc98807/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-14446e68cdc53bc98807/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-14446e68cdc53bc98807/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..32c470863a8b6f188fa96e11d6d60582e8155b2d --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/patch.diff @@ -0,0 +1,2340 @@ +diff --git a/internal/sync/singleflight/singleflight_test.go b/internal/sync/singleflight/singleflight_test.go +index ad040379e..d9da008f4 100644 +--- a/internal/sync/singleflight/singleflight_test.go ++++ b/internal/sync/singleflight/singleflight_test.go +@@ -14,6 +14,7 @@ import ( + ) + + func TestDo(t *testing.T) { ++ t.Skip("singleflight tests not stable") + var g Group + v, err, _ := g.Do("key", func() (interface{}, error) { + return "bar", nil +@@ -27,6 +28,7 @@ func TestDo(t *testing.T) { + } + + func TestDoErr(t *testing.T) { ++ t.Skip("singleflight tests not stable") + var g Group + someErr := errors.New("Some error") + v, err, _ := g.Do("key", func() (interface{}, error) { +@@ -41,6 +43,7 @@ func TestDoErr(t *testing.T) { + } + + func TestDoDupSuppress(t *testing.T) { ++ t.Skip("singleflight tests not stable") + var g Group + var wg1, wg2 sync.WaitGroup + c := make(chan string, 1) +@@ -89,6 +92,7 @@ func TestDoDupSuppress(t *testing.T) { + // Test that singleflight behaves correctly after Forget called. + // See https://github.com/golang/go/issues/31420 + func TestForget(t *testing.T) { ++ t.Skip("singleflight tests not stable") + var g Group + + var firstStarted, firstFinished sync.WaitGroup +diff --git a/service/s3/s3crypto/aes_cbc_content_cipher.go b/service/s3/s3crypto/aes_cbc_content_cipher.go +index 7346e383c..30d6b8cb7 100644 +--- a/service/s3/s3crypto/aes_cbc_content_cipher.go ++++ b/service/s3/s3crypto/aes_cbc_content_cipher.go +@@ -15,8 +15,14 @@ type cbcContentCipherBuilder struct { + padder Padder + } + ++func (cbcContentCipherBuilder) isUsingDeprecatedFeatures() error { ++ return errDeprecatedCipherBuilder ++} ++ + // AESCBCContentCipherBuilder returns a new encryption only mode structure with a specific cipher + // for the master key ++// ++// deprecated: This content cipher builder has been deprecated. Users should migrate to AESGCMContentCipherBuilder + func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder { + return cbcContentCipherBuilder{generator: generator, padder: padder} + } +diff --git a/service/s3/s3crypto/aes_gcm_content_cipher.go b/service/s3/s3crypto/aes_gcm_content_cipher.go +index 2f2c36dc6..d4a4224e5 100644 +--- a/service/s3/s3crypto/aes_gcm_content_cipher.go ++++ b/service/s3/s3crypto/aes_gcm_content_cipher.go +@@ -15,6 +15,13 @@ type gcmContentCipherBuilder struct { + generator CipherDataGenerator + } + ++func (builder gcmContentCipherBuilder) isUsingDeprecatedFeatures() error { ++ if feature, ok := builder.generator.(deprecatedFeatures); ok { ++ return feature.isUsingDeprecatedFeatures() ++ } ++ return nil ++} ++ + // AESGCMContentCipherBuilder returns a new encryption only mode structure with a specific cipher + // for the master key + func AESGCMContentCipherBuilder(generator CipherDataGenerator) ContentCipherBuilder { +@@ -29,9 +36,14 @@ func (builder gcmContentCipherBuilder) ContentCipherWithContext(ctx aws.Context) + var cd CipherData + var err error + +- if v, ok := builder.generator.(CipherDataGeneratorWithContext); ok { ++ switch v := builder.generator.(type) { ++ case CipherDataGeneratorWithCEKAlgWithContext: ++ cd, err = v.GenerateCipherDataWithCEKAlgWithContext(ctx, gcmKeySize, gcmNonceSize, AESGCMNoPadding) ++ case CipherDataGeneratorWithCEKAlg: ++ cd, err = v.GenerateCipherDataWithCEKAlg(gcmKeySize, gcmNonceSize, AESGCMNoPadding) ++ case CipherDataGeneratorWithContext: + cd, err = v.GenerateCipherDataWithContext(ctx, gcmKeySize, gcmNonceSize) +- } else { ++ default: + cd, err = builder.generator.GenerateCipherData(gcmKeySize, gcmNonceSize) + } + if err != nil { +diff --git a/service/s3/s3crypto/aes_gcm_content_cipher_test.go b/service/s3/s3crypto/aes_gcm_content_cipher_test.go +index 400ceaf5d..eb0a1c8ba 100644 +--- a/service/s3/s3crypto/aes_gcm_content_cipher_test.go ++++ b/service/s3/s3crypto/aes_gcm_content_cipher_test.go +@@ -3,6 +3,7 @@ package s3crypto_test + import ( + "testing" + ++ "github.com/aws/aws-sdk-go/service/kms/kmsiface" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" + ) + +@@ -26,3 +27,7 @@ func TestAESGCMContentCipherNewEncryptor(t *testing.T) { + t.Errorf("expected non-nil vaue") + } + } ++ ++type mockKMS struct { ++ kmsiface.KMSAPI ++} +diff --git a/service/s3/s3crypto/aes_gcm_test.go b/service/s3/s3crypto/aes_gcm_test.go +index 72d8e22e0..29e67d151 100644 +--- a/service/s3/s3crypto/aes_gcm_test.go ++++ b/service/s3/s3crypto/aes_gcm_test.go +@@ -1,8 +1,11 @@ ++// +build go1.9 ++ + package s3crypto + + import ( + "bytes" + "encoding/hex" ++ "encoding/json" + "fmt" + "io" + "io/ioutil" +@@ -15,7 +18,7 @@ func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_128_Test_0(t *testing.T) { + iv, _ := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + plaintext, _ := hex.DecodeString("2db5168e932556f8089a0622981d017d") +- expected, _ := hex.DecodeString("fa4362189661d163fcd6a56d8bf0405ad636ac1bbedd5cc3ee727dc2ab4a9489") ++ expected, _ := hex.DecodeString("fa4362189661d163fcd6a56d8bf0405a") + tag, _ := hex.DecodeString("d636ac1bbedd5cc3ee727dc2ab4a9489") + aesgcmTest(t, iv, key, plaintext, expected, tag) + } +@@ -24,7 +27,7 @@ func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_104_Test_3(t *testing.T) { + iv, _ := hex.DecodeString("4742357c335913153ff0eb0f") + key, _ := hex.DecodeString("e5a0eb92cc2b064e1bc80891faf1fab5e9a17a9c3a984e25416720e30e6c2b21") + plaintext, _ := hex.DecodeString("8499893e16b0ba8b007d54665a") +- expected, _ := hex.DecodeString("eb8e6175f1fe38eb1acf95fd5188a8b74bb74fda553e91020a23deed45") ++ expected, _ := hex.DecodeString("eb8e6175f1fe38eb1acf95fd51") + tag, _ := hex.DecodeString("88a8b74bb74fda553e91020a23deed45") + aesgcmTest(t, iv, key, plaintext, expected, tag) + } +@@ -33,7 +36,7 @@ func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_256_Test_6(t *testing.T) { + iv, _ := hex.DecodeString("a291484c3de8bec6b47f525f") + key, _ := hex.DecodeString("37f39137416bafde6f75022a7a527cc593b6000a83ff51ec04871a0ff5360e4e") + plaintext, _ := hex.DecodeString("fafd94cede8b5a0730394bec68a8e77dba288d6ccaa8e1563a81d6e7ccc7fc97") +- expected, _ := hex.DecodeString("44dc868006b21d49284016565ffb3979cc4271d967628bf7cdaf86db888e92e501a2b578aa2f41ec6379a44a31cc019c") ++ expected, _ := hex.DecodeString("44dc868006b21d49284016565ffb3979cc4271d967628bf7cdaf86db888e92e5") + tag, _ := hex.DecodeString("01a2b578aa2f41ec6379a44a31cc019c") + aesgcmTest(t, iv, key, plaintext, expected, tag) + } +@@ -42,11 +45,62 @@ func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_408_Test_8(t *testing.T) { + iv, _ := hex.DecodeString("92f258071d79af3e63672285") + key, _ := hex.DecodeString("595f259c55abe00ae07535ca5d9b09d6efb9f7e9abb64605c337acbd6b14fc7e") + plaintext, _ := hex.DecodeString("a6fee33eb110a2d769bbc52b0f36969c287874f665681477a25fc4c48015c541fbe2394133ba490a34ee2dd67b898177849a91") +- expected, _ := hex.DecodeString("bbca4a9e09ae9690c0f6f8d405e53dccd666aa9c5fa13c8758bc30abe1ddd1bcce0d36a1eaaaaffef20cd3c5970b9673f8a65c26ccecb9976fd6ac9c2c0f372c52c821") ++ expected, _ := hex.DecodeString("bbca4a9e09ae9690c0f6f8d405e53dccd666aa9c5fa13c8758bc30abe1ddd1bcce0d36a1eaaaaffef20cd3c5970b9673f8a65c") + tag, _ := hex.DecodeString("26ccecb9976fd6ac9c2c0f372c52c821") + aesgcmTest(t, iv, key, plaintext, expected, tag) + } + ++type KAT struct { ++ IV string `json:"iv"` ++ Key string `json:"key"` ++ Plaintext string `json:"pt"` ++ AAD string `json:"aad"` ++ CipherText string `json:"ct"` ++ Tag string `json:"tag"` ++} ++ ++func TestAES_GCM_KATS(t *testing.T) { ++ fileContents, err := ioutil.ReadFile("testdata/aes_gcm.json") ++ if err != nil { ++ t.Fatalf("failed to read KAT file: %v", err) ++ } ++ ++ var kats []KAT ++ err = json.Unmarshal(fileContents, &kats) ++ if err != nil { ++ t.Fatalf("failed to unmarshal KAT json file: %v", err) ++ } ++ ++ for i, kat := range kats { ++ t.Run(fmt.Sprintf("Case%d", i), func(t *testing.T) { ++ if len(kat.AAD) > 0 { ++ t.Skip("Skipping... SDK implementation does not expose additional authenticated data") ++ } ++ iv, err := hex.DecodeString(kat.IV) ++ if err != nil { ++ t.Fatalf("failed to decode iv: %v", err) ++ } ++ key, err := hex.DecodeString(kat.Key) ++ if err != nil { ++ t.Fatalf("failed to decode key: %v", err) ++ } ++ plaintext, err := hex.DecodeString(kat.Plaintext) ++ if err != nil { ++ t.Fatalf("failed to decode plaintext: %v", err) ++ } ++ ciphertext, err := hex.DecodeString(kat.CipherText) ++ if err != nil { ++ t.Fatalf("failed to decode ciphertext: %v", err) ++ } ++ tag, err := hex.DecodeString(kat.Tag) ++ if err != nil { ++ t.Fatalf("failed to decode tag: %v", err) ++ } ++ aesgcmTest(t, iv, key, plaintext, ciphertext, tag) ++ }) ++ } ++} ++ + func TestGCMEncryptReader_SourceError(t *testing.T) { + gcm := &gcmEncryptReader{ + encrypter: &mockCipherAEAD{}, +@@ -105,6 +159,8 @@ func TestGCMDecryptReader_DecrypterOpenError(t *testing.T) { + } + + func aesgcmTest(t *testing.T, iv, key, plaintext, expected, tag []byte) { ++ t.Helper() ++ const gcmTagSize = 16 + cd := CipherData{ + Key: key, + IV: iv, +@@ -122,11 +178,11 @@ func aesgcmTest(t *testing.T, iv, key, plaintext, expected, tag []byte) { + } + + // splitting tag and ciphertext +- etag := ciphertext[len(ciphertext)-16:] ++ etag := ciphertext[len(ciphertext)-gcmTagSize:] + if !bytes.Equal(etag, tag) { + t.Errorf("expected tags to be equivalent") + } +- if !bytes.Equal(ciphertext, expected) { ++ if !bytes.Equal(ciphertext[:len(ciphertext)-gcmTagSize], expected) { + t.Errorf("expected ciphertext to be equivalent") + } + +diff --git a/service/s3/s3crypto/cipher_util.go b/service/s3/s3crypto/cipher_util.go +index de7f553ba..64eac7753 100644 +--- a/service/s3/s3crypto/cipher_util.go ++++ b/service/s3/s3crypto/cipher_util.go +@@ -3,33 +3,8 @@ package s3crypto + import ( + "encoding/base64" + "strconv" +- "strings" +- +- "github.com/aws/aws-sdk-go/aws" +- "github.com/aws/aws-sdk-go/aws/awserr" + ) + +-func (client *DecryptionClient) contentCipherFromEnvelope(ctx aws.Context, env Envelope) (ContentCipher, error) { +- wrap, err := client.wrapFromEnvelope(env) +- if err != nil { +- return nil, err +- } +- +- return client.cekFromEnvelope(ctx, env, wrap) +-} +- +-func (client *DecryptionClient) wrapFromEnvelope(env Envelope) (CipherDataDecrypter, error) { +- f, ok := client.WrapRegistry[env.WrapAlg] +- if !ok || f == nil { +- return nil, awserr.New( +- "InvalidWrapAlgorithmError", +- "wrap algorithm isn't supported, "+env.WrapAlg, +- nil, +- ) +- } +- return f(env) +-} +- + // AESGCMNoPadding is the constant value that is used to specify + // the CEK algorithm consiting of AES GCM with no padding. + const AESGCMNoPadding = "AES/GCM/NoPadding" +@@ -37,61 +12,6 @@ const AESGCMNoPadding = "AES/GCM/NoPadding" + // AESCBC is the string constant that signifies the AES CBC algorithm cipher. + const AESCBC = "AES/CBC" + +-func (client *DecryptionClient) cekFromEnvelope(ctx aws.Context, env Envelope, decrypter CipherDataDecrypter) (ContentCipher, error) { +- f, ok := client.CEKRegistry[env.CEKAlg] +- if !ok || f == nil { +- return nil, awserr.New( +- "InvalidCEKAlgorithmError", +- "cek algorithm isn't supported, "+env.CEKAlg, +- nil, +- ) +- } +- +- key, err := base64.StdEncoding.DecodeString(env.CipherKey) +- if err != nil { +- return nil, err +- } +- +- iv, err := base64.StdEncoding.DecodeString(env.IV) +- if err != nil { +- return nil, err +- } +- +- if d, ok := decrypter.(CipherDataDecrypterWithContext); ok { +- key, err = d.DecryptKeyWithContext(ctx, key) +- } else { +- key, err = decrypter.DecryptKey(key) +- } +- +- if err != nil { +- return nil, err +- } +- +- cd := CipherData{ +- Key: key, +- IV: iv, +- CEKAlgorithm: env.CEKAlg, +- Padder: client.getPadder(env.CEKAlg), +- } +- return f(cd) +-} +- +-// getPadder will return an unpadder with checking the cek algorithm specific padder. +-// If there wasn't a cek algorithm specific padder, we check the padder itself. +-// We return a no unpadder, if no unpadder was found. This means any customization +-// either contained padding within the cipher implementation, and to maintain +-// backwards compatility we will simply not unpad anything. +-func (client *DecryptionClient) getPadder(cekAlg string) Padder { +- padder, ok := client.PadderRegistry[cekAlg] +- if !ok { +- padder, ok = client.PadderRegistry[cekAlg[strings.LastIndex(cekAlg, "/")+1:]] +- if !ok { +- return NoPadder +- } +- } +- return padder +-} +- + func encodeMeta(reader hashReader, cd CipherData) (Envelope, error) { + iv := base64.StdEncoding.EncodeToString(cd.IV) + key := base64.StdEncoding.EncodeToString(cd.EncryptedKey) +diff --git a/service/s3/s3crypto/cipher_util_test.go b/service/s3/s3crypto/cipher_util_test.go +index c8704c30d..5c59160aa 100644 +--- a/service/s3/s3crypto/cipher_util_test.go ++++ b/service/s3/s3crypto/cipher_util_test.go +@@ -14,7 +14,7 @@ import ( + ) + + func TestWrapFactory(t *testing.T) { +- c := DecryptionClient{ ++ o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(unit.Session), +@@ -28,7 +28,7 @@ func TestWrapFactory(t *testing.T) { + WrapAlg: KMSWrap, + MatDesc: `{"kms_cmk_id":""}`, + } +- wrap, err := c.wrapFromEnvelope(env) ++ wrap, err := wrapFromEnvelope(o, env) + w, ok := wrap.(*kmsKeyHandler) + + if err != nil { +@@ -42,7 +42,7 @@ func TestWrapFactory(t *testing.T) { + } + } + func TestWrapFactoryErrorNoWrap(t *testing.T) { +- c := DecryptionClient{ ++ o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(unit.Session), +@@ -56,7 +56,7 @@ func TestWrapFactoryErrorNoWrap(t *testing.T) { + WrapAlg: "none", + MatDesc: `{"kms_cmk_id":""}`, + } +- wrap, err := c.wrapFromEnvelope(env) ++ wrap, err := wrapFromEnvelope(o, env) + + if err == nil { + t.Error("expected error, but received none") +@@ -67,7 +67,7 @@ func TestWrapFactoryErrorNoWrap(t *testing.T) { + } + + func TestWrapFactoryCustomEntry(t *testing.T) { +- c := DecryptionClient{ ++ o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + "custom": (kmsKeyHandler{ + kms: kms.New(unit.Session), +@@ -81,7 +81,7 @@ func TestWrapFactoryCustomEntry(t *testing.T) { + WrapAlg: "custom", + MatDesc: `{"kms_cmk_id":""}`, + } +- wrap, err := c.wrapFromEnvelope(env) ++ wrap, err := wrapFromEnvelope(o, env) + + if err != nil { + t.Errorf("expected no error, but received %v", err) +@@ -107,7 +107,7 @@ func TestCEKFactory(t *testing.T) { + Region: aws.String("us-west-2"), + }) + +- c := DecryptionClient{ ++ o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), +@@ -139,8 +139,8 @@ func TestCEKFactory(t *testing.T) { + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } +- wrap, err := c.wrapFromEnvelope(env) +- cek, err := c.cekFromEnvelope(aws.BackgroundContext(), env, wrap) ++ wrap, err := wrapFromEnvelope(o, env) ++ cek, err := cekFromEnvelope(o, aws.BackgroundContext(), env, wrap) + + if err != nil { + t.Errorf("expected no error, but received %v", err) +@@ -166,7 +166,7 @@ func TestCEKFactoryNoCEK(t *testing.T) { + Region: aws.String("us-west-2"), + }) + +- c := DecryptionClient{ ++ o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), +@@ -198,8 +198,8 @@ func TestCEKFactoryNoCEK(t *testing.T) { + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } +- wrap, err := c.wrapFromEnvelope(env) +- cek, err := c.cekFromEnvelope(aws.BackgroundContext(), env, wrap) ++ wrap, err := wrapFromEnvelope(o, env) ++ cek, err := cekFromEnvelope(o, aws.BackgroundContext(), env, wrap) + + if err == nil { + t.Error("expected error, but received none") +@@ -225,7 +225,7 @@ func TestCEKFactoryCustomEntry(t *testing.T) { + Region: aws.String("us-west-2"), + }) + +- c := DecryptionClient{ ++ o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), +@@ -255,8 +255,8 @@ func TestCEKFactoryCustomEntry(t *testing.T) { + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } +- wrap, err := c.wrapFromEnvelope(env) +- cek, err := c.cekFromEnvelope(aws.BackgroundContext(), env, wrap) ++ wrap, err := wrapFromEnvelope(o, env) ++ cek, err := cekFromEnvelope(o, aws.BackgroundContext(), env, wrap) + + if err != nil { + t.Errorf("expected no error, but received %v", err) +diff --git a/service/s3/s3crypto/decryption_client.go b/service/s3/s3crypto/decryption_client.go +index 8e40f7334..7e1c8cdc6 100644 +--- a/service/s3/s3crypto/decryption_client.go ++++ b/service/s3/s3crypto/decryption_client.go +@@ -25,6 +25,8 @@ type CEKEntry func(CipherData) (ContentCipher, error) + // Supported content ciphers: + // * AES/GCM + // * AES/CBC ++// ++// deprecated: See DecryptionClientV2 + type DecryptionClient struct { + S3Client s3iface.S3API + // LoadStrategy is used to load the metadata either from the metadata of the object +@@ -45,6 +47,8 @@ type DecryptionClient struct { + // svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient{ + // // Custom client options here + // })) ++// ++// deprecated: see NewDecryptionClientV2 + func NewDecryptionClient(prov client.ConfigProvider, options ...func(*DecryptionClient)) *DecryptionClient { + s3client := s3.New(prov) + +@@ -82,47 +86,24 @@ func NewDecryptionClient(prov client.ConfigProvider, options ...func(*Decryption + // decryption will be done. The SDK only supports V2 reads of KMS and GCM. + // + // Example: +-// sess := session.New() ++// sess := session.Must(session.NewSession()) + // svc := s3crypto.NewDecryptionClient(sess) + // req, out := svc.GetObjectRequest(&s3.GetObjectInput { + // Key: aws.String("testKey"), + // Bucket: aws.String("testBucket"), + // }) + // err := req.Send() ++// ++// deprecated: see DecryptionClientV2.GetObjectRequest + func (c *DecryptionClient) GetObjectRequest(input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { +- req, out := c.S3Client.GetObjectRequest(input) +- req.Handlers.Unmarshal.PushBack(func(r *request.Request) { +- env, err := c.LoadStrategy.Load(r) +- if err != nil { +- r.Error = err +- out.Body.Close() +- return +- } +- +- // If KMS should return the correct CEK algorithm with the proper +- // KMS key provider +- cipher, err := c.contentCipherFromEnvelope(r.Context(), env) +- if err != nil { +- r.Error = err +- out.Body.Close() +- return +- } +- +- reader, err := cipher.DecryptContents(out.Body) +- if err != nil { +- r.Error = err +- out.Body.Close() +- return +- } +- out.Body = reader +- }) +- return req, out ++ return getObjectRequest(c.getClientOptions(), input) + } + + // GetObject is a wrapper for GetObjectRequest ++// ++// deprecated: see DecryptionClientV2.GetObject + func (c *DecryptionClient) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { +- req, out := c.GetObjectRequest(input) +- return out, req.Send() ++ return getObject(c.getClientOptions(), input) + } + + // GetObjectWithContext is a wrapper for GetObjectRequest with the additional +@@ -132,9 +113,18 @@ func (c *DecryptionClient) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOut + // Context input parameters. The Context must not be nil. A nil Context will + // cause a panic. Use the Context to add deadlining, timeouts, etc. In the future + // this may create sub-contexts for individual underlying requests. ++// ++// deprecated: see DecryptionClientV2.GetObjectWithContext + func (c *DecryptionClient) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { +- req, out := c.GetObjectRequest(input) +- req.SetContext(ctx) +- req.ApplyOptions(opts...) +- return out, req.Send() ++ return getObjectWithContext(c.getClientOptions(), ctx, input, opts...) ++} ++ ++func (c *DecryptionClient) getClientOptions() DecryptionClientOptions { ++ return DecryptionClientOptions{ ++ S3Client: c.S3Client, ++ LoadStrategy: c.LoadStrategy, ++ WrapRegistry: c.WrapRegistry, ++ CEKRegistry: c.CEKRegistry, ++ PadderRegistry: c.PadderRegistry, ++ } + } +diff --git a/service/s3/s3crypto/decryption_client_v2.go b/service/s3/s3crypto/decryption_client_v2.go +new file mode 100644 +index 000000000..be37bd4bb +--- /dev/null ++++ b/service/s3/s3crypto/decryption_client_v2.go +@@ -0,0 +1,115 @@ ++package s3crypto ++ ++import ( ++ "strings" ++ ++ "github.com/aws/aws-sdk-go/aws" ++ "github.com/aws/aws-sdk-go/aws/client" ++ "github.com/aws/aws-sdk-go/aws/request" ++ "github.com/aws/aws-sdk-go/service/kms" ++ "github.com/aws/aws-sdk-go/service/s3" ++ "github.com/aws/aws-sdk-go/service/s3/s3iface" ++) ++ ++// DecryptionClientV2 is an S3 crypto client. The decryption client ++// will handle all get object requests from Amazon S3. ++// Supported key wrapping algorithms: ++// * AWS KMS ++// * AWS KMS + Context ++// ++// Supported content ciphers: ++// * AES/GCM ++// * AES/CBC ++type DecryptionClientV2 struct { ++ options DecryptionClientOptions ++} ++ ++// DecryptionClientOptions is the configuration options for DecryptionClientV2. ++type DecryptionClientOptions struct { ++ S3Client s3iface.S3API ++ // LoadStrategy is used to load the metadata either from the metadata of the object ++ // or from a separate file in s3. ++ // ++ // Defaults to our default load strategy. ++ LoadStrategy LoadStrategy ++ ++ WrapRegistry map[string]WrapEntry ++ CEKRegistry map[string]CEKEntry ++ PadderRegistry map[string]Padder ++} ++ ++// NewDecryptionClientV2 instantiates a new V2 S3 crypto client. The returned DecryptionClientV2 will be able to decrypt ++// object encrypted by both the V1 and V2 clients. ++// ++// Example: ++// sess := session.Must(session.NewSession()) ++// svc := s3crypto.NewDecryptionClientV2(sess, func(svc *s3crypto.DecryptionClientOptions{ ++// // Custom client options here ++// })) ++func NewDecryptionClientV2(prov client.ConfigProvider, options ...func(clientOptions *DecryptionClientOptions)) *DecryptionClientV2 { ++ s3client := s3.New(prov) ++ ++ s3client.Handlers.Build.PushBack(func(r *request.Request) { ++ request.AddToUserAgent(r, "S3CryptoV2") ++ }) ++ ++ kmsClient := kms.New(prov) ++ clientOptions := &DecryptionClientOptions{ ++ S3Client: s3client, ++ LoadStrategy: defaultV2LoadStrategy{ ++ client: s3client, ++ }, ++ WrapRegistry: map[string]WrapEntry{ ++ KMSWrap: NewKMSWrapEntry(kmsClient), ++ KMSContextWrap: NewKMSContextWrapEntry(kmsClient), ++ }, ++ CEKRegistry: map[string]CEKEntry{ ++ AESGCMNoPadding: newAESGCMContentCipher, ++ strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): newAESCBCContentCipher, ++ }, ++ PadderRegistry: map[string]Padder{ ++ strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): AESCBCPadder, ++ "NoPadding": NoPadder, ++ }, ++ } ++ for _, option := range options { ++ option(clientOptions) ++ } ++ ++ return &DecryptionClientV2{options: *clientOptions} ++} ++ ++// GetObjectRequest will make a request to s3 and retrieve the object. In this process ++// decryption will be done. The SDK only supports V2 reads of KMS and GCM. ++// ++// Example: ++// sess := session.Must(session.NewSession()) ++// svc := s3crypto.NewDecryptionClientV2(sess) ++// req, out := svc.GetObjectRequest(&s3.GetObjectInput { ++// Key: aws.String("testKey"), ++// Bucket: aws.String("testBucket"), ++// }) ++// err := req.Send() ++func (c *DecryptionClientV2) GetObjectRequest(input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { ++ return getObjectRequest(c.options, input) ++} ++ ++// GetObject is a wrapper for GetObjectRequest ++func (c *DecryptionClientV2) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { ++ req, out := getObjectRequest(c.options, input) ++ return out, req.Send() ++} ++ ++// GetObjectWithContext is a wrapper for GetObjectRequest with the additional ++// context, and request options support. ++// ++// GetObjectWithContext is the same as GetObject with the additional support for ++// Context input parameters. The Context must not be nil. A nil Context will ++// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future ++// this may create sub-contexts for individual underlying requests. ++func (c *DecryptionClientV2) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { ++ req, out := getObjectRequest(c.options, input) ++ req.SetContext(ctx) ++ req.ApplyOptions(opts...) ++ return out, req.Send() ++} +diff --git a/service/s3/s3crypto/decryption_client_v2_test.go b/service/s3/s3crypto/decryption_client_v2_test.go +new file mode 100644 +index 000000000..126151136 +--- /dev/null ++++ b/service/s3/s3crypto/decryption_client_v2_test.go +@@ -0,0 +1,39 @@ ++package s3crypto_test ++ ++import ( ++ "testing" ++ ++ "github.com/aws/aws-sdk-go/awstesting/unit" ++ "github.com/aws/aws-sdk-go/service/kms" ++ "github.com/aws/aws-sdk-go/service/s3/s3crypto" ++) ++ ++func TestDecryptionClientV2_CheckDeprecatedFeatures(t *testing.T) { ++ // AES/GCM/NoPadding with kms+context => allowed ++ builder := s3crypto.AESGCMContentCipherBuilder(s3crypto.NewKMSContextKeyGenerator(kms.New(unit.Session), "cmkID")) ++ _, err := s3crypto.NewEncryptionClientV2(unit.Session, builder) ++ if err != nil { ++ t.Errorf("expected no error, got %v", err) ++ } ++ ++ // AES/GCM/NoPadding with kms => not allowed ++ builder = s3crypto.AESGCMContentCipherBuilder(s3crypto.NewKMSKeyGenerator(kms.New(unit.Session), "cmkID")) ++ _, err = s3crypto.NewEncryptionClientV2(unit.Session, builder) ++ if err == nil { ++ t.Error("expected error, but got nil") ++ } ++ ++ // AES/CBC/PKCS5Padding with kms => not allowed ++ builder = s3crypto.AESCBCContentCipherBuilder(s3crypto.NewKMSKeyGenerator(kms.New(unit.Session), "cmkID"), s3crypto.NewPKCS7Padder(128)) ++ _, err = s3crypto.NewEncryptionClientV2(unit.Session, builder) ++ if err == nil { ++ t.Error("expected error, but got nil") ++ } ++ ++ // AES/CBC/PKCS5Padding with kms+context => not allowed ++ builder = s3crypto.AESCBCContentCipherBuilder(s3crypto.NewKMSContextKeyGenerator(kms.New(unit.Session), "cmkID"), s3crypto.NewPKCS7Padder(128)) ++ _, err = s3crypto.NewEncryptionClientV2(unit.Session, builder) ++ if err == nil { ++ t.Error("expected error, but got nil") ++ } ++} +diff --git a/service/s3/s3crypto/deprecations.go b/service/s3/s3crypto/deprecations.go +new file mode 100644 +index 000000000..8c54aa966 +--- /dev/null ++++ b/service/s3/s3crypto/deprecations.go +@@ -0,0 +1,10 @@ ++package s3crypto ++ ++import "fmt" ++ ++var errDeprecatedCipherBuilder = fmt.Errorf("attempted to use deprecated cipher builder") ++var errDeprecatedCipherDataGenerator = fmt.Errorf("attempted to use deprecated cipher data generator") ++ ++type deprecatedFeatures interface { ++ isUsingDeprecatedFeatures() error ++} +diff --git a/service/s3/s3crypto/deprecations_test.go b/service/s3/s3crypto/deprecations_test.go +new file mode 100644 +index 000000000..6a9bb0c99 +--- /dev/null ++++ b/service/s3/s3crypto/deprecations_test.go +@@ -0,0 +1,51 @@ ++package s3crypto ++ ++import ( ++ "testing" ++ ++ "github.com/aws/aws-sdk-go/service/kms/kmsiface" ++) ++ ++type mockKMS struct { ++ kmsiface.KMSAPI ++} ++ ++func TestAESGCMContentCipherBuilder_isUsingDeprecatedFeatures(t *testing.T) { ++ builder := AESGCMContentCipherBuilder(NewKMSKeyGenerator(mockKMS{}, "cmkID")) ++ ++ features, ok := builder.(deprecatedFeatures) ++ if !ok { ++ t.Errorf("expected to implement deprecatedFeatures interface") ++ } ++ ++ err := features.isUsingDeprecatedFeatures() ++ if err == nil { ++ t.Errorf("expected to recieve error for using deprecated features") ++ } ++ ++ builder = AESGCMContentCipherBuilder(NewKMSContextKeyGenerator(mockKMS{}, "cmkID")) ++ ++ features, ok = builder.(deprecatedFeatures) ++ if !ok { ++ t.Errorf("expected to implement deprecatedFeatures interface") ++ } ++ ++ err = features.isUsingDeprecatedFeatures() ++ if err != nil { ++ t.Errorf("expected no error, got %v", err) ++ } ++} ++ ++func TestAESCBCContentCipherBuilder_isUsingDeprecatedFeatures(t *testing.T) { ++ builder := AESCBCContentCipherBuilder(nil, nil) ++ ++ features, ok := builder.(deprecatedFeatures) ++ if !ok { ++ t.Errorf("expected to implement deprecatedFeatures interface") ++ } ++ ++ err := features.isUsingDeprecatedFeatures() ++ if err == nil { ++ t.Errorf("expected to recieve error for using deprecated features") ++ } ++} +diff --git a/service/s3/s3crypto/doc.go b/service/s3/s3crypto/doc.go +index fc6760a0c..305b7e517 100644 +--- a/service/s3/s3crypto/doc.go ++++ b/service/s3/s3crypto/doc.go +@@ -15,29 +15,34 @@ ciphers. + Creating an S3 cryptography client + + cmkID := "" +- sess := session.New() ++ sess := session.Must(session.NewSession()) + // Create the KeyProvider +- handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) ++ handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) + + // Create an encryption and decryption client + // We need to pass the session here so S3 can use it. In addition, any decryption that + // occurs will use the KMS client. +- svc := s3crypto.NewEncryptionClient(sess, s3crypto.AESGCMContentCipherBuilder(handler)) +- svc := s3crypto.NewDecryptionClient(sess) ++ svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler)) ++ svc := s3crypto.NewDecryptionClientV2(sess) + + Configuration of the S3 cryptography client + +- cfg := s3crypto.EncryptionConfig{ ++ sess := session.Must(session.NewSession()) ++ handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) ++ svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler), func (o *s3crypto.EncryptionClientOptions) { + // Save instruction files to separate objects +- SaveStrategy: NewS3SaveStrategy(session.New(), ""), ++ o.SaveStrategy = NewS3SaveStrategy(sess, "") ++ + // Change instruction file suffix to .example +- InstructionFileSuffix: ".example", ++ o.InstructionFileSuffix = ".example" ++ + // Set temp folder path +- TempFolderPath: "/path/to/tmp/folder/", ++ o.TempFolderPath = "/path/to/tmp/folder/" ++ + // Any content less than the minimum file size will use memory + // instead of writing the contents to a temp file. +- MinFileSize: int64(1024 * 1024 * 1024), +- } ++ o.MinFileSize = int64(1024 * 1024 * 1024) ++ }) + + The default SaveStrategy is to the object's header. + +@@ -48,19 +53,43 @@ This suffix only affects gets and not puts. Put uses the keyprovider's suffix. + Registration of new wrap or cek algorithms are also supported by the SDK. Let's say we want to support `AES Wrap` + and `AES CTR`. Let's assume we have already defined the functionality. + +- svc := s3crypto.NewDecryptionClient(sess) +- svc.WrapRegistry["AESWrap"] = NewAESWrap +- svc.CEKRegistry["AES/CTR/NoPadding"] = NewAESCTR ++ svc := s3crypto.NewDecryptionClientV2(sess, func(o *s3crypto.DecryptionClientOptions) { ++ o.WrapRegistry["CustomWrap"] = NewCustomWrap ++ o.CEKRegistry["CustomCEK"] = NewCustomCEK ++ }) + + We have now registered these new algorithms to the decryption client. When the client calls `GetObject` and sees +-the wrap as `AESWrap` then it'll use that wrap algorithm. This is also true for `AES/CTR/NoPadding`. ++the wrap as `CustomWrap` then it'll use that wrap algorithm. This is also true for `CustomCEK`. + + For encryption adding a custom content cipher builder and key handler will allow for encryption of custom + defined ciphers. + +- // Our wrap algorithm, AESWrap +- handler := NewAESWrap(key, iv) +- // Our content cipher builder, AESCTRContentCipherBuilder +- svc := s3crypto.NewEncryptionClient(sess, NewAESCTRContentCipherBuilder(handler)) ++ // Our wrap algorithm, CustomWrap ++ handler := NewCustomWrap(key, iv) ++ // Our content cipher builder, NewCustomCEKContentBuilder ++ svc := s3crypto.NewEncryptionClientV2(sess, NewCustomCEKContentBuilder(handler)) ++ ++Deprecations ++ ++The EncryptionClient and DecryptionClient types and their associated constructor functions have been deprecated. ++Users of these clients should migrate to EncryptionClientV2 and DecryptionClientV2 types and constructor functions. ++ ++EncryptionClientV2 removes encryption support of the following features ++ * AES/CBC/PKCS5Padding (content cipher) ++ * kms (key wrap algorithm) ++ ++Attempting to construct an EncryptionClientV2 with deprecated features will result in an error returned back to the ++calling application during construction of the client. ++ ++Users of `AES/CBC/PKCS5Padding` will need to migrate usage to `AES/GCM/NoPadding`. ++Users of `kms` key provider will need to migrate `kms+context`. ++ ++DecryptionClientV2 client adds support for the `kms+context` key provider and maintains backwards comparability with ++objects encrypted with the deprecated EncryptionClient. ++ ++Migrating from V1 to V2 Clients ++ ++Examples of how to migrate usage of the V1 clients to the V2 equivalents have been documented as usage examples of ++the NewEncryptionClientV2 and NewDecryptionClientV2 functions. + */ + package s3crypto +diff --git a/service/s3/s3crypto/encryption_client.go b/service/s3/s3crypto/encryption_client.go +index 7792106d2..b3816e89a 100644 +--- a/service/s3/s3crypto/encryption_client.go ++++ b/service/s3/s3crypto/encryption_client.go +@@ -1,13 +1,9 @@ + package s3crypto + + import ( +- "encoding/hex" +- "io" +- + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" +- "github.com/aws/aws-sdk-go/internal/sdkio" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" + ) +@@ -20,6 +16,8 @@ const DefaultMinFileSize = 1024 * 512 * 5 + // will use KMS for key wrapping and AES GCM for content encryption. + // AES GCM will load all data into memory. However, the rest of the content algorithms + // do not load the entire contents into memory. ++// ++// deprecated: See EncryptionClientV2 + type EncryptionClient struct { + S3Client s3iface.S3API + ContentCipherBuilder ContentCipherBuilder +@@ -39,9 +37,11 @@ type EncryptionClient struct { + // + // Example: + // cmkID := "arn:aws:kms:region:000000000000:key/00000000-0000-0000-0000-000000000000" +-// sess := session.New() ++// sess := session.Must(session.NewSession()) + // handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) +-// svc := s3crypto.New(sess, s3crypto.AESGCMContentCipherBuilder(handler)) ++// svc := s3crypto.NewEncryptionClient(sess, s3crypto.AESGCMContentCipherBuilder(handler)) ++// ++// deprecated: See NewEncryptionClientV2 + func NewEncryptionClient(prov client.ConfigProvider, builder ContentCipherBuilder, options ...func(*EncryptionClient)) *EncryptionClient { + s3client := s3.New(prov) + +@@ -74,76 +74,17 @@ func NewEncryptionClient(prov client.ConfigProvider, builder ContentCipherBuilde + // Body: strings.NewReader("test data"), + // }) + // err := req.Send() ++// ++// deprecated: See EncryptionClientV2.PutObjectRequest + func (c *EncryptionClient) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { +- req, out := c.S3Client.PutObjectRequest(input) +- +- // Get Size of file +- n, err := aws.SeekerLen(input.Body) +- if err != nil { +- req.Error = err +- return req, out +- } +- +- dst, err := getWriterStore(req, c.TempFolderPath, n >= c.MinFileSize) +- if err != nil { +- req.Error = err +- return req, out +- } +- +- req.Handlers.Build.PushFront(func(r *request.Request) { +- if err != nil { +- r.Error = err +- return +- } +- var encryptor ContentCipher +- if v, ok := c.ContentCipherBuilder.(ContentCipherBuilderWithContext); ok { +- encryptor, err = v.ContentCipherWithContext(r.Context()) +- } else { +- encryptor, err = c.ContentCipherBuilder.ContentCipher() +- } +- if err != nil { +- r.Error = err +- return +- } +- +- md5 := newMD5Reader(input.Body) +- sha := newSHA256Writer(dst) +- reader, err := encryptor.EncryptContents(md5) +- if err != nil { +- r.Error = err +- return +- } +- +- _, err = io.Copy(sha, reader) +- if err != nil { +- r.Error = err +- return +- } +- +- data := encryptor.GetCipherData() +- env, err := encodeMeta(md5, data) +- if err != nil { +- r.Error = err +- return +- } +- +- shaHex := hex.EncodeToString(sha.GetValue()) +- req.HTTPRequest.Header.Set("X-Amz-Content-Sha256", shaHex) +- +- dst.Seek(0, sdkio.SeekStart) +- input.Body = dst +- +- err = c.SaveStrategy.Save(env, r) +- r.Error = err +- }) +- +- return req, out ++ return putObjectRequest(c.getClientOptions(), input) + } + + // PutObject is a wrapper for PutObjectRequest ++// ++// deprecated: See EncryptionClientV2.PutObject + func (c *EncryptionClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { +- req, out := c.PutObjectRequest(input) +- return out, req.Send() ++ return putObject(c.getClientOptions(), input) + } + + // PutObjectWithContext is a wrapper for PutObjectRequest with the additional +@@ -153,9 +94,19 @@ func (c *EncryptionClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOut + // Context input parameters. The Context must not be nil. A nil Context will + // cause a panic. Use the Context to add deadlining, timeouts, etc. In the future + // this may create sub-contexts for individual underlying requests. ++// PutObject is a wrapper for PutObjectRequest ++// ++// deprecated: See EncryptionClientV2.PutObjectWithContext + func (c *EncryptionClient) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { +- req, out := c.PutObjectRequest(input) +- req.SetContext(ctx) +- req.ApplyOptions(opts...) +- return out, req.Send() ++ return putObjectWithContext(c.getClientOptions(), ctx, input, opts...) ++} ++ ++func (c *EncryptionClient) getClientOptions() EncryptionClientOptions { ++ return EncryptionClientOptions{ ++ S3Client: c.S3Client, ++ ContentCipherBuilder: c.ContentCipherBuilder, ++ SaveStrategy: c.SaveStrategy, ++ TempFolderPath: c.TempFolderPath, ++ MinFileSize: c.MinFileSize, ++ } + } +diff --git a/service/s3/s3crypto/encryption_client_v2.go b/service/s3/s3crypto/encryption_client_v2.go +new file mode 100644 +index 000000000..3f8961f21 +--- /dev/null ++++ b/service/s3/s3crypto/encryption_client_v2.go +@@ -0,0 +1,108 @@ ++package s3crypto ++ ++import ( ++ "github.com/aws/aws-sdk-go/aws" ++ "github.com/aws/aws-sdk-go/aws/client" ++ "github.com/aws/aws-sdk-go/aws/request" ++ "github.com/aws/aws-sdk-go/service/s3" ++ "github.com/aws/aws-sdk-go/service/s3/s3iface" ++) ++ ++// EncryptionClientV2 is an S3 crypto client. By default the SDK will use Authentication mode which ++// will use KMS for key wrapping and AES GCM for content encryption. ++// AES GCM will load all data into memory. However, the rest of the content algorithms ++// do not load the entire contents into memory. ++type EncryptionClientV2 struct { ++ options EncryptionClientOptions ++} ++ ++// EncryptionClientOptions is the configuration options for EncryptionClientV2 ++type EncryptionClientOptions struct { ++ S3Client s3iface.S3API ++ ContentCipherBuilder ContentCipherBuilder ++ // SaveStrategy will dictate where the envelope is saved. ++ // ++ // Defaults to the object's metadata ++ SaveStrategy SaveStrategy ++ // TempFolderPath is used to store temp files when calling PutObject. ++ // Temporary files are needed to compute the X-Amz-Content-Sha256 header. ++ TempFolderPath string ++ // MinFileSize is the minimum size for the content to write to a ++ // temporary file instead of using memory. ++ MinFileSize int64 ++} ++ ++// NewEncryptionClientV2 instantiates a new S3 crypto client. An error will be returned to the caller if the provided ++// contentCipherBuilder has been deprecated, or if it uses other deprecated components. ++// ++// Example: ++// cmkID := "arn:aws:kms:region:000000000000:key/00000000-0000-0000-0000-000000000000" ++// sess := session.Must(session.NewSession()) ++// handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) ++// svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler)) ++func NewEncryptionClientV2(prov client.ConfigProvider, contentCipherBuilder ContentCipherBuilder, options ...func(clientOptions *EncryptionClientOptions), ++) ( ++ client *EncryptionClientV2, err error, ++) { ++ s3client := s3.New(prov) ++ ++ s3client.Handlers.Build.PushBack(func(r *request.Request) { ++ request.AddToUserAgent(r, "S3CryptoV2") ++ }) ++ ++ clientOptions := &EncryptionClientOptions{ ++ S3Client: s3client, ++ ContentCipherBuilder: contentCipherBuilder, ++ SaveStrategy: HeaderV2SaveStrategy{}, ++ MinFileSize: DefaultMinFileSize, ++ } ++ ++ for _, option := range options { ++ option(clientOptions) ++ } ++ ++ if feature, ok := contentCipherBuilder.(deprecatedFeatures); ok { ++ if err := feature.isUsingDeprecatedFeatures(); err != nil { ++ return nil, err ++ } ++ } ++ ++ client = &EncryptionClientV2{ ++ *clientOptions, ++ } ++ ++ return client, err ++} ++ ++// PutObjectRequest creates a temp file to encrypt the contents into. It then streams ++// that data to S3. ++// ++// Example: ++// sess := session.Must(session.NewSession()) ++// handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), "cmkID") ++// svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler)) ++// req, out := svc.PutObjectRequest(&s3.PutObjectInput { ++// Key: aws.String("testKey"), ++// Bucket: aws.String("testBucket"), ++// Body: strings.NewReader("test data"), ++// }) ++// err := req.Send() ++func (c *EncryptionClientV2) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { ++ return putObjectRequest(c.options, input) ++} ++ ++// PutObject is a wrapper for PutObjectRequest ++func (c *EncryptionClientV2) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { ++ return putObject(c.options, input) ++} ++ ++// PutObjectWithContext is a wrapper for PutObjectRequest with the additional ++// context, and request options support. ++// ++// PutObjectWithContext is the same as PutObject with the additional support for ++// Context input parameters. The Context must not be nil. A nil Context will ++// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future ++// this may create sub-contexts for individual underlying requests. ++func (c *EncryptionClientV2) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { ++ return putObjectWithContext(c.options, ctx, input, opts...) ++} +diff --git a/service/s3/s3crypto/envelope.go b/service/s3/s3crypto/envelope.go +index 6e1e70a4d..043281010 100644 +--- a/service/s3/s3crypto/envelope.go ++++ b/service/s3/s3crypto/envelope.go +@@ -32,6 +32,6 @@ type Envelope struct { + WrapAlg string `json:"x-amz-wrap-alg"` + CEKAlg string `json:"x-amz-cek-alg"` + TagLen string `json:"x-amz-tag-len"` +- UnencryptedMD5 string `json:"x-amz-unencrypted-content-md5"` ++ UnencryptedMD5 string `json:"-"` + UnencryptedContentLen string `json:"x-amz-unencrypted-content-length"` + } +diff --git a/service/s3/s3crypto/integration/main_test.go b/service/s3/s3crypto/integration/main_test.go +new file mode 100644 +index 000000000..6fff21828 +--- /dev/null ++++ b/service/s3/s3crypto/integration/main_test.go +@@ -0,0 +1,187 @@ ++// +build integration,go1.14 ++ ++package integration ++ ++import ( ++ "bytes" ++ "crypto/rand" ++ "flag" ++ "io" ++ "io/ioutil" ++ "log" ++ "os" ++ "testing" ++ ++ "github.com/aws/aws-sdk-go/aws" ++ "github.com/aws/aws-sdk-go/aws/session" ++ "github.com/aws/aws-sdk-go/awstesting/integration" ++ "github.com/aws/aws-sdk-go/service/kms" ++ "github.com/aws/aws-sdk-go/service/kms/kmsiface" ++ "github.com/aws/aws-sdk-go/service/s3" ++ "github.com/aws/aws-sdk-go/service/s3/s3crypto" ++ "github.com/aws/aws-sdk-go/service/s3/s3iface" ++) ++ ++var config = &struct { ++ Enabled bool ++ Region string ++ KMSKeyID string ++ Bucket string ++ Session *session.Session ++ Clients struct { ++ KMS kmsiface.KMSAPI ++ S3 s3iface.S3API ++ } ++}{} ++ ++func init() { ++ flag.BoolVar(&config.Enabled, "enable", false, "enable integration testing") ++ flag.StringVar(&config.Region, "region", "us-west-2", "integration test region") ++ flag.StringVar(&config.KMSKeyID, "kms-key-id", "", "KMS CMK Key ID") ++ flag.StringVar(&config.Bucket, "bucket", "", "S3 Bucket Name") ++} ++ ++func TestMain(m *testing.M) { ++ flag.Parse() ++ if !config.Enabled { ++ log.Println("skipping s3crypto integration tests") ++ os.Exit(0) ++ } ++ ++ if len(config.Bucket) == 0 { ++ log.Fatal("bucket name must be provided") ++ } ++ ++ if len(config.KMSKeyID) == 0 { ++ log.Fatal("kms cmk key id must be provided") ++ } ++ ++ config.Session = session.Must(session.NewSession(&aws.Config{Region: &config.Region})) ++ ++ config.Clients.KMS = kms.New(config.Session) ++ config.Clients.S3 = s3.New(config.Session) ++ ++ m.Run() ++} ++ ++func TestEncryptionV1_WithV2Interop(t *testing.T) { ++ kmsKeyGenerator := s3crypto.NewKMSKeyGenerator(config.Clients.KMS, config.KMSKeyID) ++ ++ // 1020 is chosen here as it is not cleanly divisible by the AES-256 block size ++ testData := make([]byte, 1020) ++ _, err := rand.Read(testData) ++ if err != nil { ++ t.Fatalf("failed to read random data: %v", err) ++ } ++ ++ v1DC := s3crypto.NewDecryptionClient(config.Session, func(client *s3crypto.DecryptionClient) { ++ client.S3Client = config.Clients.S3 ++ }) ++ v2DC := s3crypto.NewDecryptionClientV2(config.Session, func(options *s3crypto.DecryptionClientOptions) { ++ options.S3Client = config.Clients.S3 ++ }) ++ ++ cases := map[string]s3crypto.ContentCipherBuilder{ ++ "AES/GCM/NoPadding": s3crypto.AESGCMContentCipherBuilder(kmsKeyGenerator), ++ "AES/CBC/PKCS5Padding": s3crypto.AESCBCContentCipherBuilder(kmsKeyGenerator, s3crypto.AESCBCPadder), ++ } ++ ++ for name, ccb := range cases { ++ t.Run(name, func(t *testing.T) { ++ ec := s3crypto.NewEncryptionClient(config.Session, ccb, func(client *s3crypto.EncryptionClient) { ++ client.S3Client = config.Clients.S3 ++ }) ++ id := integration.UniqueID() ++ // PutObject with V1 Client ++ putObject(t, ec, id, bytes.NewReader(testData)) ++ // Verify V1 Decryption Client ++ getObjectAndCompare(t, v1DC, id, testData) ++ // Verify V2 Decryption Client ++ getObjectAndCompare(t, v2DC, id, testData) ++ }) ++ } ++} ++ ++func TestEncryptionV2(t *testing.T) { ++ kmsKeyGenerator := s3crypto.NewKMSContextKeyGenerator(config.Clients.KMS, config.KMSKeyID) ++ gcmContentCipherBuilder := s3crypto.AESGCMContentCipherBuilder(kmsKeyGenerator) ++ ++ ec, err := s3crypto.NewEncryptionClientV2(config.Session, gcmContentCipherBuilder, func(options *s3crypto.EncryptionClientOptions) { ++ options.S3Client = config.Clients.S3 ++ }) ++ if err != nil { ++ t.Fatalf("failed to construct encryption client: %v", err) ++ } ++ ++ dc := s3crypto.NewDecryptionClientV2(config.Session, func(options *s3crypto.DecryptionClientOptions) { ++ options.S3Client = config.Clients.S3 ++ }) ++ ++ // 1020 is chosen here as it is not cleanly divisible by the AES-256 block size ++ testData := make([]byte, 1020) ++ _, err = rand.Read(testData) ++ if err != nil { ++ t.Fatalf("failed to read random data: %v", err) ++ } ++ ++ keyId := integration.UniqueID() ++ ++ // Upload V2 Objects with Encryption Client ++ putObject(t, ec, keyId, bytes.NewReader(testData)) ++ ++ // Verify V2 Object with Decryption Client ++ getObjectAndCompare(t, dc, keyId, testData) ++} ++ ++type Encryptor interface { ++ PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) ++} ++ ++func putObject(t *testing.T, client Encryptor, key string, reader io.ReadSeeker) { ++ t.Helper() ++ _, err := client.PutObject(&s3.PutObjectInput{ ++ Bucket: &config.Bucket, ++ Key: &key, ++ Body: reader, ++ }) ++ if err != nil { ++ t.Fatalf("failed to upload object: %v", err) ++ } ++ t.Cleanup(doKeyCleanup(key)) ++} ++ ++type Decryptor interface { ++ GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) ++} ++ ++func getObjectAndCompare(t *testing.T, client Decryptor, key string, expected []byte) { ++ t.Helper() ++ output, err := client.GetObject(&s3.GetObjectInput{ ++ Bucket: &config.Bucket, ++ Key: &key, ++ }) ++ if err != nil { ++ t.Fatalf("failed to get object: %v", err) ++ } ++ ++ actual, err := ioutil.ReadAll(output.Body) ++ if err != nil { ++ t.Fatalf("failed to read body response: %v", err) ++ } ++ ++ if bytes.Compare(expected, actual) != 0 { ++ t.Errorf("expected bytes did not match actual") ++ } ++} ++ ++func doKeyCleanup(key string) func() { ++ return func() { ++ _, err := config.Clients.S3.DeleteObject(&s3.DeleteObjectInput{ ++ Bucket: &config.Bucket, ++ Key: &key, ++ }) ++ if err != nil { ++ log.Printf("failed to delete %s: %v", key, err) ++ } ++ } ++} +diff --git a/service/s3/s3crypto/key_handler.go b/service/s3/s3crypto/key_handler.go +index 6cab2b324..f74a74d07 100644 +--- a/service/s3/s3crypto/key_handler.go ++++ b/service/s3/s3crypto/key_handler.go +@@ -20,6 +20,22 @@ type CipherDataGeneratorWithContext interface { + GenerateCipherDataWithContext(aws.Context, int, int) (CipherData, error) + } + ++// CipherDataGeneratorWithCEKAlg handles generating proper key and IVs of proper size for the ++// content cipher. CipherDataGenerator will also encrypt the key and store it in ++// the CipherData. ++type CipherDataGeneratorWithCEKAlg interface { ++ GenerateCipherDataWithCEKAlg(int, int, string) (CipherData, error) ++ ++ CipherDataGenerator // backwards comparability to plug into older interface ++} ++ ++// CipherDataGeneratorWithCEKAlgWithContext handles generating proper key and IVs of ++// proper size for the content cipher. CipherDataGenerator will also encrypt ++// the key and store it in the CipherData. ++type CipherDataGeneratorWithCEKAlgWithContext interface { ++ GenerateCipherDataWithCEKAlgWithContext(aws.Context, int, int, string) (CipherData, error) ++} ++ + // CipherDataDecrypter is a handler to decrypt keys from the envelope. + type CipherDataDecrypter interface { + DecryptKey([]byte) ([]byte, error) +@@ -30,8 +46,11 @@ type CipherDataDecrypterWithContext interface { + DecryptKeyWithContext(aws.Context, []byte) ([]byte, error) + } + +-func generateBytes(n int) []byte { ++func generateBytes(n int) ([]byte, error) { + b := make([]byte, n) +- rand.Read(b) +- return b ++ _, err := rand.Read(b) ++ if err != nil { ++ return nil, err ++ } ++ return b, nil + } +diff --git a/service/s3/s3crypto/key_handler_test.go b/service/s3/s3crypto/key_handler_test.go +index 8e0e5ea42..bd2ba2869 100644 +--- a/service/s3/s3crypto/key_handler_test.go ++++ b/service/s3/s3crypto/key_handler_test.go +@@ -5,15 +5,15 @@ import ( + ) + + func TestGenerateBytes(t *testing.T) { +- b := generateBytes(5) ++ b, _ := generateBytes(5) + if e, a := 5, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } +- b = generateBytes(0) ++ b, _ = generateBytes(0) + if e, a := 0, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } +- b = generateBytes(1024) ++ b, _ = generateBytes(1024) + if e, a := 1024, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } +diff --git a/service/s3/s3crypto/kms_key_handler.go b/service/s3/s3crypto/kms_key_handler.go +index 91ea010ab..be1af5192 100644 +--- a/service/s3/s3crypto/kms_key_handler.go ++++ b/service/s3/s3crypto/kms_key_handler.go +@@ -1,6 +1,8 @@ + package s3crypto + + import ( ++ "fmt" ++ + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/kms" +@@ -10,12 +12,16 @@ import ( + const ( + // KMSWrap is a constant used during decryption to build a KMS key handler. + KMSWrap = "kms" ++ ++ // KMSContextWrap is a constant used during decryption to build a kms+context key handler ++ KMSContextWrap = "kms+context" + ) + + // kmsKeyHandler will make calls to KMS to get the masterkey + type kmsKeyHandler struct { +- kms kmsiface.KMSAPI +- cmkID *string ++ kms kmsiface.KMSAPI ++ cmkID *string ++ withContext bool + + CipherData + } +@@ -28,35 +34,73 @@ type kmsKeyHandler struct { + // cmkID := "arn to key" + // matdesc := s3crypto.MaterialDescription{} + // handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) ++// ++// deprecated: See NewKMSContextKeyGenerator + func NewKMSKeyGenerator(kmsClient kmsiface.KMSAPI, cmkID string) CipherDataGenerator { + return NewKMSKeyGeneratorWithMatDesc(kmsClient, cmkID, MaterialDescription{}) + } + +-// NewKMSKeyGeneratorWithMatDesc builds a new KMS key provider using the customer key ID and material ++// NewKMSContextKeyGenerator builds a new kms+context key provider using the customer key ID and material + // description. + // + // Example: + // sess := session.New(&aws.Config{}) + // cmkID := "arn to key" + // matdesc := s3crypto.MaterialDescription{} +-// handler := s3crypto.NewKMSKeyGeneratorWithMatDesc(kms.New(sess), cmkID, matdesc) +-func NewKMSKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matdesc MaterialDescription) CipherDataGenerator { ++// handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) ++func NewKMSContextKeyGenerator(client kmsiface.KMSAPI, cmkID string) CipherDataGeneratorWithCEKAlg { ++ return NewKMSContextKeyGeneratorWithMatDesc(client, cmkID, MaterialDescription{}) ++} ++ ++func newKMSKeyHandler(client kmsiface.KMSAPI, cmkID string, withContext bool, matdesc MaterialDescription) *kmsKeyHandler { ++ // These values are read only making them thread safe ++ kp := &kmsKeyHandler{ ++ kms: client, ++ cmkID: &cmkID, ++ withContext: withContext, ++ } ++ + if matdesc == nil { + matdesc = MaterialDescription{} + } +- matdesc["kms_cmk_id"] = &cmkID + + // These values are read only making them thread safe +- kp := &kmsKeyHandler{ +- kms: kmsClient, +- cmkID: &cmkID, ++ if kp.withContext { ++ kp.CipherData.WrapAlgorithm = KMSContextWrap ++ } else { ++ matdesc["kms_cmk_id"] = &cmkID ++ kp.CipherData.WrapAlgorithm = KMSWrap + } +- // These values are read only making them thread safe +- kp.CipherData.WrapAlgorithm = KMSWrap + kp.CipherData.MaterialDescription = matdesc + return kp + } + ++// NewKMSKeyGeneratorWithMatDesc builds a new KMS key provider using the customer key ID and material ++// description. ++// ++// Example: ++// sess := session.New(&aws.Config{}) ++// cmkID := "arn to key" ++// matdesc := s3crypto.MaterialDescription{} ++// handler := s3crypto.NewKMSKeyGeneratorWithMatDesc(kms.New(sess), cmkID, matdesc) ++// ++// deprecated: See NewKMSContextKeyGeneratorWithMatDesc ++func NewKMSKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matdesc MaterialDescription) CipherDataGenerator { ++ return newKMSKeyHandler(kmsClient, cmkID, false, matdesc) ++} ++ ++// NewKMSContextKeyGeneratorWithMatDesc builds a new kms+context key provider using the customer key ID and material ++// description. ++// ++// Example: ++// sess := session.New(&aws.Config{}) ++// cmkID := "arn to key" ++// matdesc := s3crypto.MaterialDescription{} ++// handler := s3crypto.NewKMSKeyGeneratorWithMatDesc(kms.New(sess), cmkID, matdesc) ++func NewKMSContextKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matdesc MaterialDescription) CipherDataGeneratorWithCEKAlg { ++ return newKMSKeyHandler(kmsClient, cmkID, true, matdesc) ++} ++ + // NewKMSWrapEntry builds returns a new KMS key provider and its decrypt handler. + // + // Example: +@@ -67,6 +111,8 @@ func NewKMSKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matd + // svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient) { + // svc.WrapRegistry[s3crypto.KMSWrap] = decryptHandler + // })) ++// ++// deprecated: See NewKMSContextWrapEntry + func NewKMSWrapEntry(kmsClient kmsiface.KMSAPI) WrapEntry { + // These values are read only making them thread safe + kp := &kmsKeyHandler{ +@@ -76,6 +122,26 @@ func NewKMSWrapEntry(kmsClient kmsiface.KMSAPI) WrapEntry { + return kp.decryptHandler + } + ++// NewKMSContextWrapEntry builds returns a new KMS key provider and its decrypt handler. ++// ++// Example: ++// sess := session.New(&aws.Config{}) ++// customKMSClient := kms.New(sess) ++// decryptHandler := s3crypto.NewKMSContextWrapEntry(customKMSClient) ++// ++// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient) { ++// svc.WrapRegistry[s3crypto.KMSContextWrap] = decryptHandler ++// })) ++func NewKMSContextWrapEntry(kmsClient kmsiface.KMSAPI) WrapEntry { ++ // These values are read only making them thread safe ++ kp := &kmsKeyHandler{ ++ kms: kmsClient, ++ withContext: true, ++ } ++ ++ return kp.decryptHandler ++} ++ + // decryptHandler initializes a KMS keyprovider with a material description. This + // is used with Decrypting kms content, due to the cmkID being in the material description. + func (kp kmsKeyHandler) decryptHandler(env Envelope) (CipherDataDecrypter, error) { +@@ -86,13 +152,16 @@ func (kp kmsKeyHandler) decryptHandler(env Envelope) (CipherDataDecrypter, error + } + + cmkID, ok := m["kms_cmk_id"] +- if !ok { ++ if !kp.withContext && !ok { + return nil, awserr.New("MissingCMKIDError", "Material description is missing CMK ID", nil) + } + + kp.CipherData.MaterialDescription = m + kp.cmkID = cmkID + kp.WrapAlgorithm = KMSWrap ++ if kp.withContext { ++ kp.WrapAlgorithm = KMSContextWrap ++ } + return &kp, nil + } + +@@ -121,12 +190,31 @@ func (kp *kmsKeyHandler) GenerateCipherData(keySize, ivSize int) (CipherData, er + return kp.GenerateCipherDataWithContext(aws.BackgroundContext(), keySize, ivSize) + } + ++func (kp kmsKeyHandler) GenerateCipherDataWithCEKAlg(keySize, ivSize int, cekAlgorithm string) (CipherData, error) { ++ return kp.GenerateCipherDataWithCEKAlgWithContext(aws.BackgroundContext(), keySize, ivSize, cekAlgorithm) ++} ++ + // GenerateCipherDataWithContext makes a call to KMS to generate a data key, + // Upon making the call, it also sets the encrypted key. + func (kp *kmsKeyHandler) GenerateCipherDataWithContext(ctx aws.Context, keySize, ivSize int) (CipherData, error) { ++ return kp.GenerateCipherDataWithCEKAlgWithContext(ctx, keySize, ivSize, "") ++} ++ ++func (kp kmsKeyHandler) GenerateCipherDataWithCEKAlgWithContext(ctx aws.Context, keySize int, ivSize int, cekAlgorithm string) (CipherData, error) { ++ md := kp.CipherData.MaterialDescription ++ ++ wrapAlgorithm := KMSWrap ++ if kp.withContext { ++ wrapAlgorithm = KMSContextWrap ++ if len(cekAlgorithm) == 0 { ++ return CipherData{}, fmt.Errorf("CEK algorithm identifier must not be empty") ++ } ++ md["aws:"+cekAlgorithmHeader] = &cekAlgorithm ++ } ++ + out, err := kp.kms.GenerateDataKeyWithContext(ctx, + &kms.GenerateDataKeyInput{ +- EncryptionContext: kp.CipherData.MaterialDescription, ++ EncryptionContext: md, + KeyId: kp.cmkID, + KeySpec: aws.String("AES_256"), + }) +@@ -134,13 +222,24 @@ func (kp *kmsKeyHandler) GenerateCipherDataWithContext(ctx aws.Context, keySize, + return CipherData{}, err + } + +- iv := generateBytes(ivSize) ++ iv, err := generateBytes(ivSize) ++ if err != nil { ++ return CipherData{}, err ++ } ++ + cd := CipherData{ + Key: out.Plaintext, + IV: iv, +- WrapAlgorithm: KMSWrap, +- MaterialDescription: kp.CipherData.MaterialDescription, ++ WrapAlgorithm: wrapAlgorithm, ++ MaterialDescription: md, + EncryptedKey: out.CiphertextBlob, + } + return cd, nil + } ++ ++func (kp *kmsKeyHandler) isUsingDeprecatedFeatures() error { ++ if !kp.withContext { ++ return errDeprecatedCipherDataGenerator ++ } ++ return nil ++} +diff --git a/service/s3/s3crypto/kms_key_handler_test.go b/service/s3/s3crypto/kms_key_handler_test.go +index b12d76d97..4c030b0e9 100644 +--- a/service/s3/s3crypto/kms_key_handler_test.go ++++ b/service/s3/s3crypto/kms_key_handler_test.go +@@ -4,7 +4,9 @@ import ( + "bytes" + "encoding/base64" + "encoding/hex" ++ "encoding/json" + "fmt" ++ "io/ioutil" + "net/http" + "net/http/httptest" + "reflect" +@@ -105,10 +107,98 @@ func TestKMSDecrypt(t *testing.T) { + } + } + +-func TestKMSDecryptBadJSON(t *testing.T) { ++func TestKMSContextGenerateCipherData(t *testing.T) { ++ ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ++ bodyBytes, err := ioutil.ReadAll(r.Body) ++ if err != nil { ++ w.WriteHeader(500) ++ return ++ } ++ var body map[string]interface{} ++ err = json.Unmarshal(bodyBytes, &body) ++ if err != nil { ++ w.WriteHeader(500) ++ return ++ } ++ ++ md, ok := body["EncryptionContext"].(map[string]interface{}) ++ if !ok { ++ w.WriteHeader(500) ++ return ++ } ++ ++ exEncContext := map[string]interface{}{ ++ "aws:" + cekAlgorithmHeader: "cekAlgValue", ++ } ++ ++ if e, a := exEncContext, md; !reflect.DeepEqual(e, a) { ++ w.WriteHeader(500) ++ t.Errorf("expected %v, got %v", e, a) ++ return ++ } ++ ++ fmt.Fprintln(w, `{"CiphertextBlob":"AQEDAHhqBCCY1MSimw8gOGcUma79cn4ANvTtQyv9iuBdbcEF1QAAAH4wfAYJKoZIhvcNAQcGoG8wbQIBADBoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDJ6IcN5E4wVbk38MNAIBEIA7oF1E3lS7FY9DkoxPc/UmJsEwHzL82zMqoLwXIvi8LQHr8If4Lv6zKqY8u0+JRgSVoqCvZDx3p8Cn6nM=","KeyId":"arn:aws:kms:us-west-2:042062605278:key/c80a5cdb-8d09-4f9f-89ee-df01b2e3870a","Plaintext":"6tmyz9JLBE2yIuU7iXpArqpDVle172WSmxjcO6GNT7E="}`) ++ })) ++ defer ts.Close() ++ ++ sess := unit.Session.Copy(&aws.Config{ ++ MaxRetries: aws.Int(0), ++ Endpoint: aws.String(ts.URL), ++ DisableSSL: aws.Bool(true), ++ S3ForcePathStyle: aws.Bool(true), ++ Region: aws.String("us-west-2"), ++ }) ++ ++ svc := kms.New(sess) ++ handler := NewKMSContextKeyGenerator(svc, "testid") ++ ++ keySize := 32 ++ ivSize := 16 ++ ++ cd, err := handler.GenerateCipherDataWithCEKAlg(keySize, ivSize, "cekAlgValue") ++ if err != nil { ++ t.Errorf("expected no error, but received %v", err) ++ } ++ if keySize != len(cd.Key) { ++ t.Errorf("expected %d, but received %d", keySize, len(cd.Key)) ++ } ++ if ivSize != len(cd.IV) { ++ t.Errorf("expected %d, but received %d", ivSize, len(cd.IV)) ++ } ++} ++ ++func TestKMSContextDecrypt(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ++ bodyBytes, err := ioutil.ReadAll(r.Body) ++ if err != nil { ++ w.WriteHeader(500) ++ return ++ } ++ var body map[string]interface{} ++ err = json.Unmarshal(bodyBytes, &body) ++ if err != nil { ++ w.WriteHeader(500) ++ return ++ } ++ ++ md, ok := body["EncryptionContext"].(map[string]interface{}) ++ if !ok { ++ w.WriteHeader(500) ++ return ++ } ++ ++ exEncContext := map[string]interface{}{ ++ "aws:" + cekAlgorithmHeader: "cekAlgValue", ++ } ++ ++ if e, a := exEncContext, md; !reflect.DeepEqual(e, a) { ++ w.WriteHeader(500) ++ t.Errorf("expected %v, got %v", e, a) ++ return ++ } ++ + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() +@@ -120,9 +210,17 @@ func TestKMSDecryptBadJSON(t *testing.T) { + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) ++ handler, err := NewKMSContextWrapEntry(kms.New(sess))(Envelope{MatDesc: `{"aws:x-amz-cek-alg": "cekAlgValue"}`}) ++ if err != nil { ++ t.Errorf("expected no error, but received %v", err) ++ } ++ ++ plaintextKey, err := handler.DecryptKey([]byte{1, 2, 3, 4}) ++ if err != nil { ++ t.Errorf("expected no error, but received %v", err) ++ } + +- _, err := (kmsKeyHandler{kms: kms.New(sess)}).decryptHandler(Envelope{MatDesc: `{"kms_cmk_id":"test"`}) +- if err == nil { +- t.Errorf("expected error, but received none") ++ if !bytes.Equal(key, plaintextKey) { ++ t.Errorf("expected %v, but received %v", key, plaintextKey) + } + } +diff --git a/service/s3/s3crypto/migrations_test.go b/service/s3/s3crypto/migrations_test.go +new file mode 100644 +index 000000000..6d76809d3 +--- /dev/null ++++ b/service/s3/s3crypto/migrations_test.go +@@ -0,0 +1,148 @@ ++package s3crypto_test ++ ++import ( ++ "bytes" ++ "fmt" ++ "io/ioutil" ++ ++ "github.com/aws/aws-sdk-go/aws" ++ "github.com/aws/aws-sdk-go/aws/session" ++ "github.com/aws/aws-sdk-go/service/kms" ++ "github.com/aws/aws-sdk-go/service/s3" ++ "github.com/aws/aws-sdk-go/service/s3/s3crypto" ++) ++ ++// ExampleNewEncryptionClientV2_migration00 provides a migration example for how users can migrate from the V1 ++// encryption client to the V2 encryption client. This example demonstrates how an application using the `kms` key wrap ++// algorithm with `AES/CBC/PKCS5Padding` can migrate their application to `kms+context` key wrapping with ++// `AES/GCM/NoPadding` content encryption. ++func ExampleNewEncryptionClientV2_migration00() { ++ sess := session.Must(session.NewSession()) ++ kmsClient := kms.New(sess) ++ cmkID := "1234abcd-12ab-34cd-56ef-1234567890ab" ++ ++ // Usage of NewKMSKeyGenerator (kms) key wrapping algorithm must be migrated to NewKMSContextKeyGenerator (kms+context) key wrapping algorithm ++ // ++ // cipherDataGenerator := s3crypto.NewKMSKeyGenerator(kmsClient, cmkID) ++ cipherDataGenerator := s3crypto.NewKMSContextKeyGenerator(kmsClient, cmkID) ++ ++ // Usage of AESCBCContentCipherBuilder (AES/CBC/PKCS5Padding) must be migrated to AESGCMContentCipherBuilder (AES/GCM/NoPadding) ++ // ++ // contentCipherBuilder := s3crypto.AESCBCContentCipherBuilder(cipherDataGenerator, s3crypto.AESCBCPadder) ++ contentCipherBuilder := s3crypto.AESGCMContentCipherBuilder(cipherDataGenerator) ++ ++ // Construction of an encryption client should be done using NewEncryptionClientV2 ++ // ++ // encryptionClient := s3crypto.NewEncryptionClient(sess, contentCipherBuilder) ++ encryptionClient, err := s3crypto.NewEncryptionClientV2(sess, contentCipherBuilder) ++ if err != nil { ++ fmt.Printf("failed to construct encryption client: %v", err) ++ return ++ } ++ ++ _, err = encryptionClient.PutObject(&s3.PutObjectInput{ ++ Bucket: aws.String("your_bucket"), ++ Key: aws.String("your_key"), ++ Body: bytes.NewReader([]byte("your content")), ++ }) ++ if err != nil { ++ fmt.Printf("put object error: %v\n", err) ++ return ++ } ++ fmt.Println("put object completed") ++} ++ ++// ExampleNewEncryptionClientV2_migration01 provides a more advanced migration example for how users can ++// migrate from the V1 encryption client to the V2 encryption client using more complex client construction. ++func ExampleNewEncryptionClientV2_migration01() { ++ sess := session.Must(session.NewSession()) ++ kmsClient := kms.New(sess) ++ cmkID := "1234abcd-12ab-34cd-56ef-1234567890ab" ++ ++ cipherDataGenerator := s3crypto.NewKMSContextKeyGenerator(kmsClient, cmkID) ++ ++ contentCipherBuilder := s3crypto.AESGCMContentCipherBuilder(cipherDataGenerator) ++ ++ // Overriding of the encryption client options is possible by passing in functional arguments that override the ++ // provided EncryptionClientOptions. ++ // ++ // encryptionClient := s3crypto.NewEncryptionClient(cipherDataGenerator, contentCipherBuilder, func(o *s3crypto.EncryptionClient) { ++ // o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}), ++ // }) ++ encryptionClient, err := s3crypto.NewEncryptionClientV2(sess, contentCipherBuilder, func(o *s3crypto.EncryptionClientOptions) { ++ o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}) ++ }) ++ if err != nil { ++ fmt.Printf("failed to construct encryption client: %v", err) ++ return ++ } ++ ++ _, err = encryptionClient.PutObject(&s3.PutObjectInput{ ++ Bucket: aws.String("your_bucket"), ++ Key: aws.String("your_key"), ++ Body: bytes.NewReader([]byte("your content")), ++ }) ++ if err != nil { ++ fmt.Printf("put object error: %v\n", err) ++ return ++ } ++ fmt.Println("put object completed") ++} ++ ++// ExampleNewDecryptionClientV2_migration00 provides a migration example for how users can migrate ++// from the V1 Decryption Clients to the V2 Decryption Clients. ++func ExampleNewDecryptionClientV2_migration00() { ++ sess := session.Must(session.NewSession()) ++ ++ // Construction of an decryption client must be done using NewDecryptionClientV2 ++ // The V2 decryption client is able to decrypt object encrypted by the V1 client. ++ // ++ // decryptionClient := s3crypto.NewDecryptionClient(sess) ++ decryptionClient := s3crypto.NewDecryptionClientV2(sess) ++ ++ getObject, err := decryptionClient.GetObject(&s3.GetObjectInput{ ++ Bucket: aws.String("your_bucket"), ++ Key: aws.String("your_key"), ++ }) ++ if err != nil { ++ fmt.Printf("get object error: %v\n", err) ++ return ++ } ++ ++ _, err = ioutil.ReadAll(getObject.Body) ++ if err != nil { ++ fmt.Printf("error reading object: %v\n", err) ++ } ++ fmt.Println("get object completed") ++} ++ ++// ExampleNewDecryptionClientV2_migration01 provides a more advanced migration example for how users can ++// migrate from the V1 decryption client to the V2 decryption client using more complex client construction. ++func ExampleNewDecryptionClientV2_migration01() { ++ sess := session.Must(session.NewSession()) ++ ++ // Construction of an decryption client must be done using NewDecryptionClientV2 ++ // The V2 decryption client is able to decrypt object encrypted by the V1 client. ++ // ++ // decryptionClient := s3crypto.NewDecryptionClient(sess, func(o *s3crypto.DecryptionClient) { ++ // o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}) ++ //}) ++ decryptionClient := s3crypto.NewDecryptionClientV2(sess, func(o *s3crypto.DecryptionClientOptions) { ++ o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}) ++ }) ++ ++ getObject, err := decryptionClient.GetObject(&s3.GetObjectInput{ ++ Bucket: aws.String("your_bucket"), ++ Key: aws.String("your_key"), ++ }) ++ if err != nil { ++ fmt.Printf("get object error: %v\n", err) ++ return ++ } ++ ++ _, err = ioutil.ReadAll(getObject.Body) ++ if err != nil { ++ fmt.Printf("error reading object: %v\n", err) ++ } ++ fmt.Println("get object completed") ++} +diff --git a/service/s3/s3crypto/mock_test.go b/service/s3/s3crypto/mock_test.go +index 4ad309c45..ac96d4cbf 100644 +--- a/service/s3/s3crypto/mock_test.go ++++ b/service/s3/s3crypto/mock_test.go +@@ -8,8 +8,7 @@ import ( + "github.com/aws/aws-sdk-go/service/s3/s3crypto" + ) + +-type mockGenerator struct { +-} ++type mockGenerator struct{} + + func (m mockGenerator) GenerateCipherData(keySize, ivSize int) (s3crypto.CipherData, error) { + cd := s3crypto.CipherData{ +@@ -27,7 +26,6 @@ func (m mockGenerator) EncryptKey(key []byte) ([]byte, error) { + + func (m mockGenerator) DecryptKey(key []byte) ([]byte, error) { + return make([]byte, 16), nil +- + } + + type mockCipherBuilder struct { +diff --git a/service/s3/s3crypto/shared_client.go b/service/s3/s3crypto/shared_client.go +new file mode 100644 +index 000000000..2c967d074 +--- /dev/null ++++ b/service/s3/s3crypto/shared_client.go +@@ -0,0 +1,210 @@ ++package s3crypto ++ ++import ( ++ "encoding/base64" ++ "encoding/hex" ++ "io" ++ "strings" ++ ++ "github.com/aws/aws-sdk-go/aws" ++ "github.com/aws/aws-sdk-go/aws/awserr" ++ "github.com/aws/aws-sdk-go/aws/request" ++ "github.com/aws/aws-sdk-go/internal/sdkio" ++ "github.com/aws/aws-sdk-go/service/s3" ++) ++ ++func putObjectRequest(c EncryptionClientOptions, input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { ++ req, out := c.S3Client.PutObjectRequest(input) ++ ++ // Get Size of file ++ n, err := aws.SeekerLen(input.Body) ++ if err != nil { ++ req.Error = err ++ return req, out ++ } ++ ++ dst, err := getWriterStore(req, c.TempFolderPath, n >= c.MinFileSize) ++ if err != nil { ++ req.Error = err ++ return req, out ++ } ++ ++ req.Handlers.Build.PushFront(func(r *request.Request) { ++ if err != nil { ++ r.Error = err ++ return ++ } ++ var encryptor ContentCipher ++ if v, ok := c.ContentCipherBuilder.(ContentCipherBuilderWithContext); ok { ++ encryptor, err = v.ContentCipherWithContext(r.Context()) ++ } else { ++ encryptor, err = c.ContentCipherBuilder.ContentCipher() ++ } ++ if err != nil { ++ r.Error = err ++ return ++ } ++ ++ md5 := newMD5Reader(input.Body) ++ sha := newSHA256Writer(dst) ++ reader, err := encryptor.EncryptContents(md5) ++ if err != nil { ++ r.Error = err ++ return ++ } ++ ++ _, err = io.Copy(sha, reader) ++ if err != nil { ++ r.Error = err ++ return ++ } ++ ++ data := encryptor.GetCipherData() ++ env, err := encodeMeta(md5, data) ++ if err != nil { ++ r.Error = err ++ return ++ } ++ ++ shaHex := hex.EncodeToString(sha.GetValue()) ++ req.HTTPRequest.Header.Set("X-Amz-Content-Sha256", shaHex) ++ ++ dst.Seek(0, sdkio.SeekStart) ++ input.Body = dst ++ ++ err = c.SaveStrategy.Save(env, r) ++ r.Error = err ++ }) ++ ++ return req, out ++} ++ ++func putObject(options EncryptionClientOptions, input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { ++ req, out := putObjectRequest(options, input) ++ return out, req.Send() ++} ++ ++func putObjectWithContext(options EncryptionClientOptions, ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { ++ req, out := putObjectRequest(options, input) ++ req.SetContext(ctx) ++ req.ApplyOptions(opts...) ++ return out, req.Send() ++} ++ ++func getObjectRequest(options DecryptionClientOptions, input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { ++ req, out := options.S3Client.GetObjectRequest(input) ++ req.Handlers.Unmarshal.PushBack(func(r *request.Request) { ++ env, err := options.LoadStrategy.Load(r) ++ if err != nil { ++ r.Error = err ++ out.Body.Close() ++ return ++ } ++ ++ // If KMS should return the correct CEK algorithm with the proper ++ // KMS key provider ++ cipher, err := contentCipherFromEnvelope(options, r.Context(), env) ++ if err != nil { ++ r.Error = err ++ out.Body.Close() ++ return ++ } ++ ++ reader, err := cipher.DecryptContents(out.Body) ++ if err != nil { ++ r.Error = err ++ out.Body.Close() ++ return ++ } ++ out.Body = reader ++ }) ++ return req, out ++} ++ ++func getObject(options DecryptionClientOptions, input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { ++ req, out := getObjectRequest(options, input) ++ return out, req.Send() ++} ++ ++func getObjectWithContext(options DecryptionClientOptions, ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { ++ req, out := getObjectRequest(options, input) ++ req.SetContext(ctx) ++ req.ApplyOptions(opts...) ++ return out, req.Send() ++} ++ ++func contentCipherFromEnvelope(options DecryptionClientOptions, ctx aws.Context, env Envelope) (ContentCipher, error) { ++ wrap, err := wrapFromEnvelope(options, env) ++ if err != nil { ++ return nil, err ++ } ++ ++ return cekFromEnvelope(options, ctx, env, wrap) ++} ++ ++func wrapFromEnvelope(options DecryptionClientOptions, env Envelope) (CipherDataDecrypter, error) { ++ f, ok := options.WrapRegistry[env.WrapAlg] ++ if !ok || f == nil { ++ return nil, awserr.New( ++ "InvalidWrapAlgorithmError", ++ "wrap algorithm isn't supported, "+env.WrapAlg, ++ nil, ++ ) ++ } ++ return f(env) ++} ++ ++func cekFromEnvelope(options DecryptionClientOptions, ctx aws.Context, env Envelope, decrypter CipherDataDecrypter) (ContentCipher, error) { ++ f, ok := options.CEKRegistry[env.CEKAlg] ++ if !ok || f == nil { ++ return nil, awserr.New( ++ "InvalidCEKAlgorithmError", ++ "cek algorithm isn't supported, "+env.CEKAlg, ++ nil, ++ ) ++ } ++ ++ key, err := base64.StdEncoding.DecodeString(env.CipherKey) ++ if err != nil { ++ return nil, err ++ } ++ ++ iv, err := base64.StdEncoding.DecodeString(env.IV) ++ if err != nil { ++ return nil, err ++ } ++ ++ if d, ok := decrypter.(CipherDataDecrypterWithContext); ok { ++ key, err = d.DecryptKeyWithContext(ctx, key) ++ } else { ++ key, err = decrypter.DecryptKey(key) ++ } ++ ++ if err != nil { ++ return nil, err ++ } ++ ++ cd := CipherData{ ++ Key: key, ++ IV: iv, ++ CEKAlgorithm: env.CEKAlg, ++ Padder: getPadder(options, env.CEKAlg), ++ } ++ return f(cd) ++} ++ ++// getPadder will return an unpadder with checking the cek algorithm specific padder. ++// If there wasn't a cek algorithm specific padder, we check the padder itself. ++// We return a no unpadder, if no unpadder was found. This means any customization ++// either contained padding within the cipher implementation, and to maintain ++// backwards compatility we will simply not unpad anything. ++func getPadder(options DecryptionClientOptions, cekAlg string) Padder { ++ padder, ok := options.PadderRegistry[cekAlg] ++ if !ok { ++ padder, ok = options.PadderRegistry[cekAlg[strings.LastIndex(cekAlg, "/")+1:]] ++ if !ok { ++ return NoPadder ++ } ++ } ++ return padder ++} +diff --git a/service/s3/s3crypto/strategy.go b/service/s3/s3crypto/strategy.go +index 9c180eabd..390b151a6 100644 +--- a/service/s3/s3crypto/strategy.go ++++ b/service/s3/s3crypto/strategy.go +@@ -63,7 +63,6 @@ func (strat HeaderV2SaveStrategy) Save(env Envelope, req *request.Request) error + input.Metadata[http.CanonicalHeaderKey(matDescHeader)] = &env.MatDesc + input.Metadata[http.CanonicalHeaderKey(wrapAlgorithmHeader)] = &env.WrapAlg + input.Metadata[http.CanonicalHeaderKey(cekAlgorithmHeader)] = &env.CEKAlg +- input.Metadata[http.CanonicalHeaderKey(unencryptedMD5Header)] = &env.UnencryptedMD5 + input.Metadata[http.CanonicalHeaderKey(unencryptedContentLengthHeader)] = &env.UnencryptedContentLen + + if len(env.TagLen) > 0 { +diff --git a/service/s3/s3crypto/strategy_test.go b/service/s3/s3crypto/strategy_test.go +index 10e3d864b..1c325e3ce 100644 +--- a/service/s3/s3crypto/strategy_test.go ++++ b/service/s3/s3crypto/strategy_test.go +@@ -1,11 +1,16 @@ + package s3crypto_test + + import ( ++ "bytes" ++ "encoding/json" ++ "io/ioutil" ++ "net/http" + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" ++ "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" + ) +@@ -33,7 +38,6 @@ func TestHeaderV2SaveStrategy(t *testing.T) { + "X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap), + "X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding), + "X-Amz-Tag-Len": aws.String("128"), +- "X-Amz-Unencrypted-Content-Md5": aws.String("hello"), + "X-Amz-Unencrypted-Content-Length": aws.String("0"), + }, + }, +@@ -53,7 +57,6 @@ func TestHeaderV2SaveStrategy(t *testing.T) { + "X-Amz-Matdesc": aws.String("{}"), + "X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap), + "X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding), +- "X-Amz-Unencrypted-Content-Md5": aws.String("hello"), + "X-Amz-Unencrypted-Content-Length": aws.String("0"), + }, + }, +@@ -75,3 +78,103 @@ func TestHeaderV2SaveStrategy(t *testing.T) { + } + } + } ++ ++func TestS3SaveStrategy(t *testing.T) { ++ cases := []struct { ++ env s3crypto.Envelope ++ expected s3crypto.Envelope ++ }{ ++ { ++ s3crypto.Envelope{ ++ CipherKey: "Foo", ++ IV: "Bar", ++ MatDesc: "{}", ++ WrapAlg: s3crypto.KMSWrap, ++ CEKAlg: s3crypto.AESGCMNoPadding, ++ TagLen: "128", ++ UnencryptedMD5: "hello", ++ UnencryptedContentLen: "0", ++ }, ++ s3crypto.Envelope{ ++ CipherKey: "Foo", ++ IV: "Bar", ++ MatDesc: "{}", ++ WrapAlg: s3crypto.KMSWrap, ++ CEKAlg: s3crypto.AESGCMNoPadding, ++ TagLen: "128", ++ UnencryptedContentLen: "0", ++ }, ++ }, ++ { ++ s3crypto.Envelope{ ++ CipherKey: "Foo", ++ IV: "Bar", ++ MatDesc: "{}", ++ WrapAlg: s3crypto.KMSWrap, ++ CEKAlg: s3crypto.AESGCMNoPadding, ++ UnencryptedMD5: "hello", ++ UnencryptedContentLen: "0", ++ }, ++ s3crypto.Envelope{ ++ CipherKey: "Foo", ++ IV: "Bar", ++ MatDesc: "{}", ++ WrapAlg: s3crypto.KMSWrap, ++ CEKAlg: s3crypto.AESGCMNoPadding, ++ UnencryptedContentLen: "0", ++ }, ++ }, ++ } ++ ++ for _, c := range cases { ++ params := &s3.PutObjectInput{ ++ Bucket: aws.String("fooBucket"), ++ Key: aws.String("barKey"), ++ } ++ req := &request.Request{ ++ Params: params, ++ } ++ ++ client := s3.New(unit.Session) ++ ++ client.Handlers.Send.Clear() ++ client.Handlers.Unmarshal.Clear() ++ client.Handlers.UnmarshalMeta.Clear() ++ client.Handlers.UnmarshalError.Clear() ++ client.Handlers.Send.PushBack(func(r *request.Request) { ++ bodyBytes, err := ioutil.ReadAll(r.Body) ++ if err != nil { ++ r.HTTPResponse = &http.Response{ ++ StatusCode: 500, ++ Body: ioutil.NopCloser(bytes.NewReader([]byte(err.Error()))), ++ } ++ return ++ } ++ ++ var actual s3crypto.Envelope ++ err = json.Unmarshal(bodyBytes, &actual) ++ if err != nil { ++ r.HTTPResponse = &http.Response{ ++ StatusCode: 500, ++ Body: ioutil.NopCloser(bytes.NewReader([]byte(err.Error()))), ++ } ++ return ++ } ++ ++ if e, a := c.expected, actual; !reflect.DeepEqual(e, a) { ++ t.Errorf("expected %v, got %v", e, a) ++ } ++ ++ r.HTTPResponse = &http.Response{ ++ StatusCode: 200, ++ Body: ioutil.NopCloser(bytes.NewReader([]byte(""))), ++ } ++ }) ++ ++ strat := s3crypto.S3SaveStrategy{Client: client} ++ err := strat.Save(c.env, req) ++ if err != nil { ++ t.Errorf("expected no error, but received %v", err) ++ } ++ } ++} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..ab816eec7cd196b71d1cc4b5a281adda6813f49b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/post_context.md @@ -0,0 +1,3212 @@ +# Patch-overlapping Go context after the fix + +## `internal/sync/singleflight/singleflight_test.go` (changed lines (17, 31, 46, 95)) + +```go +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package singleflight + +import ( + "errors" + "fmt" + "sync" + "sync/atomic" + "testing" + "time" +) + +func TestDo(t *testing.T) { + t.Skip("singleflight tests not stable") + var g Group + v, err, _ := g.Do("key", func() (interface{}, error) { + return "bar", nil + }) + if got, want := fmt.Sprintf("%v (%T)", v, v), "bar (string)"; got != want { + t.Errorf("Do = %v; want %v", got, want) + } + if err != nil { + t.Errorf("Do error = %v", err) + } +} + +func TestDoErr(t *testing.T) { + t.Skip("singleflight tests not stable") + var g Group + someErr := errors.New("Some error") + v, err, _ := g.Do("key", func() (interface{}, error) { + return nil, someErr + }) + if err != someErr { + t.Errorf("Do error = %v; want someErr %v", err, someErr) + } + if v != nil { + t.Errorf("unexpected non-nil value %#v", v) + } +} + +func TestDoDupSuppress(t *testing.T) { + t.Skip("singleflight tests not stable") + var g Group + var wg1, wg2 sync.WaitGroup + c := make(chan string, 1) + var calls int32 + fn := func() (interface{}, error) { + if atomic.AddInt32(&calls, 1) == 1 { + // First invocation. + wg1.Done() + } + v := <-c + c <- v // pump; make available for any future calls + + time.Sleep(10 * time.Millisecond) // let more goroutines enter Do + + return v, nil + } + + const n = 10 + wg1.Add(1) + for i := 0; i < n; i++ { + wg1.Add(1) + wg2.Add(1) + go func() { + defer wg2.Done() + wg1.Done() + v, err, _ := g.Do("key", fn) + if err != nil { + t.Errorf("Do error: %v", err) + return + } + if s, _ := v.(string); s != "bar" { + t.Errorf("Do = %T %v; want %q", v, v, "bar") + } + }() + } + wg1.Wait() + // At least one goroutine is in fn now and all of them have at + // least reached the line before the Do. + c <- "bar" + wg2.Wait() + if got := atomic.LoadInt32(&calls); got <= 0 || got >= n { + t.Errorf("number of calls = %d; want over 0 and less than %d", got, n) + } +} + +// Test that singleflight behaves correctly after Forget called. +// See https://github.com/golang/go/issues/31420 +func TestForget(t *testing.T) { + t.Skip("singleflight tests not stable") + var g Group + + var firstStarted, firstFinished sync.WaitGroup + + firstStarted.Add(1) + firstFinished.Add(1) + + firstCh := make(chan struct{}) + go func() { + g.Do("key", func() (i interface{}, e error) { + firstStarted.Done() + <-firstCh + firstFinished.Done() + return + }) + }() + + firstStarted.Wait() + g.Forget("key") // from this point no two function using same key should be executed concurrently + + var secondStarted int32 + var secondFinished int32 + var thirdStarted int32 + + secondCh := make(chan struct{}) + secondRunning := make(chan struct{}) + go func() { + g.Do("key", func() (i interface{}, e error) { + defer func() { + }() + atomic.AddInt32(&secondStarted, 1) + // Notify that we started + secondCh <- struct{}{} + // Wait other get above signal + <-secondRunning + <-secondCh + atomic.AddInt32(&secondFinished, 1) + return 2, nil + }) + }() + + close(firstCh) + firstFinished.Wait() // wait for first execution (which should not affect execution after Forget) + + <-secondCh + // Notify second that we got the signal that it started + secondRunning <- struct{}{} + if atomic.LoadInt32(&secondStarted) != 1 { + t.Fatal("Second execution should be executed due to usage of forget") + } + + if atomic.LoadInt32(&secondFinished) == 1 { + t.Fatal("Second execution should be still active") + } + + close(secondCh) + result, _, _ := g.Do("key", func() (i interface{}, e error) { + atomic.AddInt32(&thirdStarted, 1) + return 3, nil + }) + + if atomic.LoadInt32(&thirdStarted) != 0 { + t.Error("Third call should not be started because was started during second execution") + } + if result != 2 { + t.Errorf("We should receive result produced by second call, expected: 2, got %d", result) + } +} +``` + +## `service/s3/s3crypto/aes_cbc_content_cipher.go` (changed lines (18, 19, 20, 21, 24, 25)) + +```go +package s3crypto + +import ( + "io" + "strings" +) + +const ( + cbcKeySize = 32 + cbcNonceSize = 16 +) + +type cbcContentCipherBuilder struct { + generator CipherDataGenerator + padder Padder +} + +func (cbcContentCipherBuilder) isUsingDeprecatedFeatures() error { + return errDeprecatedCipherBuilder +} + +// AESCBCContentCipherBuilder returns a new encryption only mode structure with a specific cipher +// for the master key +// +// deprecated: This content cipher builder has been deprecated. Users should migrate to AESGCMContentCipherBuilder +func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder { + return cbcContentCipherBuilder{generator: generator, padder: padder} +} + +func (builder cbcContentCipherBuilder) ContentCipher() (ContentCipher, error) { + cd, err := builder.generator.GenerateCipherData(cbcKeySize, cbcNonceSize) + if err != nil { + return nil, err + } + + cd.Padder = builder.padder + return newAESCBCContentCipher(cd) +} + +// newAESCBCContentCipher will create a new aes cbc content cipher. If the cipher data's +// will set the CEK algorithm if it hasn't been set. +func newAESCBCContentCipher(cd CipherData) (ContentCipher, error) { + if len(cd.CEKAlgorithm) == 0 { + cd.CEKAlgorithm = strings.Join([]string{AESCBC, cd.Padder.Name()}, "/") + } + cipher, err := newAESCBC(cd, cd.Padder) + if err != nil { + return nil, err + } + + return &aesCBCContentCipher{ + CipherData: cd, + Cipher: cipher, + }, nil +} + +// aesCBCContentCipher will use AES CBC for the main cipher. +type aesCBCContentCipher struct { + CipherData CipherData + Cipher Cipher +} + +// EncryptContents will generate a random key and iv and encrypt the data using cbc +func (cc *aesCBCContentCipher) EncryptContents(src io.Reader) (io.Reader, error) { + return cc.Cipher.Encrypt(src), nil +} + +// DecryptContents will use the symmetric key provider to instantiate a new CBC cipher. +// We grab a decrypt reader from CBC and wrap it in a CryptoReadCloser. The only error +// expected here is when the key or iv is of invalid length. +func (cc *aesCBCContentCipher) DecryptContents(src io.ReadCloser) (io.ReadCloser, error) { + reader := cc.Cipher.Decrypt(src) + return &CryptoReadCloser{Body: src, Decrypter: reader}, nil +} + +// GetCipherData returns cipher data +func (cc aesCBCContentCipher) GetCipherData() CipherData { + return cc.CipherData +} +``` + +## `service/s3/s3crypto/aes_gcm_content_cipher.go` (changed lines (18, 19, 20, 21, 22, 23, 24, 39, 40, 41, 42, 43, 44, 46)) + +```go +package s3crypto + +import ( + "io" + + "github.com/aws/aws-sdk-go/aws" +) + +const ( + gcmKeySize = 32 + gcmNonceSize = 12 +) + +type gcmContentCipherBuilder struct { + generator CipherDataGenerator +} + +func (builder gcmContentCipherBuilder) isUsingDeprecatedFeatures() error { + if feature, ok := builder.generator.(deprecatedFeatures); ok { + return feature.isUsingDeprecatedFeatures() + } + return nil +} + +// AESGCMContentCipherBuilder returns a new encryption only mode structure with a specific cipher +// for the master key +func AESGCMContentCipherBuilder(generator CipherDataGenerator) ContentCipherBuilder { + return gcmContentCipherBuilder{generator} +} + +func (builder gcmContentCipherBuilder) ContentCipher() (ContentCipher, error) { + return builder.ContentCipherWithContext(aws.BackgroundContext()) +} + +func (builder gcmContentCipherBuilder) ContentCipherWithContext(ctx aws.Context) (ContentCipher, error) { + var cd CipherData + var err error + + switch v := builder.generator.(type) { + case CipherDataGeneratorWithCEKAlgWithContext: + cd, err = v.GenerateCipherDataWithCEKAlgWithContext(ctx, gcmKeySize, gcmNonceSize, AESGCMNoPadding) + case CipherDataGeneratorWithCEKAlg: + cd, err = v.GenerateCipherDataWithCEKAlg(gcmKeySize, gcmNonceSize, AESGCMNoPadding) + case CipherDataGeneratorWithContext: + cd, err = v.GenerateCipherDataWithContext(ctx, gcmKeySize, gcmNonceSize) + default: + cd, err = builder.generator.GenerateCipherData(gcmKeySize, gcmNonceSize) + } + if err != nil { + return nil, err + } + + return newAESGCMContentCipher(cd) +} + +func newAESGCMContentCipher(cd CipherData) (ContentCipher, error) { + cd.CEKAlgorithm = AESGCMNoPadding + cd.TagLength = "128" + + cipher, err := newAESGCM(cd) + if err != nil { + return nil, err + } + + return &aesGCMContentCipher{ + CipherData: cd, + Cipher: cipher, + }, nil +} + +// AESGCMContentCipher will use AES GCM for the main cipher. +type aesGCMContentCipher struct { + CipherData CipherData + Cipher Cipher +} + +// EncryptContents will generate a random key and iv and encrypt the data using cbc +func (cc *aesGCMContentCipher) EncryptContents(src io.Reader) (io.Reader, error) { + return cc.Cipher.Encrypt(src), nil +} + +// DecryptContents will use the symmetric key provider to instantiate a new GCM cipher. +// We grab a decrypt reader from gcm and wrap it in a CryptoReadCloser. The only error +// expected here is when the key or iv is of invalid length. +func (cc *aesGCMContentCipher) DecryptContents(src io.ReadCloser) (io.ReadCloser, error) { + reader := cc.Cipher.Decrypt(src) + return &CryptoReadCloser{Body: src, Decrypter: reader}, nil +} + +// GetCipherData returns cipher data +func (cc aesGCMContentCipher) GetCipherData() CipherData { + return cc.CipherData +} +``` + +## `service/s3/s3crypto/aes_gcm_content_cipher_test.go` (changed lines (6, 30, 31, 32, 33)) + +```go +package s3crypto_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/kms/kmsiface" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +func TestAESGCMContentCipherBuilder(t *testing.T) { + generator := mockGenerator{} + if builder := s3crypto.AESGCMContentCipherBuilder(generator); builder == nil { + t.Error("expected non-nil value") + } +} + +func TestAESGCMContentCipherNewEncryptor(t *testing.T) { + generator := mockGenerator{} + builder := s3crypto.AESGCMContentCipherBuilder(generator) + cipher, err := builder.ContentCipher() + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if cipher == nil { + t.Errorf("expected non-nil vaue") + } +} + +type mockKMS struct { + kmsiface.KMSAPI +} +``` + +## `service/s3/s3crypto/aes_gcm_test.go` (changed lines (1, 2, 8, 21, 30, 39, 48, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 162, 163, 181, 185)) + +```go +// +build go1.9 + +package s3crypto + +import ( + "bytes" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "strings" + "testing" +) + +// AES GCM +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_128_Test_0(t *testing.T) { + iv, _ := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + plaintext, _ := hex.DecodeString("2db5168e932556f8089a0622981d017d") + expected, _ := hex.DecodeString("fa4362189661d163fcd6a56d8bf0405a") + tag, _ := hex.DecodeString("d636ac1bbedd5cc3ee727dc2ab4a9489") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_104_Test_3(t *testing.T) { + iv, _ := hex.DecodeString("4742357c335913153ff0eb0f") + key, _ := hex.DecodeString("e5a0eb92cc2b064e1bc80891faf1fab5e9a17a9c3a984e25416720e30e6c2b21") + plaintext, _ := hex.DecodeString("8499893e16b0ba8b007d54665a") + expected, _ := hex.DecodeString("eb8e6175f1fe38eb1acf95fd51") + tag, _ := hex.DecodeString("88a8b74bb74fda553e91020a23deed45") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_256_Test_6(t *testing.T) { + iv, _ := hex.DecodeString("a291484c3de8bec6b47f525f") + key, _ := hex.DecodeString("37f39137416bafde6f75022a7a527cc593b6000a83ff51ec04871a0ff5360e4e") + plaintext, _ := hex.DecodeString("fafd94cede8b5a0730394bec68a8e77dba288d6ccaa8e1563a81d6e7ccc7fc97") + expected, _ := hex.DecodeString("44dc868006b21d49284016565ffb3979cc4271d967628bf7cdaf86db888e92e5") + tag, _ := hex.DecodeString("01a2b578aa2f41ec6379a44a31cc019c") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_408_Test_8(t *testing.T) { + iv, _ := hex.DecodeString("92f258071d79af3e63672285") + key, _ := hex.DecodeString("595f259c55abe00ae07535ca5d9b09d6efb9f7e9abb64605c337acbd6b14fc7e") + plaintext, _ := hex.DecodeString("a6fee33eb110a2d769bbc52b0f36969c287874f665681477a25fc4c48015c541fbe2394133ba490a34ee2dd67b898177849a91") + expected, _ := hex.DecodeString("bbca4a9e09ae9690c0f6f8d405e53dccd666aa9c5fa13c8758bc30abe1ddd1bcce0d36a1eaaaaffef20cd3c5970b9673f8a65c") + tag, _ := hex.DecodeString("26ccecb9976fd6ac9c2c0f372c52c821") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +type KAT struct { + IV string `json:"iv"` + Key string `json:"key"` + Plaintext string `json:"pt"` + AAD string `json:"aad"` + CipherText string `json:"ct"` + Tag string `json:"tag"` +} + +func TestAES_GCM_KATS(t *testing.T) { + fileContents, err := ioutil.ReadFile("testdata/aes_gcm.json") + if err != nil { + t.Fatalf("failed to read KAT file: %v", err) + } + + var kats []KAT + err = json.Unmarshal(fileContents, &kats) + if err != nil { + t.Fatalf("failed to unmarshal KAT json file: %v", err) + } + + for i, kat := range kats { + t.Run(fmt.Sprintf("Case%d", i), func(t *testing.T) { + if len(kat.AAD) > 0 { + t.Skip("Skipping... SDK implementation does not expose additional authenticated data") + } + iv, err := hex.DecodeString(kat.IV) + if err != nil { + t.Fatalf("failed to decode iv: %v", err) + } + key, err := hex.DecodeString(kat.Key) + if err != nil { + t.Fatalf("failed to decode key: %v", err) + } + plaintext, err := hex.DecodeString(kat.Plaintext) + if err != nil { + t.Fatalf("failed to decode plaintext: %v", err) + } + ciphertext, err := hex.DecodeString(kat.CipherText) + if err != nil { + t.Fatalf("failed to decode ciphertext: %v", err) + } + tag, err := hex.DecodeString(kat.Tag) + if err != nil { + t.Fatalf("failed to decode tag: %v", err) + } + aesgcmTest(t, iv, key, plaintext, ciphertext, tag) + }) + } +} + +func TestGCMEncryptReader_SourceError(t *testing.T) { + gcm := &gcmEncryptReader{ + encrypter: &mockCipherAEAD{}, + src: &mockSourceReader{err: fmt.Errorf("test read error")}, + } + + b := make([]byte, 10) + n, err := gcm.Read(b) + if err == nil { + t.Fatalf("expected error, but got nil") + } else if err != nil && !strings.Contains(err.Error(), "test read error") { + t.Fatalf("expected source read error, but got %v", err) + } + + if n != 0 { + t.Errorf("expected number of read bytes to be zero, but got %v", n) + } +} + +func TestGCMDecryptReader_SourceError(t *testing.T) { + gcm := &gcmDecryptReader{ + decrypter: &mockCipherAEAD{}, + src: &mockSourceReader{err: fmt.Errorf("test read error")}, + } + + b := make([]byte, 10) + n, err := gcm.Read(b) + if err == nil { + t.Fatalf("expected error, but got nil") + } else if err != nil && !strings.Contains(err.Error(), "test read error") { + t.Fatalf("expected source read error, but got %v", err) + } + + if n != 0 { + t.Errorf("expected number of read bytes to be zero, but got %v", n) + } +} + +func TestGCMDecryptReader_DecrypterOpenError(t *testing.T) { + gcm := &gcmDecryptReader{ + decrypter: &mockCipherAEAD{openError: fmt.Errorf("test open error")}, + src: &mockSourceReader{err: io.EOF}, + } + + b := make([]byte, 10) + n, err := gcm.Read(b) + if err == nil { + t.Fatalf("expected error, but got nil") + } else if err != nil && !strings.Contains(err.Error(), "test open error") { + t.Fatalf("expected source read error, but got %v", err) + } + + if n != 0 { + t.Errorf("expected number of read bytes to be zero, but got %v", n) + } +} + +func aesgcmTest(t *testing.T, iv, key, plaintext, expected, tag []byte) { + t.Helper() + const gcmTagSize = 16 + cd := CipherData{ + Key: key, + IV: iv, + } + gcm, err := newAESGCM(cd) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + cipherdata := gcm.Encrypt(bytes.NewReader(plaintext)) + + ciphertext, err := ioutil.ReadAll(cipherdata) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + // splitting tag and ciphertext + etag := ciphertext[len(ciphertext)-gcmTagSize:] + if !bytes.Equal(etag, tag) { + t.Errorf("expected tags to be equivalent") + } + if !bytes.Equal(ciphertext[:len(ciphertext)-gcmTagSize], expected) { + t.Errorf("expected ciphertext to be equivalent") + } + + data := gcm.Decrypt(bytes.NewReader(ciphertext)) + text, err := ioutil.ReadAll(data) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if !bytes.Equal(plaintext, text) { + t.Errorf("expected ciphertext to be equivalent") + } +} + +type mockSourceReader struct { + n int + err error +} + +func (b mockSourceReader) Read(p []byte) (n int, err error) { + return b.n, b.err +} + +type mockCipherAEAD struct { + seal []byte + openError error +} + +func (m mockCipherAEAD) NonceSize() int { + panic("implement me") +} + +func (m mockCipherAEAD) Overhead() int { + panic("implement me") +} + +func (m mockCipherAEAD) Seal(dst, nonce, plaintext, additionalData []byte) []byte { + return m.seal +} + +func (m mockCipherAEAD) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { + return []byte("mocked decrypt"), m.openError +} +``` + +## `service/s3/s3crypto/cipher_util.go` (changed lines (6, 8, 15)) + +```go +package s3crypto + +import ( + "encoding/base64" + "strconv" +) + +// AESGCMNoPadding is the constant value that is used to specify +// the CEK algorithm consiting of AES GCM with no padding. +const AESGCMNoPadding = "AES/GCM/NoPadding" + +// AESCBC is the string constant that signifies the AES CBC algorithm cipher. +const AESCBC = "AES/CBC" + +func encodeMeta(reader hashReader, cd CipherData) (Envelope, error) { + iv := base64.StdEncoding.EncodeToString(cd.IV) + key := base64.StdEncoding.EncodeToString(cd.EncryptedKey) + + md5 := reader.GetValue() + contentLength := reader.GetContentLength() + + md5Str := base64.StdEncoding.EncodeToString(md5) + matdesc, err := cd.MaterialDescription.encodeDescription() + if err != nil { + return Envelope{}, err + } + + return Envelope{ + CipherKey: key, + IV: iv, + MatDesc: string(matdesc), + WrapAlg: cd.WrapAlgorithm, + CEKAlg: cd.CEKAlgorithm, + TagLen: cd.TagLength, + UnencryptedMD5: md5Str, + UnencryptedContentLen: strconv.FormatInt(contentLength, 10), + }, nil +} +``` + +## `service/s3/s3crypto/cipher_util_test.go` (changed lines (17, 31, 45, 59, 70, 84, 110, 142, 143, 169, 201, 202, 228, 258, 259)) + +```go +package s3crypto + +import ( + "encoding/base64" + "encoding/hex" + "fmt" + "net/http" + "net/http/httptest" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/kms" +) + +func TestWrapFactory(t *testing.T) { + o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(unit.Session), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + } + env := Envelope{ + WrapAlg: KMSWrap, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := wrapFromEnvelope(o, env) + w, ok := wrap.(*kmsKeyHandler) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if wrap == nil { + t.Error("expected non-nil value") + } + if !ok { + t.Errorf("expected kmsKeyHandler, but received %v", *w) + } +} +func TestWrapFactoryErrorNoWrap(t *testing.T) { + o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(unit.Session), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + } + env := Envelope{ + WrapAlg: "none", + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := wrapFromEnvelope(o, env) + + if err == nil { + t.Error("expected error, but received none") + } + if wrap != nil { + t.Errorf("expected nil wrap value, received %v", wrap) + } +} + +func TestWrapFactoryCustomEntry(t *testing.T) { + o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + "custom": (kmsKeyHandler{ + kms: kms.New(unit.Session), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + } + env := Envelope{ + WrapAlg: "custom", + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := wrapFromEnvelope(o, env) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if wrap == nil { + t.Errorf("expected nil wrap value, received %v", wrap) + } +} + +func TestCEKFactory(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + PadderRegistry: map[string]Padder{ + NoPadder.Name(): NoPadder, + }, + } + iv, err := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + ivB64 := base64.URLEncoding.EncodeToString(iv) + + cipherKey, err := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + cipherKeyB64 := base64.URLEncoding.EncodeToString(cipherKey) + + env := Envelope{ + WrapAlg: KMSWrap, + CEKAlg: AESGCMNoPadding, + CipherKey: cipherKeyB64, + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := wrapFromEnvelope(o, env) + cek, err := cekFromEnvelope(o, aws.BackgroundContext(), env, wrap) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if cek == nil { + t.Errorf("expected non-nil cek") + } +} + +func TestCEKFactoryNoCEK(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + PadderRegistry: map[string]Padder{ + NoPadder.Name(): NoPadder, + }, + } + iv, err := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + ivB64 := base64.URLEncoding.EncodeToString(iv) + + cipherKey, err := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + cipherKeyB64 := base64.URLEncoding.EncodeToString(cipherKey) + + env := Envelope{ + WrapAlg: KMSWrap, + CEKAlg: "none", + CipherKey: cipherKeyB64, + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := wrapFromEnvelope(o, env) + cek, err := cekFromEnvelope(o, aws.BackgroundContext(), env, wrap) + + if err == nil { + t.Error("expected error, but received none") + } + if cek != nil { + t.Errorf("expected nil cek value, received %v", wrap) + } +} + +func TestCEKFactoryCustomEntry(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + o := DecryptionClientOptions{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + "custom": newAESGCMContentCipher, + }, + PadderRegistry: map[string]Padder{}, + } + iv, err := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + ivB64 := base64.URLEncoding.EncodeToString(iv) + + cipherKey, err := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + cipherKeyB64 := base64.URLEncoding.EncodeToString(cipherKey) + + env := Envelope{ + WrapAlg: KMSWrap, + CEKAlg: "custom", + CipherKey: cipherKeyB64, + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := wrapFromEnvelope(o, env) + cek, err := cekFromEnvelope(o, aws.BackgroundContext(), env, wrap) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if cek == nil { + t.Errorf("expected non-nil cek") + } +} +``` + +## `service/s3/s3crypto/decryption_client.go` (changed lines (28, 29, 50, 51, 89, 96, 97, 99, 103, 104, 106, 116, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129)) + +```go +package s3crypto + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// WrapEntry is builder that return a proper key decrypter and error +type WrapEntry func(Envelope) (CipherDataDecrypter, error) + +// CEKEntry is a builder thatn returns a proper content decrypter and error +type CEKEntry func(CipherData) (ContentCipher, error) + +// DecryptionClient is an S3 crypto client. The decryption client +// will handle all get object requests from Amazon S3. +// Supported key wrapping algorithms: +// *AWS KMS +// +// Supported content ciphers: +// * AES/GCM +// * AES/CBC +// +// deprecated: See DecryptionClientV2 +type DecryptionClient struct { + S3Client s3iface.S3API + // LoadStrategy is used to load the metadata either from the metadata of the object + // or from a separate file in s3. + // + // Defaults to our default load strategy. + LoadStrategy LoadStrategy + + WrapRegistry map[string]WrapEntry + CEKRegistry map[string]CEKEntry + PadderRegistry map[string]Padder +} + +// NewDecryptionClient instantiates a new S3 crypto client +// +// Example: +// sess := session.New() +// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient{ +// // Custom client options here +// })) +// +// deprecated: see NewDecryptionClientV2 +func NewDecryptionClient(prov client.ConfigProvider, options ...func(*DecryptionClient)) *DecryptionClient { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3Crypto") + }) + + client := &DecryptionClient{ + S3Client: s3client, + LoadStrategy: defaultV2LoadStrategy{ + client: s3client, + }, + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(prov), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): newAESCBCContentCipher, + }, + PadderRegistry: map[string]Padder{ + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): AESCBCPadder, + "NoPadding": NoPadder, + }, + } + for _, option := range options { + option(client) + } + + return client +} + +// GetObjectRequest will make a request to s3 and retrieve the object. In this process +// decryption will be done. The SDK only supports V2 reads of KMS and GCM. +// +// Example: +// sess := session.Must(session.NewSession()) +// svc := s3crypto.NewDecryptionClient(sess) +// req, out := svc.GetObjectRequest(&s3.GetObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// }) +// err := req.Send() +// +// deprecated: see DecryptionClientV2.GetObjectRequest +func (c *DecryptionClient) GetObjectRequest(input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { + return getObjectRequest(c.getClientOptions(), input) +} + +// GetObject is a wrapper for GetObjectRequest +// +// deprecated: see DecryptionClientV2.GetObject +func (c *DecryptionClient) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { + return getObject(c.getClientOptions(), input) +} + +// GetObjectWithContext is a wrapper for GetObjectRequest with the additional +// context, and request options support. +// +// GetObjectWithContext is the same as GetObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +// +// deprecated: see DecryptionClientV2.GetObjectWithContext +func (c *DecryptionClient) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { + return getObjectWithContext(c.getClientOptions(), ctx, input, opts...) +} + +func (c *DecryptionClient) getClientOptions() DecryptionClientOptions { + return DecryptionClientOptions{ + S3Client: c.S3Client, + LoadStrategy: c.LoadStrategy, + WrapRegistry: c.WrapRegistry, + CEKRegistry: c.CEKRegistry, + PadderRegistry: c.PadderRegistry, + } +} +``` + +## `service/s3/s3crypto/decryption_client_v2.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)) + +```go +package s3crypto + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// DecryptionClientV2 is an S3 crypto client. The decryption client +// will handle all get object requests from Amazon S3. +// Supported key wrapping algorithms: +// * AWS KMS +// * AWS KMS + Context +// +// Supported content ciphers: +// * AES/GCM +// * AES/CBC +type DecryptionClientV2 struct { + options DecryptionClientOptions +} + +// DecryptionClientOptions is the configuration options for DecryptionClientV2. +type DecryptionClientOptions struct { + S3Client s3iface.S3API + // LoadStrategy is used to load the metadata either from the metadata of the object + // or from a separate file in s3. + // + // Defaults to our default load strategy. + LoadStrategy LoadStrategy + + WrapRegistry map[string]WrapEntry + CEKRegistry map[string]CEKEntry + PadderRegistry map[string]Padder +} + +// NewDecryptionClientV2 instantiates a new V2 S3 crypto client. The returned DecryptionClientV2 will be able to decrypt +// object encrypted by both the V1 and V2 clients. +// +// Example: +// sess := session.Must(session.NewSession()) +// svc := s3crypto.NewDecryptionClientV2(sess, func(svc *s3crypto.DecryptionClientOptions{ +// // Custom client options here +// })) +func NewDecryptionClientV2(prov client.ConfigProvider, options ...func(clientOptions *DecryptionClientOptions)) *DecryptionClientV2 { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3CryptoV2") + }) + + kmsClient := kms.New(prov) + clientOptions := &DecryptionClientOptions{ + S3Client: s3client, + LoadStrategy: defaultV2LoadStrategy{ + client: s3client, + }, + WrapRegistry: map[string]WrapEntry{ + KMSWrap: NewKMSWrapEntry(kmsClient), + KMSContextWrap: NewKMSContextWrapEntry(kmsClient), + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): newAESCBCContentCipher, + }, + PadderRegistry: map[string]Padder{ + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): AESCBCPadder, + "NoPadding": NoPadder, + }, + } + for _, option := range options { + option(clientOptions) + } + + return &DecryptionClientV2{options: *clientOptions} +} + +// GetObjectRequest will make a request to s3 and retrieve the object. In this process +// decryption will be done. The SDK only supports V2 reads of KMS and GCM. +// +// Example: +// sess := session.Must(session.NewSession()) +// svc := s3crypto.NewDecryptionClientV2(sess) +// req, out := svc.GetObjectRequest(&s3.GetObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// }) +// err := req.Send() +func (c *DecryptionClientV2) GetObjectRequest(input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { + return getObjectRequest(c.options, input) +} + +// GetObject is a wrapper for GetObjectRequest +func (c *DecryptionClientV2) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { + req, out := getObjectRequest(c.options, input) + return out, req.Send() +} + +// GetObjectWithContext is a wrapper for GetObjectRequest with the additional +// context, and request options support. +// +// GetObjectWithContext is the same as GetObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +func (c *DecryptionClientV2) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { + req, out := getObjectRequest(c.options, input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} +``` + +## `service/s3/s3crypto/decryption_client_v2_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)) + +```go +package s3crypto_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +func TestDecryptionClientV2_CheckDeprecatedFeatures(t *testing.T) { + // AES/GCM/NoPadding with kms+context => allowed + builder := s3crypto.AESGCMContentCipherBuilder(s3crypto.NewKMSContextKeyGenerator(kms.New(unit.Session), "cmkID")) + _, err := s3crypto.NewEncryptionClientV2(unit.Session, builder) + if err != nil { + t.Errorf("expected no error, got %v", err) + } + + // AES/GCM/NoPadding with kms => not allowed + builder = s3crypto.AESGCMContentCipherBuilder(s3crypto.NewKMSKeyGenerator(kms.New(unit.Session), "cmkID")) + _, err = s3crypto.NewEncryptionClientV2(unit.Session, builder) + if err == nil { + t.Error("expected error, but got nil") + } + + // AES/CBC/PKCS5Padding with kms => not allowed + builder = s3crypto.AESCBCContentCipherBuilder(s3crypto.NewKMSKeyGenerator(kms.New(unit.Session), "cmkID"), s3crypto.NewPKCS7Padder(128)) + _, err = s3crypto.NewEncryptionClientV2(unit.Session, builder) + if err == nil { + t.Error("expected error, but got nil") + } + + // AES/CBC/PKCS5Padding with kms+context => not allowed + builder = s3crypto.AESCBCContentCipherBuilder(s3crypto.NewKMSContextKeyGenerator(kms.New(unit.Session), "cmkID"), s3crypto.NewPKCS7Padder(128)) + _, err = s3crypto.NewEncryptionClientV2(unit.Session, builder) + if err == nil { + t.Error("expected error, but got nil") + } +} +``` + +## `service/s3/s3crypto/deprecations.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) + +```go +package s3crypto + +import "fmt" + +var errDeprecatedCipherBuilder = fmt.Errorf("attempted to use deprecated cipher builder") +var errDeprecatedCipherDataGenerator = fmt.Errorf("attempted to use deprecated cipher data generator") + +type deprecatedFeatures interface { + isUsingDeprecatedFeatures() error +} +``` + +## `service/s3/s3crypto/deprecations_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)) + +```go +package s3crypto + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/kms/kmsiface" +) + +type mockKMS struct { + kmsiface.KMSAPI +} + +func TestAESGCMContentCipherBuilder_isUsingDeprecatedFeatures(t *testing.T) { + builder := AESGCMContentCipherBuilder(NewKMSKeyGenerator(mockKMS{}, "cmkID")) + + features, ok := builder.(deprecatedFeatures) + if !ok { + t.Errorf("expected to implement deprecatedFeatures interface") + } + + err := features.isUsingDeprecatedFeatures() + if err == nil { + t.Errorf("expected to recieve error for using deprecated features") + } + + builder = AESGCMContentCipherBuilder(NewKMSContextKeyGenerator(mockKMS{}, "cmkID")) + + features, ok = builder.(deprecatedFeatures) + if !ok { + t.Errorf("expected to implement deprecatedFeatures interface") + } + + err = features.isUsingDeprecatedFeatures() + if err != nil { + t.Errorf("expected no error, got %v", err) + } +} + +func TestAESCBCContentCipherBuilder_isUsingDeprecatedFeatures(t *testing.T) { + builder := AESCBCContentCipherBuilder(nil, nil) + + features, ok := builder.(deprecatedFeatures) + if !ok { + t.Errorf("expected to implement deprecatedFeatures interface") + } + + err := features.isUsingDeprecatedFeatures() + if err == nil { + t.Errorf("expected to recieve error for using deprecated features") + } +} +``` + +## `service/s3/s3crypto/doc.go` (changed lines (18, 20, 25, 26, 30, 31, 32, 34, 35, 37, 38, 40, 41, 44, 45, 56, 57, 58, 59, 62, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93)) + +```go +/* +Package s3crypto provides encryption to S3 using KMS and AES GCM. + +Keyproviders are interfaces that handle masterkeys. Masterkeys are used to encrypt and decrypt the randomly +generated cipher keys. The SDK currently uses KMS to do this. A user does not need to provide a master key +since all that information is hidden in KMS. + +Modes are interfaces that handle content encryption and decryption. It is an abstraction layer that instantiates +the ciphers. If content is being encrypted we generate the key and iv of the cipher. For decryption, we use the +metadata stored either on the object or an instruction file object to decrypt the contents. + +Ciphers are interfaces that handle encryption and decryption of data. This may be key wrap ciphers or content +ciphers. + +Creating an S3 cryptography client + + cmkID := "" + sess := session.Must(session.NewSession()) + // Create the KeyProvider + handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) + + // Create an encryption and decryption client + // We need to pass the session here so S3 can use it. In addition, any decryption that + // occurs will use the KMS client. + svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler)) + svc := s3crypto.NewDecryptionClientV2(sess) + +Configuration of the S3 cryptography client + + sess := session.Must(session.NewSession()) + handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) + svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler), func (o *s3crypto.EncryptionClientOptions) { + // Save instruction files to separate objects + o.SaveStrategy = NewS3SaveStrategy(sess, "") + + // Change instruction file suffix to .example + o.InstructionFileSuffix = ".example" + + // Set temp folder path + o.TempFolderPath = "/path/to/tmp/folder/" + + // Any content less than the minimum file size will use memory + // instead of writing the contents to a temp file. + o.MinFileSize = int64(1024 * 1024 * 1024) + }) + +The default SaveStrategy is to the object's header. + +The InstructionFileSuffix defaults to .instruction. Careful here though, if you do this, be sure you know +what that suffix is in grabbing data. All requests will look for fooKey.example instead of fooKey.instruction. +This suffix only affects gets and not puts. Put uses the keyprovider's suffix. + +Registration of new wrap or cek algorithms are also supported by the SDK. Let's say we want to support `AES Wrap` +and `AES CTR`. Let's assume we have already defined the functionality. + + svc := s3crypto.NewDecryptionClientV2(sess, func(o *s3crypto.DecryptionClientOptions) { + o.WrapRegistry["CustomWrap"] = NewCustomWrap + o.CEKRegistry["CustomCEK"] = NewCustomCEK + }) + +We have now registered these new algorithms to the decryption client. When the client calls `GetObject` and sees +the wrap as `CustomWrap` then it'll use that wrap algorithm. This is also true for `CustomCEK`. + +For encryption adding a custom content cipher builder and key handler will allow for encryption of custom +defined ciphers. + + // Our wrap algorithm, CustomWrap + handler := NewCustomWrap(key, iv) + // Our content cipher builder, NewCustomCEKContentBuilder + svc := s3crypto.NewEncryptionClientV2(sess, NewCustomCEKContentBuilder(handler)) + +Deprecations + +The EncryptionClient and DecryptionClient types and their associated constructor functions have been deprecated. +Users of these clients should migrate to EncryptionClientV2 and DecryptionClientV2 types and constructor functions. + +EncryptionClientV2 removes encryption support of the following features + * AES/CBC/PKCS5Padding (content cipher) + * kms (key wrap algorithm) + +Attempting to construct an EncryptionClientV2 with deprecated features will result in an error returned back to the +calling application during construction of the client. + +Users of `AES/CBC/PKCS5Padding` will need to migrate usage to `AES/GCM/NoPadding`. +Users of `kms` key provider will need to migrate `kms+context`. + +DecryptionClientV2 client adds support for the `kms+context` key provider and maintains backwards comparability with +objects encrypted with the deprecated EncryptionClient. + +Migrating from V1 to V2 Clients + +Examples of how to migrate usage of the V1 clients to the V2 equivalents have been documented as usage examples of +the NewEncryptionClientV2 and NewDecryptionClientV2 functions. +*/ +package s3crypto +``` + +## `service/s3/s3crypto/encryption_client.go` (changed lines (4, 7, 19, 20, 40, 42, 43, 44, 77, 78, 80, 84, 85, 87, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111)) + +```go +package s3crypto + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// DefaultMinFileSize is used to check whether we want to write to a temp file +// or store the data in memory. +const DefaultMinFileSize = 1024 * 512 * 5 + +// EncryptionClient is an S3 crypto client. By default the SDK will use Authentication mode which +// will use KMS for key wrapping and AES GCM for content encryption. +// AES GCM will load all data into memory. However, the rest of the content algorithms +// do not load the entire contents into memory. +// +// deprecated: See EncryptionClientV2 +type EncryptionClient struct { + S3Client s3iface.S3API + ContentCipherBuilder ContentCipherBuilder + // SaveStrategy will dictate where the envelope is saved. + // + // Defaults to the object's metadata + SaveStrategy SaveStrategy + // TempFolderPath is used to store temp files when calling PutObject. + // Temporary files are needed to compute the X-Amz-Content-Sha256 header. + TempFolderPath string + // MinFileSize is the minimum size for the content to write to a + // temporary file instead of using memory. + MinFileSize int64 +} + +// NewEncryptionClient instantiates a new S3 crypto client +// +// Example: +// cmkID := "arn:aws:kms:region:000000000000:key/00000000-0000-0000-0000-000000000000" +// sess := session.Must(session.NewSession()) +// handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) +// svc := s3crypto.NewEncryptionClient(sess, s3crypto.AESGCMContentCipherBuilder(handler)) +// +// deprecated: See NewEncryptionClientV2 +func NewEncryptionClient(prov client.ConfigProvider, builder ContentCipherBuilder, options ...func(*EncryptionClient)) *EncryptionClient { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3Crypto") + }) + + client := &EncryptionClient{ + S3Client: s3client, + ContentCipherBuilder: builder, + SaveStrategy: HeaderV2SaveStrategy{}, + MinFileSize: DefaultMinFileSize, + } + + for _, option := range options { + option(client) + } + + return client +} + +// PutObjectRequest creates a temp file to encrypt the contents into. It then streams +// that data to S3. +// +// Example: +// svc := s3crypto.New(session.New(), s3crypto.AESGCMContentCipherBuilder(handler)) +// req, out := svc.PutObjectRequest(&s3.PutObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// Body: strings.NewReader("test data"), +// }) +// err := req.Send() +// +// deprecated: See EncryptionClientV2.PutObjectRequest +func (c *EncryptionClient) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { + return putObjectRequest(c.getClientOptions(), input) +} + +// PutObject is a wrapper for PutObjectRequest +// +// deprecated: See EncryptionClientV2.PutObject +func (c *EncryptionClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { + return putObject(c.getClientOptions(), input) +} + +// PutObjectWithContext is a wrapper for PutObjectRequest with the additional +// context, and request options support. +// +// PutObjectWithContext is the same as PutObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +// PutObject is a wrapper for PutObjectRequest +// +// deprecated: See EncryptionClientV2.PutObjectWithContext +func (c *EncryptionClient) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { + return putObjectWithContext(c.getClientOptions(), ctx, input, opts...) +} + +func (c *EncryptionClient) getClientOptions() EncryptionClientOptions { + return EncryptionClientOptions{ + S3Client: c.S3Client, + ContentCipherBuilder: c.ContentCipherBuilder, + SaveStrategy: c.SaveStrategy, + TempFolderPath: c.TempFolderPath, + MinFileSize: c.MinFileSize, + } +} +``` + +## `service/s3/s3crypto/encryption_client_v2.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108)) + +```go +package s3crypto + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// EncryptionClientV2 is an S3 crypto client. By default the SDK will use Authentication mode which +// will use KMS for key wrapping and AES GCM for content encryption. +// AES GCM will load all data into memory. However, the rest of the content algorithms +// do not load the entire contents into memory. +type EncryptionClientV2 struct { + options EncryptionClientOptions +} + +// EncryptionClientOptions is the configuration options for EncryptionClientV2 +type EncryptionClientOptions struct { + S3Client s3iface.S3API + ContentCipherBuilder ContentCipherBuilder + // SaveStrategy will dictate where the envelope is saved. + // + // Defaults to the object's metadata + SaveStrategy SaveStrategy + // TempFolderPath is used to store temp files when calling PutObject. + // Temporary files are needed to compute the X-Amz-Content-Sha256 header. + TempFolderPath string + // MinFileSize is the minimum size for the content to write to a + // temporary file instead of using memory. + MinFileSize int64 +} + +// NewEncryptionClientV2 instantiates a new S3 crypto client. An error will be returned to the caller if the provided +// contentCipherBuilder has been deprecated, or if it uses other deprecated components. +// +// Example: +// cmkID := "arn:aws:kms:region:000000000000:key/00000000-0000-0000-0000-000000000000" +// sess := session.Must(session.NewSession()) +// handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) +// svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler)) +func NewEncryptionClientV2(prov client.ConfigProvider, contentCipherBuilder ContentCipherBuilder, options ...func(clientOptions *EncryptionClientOptions), +) ( + client *EncryptionClientV2, err error, +) { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3CryptoV2") + }) + + clientOptions := &EncryptionClientOptions{ + S3Client: s3client, + ContentCipherBuilder: contentCipherBuilder, + SaveStrategy: HeaderV2SaveStrategy{}, + MinFileSize: DefaultMinFileSize, + } + + for _, option := range options { + option(clientOptions) + } + + if feature, ok := contentCipherBuilder.(deprecatedFeatures); ok { + if err := feature.isUsingDeprecatedFeatures(); err != nil { + return nil, err + } + } + + client = &EncryptionClientV2{ + *clientOptions, + } + + return client, err +} + +// PutObjectRequest creates a temp file to encrypt the contents into. It then streams +// that data to S3. +// +// Example: +// sess := session.Must(session.NewSession()) +// handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), "cmkID") +// svc := s3crypto.NewEncryptionClientV2(sess, s3crypto.AESGCMContentCipherBuilder(handler)) +// req, out := svc.PutObjectRequest(&s3.PutObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// Body: strings.NewReader("test data"), +// }) +// err := req.Send() +func (c *EncryptionClientV2) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { + return putObjectRequest(c.options, input) +} + +// PutObject is a wrapper for PutObjectRequest +func (c *EncryptionClientV2) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { + return putObject(c.options, input) +} + +// PutObjectWithContext is a wrapper for PutObjectRequest with the additional +// context, and request options support. +// +// PutObjectWithContext is the same as PutObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +func (c *EncryptionClientV2) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { + return putObjectWithContext(c.options, ctx, input, opts...) +} +``` + +## `service/s3/s3crypto/envelope.go` (changed lines (35,)) + +```go +package s3crypto + +// DefaultInstructionKeySuffix is appended to the end of the instruction file key when +// grabbing or saving to S3 +const DefaultInstructionKeySuffix = ".instruction" + +const ( + metaHeader = "x-amz-meta" + keyV1Header = "x-amz-key" + keyV2Header = keyV1Header + "-v2" + ivHeader = "x-amz-iv" + matDescHeader = "x-amz-matdesc" + cekAlgorithmHeader = "x-amz-cek-alg" + wrapAlgorithmHeader = "x-amz-wrap-alg" + tagLengthHeader = "x-amz-tag-len" + unencryptedMD5Header = "x-amz-unencrypted-content-md5" + unencryptedContentLengthHeader = "x-amz-unencrypted-content-length" +) + +// Envelope encryption starts off by generating a random symmetric key using +// AES GCM. The SDK generates a random IV based off the encryption cipher +// chosen. The master key that was provided, whether by the user or KMS, will be used +// to encrypt the randomly generated symmetric key and base64 encode the iv. This will +// allow for decryption of that same data later. +type Envelope struct { + // IV is the randomly generated IV base64 encoded. + IV string `json:"x-amz-iv"` + // CipherKey is the randomly generated cipher key. + CipherKey string `json:"x-amz-key-v2"` + // MaterialDesc is a description to distinguish from other envelopes. + MatDesc string `json:"x-amz-matdesc"` + WrapAlg string `json:"x-amz-wrap-alg"` + CEKAlg string `json:"x-amz-cek-alg"` + TagLen string `json:"x-amz-tag-len"` + UnencryptedMD5 string `json:"-"` + UnencryptedContentLen string `json:"x-amz-unencrypted-content-length"` +} +``` + +## `service/s3/s3crypto/integration/main_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187)) + +```go +// +build integration,go1.14 + +package integration + +import ( + "bytes" + "crypto/rand" + "flag" + "io" + "io/ioutil" + "log" + "os" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting/integration" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/kms/kmsiface" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +var config = &struct { + Enabled bool + Region string + KMSKeyID string + Bucket string + Session *session.Session + Clients struct { + KMS kmsiface.KMSAPI + S3 s3iface.S3API + } +}{} + +func init() { + flag.BoolVar(&config.Enabled, "enable", false, "enable integration testing") + flag.StringVar(&config.Region, "region", "us-west-2", "integration test region") + flag.StringVar(&config.KMSKeyID, "kms-key-id", "", "KMS CMK Key ID") + flag.StringVar(&config.Bucket, "bucket", "", "S3 Bucket Name") +} + +func TestMain(m *testing.M) { + flag.Parse() + if !config.Enabled { + log.Println("skipping s3crypto integration tests") + os.Exit(0) + } + + if len(config.Bucket) == 0 { + log.Fatal("bucket name must be provided") + } + + if len(config.KMSKeyID) == 0 { + log.Fatal("kms cmk key id must be provided") + } + + config.Session = session.Must(session.NewSession(&aws.Config{Region: &config.Region})) + + config.Clients.KMS = kms.New(config.Session) + config.Clients.S3 = s3.New(config.Session) + + m.Run() +} + +func TestEncryptionV1_WithV2Interop(t *testing.T) { + kmsKeyGenerator := s3crypto.NewKMSKeyGenerator(config.Clients.KMS, config.KMSKeyID) + + // 1020 is chosen here as it is not cleanly divisible by the AES-256 block size + testData := make([]byte, 1020) + _, err := rand.Read(testData) + if err != nil { + t.Fatalf("failed to read random data: %v", err) + } + + v1DC := s3crypto.NewDecryptionClient(config.Session, func(client *s3crypto.DecryptionClient) { + client.S3Client = config.Clients.S3 + }) + v2DC := s3crypto.NewDecryptionClientV2(config.Session, func(options *s3crypto.DecryptionClientOptions) { + options.S3Client = config.Clients.S3 + }) + + cases := map[string]s3crypto.ContentCipherBuilder{ + "AES/GCM/NoPadding": s3crypto.AESGCMContentCipherBuilder(kmsKeyGenerator), + "AES/CBC/PKCS5Padding": s3crypto.AESCBCContentCipherBuilder(kmsKeyGenerator, s3crypto.AESCBCPadder), + } + + for name, ccb := range cases { + t.Run(name, func(t *testing.T) { + ec := s3crypto.NewEncryptionClient(config.Session, ccb, func(client *s3crypto.EncryptionClient) { + client.S3Client = config.Clients.S3 + }) + id := integration.UniqueID() + // PutObject with V1 Client + putObject(t, ec, id, bytes.NewReader(testData)) + // Verify V1 Decryption Client + getObjectAndCompare(t, v1DC, id, testData) + // Verify V2 Decryption Client + getObjectAndCompare(t, v2DC, id, testData) + }) + } +} + +func TestEncryptionV2(t *testing.T) { + kmsKeyGenerator := s3crypto.NewKMSContextKeyGenerator(config.Clients.KMS, config.KMSKeyID) + gcmContentCipherBuilder := s3crypto.AESGCMContentCipherBuilder(kmsKeyGenerator) + + ec, err := s3crypto.NewEncryptionClientV2(config.Session, gcmContentCipherBuilder, func(options *s3crypto.EncryptionClientOptions) { + options.S3Client = config.Clients.S3 + }) + if err != nil { + t.Fatalf("failed to construct encryption client: %v", err) + } + + dc := s3crypto.NewDecryptionClientV2(config.Session, func(options *s3crypto.DecryptionClientOptions) { + options.S3Client = config.Clients.S3 + }) + + // 1020 is chosen here as it is not cleanly divisible by the AES-256 block size + testData := make([]byte, 1020) + _, err = rand.Read(testData) + if err != nil { + t.Fatalf("failed to read random data: %v", err) + } + + keyId := integration.UniqueID() + + // Upload V2 Objects with Encryption Client + putObject(t, ec, keyId, bytes.NewReader(testData)) + + // Verify V2 Object with Decryption Client + getObjectAndCompare(t, dc, keyId, testData) +} + +type Encryptor interface { + PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) +} + +func putObject(t *testing.T, client Encryptor, key string, reader io.ReadSeeker) { + t.Helper() + _, err := client.PutObject(&s3.PutObjectInput{ + Bucket: &config.Bucket, + Key: &key, + Body: reader, + }) + if err != nil { + t.Fatalf("failed to upload object: %v", err) + } + t.Cleanup(doKeyCleanup(key)) +} + +type Decryptor interface { + GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) +} + +func getObjectAndCompare(t *testing.T, client Decryptor, key string, expected []byte) { + t.Helper() + output, err := client.GetObject(&s3.GetObjectInput{ + Bucket: &config.Bucket, + Key: &key, + }) + if err != nil { + t.Fatalf("failed to get object: %v", err) + } + + actual, err := ioutil.ReadAll(output.Body) + if err != nil { + t.Fatalf("failed to read body response: %v", err) + } + + if bytes.Compare(expected, actual) != 0 { + t.Errorf("expected bytes did not match actual") + } +} + +func doKeyCleanup(key string) func() { + return func() { + _, err := config.Clients.S3.DeleteObject(&s3.DeleteObjectInput{ + Bucket: &config.Bucket, + Key: &key, + }) + if err != nil { + log.Printf("failed to delete %s: %v", key, err) + } + } +} +``` + +## `service/s3/s3crypto/key_handler.go` (changed lines (23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 49, 51, 52, 53, 54, 55)) + +```go +package s3crypto + +import ( + "crypto/rand" + + "github.com/aws/aws-sdk-go/aws" +) + +// CipherDataGenerator handles generating proper key and IVs of proper size for the +// content cipher. CipherDataGenerator will also encrypt the key and store it in +// the CipherData. +type CipherDataGenerator interface { + GenerateCipherData(int, int) (CipherData, error) +} + +// CipherDataGeneratorWithContext handles generating proper key and IVs of +// proper size for the content cipher. CipherDataGenerator will also encrypt +// the key and store it in the CipherData. +type CipherDataGeneratorWithContext interface { + GenerateCipherDataWithContext(aws.Context, int, int) (CipherData, error) +} + +// CipherDataGeneratorWithCEKAlg handles generating proper key and IVs of proper size for the +// content cipher. CipherDataGenerator will also encrypt the key and store it in +// the CipherData. +type CipherDataGeneratorWithCEKAlg interface { + GenerateCipherDataWithCEKAlg(int, int, string) (CipherData, error) + + CipherDataGenerator // backwards comparability to plug into older interface +} + +// CipherDataGeneratorWithCEKAlgWithContext handles generating proper key and IVs of +// proper size for the content cipher. CipherDataGenerator will also encrypt +// the key and store it in the CipherData. +type CipherDataGeneratorWithCEKAlgWithContext interface { + GenerateCipherDataWithCEKAlgWithContext(aws.Context, int, int, string) (CipherData, error) +} + +// CipherDataDecrypter is a handler to decrypt keys from the envelope. +type CipherDataDecrypter interface { + DecryptKey([]byte) ([]byte, error) +} + +// CipherDataDecrypterWithContext is a handler to decrypt keys from the envelope with request context. +type CipherDataDecrypterWithContext interface { + DecryptKeyWithContext(aws.Context, []byte) ([]byte, error) +} + +func generateBytes(n int) ([]byte, error) { + b := make([]byte, n) + _, err := rand.Read(b) + if err != nil { + return nil, err + } + return b, nil +} +``` + +## `service/s3/s3crypto/key_handler_test.go` (changed lines (8, 12, 16)) + +```go +package s3crypto + +import ( + "testing" +) + +func TestGenerateBytes(t *testing.T) { + b, _ := generateBytes(5) + if e, a := 5, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } + b, _ = generateBytes(0) + if e, a := 0, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } + b, _ = generateBytes(1024) + if e, a := 1024, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } +} +``` + +## `service/s3/s3crypto/kms_key_handler.go` (changed lines (4, 5, 15, 16, 17, 22, 23, 24, 37, 38, 43, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 70, 71, 72, 74, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 114, 115, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 155, 162, 163, 164, 193, 194, 195, 196, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 217, 225, 226, 227, 228, 229, 233, 234, 239, 240, 241, 242, 243, 244, 245)) + +```go +package s3crypto + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/kms/kmsiface" +) + +const ( + // KMSWrap is a constant used during decryption to build a KMS key handler. + KMSWrap = "kms" + + // KMSContextWrap is a constant used during decryption to build a kms+context key handler + KMSContextWrap = "kms+context" +) + +// kmsKeyHandler will make calls to KMS to get the masterkey +type kmsKeyHandler struct { + kms kmsiface.KMSAPI + cmkID *string + withContext bool + + CipherData +} + +// NewKMSKeyGenerator builds a new KMS key provider using the customer key ID and material +// description. +// +// Example: +// sess := session.New(&aws.Config{}) +// cmkID := "arn to key" +// matdesc := s3crypto.MaterialDescription{} +// handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) +// +// deprecated: See NewKMSContextKeyGenerator +func NewKMSKeyGenerator(kmsClient kmsiface.KMSAPI, cmkID string) CipherDataGenerator { + return NewKMSKeyGeneratorWithMatDesc(kmsClient, cmkID, MaterialDescription{}) +} + +// NewKMSContextKeyGenerator builds a new kms+context key provider using the customer key ID and material +// description. +// +// Example: +// sess := session.New(&aws.Config{}) +// cmkID := "arn to key" +// matdesc := s3crypto.MaterialDescription{} +// handler := s3crypto.NewKMSContextKeyGenerator(kms.New(sess), cmkID) +func NewKMSContextKeyGenerator(client kmsiface.KMSAPI, cmkID string) CipherDataGeneratorWithCEKAlg { + return NewKMSContextKeyGeneratorWithMatDesc(client, cmkID, MaterialDescription{}) +} + +func newKMSKeyHandler(client kmsiface.KMSAPI, cmkID string, withContext bool, matdesc MaterialDescription) *kmsKeyHandler { + // These values are read only making them thread safe + kp := &kmsKeyHandler{ + kms: client, + cmkID: &cmkID, + withContext: withContext, + } + + if matdesc == nil { + matdesc = MaterialDescription{} + } + + // These values are read only making them thread safe + if kp.withContext { + kp.CipherData.WrapAlgorithm = KMSContextWrap + } else { + matdesc["kms_cmk_id"] = &cmkID + kp.CipherData.WrapAlgorithm = KMSWrap + } + kp.CipherData.MaterialDescription = matdesc + return kp +} + +// NewKMSKeyGeneratorWithMatDesc builds a new KMS key provider using the customer key ID and material +// description. +// +// Example: +// sess := session.New(&aws.Config{}) +// cmkID := "arn to key" +// matdesc := s3crypto.MaterialDescription{} +// handler := s3crypto.NewKMSKeyGeneratorWithMatDesc(kms.New(sess), cmkID, matdesc) +// +// deprecated: See NewKMSContextKeyGeneratorWithMatDesc +func NewKMSKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matdesc MaterialDescription) CipherDataGenerator { + return newKMSKeyHandler(kmsClient, cmkID, false, matdesc) +} + +// NewKMSContextKeyGeneratorWithMatDesc builds a new kms+context key provider using the customer key ID and material +// description. +// +// Example: +// sess := session.New(&aws.Config{}) +// cmkID := "arn to key" +// matdesc := s3crypto.MaterialDescription{} +// handler := s3crypto.NewKMSKeyGeneratorWithMatDesc(kms.New(sess), cmkID, matdesc) +func NewKMSContextKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matdesc MaterialDescription) CipherDataGeneratorWithCEKAlg { + return newKMSKeyHandler(kmsClient, cmkID, true, matdesc) +} + +// NewKMSWrapEntry builds returns a new KMS key provider and its decrypt handler. +// +// Example: +// sess := session.New(&aws.Config{}) +// customKMSClient := kms.New(sess) +// decryptHandler := s3crypto.NewKMSWrapEntry(customKMSClient) +// +// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient) { +// svc.WrapRegistry[s3crypto.KMSWrap] = decryptHandler +// })) +// +// deprecated: See NewKMSContextWrapEntry +func NewKMSWrapEntry(kmsClient kmsiface.KMSAPI) WrapEntry { + // These values are read only making them thread safe + kp := &kmsKeyHandler{ + kms: kmsClient, + } + + return kp.decryptHandler +} + +// NewKMSContextWrapEntry builds returns a new KMS key provider and its decrypt handler. +// +// Example: +// sess := session.New(&aws.Config{}) +// customKMSClient := kms.New(sess) +// decryptHandler := s3crypto.NewKMSContextWrapEntry(customKMSClient) +// +// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient) { +// svc.WrapRegistry[s3crypto.KMSContextWrap] = decryptHandler +// })) +func NewKMSContextWrapEntry(kmsClient kmsiface.KMSAPI) WrapEntry { + // These values are read only making them thread safe + kp := &kmsKeyHandler{ + kms: kmsClient, + withContext: true, + } + + return kp.decryptHandler +} + +// decryptHandler initializes a KMS keyprovider with a material description. This +// is used with Decrypting kms content, due to the cmkID being in the material description. +func (kp kmsKeyHandler) decryptHandler(env Envelope) (CipherDataDecrypter, error) { + m := MaterialDescription{} + err := m.decodeDescription([]byte(env.MatDesc)) + if err != nil { + return nil, err + } + + cmkID, ok := m["kms_cmk_id"] + if !kp.withContext && !ok { + return nil, awserr.New("MissingCMKIDError", "Material description is missing CMK ID", nil) + } + + kp.CipherData.MaterialDescription = m + kp.cmkID = cmkID + kp.WrapAlgorithm = KMSWrap + if kp.withContext { + kp.WrapAlgorithm = KMSContextWrap + } + return &kp, nil +} + +// DecryptKey makes a call to KMS to decrypt the key. +func (kp *kmsKeyHandler) DecryptKey(key []byte) ([]byte, error) { + return kp.DecryptKeyWithContext(aws.BackgroundContext(), key) +} + +// DecryptKeyWithContext makes a call to KMS to decrypt the key with request context. +func (kp *kmsKeyHandler) DecryptKeyWithContext(ctx aws.Context, key []byte) ([]byte, error) { + out, err := kp.kms.DecryptWithContext(ctx, + &kms.DecryptInput{ + EncryptionContext: kp.CipherData.MaterialDescription, + CiphertextBlob: key, + GrantTokens: []*string{}, + }) + if err != nil { + return nil, err + } + return out.Plaintext, nil +} + +// GenerateCipherData makes a call to KMS to generate a data key, Upon making +// the call, it also sets the encrypted key. +func (kp *kmsKeyHandler) GenerateCipherData(keySize, ivSize int) (CipherData, error) { + return kp.GenerateCipherDataWithContext(aws.BackgroundContext(), keySize, ivSize) +} + +func (kp kmsKeyHandler) GenerateCipherDataWithCEKAlg(keySize, ivSize int, cekAlgorithm string) (CipherData, error) { + return kp.GenerateCipherDataWithCEKAlgWithContext(aws.BackgroundContext(), keySize, ivSize, cekAlgorithm) +} + +// GenerateCipherDataWithContext makes a call to KMS to generate a data key, +// Upon making the call, it also sets the encrypted key. +func (kp *kmsKeyHandler) GenerateCipherDataWithContext(ctx aws.Context, keySize, ivSize int) (CipherData, error) { + return kp.GenerateCipherDataWithCEKAlgWithContext(ctx, keySize, ivSize, "") +} + +func (kp kmsKeyHandler) GenerateCipherDataWithCEKAlgWithContext(ctx aws.Context, keySize int, ivSize int, cekAlgorithm string) (CipherData, error) { + md := kp.CipherData.MaterialDescription + + wrapAlgorithm := KMSWrap + if kp.withContext { + wrapAlgorithm = KMSContextWrap + if len(cekAlgorithm) == 0 { + return CipherData{}, fmt.Errorf("CEK algorithm identifier must not be empty") + } + md["aws:"+cekAlgorithmHeader] = &cekAlgorithm + } + + out, err := kp.kms.GenerateDataKeyWithContext(ctx, + &kms.GenerateDataKeyInput{ + EncryptionContext: md, + KeyId: kp.cmkID, + KeySpec: aws.String("AES_256"), + }) + if err != nil { + return CipherData{}, err + } + + iv, err := generateBytes(ivSize) + if err != nil { + return CipherData{}, err + } + + cd := CipherData{ + Key: out.Plaintext, + IV: iv, + WrapAlgorithm: wrapAlgorithm, + MaterialDescription: md, + EncryptedKey: out.CiphertextBlob, + } + return cd, nil +} + +func (kp *kmsKeyHandler) isUsingDeprecatedFeatures() error { + if !kp.withContext { + return errDeprecatedCipherDataGenerator + } + return nil +} +``` + +## `service/s3/s3crypto/kms_key_handler_test.go` (changed lines (7, 9, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224)) + +```go +package s3crypto + +import ( + "bytes" + "encoding/base64" + "encoding/hex" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/kms" +) + +func TestBuildKMSEncryptHandler(t *testing.T) { + svc := kms.New(unit.Session) + handler := NewKMSKeyGenerator(svc, "testid") + if handler == nil { + t.Error("expected non-nil handler") + } +} + +func TestBuildKMSEncryptHandlerWithMatDesc(t *testing.T) { + svc := kms.New(unit.Session) + handler := NewKMSKeyGeneratorWithMatDesc(svc, "testid", MaterialDescription{ + "Testing": aws.String("123"), + }) + if handler == nil { + t.Error("expected non-nil handler") + } + + kmsHandler := handler.(*kmsKeyHandler) + expected := MaterialDescription{ + "kms_cmk_id": aws.String("testid"), + "Testing": aws.String("123"), + } + + if !reflect.DeepEqual(expected, kmsHandler.CipherData.MaterialDescription) { + t.Errorf("expected %v, but received %v", expected, kmsHandler.CipherData.MaterialDescription) + } +} + +func TestKMSGenerateCipherData(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, `{"CiphertextBlob":"AQEDAHhqBCCY1MSimw8gOGcUma79cn4ANvTtQyv9iuBdbcEF1QAAAH4wfAYJKoZIhvcNAQcGoG8wbQIBADBoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDJ6IcN5E4wVbk38MNAIBEIA7oF1E3lS7FY9DkoxPc/UmJsEwHzL82zMqoLwXIvi8LQHr8If4Lv6zKqY8u0+JRgSVoqCvZDx3p8Cn6nM=","KeyId":"arn:aws:kms:us-west-2:042062605278:key/c80a5cdb-8d09-4f9f-89ee-df01b2e3870a","Plaintext":"6tmyz9JLBE2yIuU7iXpArqpDVle172WSmxjcO6GNT7E="}`) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + svc := kms.New(sess) + handler := NewKMSKeyGenerator(svc, "testid") + + keySize := 32 + ivSize := 16 + + cd, err := handler.GenerateCipherData(keySize, ivSize) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if keySize != len(cd.Key) { + t.Errorf("expected %d, but received %d", keySize, len(cd.Key)) + } + if ivSize != len(cd.IV) { + t.Errorf("expected %d, but received %d", ivSize, len(cd.IV)) + } +} + +func TestKMSDecrypt(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + handler, err := (kmsKeyHandler{kms: kms.New(sess)}).decryptHandler(Envelope{MatDesc: `{"kms_cmk_id":"test"}`}) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + plaintextKey, err := handler.DecryptKey([]byte{1, 2, 3, 4}) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if !bytes.Equal(key, plaintextKey) { + t.Errorf("expected %v, but received %v", key, plaintextKey) + } +} + +func TestKMSContextGenerateCipherData(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + bodyBytes, err := ioutil.ReadAll(r.Body) + if err != nil { + w.WriteHeader(500) + return + } + var body map[string]interface{} + err = json.Unmarshal(bodyBytes, &body) + if err != nil { + w.WriteHeader(500) + return + } + + md, ok := body["EncryptionContext"].(map[string]interface{}) + if !ok { + w.WriteHeader(500) + return + } + + exEncContext := map[string]interface{}{ + "aws:" + cekAlgorithmHeader: "cekAlgValue", + } + + if e, a := exEncContext, md; !reflect.DeepEqual(e, a) { + w.WriteHeader(500) + t.Errorf("expected %v, got %v", e, a) + return + } + + fmt.Fprintln(w, `{"CiphertextBlob":"AQEDAHhqBCCY1MSimw8gOGcUma79cn4ANvTtQyv9iuBdbcEF1QAAAH4wfAYJKoZIhvcNAQcGoG8wbQIBADBoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDJ6IcN5E4wVbk38MNAIBEIA7oF1E3lS7FY9DkoxPc/UmJsEwHzL82zMqoLwXIvi8LQHr8If4Lv6zKqY8u0+JRgSVoqCvZDx3p8Cn6nM=","KeyId":"arn:aws:kms:us-west-2:042062605278:key/c80a5cdb-8d09-4f9f-89ee-df01b2e3870a","Plaintext":"6tmyz9JLBE2yIuU7iXpArqpDVle172WSmxjcO6GNT7E="}`) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + svc := kms.New(sess) + handler := NewKMSContextKeyGenerator(svc, "testid") + + keySize := 32 + ivSize := 16 + + cd, err := handler.GenerateCipherDataWithCEKAlg(keySize, ivSize, "cekAlgValue") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if keySize != len(cd.Key) { + t.Errorf("expected %d, but received %d", keySize, len(cd.Key)) + } + if ivSize != len(cd.IV) { + t.Errorf("expected %d, but received %d", ivSize, len(cd.IV)) + } +} + +func TestKMSContextDecrypt(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + bodyBytes, err := ioutil.ReadAll(r.Body) + if err != nil { + w.WriteHeader(500) + return + } + var body map[string]interface{} + err = json.Unmarshal(bodyBytes, &body) + if err != nil { + w.WriteHeader(500) + return + } + + md, ok := body["EncryptionContext"].(map[string]interface{}) + if !ok { + w.WriteHeader(500) + return + } + + exEncContext := map[string]interface{}{ + "aws:" + cekAlgorithmHeader: "cekAlgValue", + } + + if e, a := exEncContext, md; !reflect.DeepEqual(e, a) { + w.WriteHeader(500) + t.Errorf("expected %v, got %v", e, a) + return + } + + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + handler, err := NewKMSContextWrapEntry(kms.New(sess))(Envelope{MatDesc: `{"aws:x-amz-cek-alg": "cekAlgValue"}`}) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + plaintextKey, err := handler.DecryptKey([]byte{1, 2, 3, 4}) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if !bytes.Equal(key, plaintextKey) { + t.Errorf("expected %v, but received %v", key, plaintextKey) + } +} +``` + +## `service/s3/s3crypto/migrations_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148)) + +```go +package s3crypto_test + +import ( + "bytes" + "fmt" + "io/ioutil" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +// ExampleNewEncryptionClientV2_migration00 provides a migration example for how users can migrate from the V1 +// encryption client to the V2 encryption client. This example demonstrates how an application using the `kms` key wrap +// algorithm with `AES/CBC/PKCS5Padding` can migrate their application to `kms+context` key wrapping with +// `AES/GCM/NoPadding` content encryption. +func ExampleNewEncryptionClientV2_migration00() { + sess := session.Must(session.NewSession()) + kmsClient := kms.New(sess) + cmkID := "1234abcd-12ab-34cd-56ef-1234567890ab" + + // Usage of NewKMSKeyGenerator (kms) key wrapping algorithm must be migrated to NewKMSContextKeyGenerator (kms+context) key wrapping algorithm + // + // cipherDataGenerator := s3crypto.NewKMSKeyGenerator(kmsClient, cmkID) + cipherDataGenerator := s3crypto.NewKMSContextKeyGenerator(kmsClient, cmkID) + + // Usage of AESCBCContentCipherBuilder (AES/CBC/PKCS5Padding) must be migrated to AESGCMContentCipherBuilder (AES/GCM/NoPadding) + // + // contentCipherBuilder := s3crypto.AESCBCContentCipherBuilder(cipherDataGenerator, s3crypto.AESCBCPadder) + contentCipherBuilder := s3crypto.AESGCMContentCipherBuilder(cipherDataGenerator) + + // Construction of an encryption client should be done using NewEncryptionClientV2 + // + // encryptionClient := s3crypto.NewEncryptionClient(sess, contentCipherBuilder) + encryptionClient, err := s3crypto.NewEncryptionClientV2(sess, contentCipherBuilder) + if err != nil { + fmt.Printf("failed to construct encryption client: %v", err) + return + } + + _, err = encryptionClient.PutObject(&s3.PutObjectInput{ + Bucket: aws.String("your_bucket"), + Key: aws.String("your_key"), + Body: bytes.NewReader([]byte("your content")), + }) + if err != nil { + fmt.Printf("put object error: %v\n", err) + return + } + fmt.Println("put object completed") +} + +// ExampleNewEncryptionClientV2_migration01 provides a more advanced migration example for how users can +// migrate from the V1 encryption client to the V2 encryption client using more complex client construction. +func ExampleNewEncryptionClientV2_migration01() { + sess := session.Must(session.NewSession()) + kmsClient := kms.New(sess) + cmkID := "1234abcd-12ab-34cd-56ef-1234567890ab" + + cipherDataGenerator := s3crypto.NewKMSContextKeyGenerator(kmsClient, cmkID) + + contentCipherBuilder := s3crypto.AESGCMContentCipherBuilder(cipherDataGenerator) + + // Overriding of the encryption client options is possible by passing in functional arguments that override the + // provided EncryptionClientOptions. + // + // encryptionClient := s3crypto.NewEncryptionClient(cipherDataGenerator, contentCipherBuilder, func(o *s3crypto.EncryptionClient) { + // o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}), + // }) + encryptionClient, err := s3crypto.NewEncryptionClientV2(sess, contentCipherBuilder, func(o *s3crypto.EncryptionClientOptions) { + o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}) + }) + if err != nil { + fmt.Printf("failed to construct encryption client: %v", err) + return + } + + _, err = encryptionClient.PutObject(&s3.PutObjectInput{ + Bucket: aws.String("your_bucket"), + Key: aws.String("your_key"), + Body: bytes.NewReader([]byte("your content")), + }) + if err != nil { + fmt.Printf("put object error: %v\n", err) + return + } + fmt.Println("put object completed") +} + +// ExampleNewDecryptionClientV2_migration00 provides a migration example for how users can migrate +// from the V1 Decryption Clients to the V2 Decryption Clients. +func ExampleNewDecryptionClientV2_migration00() { + sess := session.Must(session.NewSession()) + + // Construction of an decryption client must be done using NewDecryptionClientV2 + // The V2 decryption client is able to decrypt object encrypted by the V1 client. + // + // decryptionClient := s3crypto.NewDecryptionClient(sess) + decryptionClient := s3crypto.NewDecryptionClientV2(sess) + + getObject, err := decryptionClient.GetObject(&s3.GetObjectInput{ + Bucket: aws.String("your_bucket"), + Key: aws.String("your_key"), + }) + if err != nil { + fmt.Printf("get object error: %v\n", err) + return + } + + _, err = ioutil.ReadAll(getObject.Body) + if err != nil { + fmt.Printf("error reading object: %v\n", err) + } + fmt.Println("get object completed") +} + +// ExampleNewDecryptionClientV2_migration01 provides a more advanced migration example for how users can +// migrate from the V1 decryption client to the V2 decryption client using more complex client construction. +func ExampleNewDecryptionClientV2_migration01() { + sess := session.Must(session.NewSession()) + + // Construction of an decryption client must be done using NewDecryptionClientV2 + // The V2 decryption client is able to decrypt object encrypted by the V1 client. + // + // decryptionClient := s3crypto.NewDecryptionClient(sess, func(o *s3crypto.DecryptionClient) { + // o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}) + //}) + decryptionClient := s3crypto.NewDecryptionClientV2(sess, func(o *s3crypto.DecryptionClientOptions) { + o.S3Client = s3.New(sess, &aws.Config{Region: aws.String("us-west-2")}) + }) + + getObject, err := decryptionClient.GetObject(&s3.GetObjectInput{ + Bucket: aws.String("your_bucket"), + Key: aws.String("your_key"), + }) + if err != nil { + fmt.Printf("get object error: %v\n", err) + return + } + + _, err = ioutil.ReadAll(getObject.Body) + if err != nil { + fmt.Printf("error reading object: %v\n", err) + } + fmt.Println("get object completed") +} +``` + +## `service/s3/s3crypto/mock_test.go` (changed lines (11, 29)) + +```go +package s3crypto_test + +import ( + "bytes" + "io" + "io/ioutil" + + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +type mockGenerator struct{} + +func (m mockGenerator) GenerateCipherData(keySize, ivSize int) (s3crypto.CipherData, error) { + cd := s3crypto.CipherData{ + Key: make([]byte, keySize), + IV: make([]byte, ivSize), + } + return cd, nil +} + +func (m mockGenerator) EncryptKey(key []byte) ([]byte, error) { + size := len(key) + b := bytes.Repeat([]byte{1}, size) + return b, nil +} + +func (m mockGenerator) DecryptKey(key []byte) ([]byte, error) { + return make([]byte, 16), nil +} + +type mockCipherBuilder struct { + generator s3crypto.CipherDataGenerator +} + +func (builder mockCipherBuilder) ContentCipher() (s3crypto.ContentCipher, error) { + cd, err := builder.generator.GenerateCipherData(32, 16) + if err != nil { + return nil, err + } + return &mockContentCipher{cd}, nil +} + +type mockContentCipher struct { + cd s3crypto.CipherData +} + +func (cipher *mockContentCipher) GetCipherData() s3crypto.CipherData { + return cipher.cd +} + +func (cipher *mockContentCipher) EncryptContents(src io.Reader) (io.Reader, error) { + b, err := ioutil.ReadAll(src) + if err != nil { + return nil, err + } + size := len(b) + b = bytes.Repeat([]byte{1}, size) + return bytes.NewReader(b), nil +} + +func (cipher *mockContentCipher) DecryptContents(src io.ReadCloser) (io.ReadCloser, error) { + b, err := ioutil.ReadAll(src) + if err != nil { + return nil, err + } + size := len(b) + return ioutil.NopCloser(bytes.NewReader(make([]byte, size))), nil +} +``` + +## `service/s3/s3crypto/shared_client.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210)) + +```go +package s3crypto + +import ( + "encoding/base64" + "encoding/hex" + "io" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkio" + "github.com/aws/aws-sdk-go/service/s3" +) + +func putObjectRequest(c EncryptionClientOptions, input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { + req, out := c.S3Client.PutObjectRequest(input) + + // Get Size of file + n, err := aws.SeekerLen(input.Body) + if err != nil { + req.Error = err + return req, out + } + + dst, err := getWriterStore(req, c.TempFolderPath, n >= c.MinFileSize) + if err != nil { + req.Error = err + return req, out + } + + req.Handlers.Build.PushFront(func(r *request.Request) { + if err != nil { + r.Error = err + return + } + var encryptor ContentCipher + if v, ok := c.ContentCipherBuilder.(ContentCipherBuilderWithContext); ok { + encryptor, err = v.ContentCipherWithContext(r.Context()) + } else { + encryptor, err = c.ContentCipherBuilder.ContentCipher() + } + if err != nil { + r.Error = err + return + } + + md5 := newMD5Reader(input.Body) + sha := newSHA256Writer(dst) + reader, err := encryptor.EncryptContents(md5) + if err != nil { + r.Error = err + return + } + + _, err = io.Copy(sha, reader) + if err != nil { + r.Error = err + return + } + + data := encryptor.GetCipherData() + env, err := encodeMeta(md5, data) + if err != nil { + r.Error = err + return + } + + shaHex := hex.EncodeToString(sha.GetValue()) + req.HTTPRequest.Header.Set("X-Amz-Content-Sha256", shaHex) + + dst.Seek(0, sdkio.SeekStart) + input.Body = dst + + err = c.SaveStrategy.Save(env, r) + r.Error = err + }) + + return req, out +} + +func putObject(options EncryptionClientOptions, input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { + req, out := putObjectRequest(options, input) + return out, req.Send() +} + +func putObjectWithContext(options EncryptionClientOptions, ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { + req, out := putObjectRequest(options, input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +func getObjectRequest(options DecryptionClientOptions, input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { + req, out := options.S3Client.GetObjectRequest(input) + req.Handlers.Unmarshal.PushBack(func(r *request.Request) { + env, err := options.LoadStrategy.Load(r) + if err != nil { + r.Error = err + out.Body.Close() + return + } + + // If KMS should return the correct CEK algorithm with the proper + // KMS key provider + cipher, err := contentCipherFromEnvelope(options, r.Context(), env) + if err != nil { + r.Error = err + out.Body.Close() + return + } + + reader, err := cipher.DecryptContents(out.Body) + if err != nil { + r.Error = err + out.Body.Close() + return + } + out.Body = reader + }) + return req, out +} + +func getObject(options DecryptionClientOptions, input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { + req, out := getObjectRequest(options, input) + return out, req.Send() +} + +func getObjectWithContext(options DecryptionClientOptions, ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { + req, out := getObjectRequest(options, input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +func contentCipherFromEnvelope(options DecryptionClientOptions, ctx aws.Context, env Envelope) (ContentCipher, error) { + wrap, err := wrapFromEnvelope(options, env) + if err != nil { + return nil, err + } + + return cekFromEnvelope(options, ctx, env, wrap) +} + +func wrapFromEnvelope(options DecryptionClientOptions, env Envelope) (CipherDataDecrypter, error) { + f, ok := options.WrapRegistry[env.WrapAlg] + if !ok || f == nil { + return nil, awserr.New( + "InvalidWrapAlgorithmError", + "wrap algorithm isn't supported, "+env.WrapAlg, + nil, + ) + } + return f(env) +} + +func cekFromEnvelope(options DecryptionClientOptions, ctx aws.Context, env Envelope, decrypter CipherDataDecrypter) (ContentCipher, error) { + f, ok := options.CEKRegistry[env.CEKAlg] + if !ok || f == nil { + return nil, awserr.New( + "InvalidCEKAlgorithmError", + "cek algorithm isn't supported, "+env.CEKAlg, + nil, + ) + } + + key, err := base64.StdEncoding.DecodeString(env.CipherKey) + if err != nil { + return nil, err + } + + iv, err := base64.StdEncoding.DecodeString(env.IV) + if err != nil { + return nil, err + } + + if d, ok := decrypter.(CipherDataDecrypterWithContext); ok { + key, err = d.DecryptKeyWithContext(ctx, key) + } else { + key, err = decrypter.DecryptKey(key) + } + + if err != nil { + return nil, err + } + + cd := CipherData{ + Key: key, + IV: iv, + CEKAlgorithm: env.CEKAlg, + Padder: getPadder(options, env.CEKAlg), + } + return f(cd) +} + +// getPadder will return an unpadder with checking the cek algorithm specific padder. +// If there wasn't a cek algorithm specific padder, we check the padder itself. +// We return a no unpadder, if no unpadder was found. This means any customization +// either contained padding within the cipher implementation, and to maintain +// backwards compatility we will simply not unpad anything. +func getPadder(options DecryptionClientOptions, cekAlg string) Padder { + padder, ok := options.PadderRegistry[cekAlg] + if !ok { + padder, ok = options.PadderRegistry[cekAlg[strings.LastIndex(cekAlg, "/")+1:]] + if !ok { + return NoPadder + } + } + return padder +} +``` + +## `service/s3/s3crypto/strategy.go` (changed lines (66,)) + +```go +package s3crypto + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "net/http" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" +) + +// SaveStrategy is how the data's metadata wants to be saved +type SaveStrategy interface { + Save(Envelope, *request.Request) error +} + +// S3SaveStrategy will save the metadata to a separate instruction file in S3 +type S3SaveStrategy struct { + Client *s3.S3 + InstructionFileSuffix string +} + +// Save will save the envelope contents to s3. +func (strat S3SaveStrategy) Save(env Envelope, req *request.Request) error { + input := req.Params.(*s3.PutObjectInput) + b, err := json.Marshal(env) + if err != nil { + return err + } + + instInput := s3.PutObjectInput{ + Bucket: input.Bucket, + Body: bytes.NewReader(b), + } + + if strat.InstructionFileSuffix == "" { + instInput.Key = aws.String(*input.Key + DefaultInstructionKeySuffix) + } else { + instInput.Key = aws.String(*input.Key + strat.InstructionFileSuffix) + } + + _, err = strat.Client.PutObject(&instInput) + return err +} + +// HeaderV2SaveStrategy will save the metadata of the crypto contents to the header of +// the object. +type HeaderV2SaveStrategy struct{} + +// Save will save the envelope to the request's header. +func (strat HeaderV2SaveStrategy) Save(env Envelope, req *request.Request) error { + input := req.Params.(*s3.PutObjectInput) + if input.Metadata == nil { + input.Metadata = map[string]*string{} + } + + input.Metadata[http.CanonicalHeaderKey(keyV2Header)] = &env.CipherKey + input.Metadata[http.CanonicalHeaderKey(ivHeader)] = &env.IV + input.Metadata[http.CanonicalHeaderKey(matDescHeader)] = &env.MatDesc + input.Metadata[http.CanonicalHeaderKey(wrapAlgorithmHeader)] = &env.WrapAlg + input.Metadata[http.CanonicalHeaderKey(cekAlgorithmHeader)] = &env.CEKAlg + input.Metadata[http.CanonicalHeaderKey(unencryptedContentLengthHeader)] = &env.UnencryptedContentLen + + if len(env.TagLen) > 0 { + input.Metadata[http.CanonicalHeaderKey(tagLengthHeader)] = &env.TagLen + } + return nil +} + +// LoadStrategy ... +type LoadStrategy interface { + Load(*request.Request) (Envelope, error) +} + +// S3LoadStrategy will load the instruction file from s3 +type S3LoadStrategy struct { + Client *s3.S3 + InstructionFileSuffix string +} + +// Load from a given instruction file suffix +func (load S3LoadStrategy) Load(req *request.Request) (Envelope, error) { + env := Envelope{} + if load.InstructionFileSuffix == "" { + load.InstructionFileSuffix = DefaultInstructionKeySuffix + } + + input := req.Params.(*s3.GetObjectInput) + out, err := load.Client.GetObject(&s3.GetObjectInput{ + Key: aws.String(strings.Join([]string{*input.Key, load.InstructionFileSuffix}, "")), + Bucket: input.Bucket, + }) + if err != nil { + return env, err + } + + b, err := ioutil.ReadAll(out.Body) + if err != nil { + return env, err + } + err = json.Unmarshal(b, &env) + return env, err +} + +// HeaderV2LoadStrategy will load the envelope from the metadata +type HeaderV2LoadStrategy struct{} + +// Load from a given object's header +func (load HeaderV2LoadStrategy) Load(req *request.Request) (Envelope, error) { + env := Envelope{} + env.CipherKey = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, keyV2Header}, "-")) + env.IV = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, ivHeader}, "-")) + env.MatDesc = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, matDescHeader}, "-")) + env.WrapAlg = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, wrapAlgorithmHeader}, "-")) + env.CEKAlg = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, cekAlgorithmHeader}, "-")) + env.TagLen = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, tagLengthHeader}, "-")) + env.UnencryptedMD5 = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, unencryptedMD5Header}, "-")) + env.UnencryptedContentLen = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, unencryptedContentLengthHeader}, "-")) + return env, nil +} + +type defaultV2LoadStrategy struct { + client *s3.S3 + suffix string +} + +func (load defaultV2LoadStrategy) Load(req *request.Request) (Envelope, error) { + if value := req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, keyV2Header}, "-")); value != "" { + strat := HeaderV2LoadStrategy{} + return strat.Load(req) + } else if value = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, keyV1Header}, "-")); value != "" { + return Envelope{}, awserr.New("V1NotSupportedError", "The AWS SDK for Go does not support version 1", nil) + } + + strat := S3LoadStrategy{ + Client: load.client, + InstructionFileSuffix: load.suffix, + } + return strat.Load(req) +} +``` + +## `service/s3/s3crypto/strategy_test.go` (changed lines (4, 5, 6, 7, 13, 41, 60, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180)) + +```go +package s3crypto_test + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "net/http" + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +func TestHeaderV2SaveStrategy(t *testing.T) { + cases := []struct { + env s3crypto.Envelope + expected map[string]*string + }{ + { + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + TagLen: "128", + UnencryptedMD5: "hello", + UnencryptedContentLen: "0", + }, + map[string]*string{ + "X-Amz-Key-V2": aws.String("Foo"), + "X-Amz-Iv": aws.String("Bar"), + "X-Amz-Matdesc": aws.String("{}"), + "X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap), + "X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding), + "X-Amz-Tag-Len": aws.String("128"), + "X-Amz-Unencrypted-Content-Length": aws.String("0"), + }, + }, + { + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + UnencryptedMD5: "hello", + UnencryptedContentLen: "0", + }, + map[string]*string{ + "X-Amz-Key-V2": aws.String("Foo"), + "X-Amz-Iv": aws.String("Bar"), + "X-Amz-Matdesc": aws.String("{}"), + "X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap), + "X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding), + "X-Amz-Unencrypted-Content-Length": aws.String("0"), + }, + }, + } + + for _, c := range cases { + params := &s3.PutObjectInput{} + req := &request.Request{ + Params: params, + } + strat := s3crypto.HeaderV2SaveStrategy{} + err := strat.Save(c.env, req) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if !reflect.DeepEqual(c.expected, params.Metadata) { + t.Errorf("expected %v, but received %v", c.expected, params.Metadata) + } + } +} + +func TestS3SaveStrategy(t *testing.T) { + cases := []struct { + env s3crypto.Envelope + expected s3crypto.Envelope + }{ + { + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + TagLen: "128", + UnencryptedMD5: "hello", + UnencryptedContentLen: "0", + }, + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + TagLen: "128", + UnencryptedContentLen: "0", + }, + }, + { + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + UnencryptedMD5: "hello", + UnencryptedContentLen: "0", + }, + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + UnencryptedContentLen: "0", + }, + }, + } + + for _, c := range cases { + params := &s3.PutObjectInput{ + Bucket: aws.String("fooBucket"), + Key: aws.String("barKey"), + } + req := &request.Request{ + Params: params, + } + + client := s3.New(unit.Session) + + client.Handlers.Send.Clear() + client.Handlers.Unmarshal.Clear() + client.Handlers.UnmarshalMeta.Clear() + client.Handlers.UnmarshalError.Clear() + client.Handlers.Send.PushBack(func(r *request.Request) { + bodyBytes, err := ioutil.ReadAll(r.Body) + if err != nil { + r.HTTPResponse = &http.Response{ + StatusCode: 500, + Body: ioutil.NopCloser(bytes.NewReader([]byte(err.Error()))), + } + return + } + + var actual s3crypto.Envelope + err = json.Unmarshal(bodyBytes, &actual) + if err != nil { + r.HTTPResponse = &http.Response{ + StatusCode: 500, + Body: ioutil.NopCloser(bytes.NewReader([]byte(err.Error()))), + } + return + } + + if e, a := c.expected, actual; !reflect.DeepEqual(e, a) { + t.Errorf("expected %v, got %v", e, a) + } + + r.HTTPResponse = &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewReader([]byte(""))), + } + }) + + strat := s3crypto.S3SaveStrategy{Client: client} + err := strat.Save(c.env, req) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..742b4b981e0670a58e9b5273ee25b4f819f2e8e8 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/pre_context.md @@ -0,0 +1,2160 @@ +# Patch-overlapping Go context before the fix + +## `internal/sync/singleflight/singleflight_test.go` (changed lines (17, 30, 44, 92)) + +```go +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package singleflight + +import ( + "errors" + "fmt" + "sync" + "sync/atomic" + "testing" + "time" +) + +func TestDo(t *testing.T) { + var g Group + v, err, _ := g.Do("key", func() (interface{}, error) { + return "bar", nil + }) + if got, want := fmt.Sprintf("%v (%T)", v, v), "bar (string)"; got != want { + t.Errorf("Do = %v; want %v", got, want) + } + if err != nil { + t.Errorf("Do error = %v", err) + } +} + +func TestDoErr(t *testing.T) { + var g Group + someErr := errors.New("Some error") + v, err, _ := g.Do("key", func() (interface{}, error) { + return nil, someErr + }) + if err != someErr { + t.Errorf("Do error = %v; want someErr %v", err, someErr) + } + if v != nil { + t.Errorf("unexpected non-nil value %#v", v) + } +} + +func TestDoDupSuppress(t *testing.T) { + var g Group + var wg1, wg2 sync.WaitGroup + c := make(chan string, 1) + var calls int32 + fn := func() (interface{}, error) { + if atomic.AddInt32(&calls, 1) == 1 { + // First invocation. + wg1.Done() + } + v := <-c + c <- v // pump; make available for any future calls + + time.Sleep(10 * time.Millisecond) // let more goroutines enter Do + + return v, nil + } + + const n = 10 + wg1.Add(1) + for i := 0; i < n; i++ { + wg1.Add(1) + wg2.Add(1) + go func() { + defer wg2.Done() + wg1.Done() + v, err, _ := g.Do("key", fn) + if err != nil { + t.Errorf("Do error: %v", err) + return + } + if s, _ := v.(string); s != "bar" { + t.Errorf("Do = %T %v; want %q", v, v, "bar") + } + }() + } + wg1.Wait() + // At least one goroutine is in fn now and all of them have at + // least reached the line before the Do. + c <- "bar" + wg2.Wait() + if got := atomic.LoadInt32(&calls); got <= 0 || got >= n { + t.Errorf("number of calls = %d; want over 0 and less than %d", got, n) + } +} + +// Test that singleflight behaves correctly after Forget called. +// See https://github.com/golang/go/issues/31420 +func TestForget(t *testing.T) { + var g Group + + var firstStarted, firstFinished sync.WaitGroup + + firstStarted.Add(1) + firstFinished.Add(1) + + firstCh := make(chan struct{}) + go func() { + g.Do("key", func() (i interface{}, e error) { + firstStarted.Done() + <-firstCh + firstFinished.Done() + return + }) + }() + + firstStarted.Wait() + g.Forget("key") // from this point no two function using same key should be executed concurrently + + var secondStarted int32 + var secondFinished int32 + var thirdStarted int32 + + secondCh := make(chan struct{}) + secondRunning := make(chan struct{}) + go func() { + g.Do("key", func() (i interface{}, e error) { + defer func() { + }() + atomic.AddInt32(&secondStarted, 1) + // Notify that we started + secondCh <- struct{}{} + // Wait other get above signal + <-secondRunning + <-secondCh + atomic.AddInt32(&secondFinished, 1) + return 2, nil + }) + }() + + close(firstCh) + firstFinished.Wait() // wait for first execution (which should not affect execution after Forget) + + <-secondCh + // Notify second that we got the signal that it started + secondRunning <- struct{}{} + if atomic.LoadInt32(&secondStarted) != 1 { + t.Fatal("Second execution should be executed due to usage of forget") + } + + if atomic.LoadInt32(&secondFinished) == 1 { + t.Fatal("Second execution should be still active") + } + + close(secondCh) + result, _, _ := g.Do("key", func() (i interface{}, e error) { + atomic.AddInt32(&thirdStarted, 1) + return 3, nil + }) + + if atomic.LoadInt32(&thirdStarted) != 0 { + t.Error("Third call should not be started because was started during second execution") + } + if result != 2 { + t.Errorf("We should receive result produced by second call, expected: 2, got %d", result) + } +} +``` + +## `service/s3/s3crypto/aes_cbc_content_cipher.go` (changed lines (18, 20)) + +```go +package s3crypto + +import ( + "io" + "strings" +) + +const ( + cbcKeySize = 32 + cbcNonceSize = 16 +) + +type cbcContentCipherBuilder struct { + generator CipherDataGenerator + padder Padder +} + +// AESCBCContentCipherBuilder returns a new encryption only mode structure with a specific cipher +// for the master key +func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder { + return cbcContentCipherBuilder{generator: generator, padder: padder} +} + +func (builder cbcContentCipherBuilder) ContentCipher() (ContentCipher, error) { + cd, err := builder.generator.GenerateCipherData(cbcKeySize, cbcNonceSize) + if err != nil { + return nil, err + } + + cd.Padder = builder.padder + return newAESCBCContentCipher(cd) +} + +// newAESCBCContentCipher will create a new aes cbc content cipher. If the cipher data's +// will set the CEK algorithm if it hasn't been set. +func newAESCBCContentCipher(cd CipherData) (ContentCipher, error) { + if len(cd.CEKAlgorithm) == 0 { + cd.CEKAlgorithm = strings.Join([]string{AESCBC, cd.Padder.Name()}, "/") + } + cipher, err := newAESCBC(cd, cd.Padder) + if err != nil { + return nil, err + } + + return &aesCBCContentCipher{ + CipherData: cd, + Cipher: cipher, + }, nil +} + +// aesCBCContentCipher will use AES CBC for the main cipher. +type aesCBCContentCipher struct { + CipherData CipherData + Cipher Cipher +} + +// EncryptContents will generate a random key and iv and encrypt the data using cbc +func (cc *aesCBCContentCipher) EncryptContents(src io.Reader) (io.Reader, error) { + return cc.Cipher.Encrypt(src), nil +} + +// DecryptContents will use the symmetric key provider to instantiate a new CBC cipher. +// We grab a decrypt reader from CBC and wrap it in a CryptoReadCloser. The only error +// expected here is when the key or iv is of invalid length. +func (cc *aesCBCContentCipher) DecryptContents(src io.ReadCloser) (io.ReadCloser, error) { + reader := cc.Cipher.Decrypt(src) + return &CryptoReadCloser{Body: src, Decrypter: reader}, nil +} + +// GetCipherData returns cipher data +func (cc aesCBCContentCipher) GetCipherData() CipherData { + return cc.CipherData +} +``` + +## `service/s3/s3crypto/aes_gcm_content_cipher.go` (changed lines (18, 32, 33, 34, 35)) + +```go +package s3crypto + +import ( + "io" + + "github.com/aws/aws-sdk-go/aws" +) + +const ( + gcmKeySize = 32 + gcmNonceSize = 12 +) + +type gcmContentCipherBuilder struct { + generator CipherDataGenerator +} + +// AESGCMContentCipherBuilder returns a new encryption only mode structure with a specific cipher +// for the master key +func AESGCMContentCipherBuilder(generator CipherDataGenerator) ContentCipherBuilder { + return gcmContentCipherBuilder{generator} +} + +func (builder gcmContentCipherBuilder) ContentCipher() (ContentCipher, error) { + return builder.ContentCipherWithContext(aws.BackgroundContext()) +} + +func (builder gcmContentCipherBuilder) ContentCipherWithContext(ctx aws.Context) (ContentCipher, error) { + var cd CipherData + var err error + + if v, ok := builder.generator.(CipherDataGeneratorWithContext); ok { + cd, err = v.GenerateCipherDataWithContext(ctx, gcmKeySize, gcmNonceSize) + } else { + cd, err = builder.generator.GenerateCipherData(gcmKeySize, gcmNonceSize) + } + if err != nil { + return nil, err + } + + return newAESGCMContentCipher(cd) +} + +func newAESGCMContentCipher(cd CipherData) (ContentCipher, error) { + cd.CEKAlgorithm = AESGCMNoPadding + cd.TagLength = "128" + + cipher, err := newAESGCM(cd) + if err != nil { + return nil, err + } + + return &aesGCMContentCipher{ + CipherData: cd, + Cipher: cipher, + }, nil +} + +// AESGCMContentCipher will use AES GCM for the main cipher. +type aesGCMContentCipher struct { + CipherData CipherData + Cipher Cipher +} + +// EncryptContents will generate a random key and iv and encrypt the data using cbc +func (cc *aesGCMContentCipher) EncryptContents(src io.Reader) (io.Reader, error) { + return cc.Cipher.Encrypt(src), nil +} + +// DecryptContents will use the symmetric key provider to instantiate a new GCM cipher. +// We grab a decrypt reader from gcm and wrap it in a CryptoReadCloser. The only error +// expected here is when the key or iv is of invalid length. +func (cc *aesGCMContentCipher) DecryptContents(src io.ReadCloser) (io.ReadCloser, error) { + reader := cc.Cipher.Decrypt(src) + return &CryptoReadCloser{Body: src, Decrypter: reader}, nil +} + +// GetCipherData returns cipher data +func (cc aesGCMContentCipher) GetCipherData() CipherData { + return cc.CipherData +} +``` + +## `service/s3/s3crypto/aes_gcm_content_cipher_test.go` (changed lines (6, 29)) + +```go +package s3crypto_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +func TestAESGCMContentCipherBuilder(t *testing.T) { + generator := mockGenerator{} + if builder := s3crypto.AESGCMContentCipherBuilder(generator); builder == nil { + t.Error("expected non-nil value") + } +} + +func TestAESGCMContentCipherNewEncryptor(t *testing.T) { + generator := mockGenerator{} + builder := s3crypto.AESGCMContentCipherBuilder(generator) + cipher, err := builder.ContentCipher() + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if cipher == nil { + t.Errorf("expected non-nil vaue") + } +} +``` + +## `service/s3/s3crypto/aes_gcm_test.go` (changed lines (1, 6, 18, 19, 27, 28, 36, 37, 45, 46, 50, 108, 125, 126, 129, 130)) + +```go +package s3crypto + +import ( + "bytes" + "encoding/hex" + "fmt" + "io" + "io/ioutil" + "strings" + "testing" +) + +// AES GCM +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_128_Test_0(t *testing.T) { + iv, _ := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + plaintext, _ := hex.DecodeString("2db5168e932556f8089a0622981d017d") + expected, _ := hex.DecodeString("fa4362189661d163fcd6a56d8bf0405ad636ac1bbedd5cc3ee727dc2ab4a9489") + tag, _ := hex.DecodeString("d636ac1bbedd5cc3ee727dc2ab4a9489") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_104_Test_3(t *testing.T) { + iv, _ := hex.DecodeString("4742357c335913153ff0eb0f") + key, _ := hex.DecodeString("e5a0eb92cc2b064e1bc80891faf1fab5e9a17a9c3a984e25416720e30e6c2b21") + plaintext, _ := hex.DecodeString("8499893e16b0ba8b007d54665a") + expected, _ := hex.DecodeString("eb8e6175f1fe38eb1acf95fd5188a8b74bb74fda553e91020a23deed45") + tag, _ := hex.DecodeString("88a8b74bb74fda553e91020a23deed45") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_256_Test_6(t *testing.T) { + iv, _ := hex.DecodeString("a291484c3de8bec6b47f525f") + key, _ := hex.DecodeString("37f39137416bafde6f75022a7a527cc593b6000a83ff51ec04871a0ff5360e4e") + plaintext, _ := hex.DecodeString("fafd94cede8b5a0730394bec68a8e77dba288d6ccaa8e1563a81d6e7ccc7fc97") + expected, _ := hex.DecodeString("44dc868006b21d49284016565ffb3979cc4271d967628bf7cdaf86db888e92e501a2b578aa2f41ec6379a44a31cc019c") + tag, _ := hex.DecodeString("01a2b578aa2f41ec6379a44a31cc019c") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestAES_GCM_NIST_gcmEncryptExtIV256_PTLen_408_Test_8(t *testing.T) { + iv, _ := hex.DecodeString("92f258071d79af3e63672285") + key, _ := hex.DecodeString("595f259c55abe00ae07535ca5d9b09d6efb9f7e9abb64605c337acbd6b14fc7e") + plaintext, _ := hex.DecodeString("a6fee33eb110a2d769bbc52b0f36969c287874f665681477a25fc4c48015c541fbe2394133ba490a34ee2dd67b898177849a91") + expected, _ := hex.DecodeString("bbca4a9e09ae9690c0f6f8d405e53dccd666aa9c5fa13c8758bc30abe1ddd1bcce0d36a1eaaaaffef20cd3c5970b9673f8a65c26ccecb9976fd6ac9c2c0f372c52c821") + tag, _ := hex.DecodeString("26ccecb9976fd6ac9c2c0f372c52c821") + aesgcmTest(t, iv, key, plaintext, expected, tag) +} + +func TestGCMEncryptReader_SourceError(t *testing.T) { + gcm := &gcmEncryptReader{ + encrypter: &mockCipherAEAD{}, + src: &mockSourceReader{err: fmt.Errorf("test read error")}, + } + + b := make([]byte, 10) + n, err := gcm.Read(b) + if err == nil { + t.Fatalf("expected error, but got nil") + } else if err != nil && !strings.Contains(err.Error(), "test read error") { + t.Fatalf("expected source read error, but got %v", err) + } + + if n != 0 { + t.Errorf("expected number of read bytes to be zero, but got %v", n) + } +} + +func TestGCMDecryptReader_SourceError(t *testing.T) { + gcm := &gcmDecryptReader{ + decrypter: &mockCipherAEAD{}, + src: &mockSourceReader{err: fmt.Errorf("test read error")}, + } + + b := make([]byte, 10) + n, err := gcm.Read(b) + if err == nil { + t.Fatalf("expected error, but got nil") + } else if err != nil && !strings.Contains(err.Error(), "test read error") { + t.Fatalf("expected source read error, but got %v", err) + } + + if n != 0 { + t.Errorf("expected number of read bytes to be zero, but got %v", n) + } +} + +func TestGCMDecryptReader_DecrypterOpenError(t *testing.T) { + gcm := &gcmDecryptReader{ + decrypter: &mockCipherAEAD{openError: fmt.Errorf("test open error")}, + src: &mockSourceReader{err: io.EOF}, + } + + b := make([]byte, 10) + n, err := gcm.Read(b) + if err == nil { + t.Fatalf("expected error, but got nil") + } else if err != nil && !strings.Contains(err.Error(), "test open error") { + t.Fatalf("expected source read error, but got %v", err) + } + + if n != 0 { + t.Errorf("expected number of read bytes to be zero, but got %v", n) + } +} + +func aesgcmTest(t *testing.T, iv, key, plaintext, expected, tag []byte) { + cd := CipherData{ + Key: key, + IV: iv, + } + gcm, err := newAESGCM(cd) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + cipherdata := gcm.Encrypt(bytes.NewReader(plaintext)) + + ciphertext, err := ioutil.ReadAll(cipherdata) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + // splitting tag and ciphertext + etag := ciphertext[len(ciphertext)-16:] + if !bytes.Equal(etag, tag) { + t.Errorf("expected tags to be equivalent") + } + if !bytes.Equal(ciphertext, expected) { + t.Errorf("expected ciphertext to be equivalent") + } + + data := gcm.Decrypt(bytes.NewReader(ciphertext)) + text, err := ioutil.ReadAll(data) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if !bytes.Equal(plaintext, text) { + t.Errorf("expected ciphertext to be equivalent") + } +} + +type mockSourceReader struct { + n int + err error +} + +func (b mockSourceReader) Read(p []byte) (n int, err error) { + return b.n, b.err +} + +type mockCipherAEAD struct { + seal []byte + openError error +} + +func (m mockCipherAEAD) NonceSize() int { + panic("implement me") +} + +func (m mockCipherAEAD) Overhead() int { + panic("implement me") +} + +func (m mockCipherAEAD) Seal(dst, nonce, plaintext, additionalData []byte) []byte { + return m.seal +} + +func (m mockCipherAEAD) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { + return []byte("mocked decrypt"), m.openError +} +``` + +## `service/s3/s3crypto/cipher_util.go` (changed lines (6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94)) + +```go +package s3crypto + +import ( + "encoding/base64" + "strconv" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" +) + +func (client *DecryptionClient) contentCipherFromEnvelope(ctx aws.Context, env Envelope) (ContentCipher, error) { + wrap, err := client.wrapFromEnvelope(env) + if err != nil { + return nil, err + } + + return client.cekFromEnvelope(ctx, env, wrap) +} + +func (client *DecryptionClient) wrapFromEnvelope(env Envelope) (CipherDataDecrypter, error) { + f, ok := client.WrapRegistry[env.WrapAlg] + if !ok || f == nil { + return nil, awserr.New( + "InvalidWrapAlgorithmError", + "wrap algorithm isn't supported, "+env.WrapAlg, + nil, + ) + } + return f(env) +} + +// AESGCMNoPadding is the constant value that is used to specify +// the CEK algorithm consiting of AES GCM with no padding. +const AESGCMNoPadding = "AES/GCM/NoPadding" + +// AESCBC is the string constant that signifies the AES CBC algorithm cipher. +const AESCBC = "AES/CBC" + +func (client *DecryptionClient) cekFromEnvelope(ctx aws.Context, env Envelope, decrypter CipherDataDecrypter) (ContentCipher, error) { + f, ok := client.CEKRegistry[env.CEKAlg] + if !ok || f == nil { + return nil, awserr.New( + "InvalidCEKAlgorithmError", + "cek algorithm isn't supported, "+env.CEKAlg, + nil, + ) + } + + key, err := base64.StdEncoding.DecodeString(env.CipherKey) + if err != nil { + return nil, err + } + + iv, err := base64.StdEncoding.DecodeString(env.IV) + if err != nil { + return nil, err + } + + if d, ok := decrypter.(CipherDataDecrypterWithContext); ok { + key, err = d.DecryptKeyWithContext(ctx, key) + } else { + key, err = decrypter.DecryptKey(key) + } + + if err != nil { + return nil, err + } + + cd := CipherData{ + Key: key, + IV: iv, + CEKAlgorithm: env.CEKAlg, + Padder: client.getPadder(env.CEKAlg), + } + return f(cd) +} + +// getPadder will return an unpadder with checking the cek algorithm specific padder. +// If there wasn't a cek algorithm specific padder, we check the padder itself. +// We return a no unpadder, if no unpadder was found. This means any customization +// either contained padding within the cipher implementation, and to maintain +// backwards compatility we will simply not unpad anything. +func (client *DecryptionClient) getPadder(cekAlg string) Padder { + padder, ok := client.PadderRegistry[cekAlg] + if !ok { + padder, ok = client.PadderRegistry[cekAlg[strings.LastIndex(cekAlg, "/")+1:]] + if !ok { + return NoPadder + } + } + return padder +} + +func encodeMeta(reader hashReader, cd CipherData) (Envelope, error) { + iv := base64.StdEncoding.EncodeToString(cd.IV) + key := base64.StdEncoding.EncodeToString(cd.EncryptedKey) + + md5 := reader.GetValue() + contentLength := reader.GetContentLength() + + md5Str := base64.StdEncoding.EncodeToString(md5) + matdesc, err := cd.MaterialDescription.encodeDescription() + if err != nil { + return Envelope{}, err + } + + return Envelope{ + CipherKey: key, + IV: iv, + MatDesc: string(matdesc), + WrapAlg: cd.WrapAlgorithm, + CEKAlg: cd.CEKAlgorithm, + TagLen: cd.TagLength, + UnencryptedMD5: md5Str, + UnencryptedContentLen: strconv.FormatInt(contentLength, 10), + }, nil +} +``` + +## `service/s3/s3crypto/cipher_util_test.go` (changed lines (17, 18, 31, 32, 45, 46, 59, 60, 70, 71, 84, 85, 110, 111, 142, 143, 144, 169, 170, 201, 202, 203, 228, 229, 258, 259, 260)) + +```go +package s3crypto + +import ( + "encoding/base64" + "encoding/hex" + "fmt" + "net/http" + "net/http/httptest" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/kms" +) + +func TestWrapFactory(t *testing.T) { + c := DecryptionClient{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(unit.Session), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + } + env := Envelope{ + WrapAlg: KMSWrap, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := c.wrapFromEnvelope(env) + w, ok := wrap.(*kmsKeyHandler) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if wrap == nil { + t.Error("expected non-nil value") + } + if !ok { + t.Errorf("expected kmsKeyHandler, but received %v", *w) + } +} +func TestWrapFactoryErrorNoWrap(t *testing.T) { + c := DecryptionClient{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(unit.Session), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + } + env := Envelope{ + WrapAlg: "none", + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := c.wrapFromEnvelope(env) + + if err == nil { + t.Error("expected error, but received none") + } + if wrap != nil { + t.Errorf("expected nil wrap value, received %v", wrap) + } +} + +func TestWrapFactoryCustomEntry(t *testing.T) { + c := DecryptionClient{ + WrapRegistry: map[string]WrapEntry{ + "custom": (kmsKeyHandler{ + kms: kms.New(unit.Session), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + } + env := Envelope{ + WrapAlg: "custom", + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := c.wrapFromEnvelope(env) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if wrap == nil { + t.Errorf("expected nil wrap value, received %v", wrap) + } +} + +func TestCEKFactory(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + c := DecryptionClient{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + PadderRegistry: map[string]Padder{ + NoPadder.Name(): NoPadder, + }, + } + iv, err := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + ivB64 := base64.URLEncoding.EncodeToString(iv) + + cipherKey, err := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + cipherKeyB64 := base64.URLEncoding.EncodeToString(cipherKey) + + env := Envelope{ + WrapAlg: KMSWrap, + CEKAlg: AESGCMNoPadding, + CipherKey: cipherKeyB64, + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := c.wrapFromEnvelope(env) + cek, err := c.cekFromEnvelope(aws.BackgroundContext(), env, wrap) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if cek == nil { + t.Errorf("expected non-nil cek") + } +} + +func TestCEKFactoryNoCEK(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + c := DecryptionClient{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + }, + PadderRegistry: map[string]Padder{ + NoPadder.Name(): NoPadder, + }, + } + iv, err := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + ivB64 := base64.URLEncoding.EncodeToString(iv) + + cipherKey, err := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + cipherKeyB64 := base64.URLEncoding.EncodeToString(cipherKey) + + env := Envelope{ + WrapAlg: KMSWrap, + CEKAlg: "none", + CipherKey: cipherKeyB64, + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := c.wrapFromEnvelope(env) + cek, err := c.cekFromEnvelope(aws.BackgroundContext(), env, wrap) + + if err == nil { + t.Error("expected error, but received none") + } + if cek != nil { + t.Errorf("expected nil cek value, received %v", wrap) + } +} + +func TestCEKFactoryCustomEntry(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + c := DecryptionClient{ + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(sess), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + "custom": newAESGCMContentCipher, + }, + PadderRegistry: map[string]Padder{}, + } + iv, err := hex.DecodeString("0d18e06c7c725ac9e362e1ce") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + ivB64 := base64.URLEncoding.EncodeToString(iv) + + cipherKey, err := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + cipherKeyB64 := base64.URLEncoding.EncodeToString(cipherKey) + + env := Envelope{ + WrapAlg: KMSWrap, + CEKAlg: "custom", + CipherKey: cipherKeyB64, + IV: ivB64, + MatDesc: `{"kms_cmk_id":""}`, + } + wrap, err := c.wrapFromEnvelope(env) + cek, err := c.cekFromEnvelope(aws.BackgroundContext(), env, wrap) + + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if cek == nil { + t.Errorf("expected non-nil cek") + } +} +``` + +## `service/s3/s3crypto/decryption_client.go` (changed lines (28, 48, 85, 86, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 135, 136, 137, 138, 139, 140)) + +```go +package s3crypto + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// WrapEntry is builder that return a proper key decrypter and error +type WrapEntry func(Envelope) (CipherDataDecrypter, error) + +// CEKEntry is a builder thatn returns a proper content decrypter and error +type CEKEntry func(CipherData) (ContentCipher, error) + +// DecryptionClient is an S3 crypto client. The decryption client +// will handle all get object requests from Amazon S3. +// Supported key wrapping algorithms: +// *AWS KMS +// +// Supported content ciphers: +// * AES/GCM +// * AES/CBC +type DecryptionClient struct { + S3Client s3iface.S3API + // LoadStrategy is used to load the metadata either from the metadata of the object + // or from a separate file in s3. + // + // Defaults to our default load strategy. + LoadStrategy LoadStrategy + + WrapRegistry map[string]WrapEntry + CEKRegistry map[string]CEKEntry + PadderRegistry map[string]Padder +} + +// NewDecryptionClient instantiates a new S3 crypto client +// +// Example: +// sess := session.New() +// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient{ +// // Custom client options here +// })) +func NewDecryptionClient(prov client.ConfigProvider, options ...func(*DecryptionClient)) *DecryptionClient { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3Crypto") + }) + + client := &DecryptionClient{ + S3Client: s3client, + LoadStrategy: defaultV2LoadStrategy{ + client: s3client, + }, + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(prov), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): newAESCBCContentCipher, + }, + PadderRegistry: map[string]Padder{ + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): AESCBCPadder, + "NoPadding": NoPadder, + }, + } + for _, option := range options { + option(client) + } + + return client +} + +// GetObjectRequest will make a request to s3 and retrieve the object. In this process +// decryption will be done. The SDK only supports V2 reads of KMS and GCM. +// +// Example: +// sess := session.New() +// svc := s3crypto.NewDecryptionClient(sess) +// req, out := svc.GetObjectRequest(&s3.GetObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// }) +// err := req.Send() +func (c *DecryptionClient) GetObjectRequest(input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { + req, out := c.S3Client.GetObjectRequest(input) + req.Handlers.Unmarshal.PushBack(func(r *request.Request) { + env, err := c.LoadStrategy.Load(r) + if err != nil { + r.Error = err + out.Body.Close() + return + } + + // If KMS should return the correct CEK algorithm with the proper + // KMS key provider + cipher, err := c.contentCipherFromEnvelope(r.Context(), env) + if err != nil { + r.Error = err + out.Body.Close() + return + } + + reader, err := cipher.DecryptContents(out.Body) + if err != nil { + r.Error = err + out.Body.Close() + return + } + out.Body = reader + }) + return req, out +} + +// GetObject is a wrapper for GetObjectRequest +func (c *DecryptionClient) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + return out, req.Send() +} + +// GetObjectWithContext is a wrapper for GetObjectRequest with the additional +// context, and request options support. +// +// GetObjectWithContext is the same as GetObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +func (c *DecryptionClient) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} +``` + +## `service/s3/s3crypto/decryption_client.go` (changed lines (28, 48, 85, 86, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 135, 136, 137, 138, 139, 140)) + +```go +package s3crypto + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// WrapEntry is builder that return a proper key decrypter and error +type WrapEntry func(Envelope) (CipherDataDecrypter, error) + +// CEKEntry is a builder thatn returns a proper content decrypter and error +type CEKEntry func(CipherData) (ContentCipher, error) + +// DecryptionClient is an S3 crypto client. The decryption client +// will handle all get object requests from Amazon S3. +// Supported key wrapping algorithms: +// *AWS KMS +// +// Supported content ciphers: +// * AES/GCM +// * AES/CBC +type DecryptionClient struct { + S3Client s3iface.S3API + // LoadStrategy is used to load the metadata either from the metadata of the object + // or from a separate file in s3. + // + // Defaults to our default load strategy. + LoadStrategy LoadStrategy + + WrapRegistry map[string]WrapEntry + CEKRegistry map[string]CEKEntry + PadderRegistry map[string]Padder +} + +// NewDecryptionClient instantiates a new S3 crypto client +// +// Example: +// sess := session.New() +// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient{ +// // Custom client options here +// })) +func NewDecryptionClient(prov client.ConfigProvider, options ...func(*DecryptionClient)) *DecryptionClient { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3Crypto") + }) + + client := &DecryptionClient{ + S3Client: s3client, + LoadStrategy: defaultV2LoadStrategy{ + client: s3client, + }, + WrapRegistry: map[string]WrapEntry{ + KMSWrap: (kmsKeyHandler{ + kms: kms.New(prov), + }).decryptHandler, + }, + CEKRegistry: map[string]CEKEntry{ + AESGCMNoPadding: newAESGCMContentCipher, + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): newAESCBCContentCipher, + }, + PadderRegistry: map[string]Padder{ + strings.Join([]string{AESCBC, AESCBCPadder.Name()}, "/"): AESCBCPadder, + "NoPadding": NoPadder, + }, + } + for _, option := range options { + option(client) + } + + return client +} + +// GetObjectRequest will make a request to s3 and retrieve the object. In this process +// decryption will be done. The SDK only supports V2 reads of KMS and GCM. +// +// Example: +// sess := session.New() +// svc := s3crypto.NewDecryptionClient(sess) +// req, out := svc.GetObjectRequest(&s3.GetObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// }) +// err := req.Send() +func (c *DecryptionClient) GetObjectRequest(input *s3.GetObjectInput) (*request.Request, *s3.GetObjectOutput) { + req, out := c.S3Client.GetObjectRequest(input) + req.Handlers.Unmarshal.PushBack(func(r *request.Request) { + env, err := c.LoadStrategy.Load(r) + if err != nil { + r.Error = err + out.Body.Close() + return + } + + // If KMS should return the correct CEK algorithm with the proper + // KMS key provider + cipher, err := c.contentCipherFromEnvelope(r.Context(), env) + if err != nil { + r.Error = err + out.Body.Close() + return + } + + reader, err := cipher.DecryptContents(out.Body) + if err != nil { + r.Error = err + out.Body.Close() + return + } + out.Body = reader + }) + return req, out +} + +// GetObject is a wrapper for GetObjectRequest +func (c *DecryptionClient) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + return out, req.Send() +} + +// GetObjectWithContext is a wrapper for GetObjectRequest with the additional +// context, and request options support. +// +// GetObjectWithContext is the same as GetObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +func (c *DecryptionClient) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} +``` + +## `service/s3/s3crypto/doc.go` (changed lines (18, 19, 20, 21, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 51, 52, 53, 54, 56, 57, 61, 62, 63, 64, 65)) + +```go +/* +Package s3crypto provides encryption to S3 using KMS and AES GCM. + +Keyproviders are interfaces that handle masterkeys. Masterkeys are used to encrypt and decrypt the randomly +generated cipher keys. The SDK currently uses KMS to do this. A user does not need to provide a master key +since all that information is hidden in KMS. + +Modes are interfaces that handle content encryption and decryption. It is an abstraction layer that instantiates +the ciphers. If content is being encrypted we generate the key and iv of the cipher. For decryption, we use the +metadata stored either on the object or an instruction file object to decrypt the contents. + +Ciphers are interfaces that handle encryption and decryption of data. This may be key wrap ciphers or content +ciphers. + +Creating an S3 cryptography client + + cmkID := "" + sess := session.New() + // Create the KeyProvider + handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) + + // Create an encryption and decryption client + // We need to pass the session here so S3 can use it. In addition, any decryption that + // occurs will use the KMS client. + svc := s3crypto.NewEncryptionClient(sess, s3crypto.AESGCMContentCipherBuilder(handler)) + svc := s3crypto.NewDecryptionClient(sess) + +Configuration of the S3 cryptography client + + cfg := s3crypto.EncryptionConfig{ + // Save instruction files to separate objects + SaveStrategy: NewS3SaveStrategy(session.New(), ""), + // Change instruction file suffix to .example + InstructionFileSuffix: ".example", + // Set temp folder path + TempFolderPath: "/path/to/tmp/folder/", + // Any content less than the minimum file size will use memory + // instead of writing the contents to a temp file. + MinFileSize: int64(1024 * 1024 * 1024), + } + +The default SaveStrategy is to the object's header. + +The InstructionFileSuffix defaults to .instruction. Careful here though, if you do this, be sure you know +what that suffix is in grabbing data. All requests will look for fooKey.example instead of fooKey.instruction. +This suffix only affects gets and not puts. Put uses the keyprovider's suffix. + +Registration of new wrap or cek algorithms are also supported by the SDK. Let's say we want to support `AES Wrap` +and `AES CTR`. Let's assume we have already defined the functionality. + + svc := s3crypto.NewDecryptionClient(sess) + svc.WrapRegistry["AESWrap"] = NewAESWrap + svc.CEKRegistry["AES/CTR/NoPadding"] = NewAESCTR + +We have now registered these new algorithms to the decryption client. When the client calls `GetObject` and sees +the wrap as `AESWrap` then it'll use that wrap algorithm. This is also true for `AES/CTR/NoPadding`. + +For encryption adding a custom content cipher builder and key handler will allow for encryption of custom +defined ciphers. + + // Our wrap algorithm, AESWrap + handler := NewAESWrap(key, iv) + // Our content cipher builder, AESCTRContentCipherBuilder + svc := s3crypto.NewEncryptionClient(sess, NewAESCTRContentCipherBuilder(handler)) +*/ +package s3crypto +``` + +## `service/s3/s3crypto/encryption_client.go` (changed lines (4, 5, 6, 10, 23, 42, 43, 44, 45, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 144, 145, 146, 147, 156, 157, 158, 159, 160, 161)) + +```go +package s3crypto + +import ( + "encoding/hex" + "io" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkio" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3iface" +) + +// DefaultMinFileSize is used to check whether we want to write to a temp file +// or store the data in memory. +const DefaultMinFileSize = 1024 * 512 * 5 + +// EncryptionClient is an S3 crypto client. By default the SDK will use Authentication mode which +// will use KMS for key wrapping and AES GCM for content encryption. +// AES GCM will load all data into memory. However, the rest of the content algorithms +// do not load the entire contents into memory. +type EncryptionClient struct { + S3Client s3iface.S3API + ContentCipherBuilder ContentCipherBuilder + // SaveStrategy will dictate where the envelope is saved. + // + // Defaults to the object's metadata + SaveStrategy SaveStrategy + // TempFolderPath is used to store temp files when calling PutObject. + // Temporary files are needed to compute the X-Amz-Content-Sha256 header. + TempFolderPath string + // MinFileSize is the minimum size for the content to write to a + // temporary file instead of using memory. + MinFileSize int64 +} + +// NewEncryptionClient instantiates a new S3 crypto client +// +// Example: +// cmkID := "arn:aws:kms:region:000000000000:key/00000000-0000-0000-0000-000000000000" +// sess := session.New() +// handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) +// svc := s3crypto.New(sess, s3crypto.AESGCMContentCipherBuilder(handler)) +func NewEncryptionClient(prov client.ConfigProvider, builder ContentCipherBuilder, options ...func(*EncryptionClient)) *EncryptionClient { + s3client := s3.New(prov) + + s3client.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "S3Crypto") + }) + + client := &EncryptionClient{ + S3Client: s3client, + ContentCipherBuilder: builder, + SaveStrategy: HeaderV2SaveStrategy{}, + MinFileSize: DefaultMinFileSize, + } + + for _, option := range options { + option(client) + } + + return client +} + +// PutObjectRequest creates a temp file to encrypt the contents into. It then streams +// that data to S3. +// +// Example: +// svc := s3crypto.New(session.New(), s3crypto.AESGCMContentCipherBuilder(handler)) +// req, out := svc.PutObjectRequest(&s3.PutObjectInput { +// Key: aws.String("testKey"), +// Bucket: aws.String("testBucket"), +// Body: strings.NewReader("test data"), +// }) +// err := req.Send() +func (c *EncryptionClient) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { + req, out := c.S3Client.PutObjectRequest(input) + + // Get Size of file + n, err := aws.SeekerLen(input.Body) + if err != nil { + req.Error = err + return req, out + } + + dst, err := getWriterStore(req, c.TempFolderPath, n >= c.MinFileSize) + if err != nil { + req.Error = err + return req, out + } + + req.Handlers.Build.PushFront(func(r *request.Request) { + if err != nil { + r.Error = err + return + } + var encryptor ContentCipher + if v, ok := c.ContentCipherBuilder.(ContentCipherBuilderWithContext); ok { + encryptor, err = v.ContentCipherWithContext(r.Context()) + } else { + encryptor, err = c.ContentCipherBuilder.ContentCipher() + } + if err != nil { + r.Error = err + return + } + + md5 := newMD5Reader(input.Body) + sha := newSHA256Writer(dst) + reader, err := encryptor.EncryptContents(md5) + if err != nil { + r.Error = err + return + } + + _, err = io.Copy(sha, reader) + if err != nil { + r.Error = err + return + } + + data := encryptor.GetCipherData() + env, err := encodeMeta(md5, data) + if err != nil { + r.Error = err + return + } + + shaHex := hex.EncodeToString(sha.GetValue()) + req.HTTPRequest.Header.Set("X-Amz-Content-Sha256", shaHex) + + dst.Seek(0, sdkio.SeekStart) + input.Body = dst + + err = c.SaveStrategy.Save(env, r) + r.Error = err + }) + + return req, out +} + +// PutObject is a wrapper for PutObjectRequest +func (c *EncryptionClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { + req, out := c.PutObjectRequest(input) + return out, req.Send() +} + +// PutObjectWithContext is a wrapper for PutObjectRequest with the additional +// context, and request options support. +// +// PutObjectWithContext is the same as PutObject with the additional support for +// Context input parameters. The Context must not be nil. A nil Context will +// cause a panic. Use the Context to add deadlining, timeouts, etc. In the future +// this may create sub-contexts for individual underlying requests. +func (c *EncryptionClient) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { + req, out := c.PutObjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} +``` + +## `service/s3/s3crypto/envelope.go` (changed lines (35, 36)) + +```go +package s3crypto + +// DefaultInstructionKeySuffix is appended to the end of the instruction file key when +// grabbing or saving to S3 +const DefaultInstructionKeySuffix = ".instruction" + +const ( + metaHeader = "x-amz-meta" + keyV1Header = "x-amz-key" + keyV2Header = keyV1Header + "-v2" + ivHeader = "x-amz-iv" + matDescHeader = "x-amz-matdesc" + cekAlgorithmHeader = "x-amz-cek-alg" + wrapAlgorithmHeader = "x-amz-wrap-alg" + tagLengthHeader = "x-amz-tag-len" + unencryptedMD5Header = "x-amz-unencrypted-content-md5" + unencryptedContentLengthHeader = "x-amz-unencrypted-content-length" +) + +// Envelope encryption starts off by generating a random symmetric key using +// AES GCM. The SDK generates a random IV based off the encryption cipher +// chosen. The master key that was provided, whether by the user or KMS, will be used +// to encrypt the randomly generated symmetric key and base64 encode the iv. This will +// allow for decryption of that same data later. +type Envelope struct { + // IV is the randomly generated IV base64 encoded. + IV string `json:"x-amz-iv"` + // CipherKey is the randomly generated cipher key. + CipherKey string `json:"x-amz-key-v2"` + // MaterialDesc is a description to distinguish from other envelopes. + MatDesc string `json:"x-amz-matdesc"` + WrapAlg string `json:"x-amz-wrap-alg"` + CEKAlg string `json:"x-amz-cek-alg"` + TagLen string `json:"x-amz-tag-len"` + UnencryptedMD5 string `json:"x-amz-unencrypted-content-md5"` + UnencryptedContentLen string `json:"x-amz-unencrypted-content-length"` +} +``` + +## `service/s3/s3crypto/key_handler.go` (changed lines (23, 33, 34, 35, 36, 37)) + +```go +package s3crypto + +import ( + "crypto/rand" + + "github.com/aws/aws-sdk-go/aws" +) + +// CipherDataGenerator handles generating proper key and IVs of proper size for the +// content cipher. CipherDataGenerator will also encrypt the key and store it in +// the CipherData. +type CipherDataGenerator interface { + GenerateCipherData(int, int) (CipherData, error) +} + +// CipherDataGeneratorWithContext handles generating proper key and IVs of +// proper size for the content cipher. CipherDataGenerator will also encrypt +// the key and store it in the CipherData. +type CipherDataGeneratorWithContext interface { + GenerateCipherDataWithContext(aws.Context, int, int) (CipherData, error) +} + +// CipherDataDecrypter is a handler to decrypt keys from the envelope. +type CipherDataDecrypter interface { + DecryptKey([]byte) ([]byte, error) +} + +// CipherDataDecrypterWithContext is a handler to decrypt keys from the envelope with request context. +type CipherDataDecrypterWithContext interface { + DecryptKeyWithContext(aws.Context, []byte) ([]byte, error) +} + +func generateBytes(n int) []byte { + b := make([]byte, n) + rand.Read(b) + return b +} +``` + +## `service/s3/s3crypto/key_handler_test.go` (changed lines (8, 9, 12, 13, 16, 17)) + +```go +package s3crypto + +import ( + "testing" +) + +func TestGenerateBytes(t *testing.T) { + b := generateBytes(5) + if e, a := 5, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } + b = generateBytes(0) + if e, a := 0, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } + b = generateBytes(1024) + if e, a := 1024, len(b); e != a { + t.Errorf("expected %d, but received %d", e, a) + } +} +``` + +## `service/s3/s3crypto/kms_key_handler.go` (changed lines (4, 13, 17, 18, 19, 31, 35, 36, 42, 43, 44, 47, 50, 51, 52, 53, 54, 55, 60, 70, 79, 89, 90, 96, 124, 127, 129, 130, 137, 138, 141, 142, 143, 147)) + +```go +package s3crypto + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/kms" + "github.com/aws/aws-sdk-go/service/kms/kmsiface" +) + +const ( + // KMSWrap is a constant used during decryption to build a KMS key handler. + KMSWrap = "kms" +) + +// kmsKeyHandler will make calls to KMS to get the masterkey +type kmsKeyHandler struct { + kms kmsiface.KMSAPI + cmkID *string + + CipherData +} + +// NewKMSKeyGenerator builds a new KMS key provider using the customer key ID and material +// description. +// +// Example: +// sess := session.New(&aws.Config{}) +// cmkID := "arn to key" +// matdesc := s3crypto.MaterialDescription{} +// handler := s3crypto.NewKMSKeyGenerator(kms.New(sess), cmkID) +func NewKMSKeyGenerator(kmsClient kmsiface.KMSAPI, cmkID string) CipherDataGenerator { + return NewKMSKeyGeneratorWithMatDesc(kmsClient, cmkID, MaterialDescription{}) +} + +// NewKMSKeyGeneratorWithMatDesc builds a new KMS key provider using the customer key ID and material +// description. +// +// Example: +// sess := session.New(&aws.Config{}) +// cmkID := "arn to key" +// matdesc := s3crypto.MaterialDescription{} +// handler := s3crypto.NewKMSKeyGeneratorWithMatDesc(kms.New(sess), cmkID, matdesc) +func NewKMSKeyGeneratorWithMatDesc(kmsClient kmsiface.KMSAPI, cmkID string, matdesc MaterialDescription) CipherDataGenerator { + if matdesc == nil { + matdesc = MaterialDescription{} + } + matdesc["kms_cmk_id"] = &cmkID + + // These values are read only making them thread safe + kp := &kmsKeyHandler{ + kms: kmsClient, + cmkID: &cmkID, + } + // These values are read only making them thread safe + kp.CipherData.WrapAlgorithm = KMSWrap + kp.CipherData.MaterialDescription = matdesc + return kp +} + +// NewKMSWrapEntry builds returns a new KMS key provider and its decrypt handler. +// +// Example: +// sess := session.New(&aws.Config{}) +// customKMSClient := kms.New(sess) +// decryptHandler := s3crypto.NewKMSWrapEntry(customKMSClient) +// +// svc := s3crypto.NewDecryptionClient(sess, func(svc *s3crypto.DecryptionClient) { +// svc.WrapRegistry[s3crypto.KMSWrap] = decryptHandler +// })) +func NewKMSWrapEntry(kmsClient kmsiface.KMSAPI) WrapEntry { + // These values are read only making them thread safe + kp := &kmsKeyHandler{ + kms: kmsClient, + } + + return kp.decryptHandler +} + +// decryptHandler initializes a KMS keyprovider with a material description. This +// is used with Decrypting kms content, due to the cmkID being in the material description. +func (kp kmsKeyHandler) decryptHandler(env Envelope) (CipherDataDecrypter, error) { + m := MaterialDescription{} + err := m.decodeDescription([]byte(env.MatDesc)) + if err != nil { + return nil, err + } + + cmkID, ok := m["kms_cmk_id"] + if !ok { + return nil, awserr.New("MissingCMKIDError", "Material description is missing CMK ID", nil) + } + + kp.CipherData.MaterialDescription = m + kp.cmkID = cmkID + kp.WrapAlgorithm = KMSWrap + return &kp, nil +} + +// DecryptKey makes a call to KMS to decrypt the key. +func (kp *kmsKeyHandler) DecryptKey(key []byte) ([]byte, error) { + return kp.DecryptKeyWithContext(aws.BackgroundContext(), key) +} + +// DecryptKeyWithContext makes a call to KMS to decrypt the key with request context. +func (kp *kmsKeyHandler) DecryptKeyWithContext(ctx aws.Context, key []byte) ([]byte, error) { + out, err := kp.kms.DecryptWithContext(ctx, + &kms.DecryptInput{ + EncryptionContext: kp.CipherData.MaterialDescription, + CiphertextBlob: key, + GrantTokens: []*string{}, + }) + if err != nil { + return nil, err + } + return out.Plaintext, nil +} + +// GenerateCipherData makes a call to KMS to generate a data key, Upon making +// the call, it also sets the encrypted key. +func (kp *kmsKeyHandler) GenerateCipherData(keySize, ivSize int) (CipherData, error) { + return kp.GenerateCipherDataWithContext(aws.BackgroundContext(), keySize, ivSize) +} + +// GenerateCipherDataWithContext makes a call to KMS to generate a data key, +// Upon making the call, it also sets the encrypted key. +func (kp *kmsKeyHandler) GenerateCipherDataWithContext(ctx aws.Context, keySize, ivSize int) (CipherData, error) { + out, err := kp.kms.GenerateDataKeyWithContext(ctx, + &kms.GenerateDataKeyInput{ + EncryptionContext: kp.CipherData.MaterialDescription, + KeyId: kp.cmkID, + KeySpec: aws.String("AES_256"), + }) + if err != nil { + return CipherData{}, err + } + + iv := generateBytes(ivSize) + cd := CipherData{ + Key: out.Plaintext, + IV: iv, + WrapAlgorithm: KMSWrap, + MaterialDescription: kp.CipherData.MaterialDescription, + EncryptedKey: out.CiphertextBlob, + } + return cd, nil +} +``` + +## `service/s3/s3crypto/kms_key_handler_test.go` (changed lines (7, 8, 108, 109, 112, 123, 124, 125, 126, 127)) + +```go +package s3crypto + +import ( + "bytes" + "encoding/base64" + "encoding/hex" + "fmt" + "net/http" + "net/http/httptest" + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/kms" +) + +func TestBuildKMSEncryptHandler(t *testing.T) { + svc := kms.New(unit.Session) + handler := NewKMSKeyGenerator(svc, "testid") + if handler == nil { + t.Error("expected non-nil handler") + } +} + +func TestBuildKMSEncryptHandlerWithMatDesc(t *testing.T) { + svc := kms.New(unit.Session) + handler := NewKMSKeyGeneratorWithMatDesc(svc, "testid", MaterialDescription{ + "Testing": aws.String("123"), + }) + if handler == nil { + t.Error("expected non-nil handler") + } + + kmsHandler := handler.(*kmsKeyHandler) + expected := MaterialDescription{ + "kms_cmk_id": aws.String("testid"), + "Testing": aws.String("123"), + } + + if !reflect.DeepEqual(expected, kmsHandler.CipherData.MaterialDescription) { + t.Errorf("expected %v, but received %v", expected, kmsHandler.CipherData.MaterialDescription) + } +} + +func TestKMSGenerateCipherData(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, `{"CiphertextBlob":"AQEDAHhqBCCY1MSimw8gOGcUma79cn4ANvTtQyv9iuBdbcEF1QAAAH4wfAYJKoZIhvcNAQcGoG8wbQIBADBoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDJ6IcN5E4wVbk38MNAIBEIA7oF1E3lS7FY9DkoxPc/UmJsEwHzL82zMqoLwXIvi8LQHr8If4Lv6zKqY8u0+JRgSVoqCvZDx3p8Cn6nM=","KeyId":"arn:aws:kms:us-west-2:042062605278:key/c80a5cdb-8d09-4f9f-89ee-df01b2e3870a","Plaintext":"6tmyz9JLBE2yIuU7iXpArqpDVle172WSmxjcO6GNT7E="}`) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + svc := kms.New(sess) + handler := NewKMSKeyGenerator(svc, "testid") + + keySize := 32 + ivSize := 16 + + cd, err := handler.GenerateCipherData(keySize, ivSize) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + if keySize != len(cd.Key) { + t.Errorf("expected %d, but received %d", keySize, len(cd.Key)) + } + if ivSize != len(cd.IV) { + t.Errorf("expected %d, but received %d", ivSize, len(cd.IV)) + } +} + +func TestKMSDecrypt(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + handler, err := (kmsKeyHandler{kms: kms.New(sess)}).decryptHandler(Envelope{MatDesc: `{"kms_cmk_id":"test"}`}) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + plaintextKey, err := handler.DecryptKey([]byte{1, 2, 3, 4}) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if !bytes.Equal(key, plaintextKey) { + t.Errorf("expected %v, but received %v", key, plaintextKey) + } +} + +func TestKMSDecryptBadJSON(t *testing.T) { + key, _ := hex.DecodeString("31bdadd96698c204aa9ce1448ea94ae1fb4a9a0b3c9d773b51bb1822666b8f22") + keyB64 := base64.URLEncoding.EncodeToString(key) + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, fmt.Sprintf("%s%s%s", `{"KeyId":"test-key-id","Plaintext":"`, keyB64, `"}`)) + })) + defer ts.Close() + + sess := unit.Session.Copy(&aws.Config{ + MaxRetries: aws.Int(0), + Endpoint: aws.String(ts.URL), + DisableSSL: aws.Bool(true), + S3ForcePathStyle: aws.Bool(true), + Region: aws.String("us-west-2"), + }) + + _, err := (kmsKeyHandler{kms: kms.New(sess)}).decryptHandler(Envelope{MatDesc: `{"kms_cmk_id":"test"`}) + if err == nil { + t.Errorf("expected error, but received none") + } +} +``` + +## `service/s3/s3crypto/mock_test.go` (changed lines (11, 12, 13, 30)) + +```go +package s3crypto_test + +import ( + "bytes" + "io" + "io/ioutil" + + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +type mockGenerator struct { +} + +func (m mockGenerator) GenerateCipherData(keySize, ivSize int) (s3crypto.CipherData, error) { + cd := s3crypto.CipherData{ + Key: make([]byte, keySize), + IV: make([]byte, ivSize), + } + return cd, nil +} + +func (m mockGenerator) EncryptKey(key []byte) ([]byte, error) { + size := len(key) + b := bytes.Repeat([]byte{1}, size) + return b, nil +} + +func (m mockGenerator) DecryptKey(key []byte) ([]byte, error) { + return make([]byte, 16), nil + +} + +type mockCipherBuilder struct { + generator s3crypto.CipherDataGenerator +} + +func (builder mockCipherBuilder) ContentCipher() (s3crypto.ContentCipher, error) { + cd, err := builder.generator.GenerateCipherData(32, 16) + if err != nil { + return nil, err + } + return &mockContentCipher{cd}, nil +} + +type mockContentCipher struct { + cd s3crypto.CipherData +} + +func (cipher *mockContentCipher) GetCipherData() s3crypto.CipherData { + return cipher.cd +} + +func (cipher *mockContentCipher) EncryptContents(src io.Reader) (io.Reader, error) { + b, err := ioutil.ReadAll(src) + if err != nil { + return nil, err + } + size := len(b) + b = bytes.Repeat([]byte{1}, size) + return bytes.NewReader(b), nil +} + +func (cipher *mockContentCipher) DecryptContents(src io.ReadCloser) (io.ReadCloser, error) { + b, err := ioutil.ReadAll(src) + if err != nil { + return nil, err + } + size := len(b) + return ioutil.NopCloser(bytes.NewReader(make([]byte, size))), nil +} +``` + +## `service/s3/s3crypto/strategy.go` (changed lines (66,)) + +```go +package s3crypto + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "net/http" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" +) + +// SaveStrategy is how the data's metadata wants to be saved +type SaveStrategy interface { + Save(Envelope, *request.Request) error +} + +// S3SaveStrategy will save the metadata to a separate instruction file in S3 +type S3SaveStrategy struct { + Client *s3.S3 + InstructionFileSuffix string +} + +// Save will save the envelope contents to s3. +func (strat S3SaveStrategy) Save(env Envelope, req *request.Request) error { + input := req.Params.(*s3.PutObjectInput) + b, err := json.Marshal(env) + if err != nil { + return err + } + + instInput := s3.PutObjectInput{ + Bucket: input.Bucket, + Body: bytes.NewReader(b), + } + + if strat.InstructionFileSuffix == "" { + instInput.Key = aws.String(*input.Key + DefaultInstructionKeySuffix) + } else { + instInput.Key = aws.String(*input.Key + strat.InstructionFileSuffix) + } + + _, err = strat.Client.PutObject(&instInput) + return err +} + +// HeaderV2SaveStrategy will save the metadata of the crypto contents to the header of +// the object. +type HeaderV2SaveStrategy struct{} + +// Save will save the envelope to the request's header. +func (strat HeaderV2SaveStrategy) Save(env Envelope, req *request.Request) error { + input := req.Params.(*s3.PutObjectInput) + if input.Metadata == nil { + input.Metadata = map[string]*string{} + } + + input.Metadata[http.CanonicalHeaderKey(keyV2Header)] = &env.CipherKey + input.Metadata[http.CanonicalHeaderKey(ivHeader)] = &env.IV + input.Metadata[http.CanonicalHeaderKey(matDescHeader)] = &env.MatDesc + input.Metadata[http.CanonicalHeaderKey(wrapAlgorithmHeader)] = &env.WrapAlg + input.Metadata[http.CanonicalHeaderKey(cekAlgorithmHeader)] = &env.CEKAlg + input.Metadata[http.CanonicalHeaderKey(unencryptedMD5Header)] = &env.UnencryptedMD5 + input.Metadata[http.CanonicalHeaderKey(unencryptedContentLengthHeader)] = &env.UnencryptedContentLen + + if len(env.TagLen) > 0 { + input.Metadata[http.CanonicalHeaderKey(tagLengthHeader)] = &env.TagLen + } + return nil +} + +// LoadStrategy ... +type LoadStrategy interface { + Load(*request.Request) (Envelope, error) +} + +// S3LoadStrategy will load the instruction file from s3 +type S3LoadStrategy struct { + Client *s3.S3 + InstructionFileSuffix string +} + +// Load from a given instruction file suffix +func (load S3LoadStrategy) Load(req *request.Request) (Envelope, error) { + env := Envelope{} + if load.InstructionFileSuffix == "" { + load.InstructionFileSuffix = DefaultInstructionKeySuffix + } + + input := req.Params.(*s3.GetObjectInput) + out, err := load.Client.GetObject(&s3.GetObjectInput{ + Key: aws.String(strings.Join([]string{*input.Key, load.InstructionFileSuffix}, "")), + Bucket: input.Bucket, + }) + if err != nil { + return env, err + } + + b, err := ioutil.ReadAll(out.Body) + if err != nil { + return env, err + } + err = json.Unmarshal(b, &env) + return env, err +} + +// HeaderV2LoadStrategy will load the envelope from the metadata +type HeaderV2LoadStrategy struct{} + +// Load from a given object's header +func (load HeaderV2LoadStrategy) Load(req *request.Request) (Envelope, error) { + env := Envelope{} + env.CipherKey = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, keyV2Header}, "-")) + env.IV = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, ivHeader}, "-")) + env.MatDesc = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, matDescHeader}, "-")) + env.WrapAlg = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, wrapAlgorithmHeader}, "-")) + env.CEKAlg = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, cekAlgorithmHeader}, "-")) + env.TagLen = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, tagLengthHeader}, "-")) + env.UnencryptedMD5 = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, unencryptedMD5Header}, "-")) + env.UnencryptedContentLen = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, unencryptedContentLengthHeader}, "-")) + return env, nil +} + +type defaultV2LoadStrategy struct { + client *s3.S3 + suffix string +} + +func (load defaultV2LoadStrategy) Load(req *request.Request) (Envelope, error) { + if value := req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, keyV2Header}, "-")); value != "" { + strat := HeaderV2LoadStrategy{} + return strat.Load(req) + } else if value = req.HTTPResponse.Header.Get(strings.Join([]string{metaHeader, keyV1Header}, "-")); value != "" { + return Envelope{}, awserr.New("V1NotSupportedError", "The AWS SDK for Go does not support version 1", nil) + } + + strat := S3LoadStrategy{ + Client: load.client, + InstructionFileSuffix: load.suffix, + } + return strat.Load(req) +} +``` + +## `service/s3/s3crypto/strategy_test.go` (changed lines (4, 9, 36, 56, 78)) + +```go +package s3crypto_test + +import ( + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3crypto" +) + +func TestHeaderV2SaveStrategy(t *testing.T) { + cases := []struct { + env s3crypto.Envelope + expected map[string]*string + }{ + { + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + TagLen: "128", + UnencryptedMD5: "hello", + UnencryptedContentLen: "0", + }, + map[string]*string{ + "X-Amz-Key-V2": aws.String("Foo"), + "X-Amz-Iv": aws.String("Bar"), + "X-Amz-Matdesc": aws.String("{}"), + "X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap), + "X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding), + "X-Amz-Tag-Len": aws.String("128"), + "X-Amz-Unencrypted-Content-Md5": aws.String("hello"), + "X-Amz-Unencrypted-Content-Length": aws.String("0"), + }, + }, + { + s3crypto.Envelope{ + CipherKey: "Foo", + IV: "Bar", + MatDesc: "{}", + WrapAlg: s3crypto.KMSWrap, + CEKAlg: s3crypto.AESGCMNoPadding, + UnencryptedMD5: "hello", + UnencryptedContentLen: "0", + }, + map[string]*string{ + "X-Amz-Key-V2": aws.String("Foo"), + "X-Amz-Iv": aws.String("Bar"), + "X-Amz-Matdesc": aws.String("{}"), + "X-Amz-Wrap-Alg": aws.String(s3crypto.KMSWrap), + "X-Amz-Cek-Alg": aws.String(s3crypto.AESGCMNoPadding), + "X-Amz-Unencrypted-Content-Md5": aws.String("hello"), + "X-Amz-Unencrypted-Content-Length": aws.String("0"), + }, + }, + } + + for _, c := range cases { + params := &s3.PutObjectInput{} + req := &request.Request{ + Params: params, + } + strat := s3crypto.HeaderV2SaveStrategy{} + err := strat.Save(c.env, req) + if err != nil { + t.Errorf("expected no error, but received %v", err) + } + + if !reflect.DeepEqual(c.expected, params.Metadata) { + t.Errorf("expected %v, but received %v", c.expected, params.Metadata) + } + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/task.json new file mode 100644 index 0000000000000000000000000000000000000000..ab11fe42e0fc12ba5f6e9a34f98d76215c3e760b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/task.json @@ -0,0 +1,112 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-1d20aba9f4be2de73db5", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-1d20aba9f4be2de73db5", + "project_id": "morefixes__aws__aws-sdk-go", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/sync/singleflight/singleflight_test.go", + "service/s3/s3crypto/aes_cbc_content_cipher.go", + "service/s3/s3crypto/aes_gcm_content_cipher.go", + "service/s3/s3crypto/aes_gcm_content_cipher_test.go", + "service/s3/s3crypto/aes_gcm_test.go", + "service/s3/s3crypto/cipher_util.go", + "service/s3/s3crypto/cipher_util_test.go", + "service/s3/s3crypto/decryption_client.go", + "service/s3/s3crypto/decryption_client_v2.go", + "service/s3/s3crypto/decryption_client_v2_test.go", + "service/s3/s3crypto/deprecations.go", + "service/s3/s3crypto/deprecations_test.go", + "service/s3/s3crypto/doc.go", + "service/s3/s3crypto/encryption_client.go", + "service/s3/s3crypto/encryption_client_v2.go", + "service/s3/s3crypto/envelope.go", + "service/s3/s3crypto/integration/main_test.go", + "service/s3/s3crypto/key_handler.go", + "service/s3/s3crypto/key_handler_test.go", + "service/s3/s3crypto/kms_key_handler.go", + "service/s3/s3crypto/kms_key_handler_test.go", + "service/s3/s3crypto/migrations_test.go", + "service/s3/s3crypto/mock_test.go", + "service/s3/s3crypto/shared_client.go", + "service/s3/s3crypto/strategy.go", + "service/s3/s3crypto/strategy_test.go" + ], + "patch_units": { + "before": [ + "internal/sync/singleflight/singleflight_test.go", + "service/s3/s3crypto/aes_cbc_content_cipher.go", + "service/s3/s3crypto/aes_gcm_content_cipher.go", + "service/s3/s3crypto/aes_gcm_content_cipher_test.go", + "service/s3/s3crypto/aes_gcm_test.go", + "service/s3/s3crypto/cipher_util.go", + "service/s3/s3crypto/cipher_util_test.go", + "service/s3/s3crypto/decryption_client.go", + "service/s3/s3crypto/decryption_client.go", + "service/s3/s3crypto/doc.go", + "service/s3/s3crypto/encryption_client.go", + "service/s3/s3crypto/envelope.go", + "service/s3/s3crypto/key_handler.go", + "service/s3/s3crypto/key_handler_test.go", + "service/s3/s3crypto/kms_key_handler.go", + "service/s3/s3crypto/kms_key_handler_test.go", + "service/s3/s3crypto/mock_test.go", + "service/s3/s3crypto/strategy.go", + "service/s3/s3crypto/strategy_test.go" + ], + "after": [ + "internal/sync/singleflight/singleflight_test.go", + "service/s3/s3crypto/aes_cbc_content_cipher.go", + "service/s3/s3crypto/aes_gcm_content_cipher.go", + "service/s3/s3crypto/aes_gcm_content_cipher_test.go", + "service/s3/s3crypto/aes_gcm_test.go", + "service/s3/s3crypto/cipher_util.go", + "service/s3/s3crypto/cipher_util_test.go", + "service/s3/s3crypto/decryption_client.go", + "service/s3/s3crypto/decryption_client_v2.go", + "service/s3/s3crypto/decryption_client_v2_test.go", + "service/s3/s3crypto/deprecations.go", + "service/s3/s3crypto/deprecations_test.go", + "service/s3/s3crypto/doc.go", + "service/s3/s3crypto/encryption_client.go", + "service/s3/s3crypto/encryption_client_v2.go", + "service/s3/s3crypto/envelope.go", + "service/s3/s3crypto/integration/main_test.go", + "service/s3/s3crypto/key_handler.go", + "service/s3/s3crypto/key_handler_test.go", + "service/s3/s3crypto/kms_key_handler.go", + "service/s3/s3crypto/kms_key_handler_test.go", + "service/s3/s3crypto/migrations_test.go", + "service/s3/s3crypto/mock_test.go", + "service/s3/s3crypto/shared_client.go", + "service/s3/s3crypto/strategy.go", + "service/s3/s3crypto/strategy_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/d5abce377c248d4771e6bee53c477a8d898672f602e5f8d94e3b689f9e1124db/database", + "cache_key": "d5abce377c248d4771e6bee53c477a8d898672f602e5f8d94e3b689f9e1124db", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/ac5f78df614fa9486f4ac35b5bbf5f976979eb0229e2acc69138ed900b87a569/database", + "cache_key": "ac5f78df614fa9486f4ac35b5bbf5f976979eb0229e2acc69138ed900b87a569", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/af291f667a688cfb10c62f3aa75bfd20007e4cbb0d2cff416d94e6f01383d19a/database", + "cache_key": "af291f667a688cfb10c62f3aa75bfd20007e4cbb0d2cff416d94e6f01383d19a", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-1d20aba9f4be2de73db5/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-1d20aba9f4be2de73db5/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-1d20aba9f4be2de73db5/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..024f668946552e107e547ae2b0147557ffb2aba0 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/patch.diff @@ -0,0 +1,224 @@ +diff --git a/workflow/executor/executor.go b/workflow/executor/executor.go +index 9cfaf5380..98a4bac44 100644 +--- a/workflow/executor/executor.go ++++ b/workflow/executor/executor.go +@@ -1026,15 +1026,20 @@ func untar(tarPath string, destPath string) error { + if !strings.HasPrefix(target, filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("illegal file path: %s", header.Name) + } +- if err := os.MkdirAll(filepath.Dir(target), 0o755); err != nil && os.IsExist(err) { +- return err +- } + switch header.Typeflag { + case tar.TypeSymlink: +- linkTarget := filepath.Join(filepath.Dir(target), header.Linkname) ++ // Validate symlink target before creating it ++ linkTarget := header.Linkname ++ if !filepath.IsAbs(linkTarget) { ++ linkTarget = filepath.Join(filepath.Dir(target), header.Linkname) ++ } + if !strings.HasPrefix(filepath.Clean(linkTarget), filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("illegal symlink target: %s -> %s", header.Name, header.Linkname) + } ++ // Create parent directory if needed ++ if err := os.MkdirAll(filepath.Dir(target), 0o755); err != nil { ++ return err ++ } + err := os.Symlink(header.Linkname, target) + if err != nil { + return err +@@ -1044,6 +1049,35 @@ func untar(tarPath string, destPath string) error { + return err + } + case tar.TypeReg: ++ // Before writing the file, check if the parent directory resolves outside dest ++ parentDir := filepath.Dir(target) ++ ++ // Resolve the destination directory ++ resolvedDest, err := filepath.EvalSymlinks(dest) ++ if err != nil { ++ return err ++ } ++ ++ // Check if parent exists and if so, verify it doesn't resolve outside dest ++ if _, err := os.Lstat(parentDir); err == nil { ++ // Parent exists, resolve it to check for symlink traversal ++ resolvedParent, err := filepath.EvalSymlinks(parentDir) ++ if err != nil { ++ return err ++ } ++ // Check if resolved parent is outside dest ++ if !strings.HasPrefix(resolvedParent+string(os.PathSeparator), resolvedDest+string(os.PathSeparator)) && resolvedParent != resolvedDest { ++ return fmt.Errorf("illegal file path after symlink resolution: %s resolves outside destination", header.Name) ++ } ++ } else if !os.IsNotExist(err) { ++ return err ++ } else { ++ // Parent doesn't exist, create it ++ if err := os.MkdirAll(parentDir, 0o755); err != nil { ++ return err ++ } ++ } ++ + f, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode)) + if err != nil { + return err +diff --git a/workflow/executor/executor_test.go b/workflow/executor/executor_test.go +index 2dd453b1c..bb7e54571 100644 +--- a/workflow/executor/executor_test.go ++++ b/workflow/executor/executor_test.go +@@ -1,9 +1,14 @@ + package executor + + import ( ++ "archive/tar" ++ "archive/zip" ++ "compress/gzip" + "fmt" + "io" + "os" ++ "os/exec" ++ "path/filepath" + "runtime" + "strings" + "testing" +@@ -589,3 +594,139 @@ func TestReportOutputs(t *testing.T) { + }) + + } ++ ++func TestUntarMaliciousSymlink(t *testing.T) { ++ // Create a temporary directory for the test ++ tmpDir := t.TempDir() ++ ++ // Create a target directory outside the extraction root ++ outsideDir := filepath.Join(tmpDir, "outside") ++ err := os.Mkdir(outsideDir, 0755) ++ require.NoError(t, err) ++ ++ // Create a file in the outside directory to verify it's NOT overwritten initially ++ targetFile := filepath.Join(outsideDir, "pwned") ++ err = os.WriteFile(targetFile, []byte("safe"), 0644) ++ require.NoError(t, err) ++ ++ // Create the malicious tarball directly ++ tarPath := filepath.Join(tmpDir, "malicious.tar.gz") ++ f, err := os.Create(tarPath) ++ require.NoError(t, err) ++ gw := gzip.NewWriter(f) ++ tw := tar.NewWriter(gw) ++ ++ // 1. Create a symlink "link" -> absolute path of outsideDir ++ absOutside, err := filepath.Abs(outsideDir) ++ require.NoError(t, err) ++ ++ err = tw.WriteHeader(&tar.Header{ ++ Name: "link", ++ Typeflag: tar.TypeSymlink, ++ Linkname: absOutside, ++ Mode: 0777, ++ }) ++ require.NoError(t, err) ++ ++ // 2. Create a file "link/pwned" that writes through the symlink ++ fileContent := []byte("pwned") ++ err = tw.WriteHeader(&tar.Header{ ++ Name: "link/pwned", ++ Typeflag: tar.TypeReg, ++ Mode: 0644, ++ Size: int64(len(fileContent)), ++ }) ++ require.NoError(t, err) ++ _, err = tw.Write(fileContent) ++ require.NoError(t, err) ++ ++ require.NoError(t, tw.Close()) ++ require.NoError(t, gw.Close()) ++ require.NoError(t, f.Close()) ++ ++ // Debug: List tarball contents ++ cmd := exec.CommandContext(t.Context(), "tar", "-tvzf", tarPath) ++ out, err := cmd.CombinedOutput() ++ require.NoError(t, err) ++ if err == nil { ++ t.Logf("Tarball contents:\n%s", string(out)) ++ } ++ ++ // Destination directory for extraction ++ destDir := filepath.Join(tmpDir, "dest") ++ ++ // Perform untar ++ err = untar(tarPath, destDir) ++ // This should return an error because the symlink is outside the extraction root ++ require.Error(t, err) ++ ++ // Check if the file outside was overwritten ++ content, err := os.ReadFile(targetFile) ++ require.NoError(t, err) ++ ++ // If content is "pwned", the vulnerability is reproduced. ++ if string(content) == "pwned" { ++ t.Logf("Tar slip symlink vulnerability reproduced: File outside was overwritten with '%s'", string(content)) ++ } else { ++ t.Logf("Tar slip symlink vulnerability NOT reproduced: File content is '%s'", string(content)) ++ } ++ ++ // Assert that it IS "safe" (this should FAIL if vulnerable) ++ assert.Equal(t, "safe", string(content), "File outside should NOT be overwritten") ++} ++ ++func TestUnzipMaliciousSymlink(t *testing.T) { ++ // Create a temporary directory for the test ++ tmpDir := t.TempDir() ++ ++ // Create a target directory outside the extraction root ++ outsideDir := filepath.Join(tmpDir, "outside") ++ err := os.Mkdir(outsideDir, 0755) ++ require.NoError(t, err) ++ ++ // Create a file in the outside directory ++ targetFile := filepath.Join(outsideDir, "pwned") ++ err = os.WriteFile(targetFile, []byte("safe"), 0644) ++ require.NoError(t, err) ++ ++ // Create the malicious zip ++ zipPath := filepath.Join(tmpDir, "malicious.zip") ++ f, err := os.Create(zipPath) ++ require.NoError(t, err) ++ zw := zip.NewWriter(f) ++ ++ // 1. Create a symlink "link" -> "../outside" ++ header := &zip.FileHeader{ ++ Name: "link", ++ Method: zip.Store, ++ } ++ header.SetMode(0777 | os.ModeSymlink) ++ w, err := zw.CreateHeader(header) ++ require.NoError(t, err) ++ _, err = w.Write([]byte("../outside")) ++ require.NoError(t, err) ++ ++ // 2. Create a file "link/pwned" ++ w, err = zw.Create("link/pwned") ++ require.NoError(t, err) ++ _, err = w.Write([]byte("pwned")) ++ require.NoError(t, err) ++ ++ require.NoError(t, zw.Close()) ++ require.NoError(t, f.Close()) ++ ++ // Destination directory ++ destDir := filepath.Join(tmpDir, "dest") ++ ++ // Perform unzip ++ ctx := logging.TestContext(t.Context()) ++ // This should return an error because the symlink is outside the extraction root ++ err = unzip(ctx, zipPath, destDir) ++ require.Error(t, err) ++ ++ // Check if the file outside was overwritten ++ content, err := os.ReadFile(targetFile) ++ require.NoError(t, err) ++ ++ assert.Equal(t, "safe", string(content), "File outside should NOT be overwritten by unzip") ++} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..0c71c0629952669acee323c587929536b51b7bc9 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/post_context.md @@ -0,0 +1,2123 @@ +# Patch-overlapping Go context after the fix + +## `workflow/executor/executor.go` (changed lines (1029, 1031, 1032, 1033, 1034, 1035, 1039, 1040, 1041, 1042, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080)) + +```go +package executor + +import ( + "archive/tar" + "archive/zip" + "bufio" + "compress/gzip" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/fs" + "math" + "os" + "path" + "path/filepath" + "runtime/debug" + "slices" + "strconv" + "strings" + "time" + + "github.com/argoproj/argo-workflows/v3/util/logging" + + "github.com/argoproj/argo-workflows/v3/util/file" + + apiv1 "k8s.io/api/core/v1" + apierr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + retryutil "k8s.io/client-go/util/retry" + + argoerrs "github.com/argoproj/argo-workflows/v3/errors" + wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + argoprojv1 "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned/typed/workflow/v1alpha1" + "github.com/argoproj/argo-workflows/v3/util" + "github.com/argoproj/argo-workflows/v3/util/archive" + errorsutil "github.com/argoproj/argo-workflows/v3/util/errors" + "github.com/argoproj/argo-workflows/v3/util/retry" + waitutil "github.com/argoproj/argo-workflows/v3/util/wait" + "github.com/argoproj/argo-workflows/v3/workflow/artifacts" + artifactcommon "github.com/argoproj/argo-workflows/v3/workflow/artifacts/common" + "github.com/argoproj/argo-workflows/v3/workflow/common" + executorretry "github.com/argoproj/argo-workflows/v3/workflow/executor/retry" +) + +const ( + // This directory temporarily stores the tarballs of the artifacts before uploading + tempOutArtDir = "/tmp/argo/outputs/artifacts" +) + +// WorkflowExecutor is program which runs as the init/wait container +type WorkflowExecutor struct { + PodName string + podUID types.UID + workflow string + workflowUID types.UID + nodeID string + Template wfv1.Template + IncludeScriptOutput bool + Deadline time.Time + ClientSet kubernetes.Interface + taskResultClient argoprojv1.WorkflowTaskResultInterface + RESTClient rest.Interface + Namespace string + RuntimeExecutor ContainerRuntimeExecutor + + // memoized configmaps + memoizedConfigMaps map[string]string + // memoized secrets + memoizedSecrets map[string][]byte + // list of errors that occurred during execution. + // the first of these is used as the overall message of the node + errors []error + + // current progress which is synced every `annotationPatchTickDuration` to the pods annotations. + progress wfv1.Progress + + annotationPatchTickDuration time.Duration + readProgressFileTickDuration time.Duration + + // flag to indicate if the task result was created + taskResultCreated bool +} + +type Initializer interface { + Init(tmpl wfv1.Template) error +} + +// ContainerRuntimeExecutor is the interface for interacting with a container runtime +type ContainerRuntimeExecutor interface { + // GetFileContents returns the file contents of a file in a container as a string + GetFileContents(containerName string, sourcePath string) (string, error) + + // CopyFile copies a source file in a container to a local path + CopyFile(ctx context.Context, containerName, sourcePath, destPath string, compressionLevel int) error + + // GetOutputStream returns the entirety of the container output as a io.Reader + // Used to capture script results as an output parameter, and to archive container logs + GetOutputStream(ctx context.Context, containerName string, combinedOutput bool) (io.ReadCloser, error) + + // Wait waits for the container to complete. + Wait(ctx context.Context, containerNames []string) error + + // Kill a list of containers first with a SIGTERM then with a SIGKILL after a grace period + Kill(ctx context.Context, containerNames []string, terminationGracePeriodDuration time.Duration) error +} + +// NewExecutor instantiates a new workflow executor +func NewExecutor( + ctx context.Context, + clientset kubernetes.Interface, + taskResultClient argoprojv1.WorkflowTaskResultInterface, + restClient rest.Interface, + podName string, + podUID types.UID, + workflow string, + workflowUID types.UID, + nodeID, namespace string, + cre ContainerRuntimeExecutor, + template wfv1.Template, + includeScriptOutput bool, + deadline time.Time, + annotationPatchTickDuration, readProgressFileTickDuration time.Duration, +) WorkflowExecutor { + retry := executorretry.ExecutorRetry(ctx) + logging.RequireLoggerFromContext(ctx).WithFields(logging.Fields{ + "Steps": retry.Steps, + "Duration": retry.Duration, + "Factor": retry.Factor, + "Jitter": retry.Jitter, + }).Info(ctx, "Using executor retry strategy") + return WorkflowExecutor{ + PodName: podName, + podUID: podUID, + workflow: workflow, + workflowUID: workflowUID, + nodeID: nodeID, + ClientSet: clientset, + taskResultClient: taskResultClient, + RESTClient: restClient, + Namespace: namespace, + RuntimeExecutor: cre, + Template: template, + IncludeScriptOutput: includeScriptOutput, + Deadline: deadline, + memoizedConfigMaps: map[string]string{}, + memoizedSecrets: map[string][]byte{}, + errors: []error{}, + annotationPatchTickDuration: annotationPatchTickDuration, + readProgressFileTickDuration: readProgressFileTickDuration, + } +} + +// HandleError is a helper to annotate the pod with the error message upon a unexpected executor panic or error +func (we *WorkflowExecutor) HandleError(ctx context.Context) { + if r := recover(); r != nil { + util.WriteTerminateMessage(fmt.Sprintf("%v", r)) + logging.RequireLoggerFromContext(ctx).WithFatal().WithFields(logging.Fields{ + "error": r, + "stack": debug.Stack(), + }).Error(ctx, "executor panic") + } else { + if len(we.errors) > 0 { + util.WriteTerminateMessage(we.errors[0].Error()) + } + } +} + +func (we *WorkflowExecutor) LoadArtifactsWithoutPlugins(ctx context.Context) error { + return we.loadArtifacts(ctx, "") +} + +func (we *WorkflowExecutor) LoadArtifactsFromPlugin(ctx context.Context, pluginName wfv1.ArtifactPluginName) error { + return we.loadArtifacts(ctx, pluginName) +} + +// loadArtifacts loads artifacts from location to a container path +// pluginName is the name of the plugin to load artifacts from, only one plugin can be used at a time +func (we *WorkflowExecutor) loadArtifacts(ctx context.Context, pluginName wfv1.ArtifactPluginName) error { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithFields(logging.Fields{"pluginName": pluginName}).Info(ctx, "Start loading input artifacts...") + for _, art := range we.Template.Inputs.Artifacts { + logger.WithField("name", art.Name).Info(ctx, "Downloading artifact") + + if !art.HasLocationOrKey() { + if art.Optional { + logger.WithField("name", art.Name).Warn(ctx, "Ignoring optional artifact which was not supplied") + continue + } else { + return argoerrs.Errorf(argoerrs.CodeNotFound, "required artifact '%s' not supplied", art.Name) + } + } + err := art.CleanPath() + if err != nil { + return err + } + driverArt, err := we.newDriverArt(&art) + if err != nil { + return fmt.Errorf("failed to load artifact '%s': %w", art.Name, err) + } + switch pluginName { + // If no plugin is specified only load non-plugin artifacts + case "": + if driverArt.Plugin != nil { + logger.Info(ctx, "Skipping artifact that is from a plugin") + continue + } + // If a plugin is specified only load artifacts from that plugin + default: + if driverArt.Plugin == nil || driverArt.Plugin.Name != pluginName { + logger.WithFields(logging.Fields{"name": driverArt.Name, "plugin": driverArt.Plugin}).Info(ctx, "Skipping artifact that is not from the specified plugin") + continue + } + } + + artDriver, err := we.InitDriver(ctx, driverArt) + if err != nil { + return err + } + // Determine the file path of where to load the artifact + var artPath string + mnt := common.FindOverlappingVolume(&we.Template, art.Path) + if mnt == nil { + artPath = path.Join(common.ExecutorArtifactBaseDir, art.Name) + } else { + // If we get here, it means the input artifact path overlaps with a user-specified + // volumeMount in the container. Because we also implement input artifacts as volume + // mounts, we need to load the artifact into the user specified volume mount, + // as opposed to the `input-artifacts` volume that is an implementation detail + // unbeknownst to the user. + logger.WithFields(logging.Fields{"path": art.Path, "mountPath": mnt.MountPath}).Info(ctx, "Specified artifact path overlaps with volume mount, extracting to volume mount") + artPath = path.Join(common.ExecutorMainFilesystemDir, art.Path) + } + + // The artifact is downloaded to a temporary location, after which we determine if + // the file is a tarball or not. If it is, it is first extracted then renamed to + // the desired location. If not, it is simply renamed to the location. + tempArtPath := artPath + ".tmp" + // Ensure parent directory exist, create if missing + tempArtDir := filepath.Dir(tempArtPath) + if err := os.MkdirAll(tempArtDir, 0o700); err != nil { + return fmt.Errorf("failed to create artifact temporary parent directory %s: %w", tempArtDir, err) + } + err = artDriver.Load(ctx, driverArt, tempArtPath) + if err != nil { + if art.Optional && argoerrs.IsCode(argoerrs.CodeNotFound, err) { + logger.WithField("name", art.Name).Info(ctx, "Skipping optional input artifact that was not found") + continue + } + return fmt.Errorf("artifact %s failed to load: %w", art.Name, err) + } + + isTar := false + isZip := false + if art.GetArchive().None != nil { + // explicitly not a tar + isTar = false + isZip = false + } else if art.GetArchive().Tar != nil { + // explicitly a tar + isTar = true + } else if art.GetArchive().Zip != nil { + // explicitly a zip + isZip = true + } else { + // auto-detect if tarball + // (don't try to autodetect zip files for backwards compatibility) + isTar, err = isTarball(ctx, tempArtPath) + if err != nil { + return err + } + } + + if isTar { + err = untar(tempArtPath, artPath) + _ = os.Remove(tempArtPath) + } else if isZip { + err = unzip(ctx, tempArtPath, artPath) + _ = os.Remove(tempArtPath) + } else { + err = os.Rename(tempArtPath, artPath) + } + if err != nil { + return err + } + + logger.WithField("path", artPath).Info(ctx, "Successfully download file") + if art.Mode != nil { + err = chmod(artPath, *art.Mode, art.RecurseMode) + if err != nil { + return err + } + } else if driverArt.Plugin != nil { + // For plugin artifacts without explicit mode, ensure the file is writable + // by setting mode to 0666 so the main container can read/write it + err = chmod(artPath, 0666, art.RecurseMode) + if err != nil { + logger.WithError(err).Error(ctx, "Failed to chmod plugin artifact") + return err + } + } + } + return nil +} + +// StageFiles will create any files required by script/resource templates +func (we *WorkflowExecutor) StageFiles(ctx context.Context) error { + var filePath string + var body []byte + logger := logging.RequireLoggerFromContext(ctx) + mode := os.FileMode(0o644) + switch we.Template.GetType() { + case wfv1.TemplateTypeScript: + logger.WithField("path", common.ExecutorScriptSourcePath).Info(ctx, "Loading script source") + filePath = common.ExecutorScriptSourcePath + body = []byte(we.Template.Script.Source) + mode = os.FileMode(0o755) + case wfv1.TemplateTypeResource: + if we.Template.Resource.ManifestFrom != nil && we.Template.Resource.ManifestFrom.Artifact != nil { + logger.WithField("name", we.Template.Resource.ManifestFrom.Artifact.Name).Info(ctx, "manifest already staged") + return nil + } + logger.WithField("path", common.ExecutorResourceManifestPath).Info(ctx, "Loading manifest") + filePath = common.ExecutorResourceManifestPath + body = []byte(we.Template.Resource.Manifest) + default: + return nil + } + err := os.WriteFile(filePath, body, mode) + if err != nil { + return argoerrs.InternalWrapError(err) + } + return nil +} + +// SaveArtifacts uploads artifacts to the archive location +func (we *WorkflowExecutor) SaveArtifacts(ctx context.Context) (wfv1.Artifacts, error) { + logger := logging.RequireLoggerFromContext(ctx) + artifacts := wfv1.Artifacts{} + if len(we.Template.Outputs.Artifacts) == 0 { + logger.Info(ctx, "No output artifacts") + return artifacts, nil + } + + logger.Info(ctx, "Saving output artifacts") + err := os.MkdirAll(tempOutArtDir, os.ModePerm) + if err != nil { + return artifacts, argoerrs.InternalWrapError(err) + } + + aggregateError := "" + for _, art := range we.Template.Outputs.Artifacts { + saved, err := we.saveArtifact(ctx, common.MainContainerName, &art) + if err != nil { + aggregateError += err.Error() + "; " + } + if saved { + artifacts = append(artifacts, art) + } + } + if aggregateError == "" { + return artifacts, nil + } else { + return artifacts, errors.New(aggregateError) + } +} + +// save artifact +// return whether artifact was in fact saved, and if there was an error +func (we *WorkflowExecutor) saveArtifact(ctx context.Context, containerName string, art *wfv1.Artifact) (bool, error) { + logger := logging.RequireLoggerFromContext(ctx) + // Determine the file path of where to find the artifact + err := art.CleanPath() + if err != nil { + return false, err + } + fileName, localArtPath, err := we.stageArchiveFile(ctx, containerName, art) + if err != nil { + if art.Optional && argoerrs.IsCode(argoerrs.CodeNotFound, err) { + logger.WithField("name", art.Name).WithField("path", art.Path).WithError(err).Warn(ctx, "Ignoring optional artifact which does not exist in path") + return false, nil + } + return false, err + } + fi, err := os.Stat(localArtPath) + if err != nil { + return false, err + } + size := fi.Size() + if size == 0 { + logger.WithField("path", localArtPath).Warn(ctx, "The file is empty. It may not be uploaded successfully depending on the artifact driver") + } + err = we.saveArtifactFromFile(ctx, art, fileName, localArtPath) + return err == nil, err +} + +// fileBase is probably path.Base(filePath), but can be something else +func (we *WorkflowExecutor) saveArtifactFromFile(ctx context.Context, art *wfv1.Artifact, fileName, localArtPath string) error { + if !art.HasKey() { + key, err := we.Template.ArchiveLocation.GetKey() + if err != nil { + return err + } + artLocation, err := we.Template.ArchiveLocation.Get() + if err != nil { + return err + } + if err = art.SetType(artLocation); err != nil { + return err + } + if err := art.SetKey(path.Join(key, fileName)); err != nil { + return err + } + } + driverArt, err := we.newDriverArt(art) + if err != nil { + return err + } + artDriver, err := we.InitDriver(ctx, driverArt) + if err != nil { + return err + } + err = artDriver.Save(ctx, localArtPath, driverArt) + if err != nil { + return err + } + we.maybeDeleteLocalArtPath(ctx, localArtPath) + logging.RequireLoggerFromContext(ctx).WithField("path", localArtPath).Info(ctx, "Successfully saved file") + return nil +} + +func (we *WorkflowExecutor) maybeDeleteLocalArtPath(ctx context.Context, localArtPath string) { + if os.Getenv("REMOVE_LOCAL_ART_PATH") == "true" { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("localArtPath", localArtPath).Info(ctx, "deleting local artifact") + // remove is best effort (the container will go away anyways). + // we just want reduce peak space usage + err := os.Remove(localArtPath) + if err != nil { + logger.WithField("path", localArtPath).WithError(err).Warn(ctx, "Failed to remove") + } + } else { + logging.RequireLoggerFromContext(ctx).WithField("localArtPath", localArtPath).Info(ctx, "not deleting local artifact") + } +} + +// stageArchiveFile stages a path in a container for archiving from the wait sidecar. +// Returns a filename and a local path for the upload. +// The filename is incorporated into the final path when uploading it to the artifact repo. +// The local path is the final staging location of the file (or directory) which we will pass +// to the SaveArtifacts call and may be a directory or file. +func (we *WorkflowExecutor) stageArchiveFile(ctx context.Context, containerName string, art *wfv1.Artifact) (string, string, error) { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("name", art.Name).Info(ctx, "Staging artifact") + strategy := art.Archive + if strategy == nil { + // If no strategy is specified, default to the tar strategy + strategy = &wfv1.ArchiveStrategy{ + Tar: &wfv1.TarStrategy{}, + } + } + compressionLevel := gzip.NoCompression + if strategy.Tar != nil { + if l := strategy.Tar.CompressionLevel; l != nil { + compressionLevel = int(*l) + } else { + compressionLevel = gzip.DefaultCompression + } + } + + if !we.isBaseImagePath(art.Path) { + // If we get here, we are uploading an artifact from a mirrored volume mount which the wait + // sidecar has direct access to. We can upload directly from the shared volume mount, + // instead of copying it from the container. + mountedArtPath := filepath.Join(common.ExecutorMainFilesystemDir, art.Path) + logger.WithFields(logging.Fields{"path": art.Path, "mountedArtPath": mountedArtPath}).Info(ctx, "Staging from mirrored volume mount") + if strategy.None != nil { + fileName := filepath.Base(art.Path) + logger.WithField("fileName", fileName).Info(ctx, "No compression strategy needed, staging skipped") + if !file.Exists(mountedArtPath) { + return "", "", argoerrs.Errorf(argoerrs.CodeNotFound, "%s no such file or directory", art.Path) + } + return fileName, mountedArtPath, nil + } + if strategy.Zip != nil { + fileName := fmt.Sprintf("%s.zip", art.Name) + localArtPath := filepath.Join(tempOutArtDir, fileName) + f, err := os.Create(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + zw := zip.NewWriter(f) + defer zw.Close() + err = archive.ZipToWriter(ctx, mountedArtPath, zw) + if err != nil { + return "", "", err + } + logger.WithFields(logging.Fields{"path": art.Path, "mountedArtPath": mountedArtPath}).Info(ctx, "Successfully staged from mirrored volume mount") + return fileName, localArtPath, nil + } + fileName := fmt.Sprintf("%s.tgz", art.Name) + localArtPath := filepath.Join(tempOutArtDir, fileName) + f, err := os.Create(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + w := bufio.NewWriter(f) + err = archive.TarGzToWriter(ctx, mountedArtPath, compressionLevel, w) + if err != nil { + return "", "", err + } + logger.WithFields(logging.Fields{"path": art.Path, "mountedArtPath": mountedArtPath}).Info(ctx, "Successfully staged from mirrored volume mount") + return fileName, localArtPath, nil + } + + fileName := fmt.Sprintf("%s.tgz", art.Name) + localArtPath := filepath.Join(tempOutArtDir, fileName) + logger.WithFields(logging.Fields{"path": art.Path, "localArtPath": localArtPath}).Info(ctx, "Copying from container base image layer") + + err := we.RuntimeExecutor.CopyFile(ctx, containerName, art.Path, localArtPath, compressionLevel) + if err != nil { + return "", "", err + } + if strategy.Tar != nil { + // NOTE we already tar gzip the file in the executor. So this is a noop. + return fileName, localArtPath, nil + } + // localArtPath now points to a .tgz file, and the archive strategy is *not* tar. We need to untar it + logger.WithField("path", localArtPath).Info(ctx, "Untaring archive before upload") + unarchivedArtPath := path.Join(filepath.Dir(localArtPath), art.Name) + err = untar(localArtPath, unarchivedArtPath) + if err != nil { + return "", "", err + } + // Delete the tarball + err = os.Remove(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + isDir, err := file.IsDirectory(unarchivedArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + fileName = filepath.Base(art.Path) + if isDir { + localArtPath = unarchivedArtPath + } else { + // If we are uploading a single file, we need to preserve original filename so that + // 1. minio client can infer its mime-type, based on file extension + // 2. the original filename is incorporated into the final path + localArtPath = path.Join(tempOutArtDir, fileName) + err = os.Rename(unarchivedArtPath, localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + } + // In the future, if we were to support other compression formats (e.g. bzip2) or options + // the logic would go here, and compression would be moved out of the executors + if strategy.Zip != nil { + fileName = fmt.Sprintf("%s.zip", art.Name) + localArtPath = filepath.Join(tempOutArtDir, fileName) + f, err := os.Create(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + zw := zip.NewWriter(f) + defer zw.Close() + err = archive.ZipToWriter(ctx, unarchivedArtPath, zw) + if err != nil { + return "", "", err + } + logger.WithFields(logging.Fields{"unarchivedArtPath": unarchivedArtPath, "localArtPath": localArtPath}).Info(ctx, "Successfully zipped") + return fileName, localArtPath, nil + } + return fileName, localArtPath, nil +} + +// isBaseImagePath checks if the given artifact path resides in the base image layer of the container +// versus a shared volume mount between the wait and main container +func (we *WorkflowExecutor) isBaseImagePath(path string) bool { + // first check if path overlaps with a user-specified volumeMount + if common.FindOverlappingVolume(&we.Template, path) != nil { + return false + } + // next check if path overlaps with a shared input-artifact emptyDir mounted by argo + for _, inArt := range we.Template.Inputs.Artifacts { + if path == inArt.Path { + // The input artifact may have been optional and not supplied. If this is the case, the file won't exist on + // the input artifact volume. Since this function was called, we know that we want to use this path as an + // output artifact, so we should look for it in the base image path. + if inArt.Optional && !inArt.HasLocationOrKey() { + return true + } + return false + } + if strings.HasPrefix(path, inArt.Path+"/") { + return false + } + } + return true +} + +// SaveParameters will save the content in the specified file path as output parameter value +func (we *WorkflowExecutor) SaveParameters(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + if len(we.Template.Outputs.Parameters) == 0 { + logger.Info(ctx, "No output parameters") + return nil + } + logger.Info(ctx, "Saving output parameters") + for i, param := range we.Template.Outputs.Parameters { + logger.WithField("name", param.Name).Info(ctx, "Saving path output parameter") + // Determine the file path of where to find the parameter + if param.ValueFrom == nil || param.ValueFrom.Path == "" { + continue + } + + var output *wfv1.AnyString + if we.isBaseImagePath(param.ValueFrom.Path) { + logger.WithField("path", param.ValueFrom.Path).Info(ctx, "Copying from base image layer") + fileContents, err := we.RuntimeExecutor.GetFileContents(common.MainContainerName, param.ValueFrom.Path) + if err != nil { + // We have a default value to use instead of returning an error + if param.ValueFrom.Default != nil { + output = param.ValueFrom.Default + } else { + return err + } + } else { + output = wfv1.AnyStringPtr(fileContents) + } + } else { + logger.WithField("path", param.ValueFrom.Path).Info(ctx, "Copying from volume mount") + mountedPath := filepath.Join(common.ExecutorMainFilesystemDir, param.ValueFrom.Path) + data, err := os.ReadFile(filepath.Clean(mountedPath)) + if err != nil { + // We have a default value to use instead of returning an error + if param.ValueFrom.Default != nil { + output = param.ValueFrom.Default + } else { + return err + } + } else { + output = wfv1.AnyStringPtr(string(data)) + } + } + + // Trims off a single newline for user convenience + output = wfv1.AnyStringPtr(strings.TrimSuffix(output.String(), "\n")) + we.Template.Outputs.Parameters[i].Value = output + logger.WithField("name", param.Name).Info(ctx, "Successfully saved output parameter") + } + return nil +} + +func (we *WorkflowExecutor) SaveLogs(ctx context.Context) []wfv1.Artifact { + var logArtifacts []wfv1.Artifact + tempLogsDir := "/tmp/argo/outputs/logs" + + if we.Template.SaveLogsAsArtifact() { + err := os.MkdirAll(tempLogsDir, os.ModePerm) + if err != nil { + we.AddError(ctx, argoerrs.InternalWrapError(err)) + } + + containerNames := we.Template.GetMainContainerNames() + logArtifacts = make([]wfv1.Artifact, 0) + + for _, containerName := range containerNames { + // Saving logs + art, err := we.saveContainerLogs(ctx, tempLogsDir, containerName) + if err != nil { + we.AddError(ctx, err) + } else { + logArtifacts = append(logArtifacts, *art) + } + } + } + + return logArtifacts +} + +// saveContainerLogs saves a single container's log into a file +func (we *WorkflowExecutor) saveContainerLogs(ctx context.Context, tempLogsDir, containerName string) (*wfv1.Artifact, error) { + fileName := containerName + ".log" + filePath := path.Join(tempLogsDir, fileName) + err := we.saveLogToFile(ctx, containerName, filePath) + if err != nil { + return nil, err + } + + art := &wfv1.Artifact{Name: containerName + "-logs"} + err = we.saveArtifactFromFile(ctx, art, fileName, filePath) + if err != nil { + return nil, err + } + + return art, nil +} + +// GetSecret will retrieve the Secrets from VolumeMount +func (we *WorkflowExecutor) GetSecret(ctx context.Context, accessKeyName string, accessKey string) (string, error) { + file, err := os.ReadFile(filepath.Clean(filepath.Join(common.SecretVolMountPath, accessKeyName, accessKey))) + if err != nil { + return "", err + } + return string(file), nil +} + +// saveLogToFile saves the entire log output of a container to a local file +func (we *WorkflowExecutor) saveLogToFile(ctx context.Context, containerName, path string) error { + outFile, err := os.Create(path) + if err != nil { + return argoerrs.InternalWrapError(err) + } + defer func() { _ = outFile.Close() }() + reader, err := we.RuntimeExecutor.GetOutputStream(ctx, containerName, true) + if err != nil { + return err + } + defer func() { _ = reader.Close() }() + _, err = io.Copy(outFile, reader) + if err != nil { + return argoerrs.InternalWrapError(err) + } + return nil +} + +func (we *WorkflowExecutor) newDriverArt(art *wfv1.Artifact) (*wfv1.Artifact, error) { + driverArt := art.DeepCopy() + err := driverArt.Relocate(we.Template.ArchiveLocation) + return driverArt, err +} + +// InitDriver initializes an instance of an artifact driver +func (we *WorkflowExecutor) InitDriver(ctx context.Context, art *wfv1.Artifact) (artifactcommon.ArtifactDriver, error) { + driver, err := artifacts.NewDriver(ctx, art, we) + if err == artifacts.ErrUnsupportedDriver { + return nil, argoerrs.Errorf(argoerrs.CodeBadRequest, "Unsupported artifact driver for %s", art.Name) + } + return driver, err +} + +// GetConfigMapKey retrieves a configmap value and memoizes the result +func (we *WorkflowExecutor) GetConfigMapKey(ctx context.Context, name, key string) (string, error) { + namespace := we.Namespace + cachedKey := fmt.Sprintf("%s/%s/%s", namespace, name, key) + if val, ok := we.memoizedConfigMaps[cachedKey]; ok { + return val, nil + } + configmapsIf := we.ClientSet.CoreV1().ConfigMaps(namespace) + var configmap *apiv1.ConfigMap + err := waitutil.Backoff(retry.DefaultRetry(ctx), func() (bool, error) { + var err error + configmap, err = configmapsIf.Get(ctx, name, metav1.GetOptions{}) + return !errorsutil.IsTransientErr(ctx, err), err + }) + if err != nil { + return "", argoerrs.InternalWrapError(err) + } + // memoize all keys in the configmap since it's highly likely we will need to get a + // subsequent key in the configmap (e.g. username + password) and we can save an API call + for k, v := range configmap.Data { + we.memoizedConfigMaps[fmt.Sprintf("%s/%s/%s", namespace, name, k)] = v + } + val, ok := we.memoizedConfigMaps[cachedKey] + if !ok { + return "", argoerrs.Errorf(argoerrs.CodeBadRequest, "configmap '%s' does not have the key '%s'", name, key) + } + return val, nil +} + +// GetSecrets retrieves a secret value and memoizes the result +func (we *WorkflowExecutor) GetSecrets(ctx context.Context, namespace, name, key string) ([]byte, error) { + cachedKey := fmt.Sprintf("%s/%s/%s", namespace, name, key) + if val, ok := we.memoizedSecrets[cachedKey]; ok { + return val, nil + } + secretsIf := we.ClientSet.CoreV1().Secrets(namespace) + var secret *apiv1.Secret + err := waitutil.Backoff(retry.DefaultRetry(ctx), func() (bool, error) { + var err error + secret, err = secretsIf.Get(ctx, name, metav1.GetOptions{}) + return !errorsutil.IsTransientErr(ctx, err), err + }) + if err != nil { + return []byte{}, argoerrs.InternalWrapError(err) + } + // memoize all keys in the secret since it's highly likely we will need to get a + // subsequent key in the secret (e.g. username + password) and we can save an API call + for k, v := range secret.Data { + we.memoizedSecrets[fmt.Sprintf("%s/%s/%s", namespace, name, k)] = v + } + val, ok := we.memoizedSecrets[cachedKey] + if !ok { + return []byte{}, argoerrs.Errorf(argoerrs.CodeBadRequest, "secret '%s' does not have the key '%s'", name, key) + } + return val, nil +} + +// GetTerminationGracePeriodDuration returns the terminationGracePeriodSeconds of podSpec in Time.Duration format +func GetTerminationGracePeriodDuration() time.Duration { + x, _ := strconv.ParseInt(os.Getenv(common.EnvVarTerminationGracePeriodSeconds), 10, 64) + if x > 0 { + return time.Duration(x) * time.Second + } + return 30 * time.Second +} + +// CaptureScriptResult will add the stdout of a script template as output result +func (we *WorkflowExecutor) CaptureScriptResult(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + if !we.IncludeScriptOutput { + logger.Info(ctx, "No Script output reference in workflow. Capturing script output ignored") + return nil + } + if !we.Template.HasOutput() { + logger.Info(ctx, "Template type is neither of Script, Container, or Pod. Capturing script output ignored") + return nil + } + logger.Info(ctx, "Capturing script output") + reader, err := we.RuntimeExecutor.GetOutputStream(ctx, common.MainContainerName, false) + if err != nil { + return err + } + defer func() { _ = reader.Close() }() + bytes, err := io.ReadAll(reader) + if err != nil { + return argoerrs.InternalWrapError(err) + } + out := string(bytes) + // Trims off a single newline for user convenience + outputLen := len(out) + if outputLen > 0 && out[outputLen-1] == '\n' { + out = out[0 : outputLen-1] + } + + const maxAnnotationSize int = 256 * (1 << 10) // 256 kB + // A character in a string is a byte + if len(out) > maxAnnotationSize { + logger.Warn(ctx, "Output is larger than the maximum allowed size of 256 kB, only the last 256 kB were saved") + out = out[len(out)-maxAnnotationSize:] + } + + we.Template.Outputs.Result = &out + return nil +} + +// FinalizeOutput adds a label or annotation to denote that outputs have completed reporting. +func (we *WorkflowExecutor) FinalizeOutput(ctx context.Context) { + logger := logging.RequireLoggerFromContext(ctx) + var count uint64 + err := retryutil.OnError(wait.Backoff{ + Duration: time.Second, + Factor: 2, + Jitter: 0.1, + Steps: math.MaxInt32, // effectively infinite retries + Cap: 30 * time.Second, + }, func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + err := we.patchTaskResultLabels(ctx, map[string]string{ + common.LabelKeyReportOutputsCompleted: "true", + }) + if apierr.IsForbidden(err) || apierr.IsNotFound(err) { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/") + } else if err != nil && count%20 == 0 { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result") + } + count++ + return err + }) + if err != nil { + we.AddError(ctx, err) + } +} + +func (we *WorkflowExecutor) InitializeOutput(ctx context.Context) { + logger := logging.RequireLoggerFromContext(ctx) + var count uint64 + err := retryutil.OnError(wait.Backoff{ + Duration: time.Second, + Factor: 2, + Jitter: 0.1, + Steps: math.MaxInt32, // effectively infinite retries + Cap: 30 * time.Second, + }, func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + err := we.upsertTaskResult(ctx, wfv1.NodeResult{}) + if apierr.IsForbidden(err) { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/") + } else if err != nil && count%20 == 0 { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result") + } + count++ + return err + }) + if err != nil { + we.AddError(ctx, err) + } +} + +// ReportOutputs updates the WorkflowTaskResult (or falls back to annotate the Pod) +func (we *WorkflowExecutor) ReportOutputs(ctx context.Context, artifacts []wfv1.Artifact) error { + outputs := we.Template.Outputs.DeepCopy() + outputs.Artifacts = artifacts + return we.reportResult(ctx, wfv1.NodeResult{Outputs: outputs}) +} + +// ReportOutputsLogs updates the WorkflowTaskResult log fields +func (we *WorkflowExecutor) ReportOutputsLogs(ctx context.Context) error { + var outputs wfv1.Outputs + artifacts := wfv1.Artifacts{} + logArtifacts := we.SaveLogs(ctx) + artifacts = append(artifacts, logArtifacts...) + outputs.Artifacts = artifacts + return we.reportResult(ctx, wfv1.NodeResult{Outputs: &outputs}) +} + +func (we *WorkflowExecutor) reportResult(ctx context.Context, result wfv1.NodeResult) error { + var count uint64 // used to avoid spamming with these messages + logger := logging.RequireLoggerFromContext(ctx) + return retryutil.OnError(wait.Backoff{ + Duration: time.Second, + Factor: 2.0, + Jitter: 0.2, + Steps: math.MaxInt32, // effectively infinite retries + Cap: 30 * time.Second, + }, func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + err := we.upsertTaskResult(ctx, result) + if apierr.IsForbidden(err) { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/") + } else if err != nil && count%20 == 0 { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result") + } + count++ + return err + }) +} + +// AddError adds an error to the list of encountered errors during execution +func (we *WorkflowExecutor) AddError(ctx context.Context, err error) { + logging.RequireLoggerFromContext(ctx).WithError(err).Error(ctx, "executor error") + we.errors = append(we.errors, err) +} + +// HasError return the first error if exist +func (we *WorkflowExecutor) HasError() error { + if len(we.errors) > 0 { + return we.errors[0] + } + return nil +} + +// AddAnnotation adds an annotation to the workflow pod +func (we *WorkflowExecutor) AddAnnotation(ctx context.Context, key, value string) error { + data, err := json.Marshal(map[string]interface{}{"metadata": metav1.ObjectMeta{ + Annotations: map[string]string{ + key: value, + }, + }}) + if err != nil { + return err + } + _, err = we.ClientSet.CoreV1().Pods(we.Namespace).Patch(ctx, we.PodName, types.MergePatchType, data, metav1.PatchOptions{}) + return err +} + +// isTarball returns whether or not the file is a tarball +func isTarball(ctx context.Context, filePath string) (bool, error) { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("path", filePath).Info(ctx, "Detecting if file is a tarball") + f, err := os.Open(filepath.Clean(filePath)) + if err != nil { + return false, err + } + defer func() { + if err := f.Close(); err != nil { + logger.WithFatal().WithField("path", filePath).WithError(err).Error(ctx, "Error closing file") + } + }() + gzr, err := gzip.NewReader(f) + if err != nil { + return false, nil + } + defer gzr.Close() + tarr := tar.NewReader(gzr) + _, err = tarr.Next() + return err == nil, nil +} + +// untar extracts a tarball to a temporary directory, +// renaming it to the desired location +func untar(tarPath string, destPath string) error { + decompressor := func(src string, dest string) error { + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + gzr, err := file.GetGzipReader(f) + if err != nil { + return err + } + defer gzr.Close() + tr := tar.NewReader(gzr) + for { + header, err := tr.Next() + switch { + case err == io.EOF: + return nil + case err != nil: + return err + case header == nil: + continue + } + target := filepath.Join(dest, filepath.Clean(header.Name)) + if !strings.HasPrefix(target, filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("illegal file path: %s", header.Name) + } + switch header.Typeflag { + case tar.TypeSymlink: + // Validate symlink target before creating it + linkTarget := header.Linkname + if !filepath.IsAbs(linkTarget) { + linkTarget = filepath.Join(filepath.Dir(target), header.Linkname) + } + if !strings.HasPrefix(filepath.Clean(linkTarget), filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("illegal symlink target: %s -> %s", header.Name, header.Linkname) + } + // Create parent directory if needed + if err := os.MkdirAll(filepath.Dir(target), 0o755); err != nil { + return err + } + err := os.Symlink(header.Linkname, target) + if err != nil { + return err + } + case tar.TypeDir: + if err := os.MkdirAll(target, 0o755); err != nil { + return err + } + case tar.TypeReg: + // Before writing the file, check if the parent directory resolves outside dest + parentDir := filepath.Dir(target) + + // Resolve the destination directory + resolvedDest, err := filepath.EvalSymlinks(dest) + if err != nil { + return err + } + + // Check if parent exists and if so, verify it doesn't resolve outside dest + if _, err := os.Lstat(parentDir); err == nil { + // Parent exists, resolve it to check for symlink traversal + resolvedParent, err := filepath.EvalSymlinks(parentDir) + if err != nil { + return err + } + // Check if resolved parent is outside dest + if !strings.HasPrefix(resolvedParent+string(os.PathSeparator), resolvedDest+string(os.PathSeparator)) && resolvedParent != resolvedDest { + return fmt.Errorf("illegal file path after symlink resolution: %s resolves outside destination", header.Name) + } + } else if !os.IsNotExist(err) { + return err + } else { + // Parent doesn't exist, create it + if err := os.MkdirAll(parentDir, 0o755); err != nil { + return err + } + } + + f, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode)) + if err != nil { + return err + } + if _, err := io.Copy(f, tr); err != nil { + return err + } + if err := f.Close(); err != nil { + return err + } + if err := os.Chtimes(target, header.AccessTime, header.ModTime); err != nil { + return err + } + } + } + } + + return unpack(tarPath, destPath, decompressor) +} + +// unzip extracts a zip folder to a temporary directory, +// renaming it to the desired location +func unzip(ctx context.Context, zipPath string, destPath string) error { + decompressor := func(src string, dest string) error { + r, err := zip.OpenReader(src) + if err != nil { + return err + } + defer func() { + if err := r.Close(); err != nil { + panic(err) + } + }() + + // Closure to address file descriptors issue with all the deferred .Close() methods + extractAndWriteFile := func(f *zip.File) error { + rc, err := f.Open() + if err != nil { + return err + } + defer func() { + if err := rc.Close(); err != nil { + panic(err) + } + }() + + path := filepath.Join(dest, f.Name) + if !strings.HasPrefix(path, filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("%s: Illegal file path", path) + } + + if f.FileInfo().IsDir() { + if err = os.MkdirAll(path, f.Mode()); err != nil { + return err + } + } else { + if err = os.MkdirAll(filepath.Dir(path), f.Mode()); err != nil { + return err + } + f, err := os.OpenFile(filepath.Clean(path), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode()) + if err != nil { + return err + } + defer func() { + if err := f.Close(); err != nil { + panic(err) + } + }() + + _, err = io.Copy(f, rc) + if err != nil { + return err + } + } + return nil + } + + logger := logging.RequireLoggerFromContext(ctx) + for _, f := range r.File { + if err := extractAndWriteFile(f); err != nil { + return err + } + logger.WithFields(logging.Fields{"name": f.Name, "src": src}).Info(ctx, "Extracting file") + } + + logger.WithField("src", src).Info(ctx, "Extraction finished") + + return nil + } + + return unpack(zipPath, destPath, decompressor) +} + +// unpack unpacks a compressed file (tarball or zip file) to a temporary directory, +// renaming it to the desired location +// decompression is done using the decompressor closure, that should decompress a tarball or zip file +func unpack(srcPath string, destPath string, decompressor func(string, string) error) error { + // first extract the tar into a temporary dir + tmpDir := destPath + ".tmpdir" + err := os.MkdirAll(tmpDir, os.ModePerm) + if err != nil { + return argoerrs.InternalWrapError(err) + } + if decompressor != nil { + if err = decompressor(srcPath, tmpDir); err != nil { + return err + } + } + // next, decide how we wish to rename the file/dir + // to the destination path. + files, err := os.ReadDir(tmpDir) + if err != nil { + return argoerrs.InternalWrapError(err) + } + if len(files) == 1 { + // if the tar is comprised of single file or directory, + // rename that file to the desired location + filePath := path.Join(tmpDir, files[0].Name()) + err = os.Rename(filePath, destPath) + if err != nil { + return argoerrs.InternalWrapError(err) + } + err = os.Remove(tmpDir) + if err != nil { + return argoerrs.InternalWrapError(err) + } + } else { + // the tar extracted into multiple files. In this case, + // just rename the temp directory to the dest path + err = os.Rename(tmpDir, destPath) + if err != nil { + return argoerrs.InternalWrapError(err) + } + } + return nil +} + +func chmod(artPath string, mode int32, recurse bool) error { + err := os.Chmod(artPath, os.FileMode(mode)) + if err != nil { + return argoerrs.InternalWrapError(err) + } + + if recurse { + err = filepath.Walk(artPath, func(path string, f os.FileInfo, err error) error { + return os.Chmod(path, os.FileMode(mode)) + }) + if err != nil { + return argoerrs.InternalWrapError(err) + } + } + + return nil +} + +// Wait is the sidecar container logic which waits for the main container to complete. +// Also monitors for updates in the pod annotations which may change (e.g. terminate) +// Upon completion, kills any sidecars after it finishes. +func (we *WorkflowExecutor) Wait(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + containerNames := we.Template.GetMainContainerNames() + // only monitor progress if both tick durations are >0 + if we.annotationPatchTickDuration != 0 && we.readProgressFileTickDuration != 0 { + go we.monitorProgress(ctx, os.Getenv(common.EnvVarProgressFile)) + } else { + logger.WithField("annotationPatchTickDuration", we.annotationPatchTickDuration).WithField("readProgressFileTickDuration", we.readProgressFileTickDuration).Info(ctx, "monitoring progress disabled") + } + + go we.monitorDeadline(ctx, containerNames) + + err := retryutil.OnError(executorretry.ExecutorRetry(ctx), func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + return we.RuntimeExecutor.Wait(ctx, containerNames) + }) + + logger.WithError(err).Info(ctx, "Main container completed") + + if err != nil && err != context.Canceled { + return fmt.Errorf("failed to wait for main container to complete: %w", err) + } + return nil +} + +// monitorProgress monitors for self-reported progress in the progressFile and patches the pod annotations with the parsed progress. +// +// The function reads the last line of the `progressFile` every `readFileTickDuration`. +// If the line matches `N/M`, will set the progress annotation to the parsed progress value. +// Every `annotationPatchTickDuration` the pod is patched with the updated annotations. This way the controller +// gets notified of new self reported progress. +func (we *WorkflowExecutor) monitorProgress(ctx context.Context, progressFile string) { + logger := logging.RequireLoggerFromContext(ctx) + annotationPatchTicker := time.NewTicker(we.annotationPatchTickDuration) + defer annotationPatchTicker.Stop() + fileTicker := time.NewTicker(we.readProgressFileTickDuration) + defer fileTicker.Stop() + + lastLine := "" + progressFile = filepath.Clean(progressFile) + + for { + select { + case <-ctx.Done(): + logger.WithError(ctx.Err()).Info(ctx, "stopping progress monitor (context done)") + return + case <-annotationPatchTicker.C: + if err := we.reportResult(ctx, wfv1.NodeResult{Progress: we.progress}); err != nil { + logger.WithError(err).Info(ctx, "failed to report progress") + } else { + we.progress = "" + } + case <-fileTicker.C: + data, err := os.ReadFile(progressFile) + if err != nil { + if !errors.Is(err, fs.ErrNotExist) { + logger.WithError(err).WithField("file", progressFile).Info(ctx, "unable to watch file") + } + continue + } + lines := strings.Split(strings.TrimSpace(string(data)), "\n") + mostRecent := strings.TrimSpace(lines[len(lines)-1]) + + if mostRecent == "" || mostRecent == lastLine { + continue + } + lastLine = mostRecent + + if progress, ok := wfv1.ParseProgress(lastLine); ok { + logger.WithField("progress", progress).Info(ctx, "") + we.progress = progress + } else { + logger.WithField("line", lastLine).Info(ctx, "unable to parse progress") + } + } + } +} + +// monitorDeadline checks to see if we exceeded the deadline for the step and +// terminates the main container if we did +func (we *WorkflowExecutor) monitorDeadline(ctx context.Context, containerNames []string) { + deadlineExceeded := make(chan bool, 1) + if !we.Deadline.IsZero() { + t := time.AfterFunc(time.Until(we.Deadline), func() { + deadlineExceeded <- true + }) + defer t.Stop() + } + + var message string + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("containers", containerNames).Info(ctx, "Starting deadline monitor") + select { + case <-ctx.Done(): + logger.Info(ctx, "Deadline monitor stopped") + return + case <-deadlineExceeded: + message = "Step exceeded its deadline" + } + logger.Info(ctx, message) + util.WriteTerminateMessage(message) + + containerNames = slices.DeleteFunc(containerNames, func(containerName string) bool { + return common.IsArtifactPluginSidecar(containerName) + }) + we.killContainers(ctx, containerNames) +} + +func (we *WorkflowExecutor) killContainers(ctx context.Context, containerNames []string) { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("containerNames", containerNames).Info(ctx, "Killing containers") + terminationGracePeriodDuration := GetTerminationGracePeriodDuration() + if err := we.RuntimeExecutor.Kill(ctx, containerNames, terminationGracePeriodDuration); err != nil { + logger.WithField("containerNames", containerNames).WithError(err).Warn(ctx, "Failed to kill") + } +} + +func (we *WorkflowExecutor) Init() error { + if i, ok := we.RuntimeExecutor.(Initializer); ok { + return i.Init(we.Template) + } + return nil +} + +func (we *WorkflowExecutor) KillArtifactSidecars(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + pluginNamesEnv := os.Getenv(common.EnvVarArtifactPluginNames) + if pluginNamesEnv == "" { + logger.Info(ctx, "no artifact sidecars to kill") + return nil + } + artifactSidecars := strings.Split(pluginNamesEnv, ",") + logger.WithFields(logging.Fields{"numSidecars": len(artifactSidecars), "artifactSidecars": artifactSidecars}).Info(ctx, "killing artifact sidecars") + err := we.RuntimeExecutor.Kill(ctx, artifactSidecars, GetTerminationGracePeriodDuration()) + if err != nil { + logger.WithError(err).WithFields(logging.Fields{"artifactSidecars": artifactSidecars}).Error(ctx, "failed to kill artifact sidecars") + return err + } + logger.WithFields(logging.Fields{"artifactSidecars": artifactSidecars}).Info(ctx, "artifact sidecars killed") + return nil +} +``` + +## `workflow/executor/executor_test.go` (changed lines (4, 5, 6, 10, 11, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732)) + +```go +package executor + +import ( + "archive/tar" + "archive/zip" + "compress/gzip" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/fake" + "k8s.io/utils/ptr" + + wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + argofake "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo-workflows/v3/util/logging" + "github.com/argoproj/argo-workflows/v3/workflow/common" + "github.com/argoproj/argo-workflows/v3/workflow/executor/mocks" +) + +const ( + fakePodName = "fake-test-pod-1234567890" + fakeWorkflow = "my-wf" + fakeWorkflowUID = "my-wf-uid" + fakePodUID = "my-pod-uid" + fakeNodeID = "my-node-id" + fakeNamespace = "default" + fakeContainerName = "main" +) + +func TestWorkflowExecutor_LoadArtifacts(t *testing.T) { + tests := []struct { + name string + artifact wfv1.Artifact + error string + }{ + {"ErrNotSupplied", wfv1.Artifact{Name: "foo"}, "required artifact 'foo' not supplied"}, + {"ErrFailedToLoad", wfv1.Artifact{ + Name: "foo", + Path: "/tmp/foo.txt", + ArtifactLocation: wfv1.ArtifactLocation{ + S3: &wfv1.S3Artifact{ + Key: "my-key", + }, + }, + }, "failed to load artifact 'foo': template artifact location not set"}, + {"ErrNoPath", wfv1.Artifact{ + Name: "foo", + ArtifactLocation: wfv1.ArtifactLocation{ + S3: &wfv1.S3Artifact{ + S3Bucket: wfv1.S3Bucket{Endpoint: "my-endpoint", Bucket: "my-bucket"}, + Key: "my-key", + }, + }, + }, "Artifact 'foo' did not specify a path"}, + {"ErrDirTraversal", wfv1.Artifact{ + Name: "foo", + Path: "/tmp/../etc/passwd", + ArtifactLocation: wfv1.ArtifactLocation{ + S3: &wfv1.S3Artifact{ + S3Bucket: wfv1.S3Bucket{Endpoint: "my-endpoint", Bucket: "my-bucket"}, + Key: "my-key", + }, + }, + }, "Artifact 'foo' attempted to use a path containing '..'. Directory traversal is not permitted"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ctx := logging.TestContext(t.Context()) + we := WorkflowExecutor{ + Template: wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{test.artifact}, + }, + }, + } + err := we.loadArtifacts(ctx, "") + require.EqualError(t, err, test.error) + }) + } +} + +func TestSaveParameters(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + templateWithOutParam := wfv1.Template{ + Outputs: wfv1.Outputs{ + Parameters: []wfv1.Parameter{ + { + Name: "my-out", + ValueFrom: &wfv1.ValueFrom{ + Path: "/path", + }, + }, + }, + }, + } + we := WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + } + mockRuntimeExecutor.On("GetFileContents", fakeContainerName, "/path").Return("has a newline\n", nil) + + ctx := logging.TestContext(t.Context()) + err := we.SaveParameters(ctx) + require.NoError(t, err) + assert.Equal(t, "has a newline", we.Template.Outputs.Parameters[0].Value.String()) +} + +// TestIsBaseImagePath tests logic of isBaseImagePath which determines if a path is coming from a +// base image layer versus a shared volumeMount. +func TestIsBaseImagePath(t *testing.T) { + templateWithSameDir := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: "/samedir", + }, + }, + }, + Container: &corev1.Container{}, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: "/samedir", + }, + }, + }, + } + + we := WorkflowExecutor{ + Template: templateWithSameDir, + } + // 1. unrelated dir/file should be captured from base image layer + assert.True(t, we.isBaseImagePath("/foo")) + + // 2. when input and output directory is same, it should be captured from shared emptyDir + assert.False(t, we.isBaseImagePath("/samedir")) + + // 3. when output is a sub path of input dir, it should be captured from shared emptyDir + we.Template.Outputs.Artifacts[0].Path = "/samedir/inner" + assert.False(t, we.isBaseImagePath("/samedir/inner")) + + // 4. when output happens to overlap with input (in name only), it should be captured from base image layer + we.Template.Inputs.Artifacts[0].Path = "/hello.txt" + we.Template.Outputs.Artifacts[0].Path = "/hello.txt-COINCIDENCE" + assert.True(t, we.isBaseImagePath("/hello.txt-COINCIDENCE")) + + // 5. when output is under a user specified volumeMount, it should be captured from shared mount + we.Template.Inputs.Artifacts = nil + we.Template.Container.VolumeMounts = []corev1.VolumeMount{ + { + Name: "workdir", + MountPath: "/user-mount", + }, + } + we.Template.Outputs.Artifacts[0].Path = "/user-mount/some-path" + assert.False(t, we.isBaseImagePath("/user-mount")) + assert.False(t, we.isBaseImagePath("/user-mount/some-path")) + assert.False(t, we.isBaseImagePath("/user-mount/some-path/foo")) + assert.True(t, we.isBaseImagePath("/user-mount-coincidence")) +} + +func TestDefaultParameters(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + templateWithOutParam := wfv1.Template{ + Outputs: wfv1.Outputs{ + Parameters: []wfv1.Parameter{ + { + Name: "my-out", + ValueFrom: &wfv1.ValueFrom{ + Default: wfv1.AnyStringPtr("Default Value"), + Path: "/path", + }, + }, + }, + }, + } + we := WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + } + mockRuntimeExecutor.On("GetFileContents", fakeContainerName, "/path").Return("", fmt.Errorf("file not found")) + + ctx := logging.TestContext(t.Context()) + err := we.SaveParameters(ctx) + require.NoError(t, err) + assert.Equal(t, "Default Value", we.Template.Outputs.Parameters[0].Value.String()) +} + +func TestDefaultParametersEmptyString(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + templateWithOutParam := wfv1.Template{ + Outputs: wfv1.Outputs{ + Parameters: []wfv1.Parameter{ + { + Name: "my-out", + ValueFrom: &wfv1.ValueFrom{ + Default: wfv1.AnyStringPtr(""), + Path: "/path", + }, + }, + }, + }, + } + we := WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + } + mockRuntimeExecutor.On("GetFileContents", fakeContainerName, "/path").Return("", fmt.Errorf("file not found")) + + ctx := logging.TestContext(t.Context()) + err := we.SaveParameters(ctx) + require.NoError(t, err) + assert.Empty(t, we.Template.Outputs.Parameters[0].Value.String()) +} + +func TestIsTarball(t *testing.T) { + ctx := logging.TestContext(t.Context()) + tests := []struct { + path string + isTarball bool + expectErr bool + }{ + {"testdata/file", false, false}, + {"testdata/file.zip", false, false}, + {"testdata/file.tar", false, false}, + {"testdata/file.gz", false, false}, + {"testdata/file.tar.gz", true, false}, + {"testdata/file.tgz", true, false}, + {"testdata/not-found", false, true}, + } + + for _, test := range tests { + ok, err := isTarball(ctx, test.path) + if test.expectErr { + require.Error(t, err, test.path) + } else { + require.NoError(t, err, test.path) + } + assert.Equal(t, test.isTarball, ok, test.path) + } +} + +func TestUnzip(t *testing.T) { + ctx := logging.TestContext(t.Context()) + zipPath := "testdata/file.zip" + destPath := "testdata/unzippedFile" + + // test + err := unzip(ctx, zipPath, destPath) + require.NoError(t, err) + + // check unzipped file + fileInfo, err := os.Stat(destPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsRegular()) + + // cleanup + err = os.Remove(destPath) + require.NoError(t, err) +} + +func TestUntar(t *testing.T) { + tarPath := "testdata/file.tar.gz" + destPath := "testdata/untarredDir" + filePath := "testdata/untarredDir/file" + linkPath := "testdata/untarredDir/link" + emptyDirPath := "testdata/untarredDir/empty-dir" + + // test + err := untar(tarPath, destPath) + require.NoError(t, err) + + // check untarred contents + fileInfo, err := os.Stat(destPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsDir()) + fileInfo, err = os.Stat(filePath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsRegular()) + dirInfo, err := os.Stat(destPath) + require.NoError(t, err) + // check that the modification time of the file is retained + assert.True(t, fileInfo.ModTime().Before(dirInfo.ModTime())) + fileInfo, err = os.Stat(linkPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsRegular()) + fileInfo, err = os.Stat(emptyDirPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsDir()) + + // cleanup + err = os.Remove(linkPath) + require.NoError(t, err) + err = os.Remove(filePath) + require.NoError(t, err) + err = os.Remove(emptyDirPath) + require.NoError(t, err) + err = os.Remove(destPath) + require.NoError(t, err) +} + +func TestChmod(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("chmod does not work in windows") + } + + type perm struct { + dir string + file string + } + + tests := []struct { + mode int32 + recurse bool + permissions perm + }{ + { + 0o777, + false, + perm{ + "drwxrwxrwx", + "-rw-------", + }, + }, + { + 0o777, + true, + perm{ + "drwxrwxrwx", + "-rwxrwxrwx", + }, + }, + } + + for _, test := range tests { + // Setup directory and file for testing + tempDir := t.TempDir() + + tempFile, err := os.CreateTemp(tempDir, "chmod-file-test") + require.NoError(t, err) + + // Run chmod function + err = chmod(tempDir, test.mode, test.recurse) + require.NoError(t, err) + + // Check directory mode if set + dirPermission, err := os.Stat(tempDir) + require.NoError(t, err) + assert.Equal(t, dirPermission.Mode().String(), test.permissions.dir) + + // Check file mode mode if set + filePermission, err := os.Stat(tempFile.Name()) + require.NoError(t, err) + assert.Equal(t, filePermission.Mode().String(), test.permissions.file) + } +} + +func TestSaveArtifacts(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + mockTaskResultClient := argofake.NewSimpleClientset().ArgoprojV1alpha1().WorkflowTaskResults(fakeNamespace) + templateWithOutParam := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + }, + }, + }, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + Optional: true, + }, + }, + }, + } + templateOptionFalse := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + }, + }, + }, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + Optional: false, + }, + }, + }, + } + templateZipArchive := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + }, + }, + }, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + Optional: true, + Archive: &wfv1.ArchiveStrategy{ + Zip: &wfv1.ZipStrategy{}, + }, + }, + }, + }, + } + tests := []struct { + workflowExecutor WorkflowExecutor + expectError bool + }{ + { + workflowExecutor: WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + }, + expectError: false, + }, + { + workflowExecutor: WorkflowExecutor{ + PodName: fakePodName, + Template: templateOptionFalse, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + }, + expectError: true, + }, + { + workflowExecutor: WorkflowExecutor{ + PodName: fakePodName, + Template: templateZipArchive, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + }, + expectError: false, + }, + } + + for _, tt := range tests { + ctx := logging.TestContext(t.Context()) + _, err := tt.workflowExecutor.SaveArtifacts(ctx) + if err != nil { + assert.True(t, tt.expectError) + continue + } + assert.False(t, tt.expectError) + } +} + +func TestMonitorProgress(t *testing.T) { + ctx := logging.TestContext(t.Context()) + + annotationPackTickDuration := 5 * time.Millisecond + readProgressFileTickDuration := time.Millisecond + progressFile := "/tmp/progress" + + wfFake := argofake.NewSimpleClientset(&wfv1.WorkflowTaskSet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: fakeNamespace, + Name: fakeWorkflow, + }, + }) + taskResults := wfFake.ArgoprojV1alpha1().WorkflowTaskResults(fakeNamespace) + we := NewExecutor( + ctx, + nil, + taskResults, + nil, + fakePodName, + fakePodUID, + fakeWorkflow, + fakeWorkflowUID, + fakeNodeID, + fakeNamespace, + &mocks.ContainerRuntimeExecutor{}, + wfv1.Template{}, + false, + time.Now(), + annotationPackTickDuration, + readProgressFileTickDuration, + ) + + go we.monitorProgress(ctx, progressFile) + + err := os.WriteFile(progressFile, []byte("100/100\n"), os.ModePerm) + require.NoError(t, err) + + time.Sleep(time.Second) + + result, err := taskResults.Get(ctx, fakeNodeID, metav1.GetOptions{}) + require.NoError(t, err) + assert.Equal(t, fakeWorkflow, result.Labels[common.LabelKeyWorkflow]) + assert.Len(t, result.OwnerReferences, 1) + assert.Equal(t, wfv1.Progress("100/100"), result.Progress) +} + +func TestSaveLogs(t *testing.T) { + const artStorageError = "artifact storage is not configured; see the docs for setup instructions: https://argo-workflows.readthedocs.io/en/latest/configure-artifact-repository/" + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + mockRuntimeExecutor.On("GetOutputStream", mock.Anything, mock.AnythingOfType("string"), true).Return(io.NopCloser(strings.NewReader("hello world")), nil) + t.Run("Simple Pod node", func(t *testing.T) { + templateWithArchiveLogs := wfv1.Template{ + ArchiveLocation: &wfv1.ArtifactLocation{ + ArchiveLogs: ptr.To(true), + }, + } + we := WorkflowExecutor{ + Template: templateWithArchiveLogs, + RuntimeExecutor: &mockRuntimeExecutor, + } + + ctx := logging.TestContext(t.Context()) + logArtifacts := we.SaveLogs(ctx) + + require.EqualError(t, we.errors[0], artStorageError) + assert.Empty(t, logArtifacts) + }) +} + +func TestReportOutputs(t *testing.T) { + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + mockTaskResultClient := argofake.NewSimpleClientset().ArgoprojV1alpha1().WorkflowTaskResults(fakeNamespace) + t.Run("Simple report output", func(t *testing.T) { + artifacts := []wfv1.Artifact{ + { + Name: "samedir", + Path: "/samedir", + }, + } + templateWithArtifacts := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: artifacts, + }, + } + we := WorkflowExecutor{ + Template: templateWithArtifacts, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + } + + ctx := logging.TestContext(t.Context()) + err := we.ReportOutputs(ctx, artifacts) + + require.NoError(t, err) + assert.Empty(t, we.errors) + }) + +} + +func TestUntarMaliciousSymlink(t *testing.T) { + // Create a temporary directory for the test + tmpDir := t.TempDir() + + // Create a target directory outside the extraction root + outsideDir := filepath.Join(tmpDir, "outside") + err := os.Mkdir(outsideDir, 0755) + require.NoError(t, err) + + // Create a file in the outside directory to verify it's NOT overwritten initially + targetFile := filepath.Join(outsideDir, "pwned") + err = os.WriteFile(targetFile, []byte("safe"), 0644) + require.NoError(t, err) + + // Create the malicious tarball directly + tarPath := filepath.Join(tmpDir, "malicious.tar.gz") + f, err := os.Create(tarPath) + require.NoError(t, err) + gw := gzip.NewWriter(f) + tw := tar.NewWriter(gw) + + // 1. Create a symlink "link" -> absolute path of outsideDir + absOutside, err := filepath.Abs(outsideDir) + require.NoError(t, err) + + err = tw.WriteHeader(&tar.Header{ + Name: "link", + Typeflag: tar.TypeSymlink, + Linkname: absOutside, + Mode: 0777, + }) + require.NoError(t, err) + + // 2. Create a file "link/pwned" that writes through the symlink + fileContent := []byte("pwned") + err = tw.WriteHeader(&tar.Header{ + Name: "link/pwned", + Typeflag: tar.TypeReg, + Mode: 0644, + Size: int64(len(fileContent)), + }) + require.NoError(t, err) + _, err = tw.Write(fileContent) + require.NoError(t, err) + + require.NoError(t, tw.Close()) + require.NoError(t, gw.Close()) + require.NoError(t, f.Close()) + + // Debug: List tarball contents + cmd := exec.CommandContext(t.Context(), "tar", "-tvzf", tarPath) + out, err := cmd.CombinedOutput() + require.NoError(t, err) + if err == nil { + t.Logf("Tarball contents:\n%s", string(out)) + } + + // Destination directory for extraction + destDir := filepath.Join(tmpDir, "dest") + + // Perform untar + err = untar(tarPath, destDir) + // This should return an error because the symlink is outside the extraction root + require.Error(t, err) + + // Check if the file outside was overwritten + content, err := os.ReadFile(targetFile) + require.NoError(t, err) + + // If content is "pwned", the vulnerability is reproduced. + if string(content) == "pwned" { + t.Logf("Tar slip symlink vulnerability reproduced: File outside was overwritten with '%s'", string(content)) + } else { + t.Logf("Tar slip symlink vulnerability NOT reproduced: File content is '%s'", string(content)) + } + + // Assert that it IS "safe" (this should FAIL if vulnerable) + assert.Equal(t, "safe", string(content), "File outside should NOT be overwritten") +} + +func TestUnzipMaliciousSymlink(t *testing.T) { + // Create a temporary directory for the test + tmpDir := t.TempDir() + + // Create a target directory outside the extraction root + outsideDir := filepath.Join(tmpDir, "outside") + err := os.Mkdir(outsideDir, 0755) + require.NoError(t, err) + + // Create a file in the outside directory + targetFile := filepath.Join(outsideDir, "pwned") + err = os.WriteFile(targetFile, []byte("safe"), 0644) + require.NoError(t, err) + + // Create the malicious zip + zipPath := filepath.Join(tmpDir, "malicious.zip") + f, err := os.Create(zipPath) + require.NoError(t, err) + zw := zip.NewWriter(f) + + // 1. Create a symlink "link" -> "../outside" + header := &zip.FileHeader{ + Name: "link", + Method: zip.Store, + } + header.SetMode(0777 | os.ModeSymlink) + w, err := zw.CreateHeader(header) + require.NoError(t, err) + _, err = w.Write([]byte("../outside")) + require.NoError(t, err) + + // 2. Create a file "link/pwned" + w, err = zw.Create("link/pwned") + require.NoError(t, err) + _, err = w.Write([]byte("pwned")) + require.NoError(t, err) + + require.NoError(t, zw.Close()) + require.NoError(t, f.Close()) + + // Destination directory + destDir := filepath.Join(tmpDir, "dest") + + // Perform unzip + ctx := logging.TestContext(t.Context()) + // This should return an error because the symlink is outside the extraction root + err = unzip(ctx, zipPath, destDir) + require.Error(t, err) + + // Check if the file outside was overwritten + content, err := os.ReadFile(targetFile) + require.NoError(t, err) + + assert.Equal(t, "safe", string(content), "File outside should NOT be overwritten by unzip") +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..e8a5885272bf3bf261e9d84ba6467fb0236f2d10 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/pre_context.md @@ -0,0 +1,1948 @@ +# Patch-overlapping Go context before the fix + +## `workflow/executor/executor.go` (changed lines (1029, 1030, 1031, 1034, 1035, 1038, 1047)) + +```go +package executor + +import ( + "archive/tar" + "archive/zip" + "bufio" + "compress/gzip" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/fs" + "math" + "os" + "path" + "path/filepath" + "runtime/debug" + "slices" + "strconv" + "strings" + "time" + + "github.com/argoproj/argo-workflows/v3/util/logging" + + "github.com/argoproj/argo-workflows/v3/util/file" + + apiv1 "k8s.io/api/core/v1" + apierr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + retryutil "k8s.io/client-go/util/retry" + + argoerrs "github.com/argoproj/argo-workflows/v3/errors" + wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + argoprojv1 "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned/typed/workflow/v1alpha1" + "github.com/argoproj/argo-workflows/v3/util" + "github.com/argoproj/argo-workflows/v3/util/archive" + errorsutil "github.com/argoproj/argo-workflows/v3/util/errors" + "github.com/argoproj/argo-workflows/v3/util/retry" + waitutil "github.com/argoproj/argo-workflows/v3/util/wait" + "github.com/argoproj/argo-workflows/v3/workflow/artifacts" + artifactcommon "github.com/argoproj/argo-workflows/v3/workflow/artifacts/common" + "github.com/argoproj/argo-workflows/v3/workflow/common" + executorretry "github.com/argoproj/argo-workflows/v3/workflow/executor/retry" +) + +const ( + // This directory temporarily stores the tarballs of the artifacts before uploading + tempOutArtDir = "/tmp/argo/outputs/artifacts" +) + +// WorkflowExecutor is program which runs as the init/wait container +type WorkflowExecutor struct { + PodName string + podUID types.UID + workflow string + workflowUID types.UID + nodeID string + Template wfv1.Template + IncludeScriptOutput bool + Deadline time.Time + ClientSet kubernetes.Interface + taskResultClient argoprojv1.WorkflowTaskResultInterface + RESTClient rest.Interface + Namespace string + RuntimeExecutor ContainerRuntimeExecutor + + // memoized configmaps + memoizedConfigMaps map[string]string + // memoized secrets + memoizedSecrets map[string][]byte + // list of errors that occurred during execution. + // the first of these is used as the overall message of the node + errors []error + + // current progress which is synced every `annotationPatchTickDuration` to the pods annotations. + progress wfv1.Progress + + annotationPatchTickDuration time.Duration + readProgressFileTickDuration time.Duration + + // flag to indicate if the task result was created + taskResultCreated bool +} + +type Initializer interface { + Init(tmpl wfv1.Template) error +} + +// ContainerRuntimeExecutor is the interface for interacting with a container runtime +type ContainerRuntimeExecutor interface { + // GetFileContents returns the file contents of a file in a container as a string + GetFileContents(containerName string, sourcePath string) (string, error) + + // CopyFile copies a source file in a container to a local path + CopyFile(ctx context.Context, containerName, sourcePath, destPath string, compressionLevel int) error + + // GetOutputStream returns the entirety of the container output as a io.Reader + // Used to capture script results as an output parameter, and to archive container logs + GetOutputStream(ctx context.Context, containerName string, combinedOutput bool) (io.ReadCloser, error) + + // Wait waits for the container to complete. + Wait(ctx context.Context, containerNames []string) error + + // Kill a list of containers first with a SIGTERM then with a SIGKILL after a grace period + Kill(ctx context.Context, containerNames []string, terminationGracePeriodDuration time.Duration) error +} + +// NewExecutor instantiates a new workflow executor +func NewExecutor( + ctx context.Context, + clientset kubernetes.Interface, + taskResultClient argoprojv1.WorkflowTaskResultInterface, + restClient rest.Interface, + podName string, + podUID types.UID, + workflow string, + workflowUID types.UID, + nodeID, namespace string, + cre ContainerRuntimeExecutor, + template wfv1.Template, + includeScriptOutput bool, + deadline time.Time, + annotationPatchTickDuration, readProgressFileTickDuration time.Duration, +) WorkflowExecutor { + retry := executorretry.ExecutorRetry(ctx) + logging.RequireLoggerFromContext(ctx).WithFields(logging.Fields{ + "Steps": retry.Steps, + "Duration": retry.Duration, + "Factor": retry.Factor, + "Jitter": retry.Jitter, + }).Info(ctx, "Using executor retry strategy") + return WorkflowExecutor{ + PodName: podName, + podUID: podUID, + workflow: workflow, + workflowUID: workflowUID, + nodeID: nodeID, + ClientSet: clientset, + taskResultClient: taskResultClient, + RESTClient: restClient, + Namespace: namespace, + RuntimeExecutor: cre, + Template: template, + IncludeScriptOutput: includeScriptOutput, + Deadline: deadline, + memoizedConfigMaps: map[string]string{}, + memoizedSecrets: map[string][]byte{}, + errors: []error{}, + annotationPatchTickDuration: annotationPatchTickDuration, + readProgressFileTickDuration: readProgressFileTickDuration, + } +} + +// HandleError is a helper to annotate the pod with the error message upon a unexpected executor panic or error +func (we *WorkflowExecutor) HandleError(ctx context.Context) { + if r := recover(); r != nil { + util.WriteTerminateMessage(fmt.Sprintf("%v", r)) + logging.RequireLoggerFromContext(ctx).WithFatal().WithFields(logging.Fields{ + "error": r, + "stack": debug.Stack(), + }).Error(ctx, "executor panic") + } else { + if len(we.errors) > 0 { + util.WriteTerminateMessage(we.errors[0].Error()) + } + } +} + +func (we *WorkflowExecutor) LoadArtifactsWithoutPlugins(ctx context.Context) error { + return we.loadArtifacts(ctx, "") +} + +func (we *WorkflowExecutor) LoadArtifactsFromPlugin(ctx context.Context, pluginName wfv1.ArtifactPluginName) error { + return we.loadArtifacts(ctx, pluginName) +} + +// loadArtifacts loads artifacts from location to a container path +// pluginName is the name of the plugin to load artifacts from, only one plugin can be used at a time +func (we *WorkflowExecutor) loadArtifacts(ctx context.Context, pluginName wfv1.ArtifactPluginName) error { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithFields(logging.Fields{"pluginName": pluginName}).Info(ctx, "Start loading input artifacts...") + for _, art := range we.Template.Inputs.Artifacts { + logger.WithField("name", art.Name).Info(ctx, "Downloading artifact") + + if !art.HasLocationOrKey() { + if art.Optional { + logger.WithField("name", art.Name).Warn(ctx, "Ignoring optional artifact which was not supplied") + continue + } else { + return argoerrs.Errorf(argoerrs.CodeNotFound, "required artifact '%s' not supplied", art.Name) + } + } + err := art.CleanPath() + if err != nil { + return err + } + driverArt, err := we.newDriverArt(&art) + if err != nil { + return fmt.Errorf("failed to load artifact '%s': %w", art.Name, err) + } + switch pluginName { + // If no plugin is specified only load non-plugin artifacts + case "": + if driverArt.Plugin != nil { + logger.Info(ctx, "Skipping artifact that is from a plugin") + continue + } + // If a plugin is specified only load artifacts from that plugin + default: + if driverArt.Plugin == nil || driverArt.Plugin.Name != pluginName { + logger.WithFields(logging.Fields{"name": driverArt.Name, "plugin": driverArt.Plugin}).Info(ctx, "Skipping artifact that is not from the specified plugin") + continue + } + } + + artDriver, err := we.InitDriver(ctx, driverArt) + if err != nil { + return err + } + // Determine the file path of where to load the artifact + var artPath string + mnt := common.FindOverlappingVolume(&we.Template, art.Path) + if mnt == nil { + artPath = path.Join(common.ExecutorArtifactBaseDir, art.Name) + } else { + // If we get here, it means the input artifact path overlaps with a user-specified + // volumeMount in the container. Because we also implement input artifacts as volume + // mounts, we need to load the artifact into the user specified volume mount, + // as opposed to the `input-artifacts` volume that is an implementation detail + // unbeknownst to the user. + logger.WithFields(logging.Fields{"path": art.Path, "mountPath": mnt.MountPath}).Info(ctx, "Specified artifact path overlaps with volume mount, extracting to volume mount") + artPath = path.Join(common.ExecutorMainFilesystemDir, art.Path) + } + + // The artifact is downloaded to a temporary location, after which we determine if + // the file is a tarball or not. If it is, it is first extracted then renamed to + // the desired location. If not, it is simply renamed to the location. + tempArtPath := artPath + ".tmp" + // Ensure parent directory exist, create if missing + tempArtDir := filepath.Dir(tempArtPath) + if err := os.MkdirAll(tempArtDir, 0o700); err != nil { + return fmt.Errorf("failed to create artifact temporary parent directory %s: %w", tempArtDir, err) + } + err = artDriver.Load(ctx, driverArt, tempArtPath) + if err != nil { + if art.Optional && argoerrs.IsCode(argoerrs.CodeNotFound, err) { + logger.WithField("name", art.Name).Info(ctx, "Skipping optional input artifact that was not found") + continue + } + return fmt.Errorf("artifact %s failed to load: %w", art.Name, err) + } + + isTar := false + isZip := false + if art.GetArchive().None != nil { + // explicitly not a tar + isTar = false + isZip = false + } else if art.GetArchive().Tar != nil { + // explicitly a tar + isTar = true + } else if art.GetArchive().Zip != nil { + // explicitly a zip + isZip = true + } else { + // auto-detect if tarball + // (don't try to autodetect zip files for backwards compatibility) + isTar, err = isTarball(ctx, tempArtPath) + if err != nil { + return err + } + } + + if isTar { + err = untar(tempArtPath, artPath) + _ = os.Remove(tempArtPath) + } else if isZip { + err = unzip(ctx, tempArtPath, artPath) + _ = os.Remove(tempArtPath) + } else { + err = os.Rename(tempArtPath, artPath) + } + if err != nil { + return err + } + + logger.WithField("path", artPath).Info(ctx, "Successfully download file") + if art.Mode != nil { + err = chmod(artPath, *art.Mode, art.RecurseMode) + if err != nil { + return err + } + } else if driverArt.Plugin != nil { + // For plugin artifacts without explicit mode, ensure the file is writable + // by setting mode to 0666 so the main container can read/write it + err = chmod(artPath, 0666, art.RecurseMode) + if err != nil { + logger.WithError(err).Error(ctx, "Failed to chmod plugin artifact") + return err + } + } + } + return nil +} + +// StageFiles will create any files required by script/resource templates +func (we *WorkflowExecutor) StageFiles(ctx context.Context) error { + var filePath string + var body []byte + logger := logging.RequireLoggerFromContext(ctx) + mode := os.FileMode(0o644) + switch we.Template.GetType() { + case wfv1.TemplateTypeScript: + logger.WithField("path", common.ExecutorScriptSourcePath).Info(ctx, "Loading script source") + filePath = common.ExecutorScriptSourcePath + body = []byte(we.Template.Script.Source) + mode = os.FileMode(0o755) + case wfv1.TemplateTypeResource: + if we.Template.Resource.ManifestFrom != nil && we.Template.Resource.ManifestFrom.Artifact != nil { + logger.WithField("name", we.Template.Resource.ManifestFrom.Artifact.Name).Info(ctx, "manifest already staged") + return nil + } + logger.WithField("path", common.ExecutorResourceManifestPath).Info(ctx, "Loading manifest") + filePath = common.ExecutorResourceManifestPath + body = []byte(we.Template.Resource.Manifest) + default: + return nil + } + err := os.WriteFile(filePath, body, mode) + if err != nil { + return argoerrs.InternalWrapError(err) + } + return nil +} + +// SaveArtifacts uploads artifacts to the archive location +func (we *WorkflowExecutor) SaveArtifacts(ctx context.Context) (wfv1.Artifacts, error) { + logger := logging.RequireLoggerFromContext(ctx) + artifacts := wfv1.Artifacts{} + if len(we.Template.Outputs.Artifacts) == 0 { + logger.Info(ctx, "No output artifacts") + return artifacts, nil + } + + logger.Info(ctx, "Saving output artifacts") + err := os.MkdirAll(tempOutArtDir, os.ModePerm) + if err != nil { + return artifacts, argoerrs.InternalWrapError(err) + } + + aggregateError := "" + for _, art := range we.Template.Outputs.Artifacts { + saved, err := we.saveArtifact(ctx, common.MainContainerName, &art) + if err != nil { + aggregateError += err.Error() + "; " + } + if saved { + artifacts = append(artifacts, art) + } + } + if aggregateError == "" { + return artifacts, nil + } else { + return artifacts, errors.New(aggregateError) + } +} + +// save artifact +// return whether artifact was in fact saved, and if there was an error +func (we *WorkflowExecutor) saveArtifact(ctx context.Context, containerName string, art *wfv1.Artifact) (bool, error) { + logger := logging.RequireLoggerFromContext(ctx) + // Determine the file path of where to find the artifact + err := art.CleanPath() + if err != nil { + return false, err + } + fileName, localArtPath, err := we.stageArchiveFile(ctx, containerName, art) + if err != nil { + if art.Optional && argoerrs.IsCode(argoerrs.CodeNotFound, err) { + logger.WithField("name", art.Name).WithField("path", art.Path).WithError(err).Warn(ctx, "Ignoring optional artifact which does not exist in path") + return false, nil + } + return false, err + } + fi, err := os.Stat(localArtPath) + if err != nil { + return false, err + } + size := fi.Size() + if size == 0 { + logger.WithField("path", localArtPath).Warn(ctx, "The file is empty. It may not be uploaded successfully depending on the artifact driver") + } + err = we.saveArtifactFromFile(ctx, art, fileName, localArtPath) + return err == nil, err +} + +// fileBase is probably path.Base(filePath), but can be something else +func (we *WorkflowExecutor) saveArtifactFromFile(ctx context.Context, art *wfv1.Artifact, fileName, localArtPath string) error { + if !art.HasKey() { + key, err := we.Template.ArchiveLocation.GetKey() + if err != nil { + return err + } + artLocation, err := we.Template.ArchiveLocation.Get() + if err != nil { + return err + } + if err = art.SetType(artLocation); err != nil { + return err + } + if err := art.SetKey(path.Join(key, fileName)); err != nil { + return err + } + } + driverArt, err := we.newDriverArt(art) + if err != nil { + return err + } + artDriver, err := we.InitDriver(ctx, driverArt) + if err != nil { + return err + } + err = artDriver.Save(ctx, localArtPath, driverArt) + if err != nil { + return err + } + we.maybeDeleteLocalArtPath(ctx, localArtPath) + logging.RequireLoggerFromContext(ctx).WithField("path", localArtPath).Info(ctx, "Successfully saved file") + return nil +} + +func (we *WorkflowExecutor) maybeDeleteLocalArtPath(ctx context.Context, localArtPath string) { + if os.Getenv("REMOVE_LOCAL_ART_PATH") == "true" { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("localArtPath", localArtPath).Info(ctx, "deleting local artifact") + // remove is best effort (the container will go away anyways). + // we just want reduce peak space usage + err := os.Remove(localArtPath) + if err != nil { + logger.WithField("path", localArtPath).WithError(err).Warn(ctx, "Failed to remove") + } + } else { + logging.RequireLoggerFromContext(ctx).WithField("localArtPath", localArtPath).Info(ctx, "not deleting local artifact") + } +} + +// stageArchiveFile stages a path in a container for archiving from the wait sidecar. +// Returns a filename and a local path for the upload. +// The filename is incorporated into the final path when uploading it to the artifact repo. +// The local path is the final staging location of the file (or directory) which we will pass +// to the SaveArtifacts call and may be a directory or file. +func (we *WorkflowExecutor) stageArchiveFile(ctx context.Context, containerName string, art *wfv1.Artifact) (string, string, error) { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("name", art.Name).Info(ctx, "Staging artifact") + strategy := art.Archive + if strategy == nil { + // If no strategy is specified, default to the tar strategy + strategy = &wfv1.ArchiveStrategy{ + Tar: &wfv1.TarStrategy{}, + } + } + compressionLevel := gzip.NoCompression + if strategy.Tar != nil { + if l := strategy.Tar.CompressionLevel; l != nil { + compressionLevel = int(*l) + } else { + compressionLevel = gzip.DefaultCompression + } + } + + if !we.isBaseImagePath(art.Path) { + // If we get here, we are uploading an artifact from a mirrored volume mount which the wait + // sidecar has direct access to. We can upload directly from the shared volume mount, + // instead of copying it from the container. + mountedArtPath := filepath.Join(common.ExecutorMainFilesystemDir, art.Path) + logger.WithFields(logging.Fields{"path": art.Path, "mountedArtPath": mountedArtPath}).Info(ctx, "Staging from mirrored volume mount") + if strategy.None != nil { + fileName := filepath.Base(art.Path) + logger.WithField("fileName", fileName).Info(ctx, "No compression strategy needed, staging skipped") + if !file.Exists(mountedArtPath) { + return "", "", argoerrs.Errorf(argoerrs.CodeNotFound, "%s no such file or directory", art.Path) + } + return fileName, mountedArtPath, nil + } + if strategy.Zip != nil { + fileName := fmt.Sprintf("%s.zip", art.Name) + localArtPath := filepath.Join(tempOutArtDir, fileName) + f, err := os.Create(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + zw := zip.NewWriter(f) + defer zw.Close() + err = archive.ZipToWriter(ctx, mountedArtPath, zw) + if err != nil { + return "", "", err + } + logger.WithFields(logging.Fields{"path": art.Path, "mountedArtPath": mountedArtPath}).Info(ctx, "Successfully staged from mirrored volume mount") + return fileName, localArtPath, nil + } + fileName := fmt.Sprintf("%s.tgz", art.Name) + localArtPath := filepath.Join(tempOutArtDir, fileName) + f, err := os.Create(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + w := bufio.NewWriter(f) + err = archive.TarGzToWriter(ctx, mountedArtPath, compressionLevel, w) + if err != nil { + return "", "", err + } + logger.WithFields(logging.Fields{"path": art.Path, "mountedArtPath": mountedArtPath}).Info(ctx, "Successfully staged from mirrored volume mount") + return fileName, localArtPath, nil + } + + fileName := fmt.Sprintf("%s.tgz", art.Name) + localArtPath := filepath.Join(tempOutArtDir, fileName) + logger.WithFields(logging.Fields{"path": art.Path, "localArtPath": localArtPath}).Info(ctx, "Copying from container base image layer") + + err := we.RuntimeExecutor.CopyFile(ctx, containerName, art.Path, localArtPath, compressionLevel) + if err != nil { + return "", "", err + } + if strategy.Tar != nil { + // NOTE we already tar gzip the file in the executor. So this is a noop. + return fileName, localArtPath, nil + } + // localArtPath now points to a .tgz file, and the archive strategy is *not* tar. We need to untar it + logger.WithField("path", localArtPath).Info(ctx, "Untaring archive before upload") + unarchivedArtPath := path.Join(filepath.Dir(localArtPath), art.Name) + err = untar(localArtPath, unarchivedArtPath) + if err != nil { + return "", "", err + } + // Delete the tarball + err = os.Remove(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + isDir, err := file.IsDirectory(unarchivedArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + fileName = filepath.Base(art.Path) + if isDir { + localArtPath = unarchivedArtPath + } else { + // If we are uploading a single file, we need to preserve original filename so that + // 1. minio client can infer its mime-type, based on file extension + // 2. the original filename is incorporated into the final path + localArtPath = path.Join(tempOutArtDir, fileName) + err = os.Rename(unarchivedArtPath, localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + } + // In the future, if we were to support other compression formats (e.g. bzip2) or options + // the logic would go here, and compression would be moved out of the executors + if strategy.Zip != nil { + fileName = fmt.Sprintf("%s.zip", art.Name) + localArtPath = filepath.Join(tempOutArtDir, fileName) + f, err := os.Create(localArtPath) + if err != nil { + return "", "", argoerrs.InternalWrapError(err) + } + zw := zip.NewWriter(f) + defer zw.Close() + err = archive.ZipToWriter(ctx, unarchivedArtPath, zw) + if err != nil { + return "", "", err + } + logger.WithFields(logging.Fields{"unarchivedArtPath": unarchivedArtPath, "localArtPath": localArtPath}).Info(ctx, "Successfully zipped") + return fileName, localArtPath, nil + } + return fileName, localArtPath, nil +} + +// isBaseImagePath checks if the given artifact path resides in the base image layer of the container +// versus a shared volume mount between the wait and main container +func (we *WorkflowExecutor) isBaseImagePath(path string) bool { + // first check if path overlaps with a user-specified volumeMount + if common.FindOverlappingVolume(&we.Template, path) != nil { + return false + } + // next check if path overlaps with a shared input-artifact emptyDir mounted by argo + for _, inArt := range we.Template.Inputs.Artifacts { + if path == inArt.Path { + // The input artifact may have been optional and not supplied. If this is the case, the file won't exist on + // the input artifact volume. Since this function was called, we know that we want to use this path as an + // output artifact, so we should look for it in the base image path. + if inArt.Optional && !inArt.HasLocationOrKey() { + return true + } + return false + } + if strings.HasPrefix(path, inArt.Path+"/") { + return false + } + } + return true +} + +// SaveParameters will save the content in the specified file path as output parameter value +func (we *WorkflowExecutor) SaveParameters(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + if len(we.Template.Outputs.Parameters) == 0 { + logger.Info(ctx, "No output parameters") + return nil + } + logger.Info(ctx, "Saving output parameters") + for i, param := range we.Template.Outputs.Parameters { + logger.WithField("name", param.Name).Info(ctx, "Saving path output parameter") + // Determine the file path of where to find the parameter + if param.ValueFrom == nil || param.ValueFrom.Path == "" { + continue + } + + var output *wfv1.AnyString + if we.isBaseImagePath(param.ValueFrom.Path) { + logger.WithField("path", param.ValueFrom.Path).Info(ctx, "Copying from base image layer") + fileContents, err := we.RuntimeExecutor.GetFileContents(common.MainContainerName, param.ValueFrom.Path) + if err != nil { + // We have a default value to use instead of returning an error + if param.ValueFrom.Default != nil { + output = param.ValueFrom.Default + } else { + return err + } + } else { + output = wfv1.AnyStringPtr(fileContents) + } + } else { + logger.WithField("path", param.ValueFrom.Path).Info(ctx, "Copying from volume mount") + mountedPath := filepath.Join(common.ExecutorMainFilesystemDir, param.ValueFrom.Path) + data, err := os.ReadFile(filepath.Clean(mountedPath)) + if err != nil { + // We have a default value to use instead of returning an error + if param.ValueFrom.Default != nil { + output = param.ValueFrom.Default + } else { + return err + } + } else { + output = wfv1.AnyStringPtr(string(data)) + } + } + + // Trims off a single newline for user convenience + output = wfv1.AnyStringPtr(strings.TrimSuffix(output.String(), "\n")) + we.Template.Outputs.Parameters[i].Value = output + logger.WithField("name", param.Name).Info(ctx, "Successfully saved output parameter") + } + return nil +} + +func (we *WorkflowExecutor) SaveLogs(ctx context.Context) []wfv1.Artifact { + var logArtifacts []wfv1.Artifact + tempLogsDir := "/tmp/argo/outputs/logs" + + if we.Template.SaveLogsAsArtifact() { + err := os.MkdirAll(tempLogsDir, os.ModePerm) + if err != nil { + we.AddError(ctx, argoerrs.InternalWrapError(err)) + } + + containerNames := we.Template.GetMainContainerNames() + logArtifacts = make([]wfv1.Artifact, 0) + + for _, containerName := range containerNames { + // Saving logs + art, err := we.saveContainerLogs(ctx, tempLogsDir, containerName) + if err != nil { + we.AddError(ctx, err) + } else { + logArtifacts = append(logArtifacts, *art) + } + } + } + + return logArtifacts +} + +// saveContainerLogs saves a single container's log into a file +func (we *WorkflowExecutor) saveContainerLogs(ctx context.Context, tempLogsDir, containerName string) (*wfv1.Artifact, error) { + fileName := containerName + ".log" + filePath := path.Join(tempLogsDir, fileName) + err := we.saveLogToFile(ctx, containerName, filePath) + if err != nil { + return nil, err + } + + art := &wfv1.Artifact{Name: containerName + "-logs"} + err = we.saveArtifactFromFile(ctx, art, fileName, filePath) + if err != nil { + return nil, err + } + + return art, nil +} + +// GetSecret will retrieve the Secrets from VolumeMount +func (we *WorkflowExecutor) GetSecret(ctx context.Context, accessKeyName string, accessKey string) (string, error) { + file, err := os.ReadFile(filepath.Clean(filepath.Join(common.SecretVolMountPath, accessKeyName, accessKey))) + if err != nil { + return "", err + } + return string(file), nil +} + +// saveLogToFile saves the entire log output of a container to a local file +func (we *WorkflowExecutor) saveLogToFile(ctx context.Context, containerName, path string) error { + outFile, err := os.Create(path) + if err != nil { + return argoerrs.InternalWrapError(err) + } + defer func() { _ = outFile.Close() }() + reader, err := we.RuntimeExecutor.GetOutputStream(ctx, containerName, true) + if err != nil { + return err + } + defer func() { _ = reader.Close() }() + _, err = io.Copy(outFile, reader) + if err != nil { + return argoerrs.InternalWrapError(err) + } + return nil +} + +func (we *WorkflowExecutor) newDriverArt(art *wfv1.Artifact) (*wfv1.Artifact, error) { + driverArt := art.DeepCopy() + err := driverArt.Relocate(we.Template.ArchiveLocation) + return driverArt, err +} + +// InitDriver initializes an instance of an artifact driver +func (we *WorkflowExecutor) InitDriver(ctx context.Context, art *wfv1.Artifact) (artifactcommon.ArtifactDriver, error) { + driver, err := artifacts.NewDriver(ctx, art, we) + if err == artifacts.ErrUnsupportedDriver { + return nil, argoerrs.Errorf(argoerrs.CodeBadRequest, "Unsupported artifact driver for %s", art.Name) + } + return driver, err +} + +// GetConfigMapKey retrieves a configmap value and memoizes the result +func (we *WorkflowExecutor) GetConfigMapKey(ctx context.Context, name, key string) (string, error) { + namespace := we.Namespace + cachedKey := fmt.Sprintf("%s/%s/%s", namespace, name, key) + if val, ok := we.memoizedConfigMaps[cachedKey]; ok { + return val, nil + } + configmapsIf := we.ClientSet.CoreV1().ConfigMaps(namespace) + var configmap *apiv1.ConfigMap + err := waitutil.Backoff(retry.DefaultRetry(ctx), func() (bool, error) { + var err error + configmap, err = configmapsIf.Get(ctx, name, metav1.GetOptions{}) + return !errorsutil.IsTransientErr(ctx, err), err + }) + if err != nil { + return "", argoerrs.InternalWrapError(err) + } + // memoize all keys in the configmap since it's highly likely we will need to get a + // subsequent key in the configmap (e.g. username + password) and we can save an API call + for k, v := range configmap.Data { + we.memoizedConfigMaps[fmt.Sprintf("%s/%s/%s", namespace, name, k)] = v + } + val, ok := we.memoizedConfigMaps[cachedKey] + if !ok { + return "", argoerrs.Errorf(argoerrs.CodeBadRequest, "configmap '%s' does not have the key '%s'", name, key) + } + return val, nil +} + +// GetSecrets retrieves a secret value and memoizes the result +func (we *WorkflowExecutor) GetSecrets(ctx context.Context, namespace, name, key string) ([]byte, error) { + cachedKey := fmt.Sprintf("%s/%s/%s", namespace, name, key) + if val, ok := we.memoizedSecrets[cachedKey]; ok { + return val, nil + } + secretsIf := we.ClientSet.CoreV1().Secrets(namespace) + var secret *apiv1.Secret + err := waitutil.Backoff(retry.DefaultRetry(ctx), func() (bool, error) { + var err error + secret, err = secretsIf.Get(ctx, name, metav1.GetOptions{}) + return !errorsutil.IsTransientErr(ctx, err), err + }) + if err != nil { + return []byte{}, argoerrs.InternalWrapError(err) + } + // memoize all keys in the secret since it's highly likely we will need to get a + // subsequent key in the secret (e.g. username + password) and we can save an API call + for k, v := range secret.Data { + we.memoizedSecrets[fmt.Sprintf("%s/%s/%s", namespace, name, k)] = v + } + val, ok := we.memoizedSecrets[cachedKey] + if !ok { + return []byte{}, argoerrs.Errorf(argoerrs.CodeBadRequest, "secret '%s' does not have the key '%s'", name, key) + } + return val, nil +} + +// GetTerminationGracePeriodDuration returns the terminationGracePeriodSeconds of podSpec in Time.Duration format +func GetTerminationGracePeriodDuration() time.Duration { + x, _ := strconv.ParseInt(os.Getenv(common.EnvVarTerminationGracePeriodSeconds), 10, 64) + if x > 0 { + return time.Duration(x) * time.Second + } + return 30 * time.Second +} + +// CaptureScriptResult will add the stdout of a script template as output result +func (we *WorkflowExecutor) CaptureScriptResult(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + if !we.IncludeScriptOutput { + logger.Info(ctx, "No Script output reference in workflow. Capturing script output ignored") + return nil + } + if !we.Template.HasOutput() { + logger.Info(ctx, "Template type is neither of Script, Container, or Pod. Capturing script output ignored") + return nil + } + logger.Info(ctx, "Capturing script output") + reader, err := we.RuntimeExecutor.GetOutputStream(ctx, common.MainContainerName, false) + if err != nil { + return err + } + defer func() { _ = reader.Close() }() + bytes, err := io.ReadAll(reader) + if err != nil { + return argoerrs.InternalWrapError(err) + } + out := string(bytes) + // Trims off a single newline for user convenience + outputLen := len(out) + if outputLen > 0 && out[outputLen-1] == '\n' { + out = out[0 : outputLen-1] + } + + const maxAnnotationSize int = 256 * (1 << 10) // 256 kB + // A character in a string is a byte + if len(out) > maxAnnotationSize { + logger.Warn(ctx, "Output is larger than the maximum allowed size of 256 kB, only the last 256 kB were saved") + out = out[len(out)-maxAnnotationSize:] + } + + we.Template.Outputs.Result = &out + return nil +} + +// FinalizeOutput adds a label or annotation to denote that outputs have completed reporting. +func (we *WorkflowExecutor) FinalizeOutput(ctx context.Context) { + logger := logging.RequireLoggerFromContext(ctx) + var count uint64 + err := retryutil.OnError(wait.Backoff{ + Duration: time.Second, + Factor: 2, + Jitter: 0.1, + Steps: math.MaxInt32, // effectively infinite retries + Cap: 30 * time.Second, + }, func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + err := we.patchTaskResultLabels(ctx, map[string]string{ + common.LabelKeyReportOutputsCompleted: "true", + }) + if apierr.IsForbidden(err) || apierr.IsNotFound(err) { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/") + } else if err != nil && count%20 == 0 { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result") + } + count++ + return err + }) + if err != nil { + we.AddError(ctx, err) + } +} + +func (we *WorkflowExecutor) InitializeOutput(ctx context.Context) { + logger := logging.RequireLoggerFromContext(ctx) + var count uint64 + err := retryutil.OnError(wait.Backoff{ + Duration: time.Second, + Factor: 2, + Jitter: 0.1, + Steps: math.MaxInt32, // effectively infinite retries + Cap: 30 * time.Second, + }, func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + err := we.upsertTaskResult(ctx, wfv1.NodeResult{}) + if apierr.IsForbidden(err) { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/") + } else if err != nil && count%20 == 0 { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result") + } + count++ + return err + }) + if err != nil { + we.AddError(ctx, err) + } +} + +// ReportOutputs updates the WorkflowTaskResult (or falls back to annotate the Pod) +func (we *WorkflowExecutor) ReportOutputs(ctx context.Context, artifacts []wfv1.Artifact) error { + outputs := we.Template.Outputs.DeepCopy() + outputs.Artifacts = artifacts + return we.reportResult(ctx, wfv1.NodeResult{Outputs: outputs}) +} + +// ReportOutputsLogs updates the WorkflowTaskResult log fields +func (we *WorkflowExecutor) ReportOutputsLogs(ctx context.Context) error { + var outputs wfv1.Outputs + artifacts := wfv1.Artifacts{} + logArtifacts := we.SaveLogs(ctx) + artifacts = append(artifacts, logArtifacts...) + outputs.Artifacts = artifacts + return we.reportResult(ctx, wfv1.NodeResult{Outputs: &outputs}) +} + +func (we *WorkflowExecutor) reportResult(ctx context.Context, result wfv1.NodeResult) error { + var count uint64 // used to avoid spamming with these messages + logger := logging.RequireLoggerFromContext(ctx) + return retryutil.OnError(wait.Backoff{ + Duration: time.Second, + Factor: 2.0, + Jitter: 0.2, + Steps: math.MaxInt32, // effectively infinite retries + Cap: 30 * time.Second, + }, func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + err := we.upsertTaskResult(ctx, result) + if apierr.IsForbidden(err) { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result, see https://argo-workflows.readthedocs.io/en/latest/workflow-rbac/") + } else if err != nil && count%20 == 0 { + logger.WithError(err).WithField("attempt", count).Warn(ctx, "failed to patch task result") + } + count++ + return err + }) +} + +// AddError adds an error to the list of encountered errors during execution +func (we *WorkflowExecutor) AddError(ctx context.Context, err error) { + logging.RequireLoggerFromContext(ctx).WithError(err).Error(ctx, "executor error") + we.errors = append(we.errors, err) +} + +// HasError return the first error if exist +func (we *WorkflowExecutor) HasError() error { + if len(we.errors) > 0 { + return we.errors[0] + } + return nil +} + +// AddAnnotation adds an annotation to the workflow pod +func (we *WorkflowExecutor) AddAnnotation(ctx context.Context, key, value string) error { + data, err := json.Marshal(map[string]interface{}{"metadata": metav1.ObjectMeta{ + Annotations: map[string]string{ + key: value, + }, + }}) + if err != nil { + return err + } + _, err = we.ClientSet.CoreV1().Pods(we.Namespace).Patch(ctx, we.PodName, types.MergePatchType, data, metav1.PatchOptions{}) + return err +} + +// isTarball returns whether or not the file is a tarball +func isTarball(ctx context.Context, filePath string) (bool, error) { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("path", filePath).Info(ctx, "Detecting if file is a tarball") + f, err := os.Open(filepath.Clean(filePath)) + if err != nil { + return false, err + } + defer func() { + if err := f.Close(); err != nil { + logger.WithFatal().WithField("path", filePath).WithError(err).Error(ctx, "Error closing file") + } + }() + gzr, err := gzip.NewReader(f) + if err != nil { + return false, nil + } + defer gzr.Close() + tarr := tar.NewReader(gzr) + _, err = tarr.Next() + return err == nil, nil +} + +// untar extracts a tarball to a temporary directory, +// renaming it to the desired location +func untar(tarPath string, destPath string) error { + decompressor := func(src string, dest string) error { + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + gzr, err := file.GetGzipReader(f) + if err != nil { + return err + } + defer gzr.Close() + tr := tar.NewReader(gzr) + for { + header, err := tr.Next() + switch { + case err == io.EOF: + return nil + case err != nil: + return err + case header == nil: + continue + } + target := filepath.Join(dest, filepath.Clean(header.Name)) + if !strings.HasPrefix(target, filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("illegal file path: %s", header.Name) + } + if err := os.MkdirAll(filepath.Dir(target), 0o755); err != nil && os.IsExist(err) { + return err + } + switch header.Typeflag { + case tar.TypeSymlink: + linkTarget := filepath.Join(filepath.Dir(target), header.Linkname) + if !strings.HasPrefix(filepath.Clean(linkTarget), filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("illegal symlink target: %s -> %s", header.Name, header.Linkname) + } + err := os.Symlink(header.Linkname, target) + if err != nil { + return err + } + case tar.TypeDir: + if err := os.MkdirAll(target, 0o755); err != nil { + return err + } + case tar.TypeReg: + f, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode)) + if err != nil { + return err + } + if _, err := io.Copy(f, tr); err != nil { + return err + } + if err := f.Close(); err != nil { + return err + } + if err := os.Chtimes(target, header.AccessTime, header.ModTime); err != nil { + return err + } + } + } + } + + return unpack(tarPath, destPath, decompressor) +} + +// unzip extracts a zip folder to a temporary directory, +// renaming it to the desired location +func unzip(ctx context.Context, zipPath string, destPath string) error { + decompressor := func(src string, dest string) error { + r, err := zip.OpenReader(src) + if err != nil { + return err + } + defer func() { + if err := r.Close(); err != nil { + panic(err) + } + }() + + // Closure to address file descriptors issue with all the deferred .Close() methods + extractAndWriteFile := func(f *zip.File) error { + rc, err := f.Open() + if err != nil { + return err + } + defer func() { + if err := rc.Close(); err != nil { + panic(err) + } + }() + + path := filepath.Join(dest, f.Name) + if !strings.HasPrefix(path, filepath.Clean(dest)+string(os.PathSeparator)) { + return fmt.Errorf("%s: Illegal file path", path) + } + + if f.FileInfo().IsDir() { + if err = os.MkdirAll(path, f.Mode()); err != nil { + return err + } + } else { + if err = os.MkdirAll(filepath.Dir(path), f.Mode()); err != nil { + return err + } + f, err := os.OpenFile(filepath.Clean(path), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode()) + if err != nil { + return err + } + defer func() { + if err := f.Close(); err != nil { + panic(err) + } + }() + + _, err = io.Copy(f, rc) + if err != nil { + return err + } + } + return nil + } + + logger := logging.RequireLoggerFromContext(ctx) + for _, f := range r.File { + if err := extractAndWriteFile(f); err != nil { + return err + } + logger.WithFields(logging.Fields{"name": f.Name, "src": src}).Info(ctx, "Extracting file") + } + + logger.WithField("src", src).Info(ctx, "Extraction finished") + + return nil + } + + return unpack(zipPath, destPath, decompressor) +} + +// unpack unpacks a compressed file (tarball or zip file) to a temporary directory, +// renaming it to the desired location +// decompression is done using the decompressor closure, that should decompress a tarball or zip file +func unpack(srcPath string, destPath string, decompressor func(string, string) error) error { + // first extract the tar into a temporary dir + tmpDir := destPath + ".tmpdir" + err := os.MkdirAll(tmpDir, os.ModePerm) + if err != nil { + return argoerrs.InternalWrapError(err) + } + if decompressor != nil { + if err = decompressor(srcPath, tmpDir); err != nil { + return err + } + } + // next, decide how we wish to rename the file/dir + // to the destination path. + files, err := os.ReadDir(tmpDir) + if err != nil { + return argoerrs.InternalWrapError(err) + } + if len(files) == 1 { + // if the tar is comprised of single file or directory, + // rename that file to the desired location + filePath := path.Join(tmpDir, files[0].Name()) + err = os.Rename(filePath, destPath) + if err != nil { + return argoerrs.InternalWrapError(err) + } + err = os.Remove(tmpDir) + if err != nil { + return argoerrs.InternalWrapError(err) + } + } else { + // the tar extracted into multiple files. In this case, + // just rename the temp directory to the dest path + err = os.Rename(tmpDir, destPath) + if err != nil { + return argoerrs.InternalWrapError(err) + } + } + return nil +} + +func chmod(artPath string, mode int32, recurse bool) error { + err := os.Chmod(artPath, os.FileMode(mode)) + if err != nil { + return argoerrs.InternalWrapError(err) + } + + if recurse { + err = filepath.Walk(artPath, func(path string, f os.FileInfo, err error) error { + return os.Chmod(path, os.FileMode(mode)) + }) + if err != nil { + return argoerrs.InternalWrapError(err) + } + } + + return nil +} + +// Wait is the sidecar container logic which waits for the main container to complete. +// Also monitors for updates in the pod annotations which may change (e.g. terminate) +// Upon completion, kills any sidecars after it finishes. +func (we *WorkflowExecutor) Wait(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + containerNames := we.Template.GetMainContainerNames() + // only monitor progress if both tick durations are >0 + if we.annotationPatchTickDuration != 0 && we.readProgressFileTickDuration != 0 { + go we.monitorProgress(ctx, os.Getenv(common.EnvVarProgressFile)) + } else { + logger.WithField("annotationPatchTickDuration", we.annotationPatchTickDuration).WithField("readProgressFileTickDuration", we.readProgressFileTickDuration).Info(ctx, "monitoring progress disabled") + } + + go we.monitorDeadline(ctx, containerNames) + + err := retryutil.OnError(executorretry.ExecutorRetry(ctx), func(err error) bool { + return errorsutil.IsTransientErr(ctx, err) + }, func() error { + return we.RuntimeExecutor.Wait(ctx, containerNames) + }) + + logger.WithError(err).Info(ctx, "Main container completed") + + if err != nil && err != context.Canceled { + return fmt.Errorf("failed to wait for main container to complete: %w", err) + } + return nil +} + +// monitorProgress monitors for self-reported progress in the progressFile and patches the pod annotations with the parsed progress. +// +// The function reads the last line of the `progressFile` every `readFileTickDuration`. +// If the line matches `N/M`, will set the progress annotation to the parsed progress value. +// Every `annotationPatchTickDuration` the pod is patched with the updated annotations. This way the controller +// gets notified of new self reported progress. +func (we *WorkflowExecutor) monitorProgress(ctx context.Context, progressFile string) { + logger := logging.RequireLoggerFromContext(ctx) + annotationPatchTicker := time.NewTicker(we.annotationPatchTickDuration) + defer annotationPatchTicker.Stop() + fileTicker := time.NewTicker(we.readProgressFileTickDuration) + defer fileTicker.Stop() + + lastLine := "" + progressFile = filepath.Clean(progressFile) + + for { + select { + case <-ctx.Done(): + logger.WithError(ctx.Err()).Info(ctx, "stopping progress monitor (context done)") + return + case <-annotationPatchTicker.C: + if err := we.reportResult(ctx, wfv1.NodeResult{Progress: we.progress}); err != nil { + logger.WithError(err).Info(ctx, "failed to report progress") + } else { + we.progress = "" + } + case <-fileTicker.C: + data, err := os.ReadFile(progressFile) + if err != nil { + if !errors.Is(err, fs.ErrNotExist) { + logger.WithError(err).WithField("file", progressFile).Info(ctx, "unable to watch file") + } + continue + } + lines := strings.Split(strings.TrimSpace(string(data)), "\n") + mostRecent := strings.TrimSpace(lines[len(lines)-1]) + + if mostRecent == "" || mostRecent == lastLine { + continue + } + lastLine = mostRecent + + if progress, ok := wfv1.ParseProgress(lastLine); ok { + logger.WithField("progress", progress).Info(ctx, "") + we.progress = progress + } else { + logger.WithField("line", lastLine).Info(ctx, "unable to parse progress") + } + } + } +} + +// monitorDeadline checks to see if we exceeded the deadline for the step and +// terminates the main container if we did +func (we *WorkflowExecutor) monitorDeadline(ctx context.Context, containerNames []string) { + deadlineExceeded := make(chan bool, 1) + if !we.Deadline.IsZero() { + t := time.AfterFunc(time.Until(we.Deadline), func() { + deadlineExceeded <- true + }) + defer t.Stop() + } + + var message string + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("containers", containerNames).Info(ctx, "Starting deadline monitor") + select { + case <-ctx.Done(): + logger.Info(ctx, "Deadline monitor stopped") + return + case <-deadlineExceeded: + message = "Step exceeded its deadline" + } + logger.Info(ctx, message) + util.WriteTerminateMessage(message) + + containerNames = slices.DeleteFunc(containerNames, func(containerName string) bool { + return common.IsArtifactPluginSidecar(containerName) + }) + we.killContainers(ctx, containerNames) +} + +func (we *WorkflowExecutor) killContainers(ctx context.Context, containerNames []string) { + logger := logging.RequireLoggerFromContext(ctx) + logger.WithField("containerNames", containerNames).Info(ctx, "Killing containers") + terminationGracePeriodDuration := GetTerminationGracePeriodDuration() + if err := we.RuntimeExecutor.Kill(ctx, containerNames, terminationGracePeriodDuration); err != nil { + logger.WithField("containerNames", containerNames).WithError(err).Warn(ctx, "Failed to kill") + } +} + +func (we *WorkflowExecutor) Init() error { + if i, ok := we.RuntimeExecutor.(Initializer); ok { + return i.Init(we.Template) + } + return nil +} + +func (we *WorkflowExecutor) KillArtifactSidecars(ctx context.Context) error { + logger := logging.RequireLoggerFromContext(ctx) + pluginNamesEnv := os.Getenv(common.EnvVarArtifactPluginNames) + if pluginNamesEnv == "" { + logger.Info(ctx, "no artifact sidecars to kill") + return nil + } + artifactSidecars := strings.Split(pluginNamesEnv, ",") + logger.WithFields(logging.Fields{"numSidecars": len(artifactSidecars), "artifactSidecars": artifactSidecars}).Info(ctx, "killing artifact sidecars") + err := we.RuntimeExecutor.Kill(ctx, artifactSidecars, GetTerminationGracePeriodDuration()) + if err != nil { + logger.WithError(err).WithFields(logging.Fields{"artifactSidecars": artifactSidecars}).Error(ctx, "failed to kill artifact sidecars") + return err + } + logger.WithFields(logging.Fields{"artifactSidecars": artifactSidecars}).Info(ctx, "artifact sidecars killed") + return nil +} +``` + +## `workflow/executor/executor_test.go` (changed lines (4, 7, 592)) + +```go +package executor + +import ( + "fmt" + "io" + "os" + "runtime" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/fake" + "k8s.io/utils/ptr" + + wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + argofake "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo-workflows/v3/util/logging" + "github.com/argoproj/argo-workflows/v3/workflow/common" + "github.com/argoproj/argo-workflows/v3/workflow/executor/mocks" +) + +const ( + fakePodName = "fake-test-pod-1234567890" + fakeWorkflow = "my-wf" + fakeWorkflowUID = "my-wf-uid" + fakePodUID = "my-pod-uid" + fakeNodeID = "my-node-id" + fakeNamespace = "default" + fakeContainerName = "main" +) + +func TestWorkflowExecutor_LoadArtifacts(t *testing.T) { + tests := []struct { + name string + artifact wfv1.Artifact + error string + }{ + {"ErrNotSupplied", wfv1.Artifact{Name: "foo"}, "required artifact 'foo' not supplied"}, + {"ErrFailedToLoad", wfv1.Artifact{ + Name: "foo", + Path: "/tmp/foo.txt", + ArtifactLocation: wfv1.ArtifactLocation{ + S3: &wfv1.S3Artifact{ + Key: "my-key", + }, + }, + }, "failed to load artifact 'foo': template artifact location not set"}, + {"ErrNoPath", wfv1.Artifact{ + Name: "foo", + ArtifactLocation: wfv1.ArtifactLocation{ + S3: &wfv1.S3Artifact{ + S3Bucket: wfv1.S3Bucket{Endpoint: "my-endpoint", Bucket: "my-bucket"}, + Key: "my-key", + }, + }, + }, "Artifact 'foo' did not specify a path"}, + {"ErrDirTraversal", wfv1.Artifact{ + Name: "foo", + Path: "/tmp/../etc/passwd", + ArtifactLocation: wfv1.ArtifactLocation{ + S3: &wfv1.S3Artifact{ + S3Bucket: wfv1.S3Bucket{Endpoint: "my-endpoint", Bucket: "my-bucket"}, + Key: "my-key", + }, + }, + }, "Artifact 'foo' attempted to use a path containing '..'. Directory traversal is not permitted"}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + ctx := logging.TestContext(t.Context()) + we := WorkflowExecutor{ + Template: wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{test.artifact}, + }, + }, + } + err := we.loadArtifacts(ctx, "") + require.EqualError(t, err, test.error) + }) + } +} + +func TestSaveParameters(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + templateWithOutParam := wfv1.Template{ + Outputs: wfv1.Outputs{ + Parameters: []wfv1.Parameter{ + { + Name: "my-out", + ValueFrom: &wfv1.ValueFrom{ + Path: "/path", + }, + }, + }, + }, + } + we := WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + } + mockRuntimeExecutor.On("GetFileContents", fakeContainerName, "/path").Return("has a newline\n", nil) + + ctx := logging.TestContext(t.Context()) + err := we.SaveParameters(ctx) + require.NoError(t, err) + assert.Equal(t, "has a newline", we.Template.Outputs.Parameters[0].Value.String()) +} + +// TestIsBaseImagePath tests logic of isBaseImagePath which determines if a path is coming from a +// base image layer versus a shared volumeMount. +func TestIsBaseImagePath(t *testing.T) { + templateWithSameDir := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: "/samedir", + }, + }, + }, + Container: &corev1.Container{}, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: "/samedir", + }, + }, + }, + } + + we := WorkflowExecutor{ + Template: templateWithSameDir, + } + // 1. unrelated dir/file should be captured from base image layer + assert.True(t, we.isBaseImagePath("/foo")) + + // 2. when input and output directory is same, it should be captured from shared emptyDir + assert.False(t, we.isBaseImagePath("/samedir")) + + // 3. when output is a sub path of input dir, it should be captured from shared emptyDir + we.Template.Outputs.Artifacts[0].Path = "/samedir/inner" + assert.False(t, we.isBaseImagePath("/samedir/inner")) + + // 4. when output happens to overlap with input (in name only), it should be captured from base image layer + we.Template.Inputs.Artifacts[0].Path = "/hello.txt" + we.Template.Outputs.Artifacts[0].Path = "/hello.txt-COINCIDENCE" + assert.True(t, we.isBaseImagePath("/hello.txt-COINCIDENCE")) + + // 5. when output is under a user specified volumeMount, it should be captured from shared mount + we.Template.Inputs.Artifacts = nil + we.Template.Container.VolumeMounts = []corev1.VolumeMount{ + { + Name: "workdir", + MountPath: "/user-mount", + }, + } + we.Template.Outputs.Artifacts[0].Path = "/user-mount/some-path" + assert.False(t, we.isBaseImagePath("/user-mount")) + assert.False(t, we.isBaseImagePath("/user-mount/some-path")) + assert.False(t, we.isBaseImagePath("/user-mount/some-path/foo")) + assert.True(t, we.isBaseImagePath("/user-mount-coincidence")) +} + +func TestDefaultParameters(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + templateWithOutParam := wfv1.Template{ + Outputs: wfv1.Outputs{ + Parameters: []wfv1.Parameter{ + { + Name: "my-out", + ValueFrom: &wfv1.ValueFrom{ + Default: wfv1.AnyStringPtr("Default Value"), + Path: "/path", + }, + }, + }, + }, + } + we := WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + } + mockRuntimeExecutor.On("GetFileContents", fakeContainerName, "/path").Return("", fmt.Errorf("file not found")) + + ctx := logging.TestContext(t.Context()) + err := we.SaveParameters(ctx) + require.NoError(t, err) + assert.Equal(t, "Default Value", we.Template.Outputs.Parameters[0].Value.String()) +} + +func TestDefaultParametersEmptyString(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + templateWithOutParam := wfv1.Template{ + Outputs: wfv1.Outputs{ + Parameters: []wfv1.Parameter{ + { + Name: "my-out", + ValueFrom: &wfv1.ValueFrom{ + Default: wfv1.AnyStringPtr(""), + Path: "/path", + }, + }, + }, + }, + } + we := WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + } + mockRuntimeExecutor.On("GetFileContents", fakeContainerName, "/path").Return("", fmt.Errorf("file not found")) + + ctx := logging.TestContext(t.Context()) + err := we.SaveParameters(ctx) + require.NoError(t, err) + assert.Empty(t, we.Template.Outputs.Parameters[0].Value.String()) +} + +func TestIsTarball(t *testing.T) { + ctx := logging.TestContext(t.Context()) + tests := []struct { + path string + isTarball bool + expectErr bool + }{ + {"testdata/file", false, false}, + {"testdata/file.zip", false, false}, + {"testdata/file.tar", false, false}, + {"testdata/file.gz", false, false}, + {"testdata/file.tar.gz", true, false}, + {"testdata/file.tgz", true, false}, + {"testdata/not-found", false, true}, + } + + for _, test := range tests { + ok, err := isTarball(ctx, test.path) + if test.expectErr { + require.Error(t, err, test.path) + } else { + require.NoError(t, err, test.path) + } + assert.Equal(t, test.isTarball, ok, test.path) + } +} + +func TestUnzip(t *testing.T) { + ctx := logging.TestContext(t.Context()) + zipPath := "testdata/file.zip" + destPath := "testdata/unzippedFile" + + // test + err := unzip(ctx, zipPath, destPath) + require.NoError(t, err) + + // check unzipped file + fileInfo, err := os.Stat(destPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsRegular()) + + // cleanup + err = os.Remove(destPath) + require.NoError(t, err) +} + +func TestUntar(t *testing.T) { + tarPath := "testdata/file.tar.gz" + destPath := "testdata/untarredDir" + filePath := "testdata/untarredDir/file" + linkPath := "testdata/untarredDir/link" + emptyDirPath := "testdata/untarredDir/empty-dir" + + // test + err := untar(tarPath, destPath) + require.NoError(t, err) + + // check untarred contents + fileInfo, err := os.Stat(destPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsDir()) + fileInfo, err = os.Stat(filePath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsRegular()) + dirInfo, err := os.Stat(destPath) + require.NoError(t, err) + // check that the modification time of the file is retained + assert.True(t, fileInfo.ModTime().Before(dirInfo.ModTime())) + fileInfo, err = os.Stat(linkPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsRegular()) + fileInfo, err = os.Stat(emptyDirPath) + require.NoError(t, err) + assert.True(t, fileInfo.Mode().IsDir()) + + // cleanup + err = os.Remove(linkPath) + require.NoError(t, err) + err = os.Remove(filePath) + require.NoError(t, err) + err = os.Remove(emptyDirPath) + require.NoError(t, err) + err = os.Remove(destPath) + require.NoError(t, err) +} + +func TestChmod(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("chmod does not work in windows") + } + + type perm struct { + dir string + file string + } + + tests := []struct { + mode int32 + recurse bool + permissions perm + }{ + { + 0o777, + false, + perm{ + "drwxrwxrwx", + "-rw-------", + }, + }, + { + 0o777, + true, + perm{ + "drwxrwxrwx", + "-rwxrwxrwx", + }, + }, + } + + for _, test := range tests { + // Setup directory and file for testing + tempDir := t.TempDir() + + tempFile, err := os.CreateTemp(tempDir, "chmod-file-test") + require.NoError(t, err) + + // Run chmod function + err = chmod(tempDir, test.mode, test.recurse) + require.NoError(t, err) + + // Check directory mode if set + dirPermission, err := os.Stat(tempDir) + require.NoError(t, err) + assert.Equal(t, dirPermission.Mode().String(), test.permissions.dir) + + // Check file mode mode if set + filePermission, err := os.Stat(tempFile.Name()) + require.NoError(t, err) + assert.Equal(t, filePermission.Mode().String(), test.permissions.file) + } +} + +func TestSaveArtifacts(t *testing.T) { + fakeClientset := fake.NewSimpleClientset() + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + mockTaskResultClient := argofake.NewSimpleClientset().ArgoprojV1alpha1().WorkflowTaskResults(fakeNamespace) + templateWithOutParam := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + }, + }, + }, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + Optional: true, + }, + }, + }, + } + templateOptionFalse := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + }, + }, + }, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + Optional: false, + }, + }, + }, + } + templateZipArchive := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + }, + }, + }, + Outputs: wfv1.Outputs{ + Artifacts: []wfv1.Artifact{ + { + Name: "samedir", + Path: string(os.PathSeparator) + "samedir", + Optional: true, + Archive: &wfv1.ArchiveStrategy{ + Zip: &wfv1.ZipStrategy{}, + }, + }, + }, + }, + } + tests := []struct { + workflowExecutor WorkflowExecutor + expectError bool + }{ + { + workflowExecutor: WorkflowExecutor{ + PodName: fakePodName, + Template: templateWithOutParam, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + }, + expectError: false, + }, + { + workflowExecutor: WorkflowExecutor{ + PodName: fakePodName, + Template: templateOptionFalse, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + }, + expectError: true, + }, + { + workflowExecutor: WorkflowExecutor{ + PodName: fakePodName, + Template: templateZipArchive, + ClientSet: fakeClientset, + Namespace: fakeNamespace, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + }, + expectError: false, + }, + } + + for _, tt := range tests { + ctx := logging.TestContext(t.Context()) + _, err := tt.workflowExecutor.SaveArtifacts(ctx) + if err != nil { + assert.True(t, tt.expectError) + continue + } + assert.False(t, tt.expectError) + } +} + +func TestMonitorProgress(t *testing.T) { + ctx := logging.TestContext(t.Context()) + + annotationPackTickDuration := 5 * time.Millisecond + readProgressFileTickDuration := time.Millisecond + progressFile := "/tmp/progress" + + wfFake := argofake.NewSimpleClientset(&wfv1.WorkflowTaskSet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: fakeNamespace, + Name: fakeWorkflow, + }, + }) + taskResults := wfFake.ArgoprojV1alpha1().WorkflowTaskResults(fakeNamespace) + we := NewExecutor( + ctx, + nil, + taskResults, + nil, + fakePodName, + fakePodUID, + fakeWorkflow, + fakeWorkflowUID, + fakeNodeID, + fakeNamespace, + &mocks.ContainerRuntimeExecutor{}, + wfv1.Template{}, + false, + time.Now(), + annotationPackTickDuration, + readProgressFileTickDuration, + ) + + go we.monitorProgress(ctx, progressFile) + + err := os.WriteFile(progressFile, []byte("100/100\n"), os.ModePerm) + require.NoError(t, err) + + time.Sleep(time.Second) + + result, err := taskResults.Get(ctx, fakeNodeID, metav1.GetOptions{}) + require.NoError(t, err) + assert.Equal(t, fakeWorkflow, result.Labels[common.LabelKeyWorkflow]) + assert.Len(t, result.OwnerReferences, 1) + assert.Equal(t, wfv1.Progress("100/100"), result.Progress) +} + +func TestSaveLogs(t *testing.T) { + const artStorageError = "artifact storage is not configured; see the docs for setup instructions: https://argo-workflows.readthedocs.io/en/latest/configure-artifact-repository/" + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + mockRuntimeExecutor.On("GetOutputStream", mock.Anything, mock.AnythingOfType("string"), true).Return(io.NopCloser(strings.NewReader("hello world")), nil) + t.Run("Simple Pod node", func(t *testing.T) { + templateWithArchiveLogs := wfv1.Template{ + ArchiveLocation: &wfv1.ArtifactLocation{ + ArchiveLogs: ptr.To(true), + }, + } + we := WorkflowExecutor{ + Template: templateWithArchiveLogs, + RuntimeExecutor: &mockRuntimeExecutor, + } + + ctx := logging.TestContext(t.Context()) + logArtifacts := we.SaveLogs(ctx) + + require.EqualError(t, we.errors[0], artStorageError) + assert.Empty(t, logArtifacts) + }) +} + +func TestReportOutputs(t *testing.T) { + mockRuntimeExecutor := mocks.ContainerRuntimeExecutor{} + mockTaskResultClient := argofake.NewSimpleClientset().ArgoprojV1alpha1().WorkflowTaskResults(fakeNamespace) + t.Run("Simple report output", func(t *testing.T) { + artifacts := []wfv1.Artifact{ + { + Name: "samedir", + Path: "/samedir", + }, + } + templateWithArtifacts := wfv1.Template{ + Inputs: wfv1.Inputs{ + Artifacts: artifacts, + }, + } + we := WorkflowExecutor{ + Template: templateWithArtifacts, + RuntimeExecutor: &mockRuntimeExecutor, + taskResultClient: mockTaskResultClient, + } + + ctx := logging.TestContext(t.Context()) + err := we.ReportOutputs(ctx, artifacts) + + require.NoError(t, err) + assert.Empty(t, we.errors) + }) + +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/task.json new file mode 100644 index 0000000000000000000000000000000000000000..2e11f98c4a1f1e39e3bfa8d809ec60bce78092de --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-2331a664751876781460", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-2331a664751876781460", + "project_id": "morefixes__argoproj__argo-workflows", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "workflow/executor/executor.go", + "workflow/executor/executor_test.go" + ], + "patch_units": { + "before": [ + "workflow/executor/executor.go", + "workflow/executor/executor_test.go" + ], + "after": [ + "workflow/executor/executor.go", + "workflow/executor/executor_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/7bcf53fa77dff1713a21a1673ac843c5abcc8c8a2e13adabe90e8835f7b5d3be/database", + "cache_key": "7bcf53fa77dff1713a21a1673ac843c5abcc8c8a2e13adabe90e8835f7b5d3be", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/d27350a8949789211a3700e321882ad4997e8f47b49c205fb4949a075dd03162/database", + "cache_key": "d27350a8949789211a3700e321882ad4997e8f47b49c205fb4949a075dd03162", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/92bfca31f310d4b8fcf297747ebe623381a8b525bcdbb4919b27fb37a72abc35/database", + "cache_key": "92bfca31f310d4b8fcf297747ebe623381a8b525bcdbb4919b27fb37a72abc35", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-2331a664751876781460/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-2331a664751876781460/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2331a664751876781460/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..c9be7a0a9d89ef948e50cdd2ed931575687c71c9 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/patch.diff @@ -0,0 +1,42 @@ +diff --git a/platforms/mqtt/mqtt_adaptor.go b/platforms/mqtt/mqtt_adaptor.go +index 78bc508e..b3df24a5 100644 +--- a/platforms/mqtt/mqtt_adaptor.go ++++ b/platforms/mqtt/mqtt_adaptor.go +@@ -230,7 +230,7 @@ func (a *Adaptor) newTLSConfig() *tls.Config { + ClientCAs: nil, + // InsecureSkipVerify = verify that cert contents + // match server. IP matches what is in cert etc. +- InsecureSkipVerify: true, ++ InsecureSkipVerify: false, + // Certificates = list of certs client sends to server. + Certificates: certs, + } +diff --git a/platforms/mqtt/mqtt_adaptor_test.go b/platforms/mqtt/mqtt_adaptor_test.go +index 2adc1987..c4f33445 100644 +--- a/platforms/mqtt/mqtt_adaptor_test.go ++++ b/platforms/mqtt/mqtt_adaptor_test.go +@@ -72,21 +72,21 @@ func TestMqttAdaptorUseClientKey(t *testing.T) { + } + + func TestMqttAdaptorConnectError(t *testing.T) { +- a := initTestMqttAdaptor() ++ a := NewAdaptor("tcp://localhost:1884", "client") + + err := a.Connect() + gobottest.Assert(t, strings.Contains(err.Error(), "connection refused"), true) + } + + func TestMqttAdaptorConnectSSLError(t *testing.T) { +- a := initTestMqttAdaptor() ++ a := NewAdaptor("tcp://localhost:1884", "client") + a.SetUseSSL(true) + err := a.Connect() + gobottest.Assert(t, strings.Contains(err.Error(), "connection refused"), true) + } + + func TestMqttAdaptorConnectWithAuthError(t *testing.T) { +- a := NewAdaptorWithAuth("localhost:1883", "client", "user", "pass") ++ a := NewAdaptorWithAuth("xyz://localhost:1883", "client", "user", "pass") + var expected error + expected = multierror.Append(expected, errors.New("Network Error : Unknown protocol")) + diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..21c028062be241fb7b3384a5768e4c6ed90786bc --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/post_context.md @@ -0,0 +1,381 @@ +# Patch-overlapping Go context after the fix + +## `platforms/mqtt/mqtt_adaptor.go` (changed lines (233,)) + +```go +package mqtt + +import ( + "crypto/tls" + "crypto/x509" + "io/ioutil" + + "gobot.io/x/gobot" + + paho "github.com/eclipse/paho.mqtt.golang" + multierror "github.com/hashicorp/go-multierror" + "github.com/pkg/errors" +) + +var ( + // ErrNilClient is returned when a client action can't be taken because the struct has no client + ErrNilClient = errors.New("no MQTT client available") +) + +// Message is a message received from the broker. +type Message paho.Message + +// Adaptor is the Gobot Adaptor for MQTT +type Adaptor struct { + name string + Host string + clientID string + username string + password string + useSSL bool + serverCert string + clientCert string + clientKey string + autoReconnect bool + cleanSession bool + client paho.Client + qos int +} + +// NewAdaptor creates a new mqtt adaptor with specified host and client id +func NewAdaptor(host string, clientID string) *Adaptor { + return &Adaptor{ + name: gobot.DefaultName("MQTT"), + Host: host, + autoReconnect: false, + cleanSession: true, + useSSL: false, + clientID: clientID, + } +} + +// NewAdaptorWithAuth creates a new mqtt adaptor with specified host, client id, username, and password. +func NewAdaptorWithAuth(host, clientID, username, password string) *Adaptor { + return &Adaptor{ + name: "MQTT", + Host: host, + autoReconnect: false, + cleanSession: true, + useSSL: false, + clientID: clientID, + username: username, + password: password, + } +} + +// Name returns the MQTT Adaptor's name +func (a *Adaptor) Name() string { return a.name } + +// SetName sets the MQTT Adaptor's name +func (a *Adaptor) SetName(n string) { a.name = n } + +// Port returns the Host name +func (a *Adaptor) Port() string { return a.Host } + +// AutoReconnect returns the MQTT AutoReconnect setting +func (a *Adaptor) AutoReconnect() bool { return a.autoReconnect } + +// SetAutoReconnect sets the MQTT AutoReconnect setting +func (a *Adaptor) SetAutoReconnect(val bool) { a.autoReconnect = val } + +// CleanSession returns the MQTT CleanSession setting +func (a *Adaptor) CleanSession() bool { return a.cleanSession } + +// SetCleanSession sets the MQTT CleanSession setting. Should be false if reconnect is enabled. Otherwise all subscriptions will be lost +func (a *Adaptor) SetCleanSession(val bool) { a.cleanSession = val } + +// UseSSL returns the MQTT server SSL preference +func (a *Adaptor) UseSSL() bool { return a.useSSL } + +// SetUseSSL sets the MQTT server SSL preference +func (a *Adaptor) SetUseSSL(val bool) { a.useSSL = val } + +// ServerCert returns the MQTT server SSL cert file +func (a *Adaptor) ServerCert() string { return a.serverCert } + +// SetQoS sets the QoS value passed into the MTT client on Publish/Subscribe events +func (a *Adaptor) SetQoS(qos int) { a.qos = qos } + +// SetServerCert sets the MQTT server SSL cert file +func (a *Adaptor) SetServerCert(val string) { a.serverCert = val } + +// ClientCert returns the MQTT client SSL cert file +func (a *Adaptor) ClientCert() string { return a.clientCert } + +// SetClientCert sets the MQTT client SSL cert file +func (a *Adaptor) SetClientCert(val string) { a.clientCert = val } + +// ClientKey returns the MQTT client SSL key file +func (a *Adaptor) ClientKey() string { return a.clientKey } + +// SetClientKey sets the MQTT client SSL key file +func (a *Adaptor) SetClientKey(val string) { a.clientKey = val } + +// Connect returns true if connection to mqtt is established +func (a *Adaptor) Connect() (err error) { + a.client = paho.NewClient(a.createClientOptions()) + if token := a.client.Connect(); token.Wait() && token.Error() != nil { + err = multierror.Append(err, token.Error()) + } + + return +} + +// Disconnect returns true if connection to mqtt is closed +func (a *Adaptor) Disconnect() (err error) { + if a.client != nil { + a.client.Disconnect(500) + } + return +} + +// Finalize returns true if connection to mqtt is finalized successfully +func (a *Adaptor) Finalize() (err error) { + a.Disconnect() + return +} + +// Publish a message under a specific topic +func (a *Adaptor) Publish(topic string, message []byte) bool { + _, err := a.PublishWithQOS(topic, a.qos, message) + if err != nil { + return false + } + + return true +} + +// PublishWithQOS allows per-publish QOS values to be set and returns a poken.Token +func (a *Adaptor) PublishWithQOS(topic string, qos int, message []byte) (paho.Token, error) { + if a.client == nil { + return nil, ErrNilClient + } + + token := a.client.Publish(topic, byte(qos), false, message) + return token, nil +} + +// OnWithQOS allows per-subscribe QOS values to be set and returns a paho.Token +func (a *Adaptor) OnWithQOS(event string, qos int, f func(msg Message)) (paho.Token, error) { + if a.client == nil { + return nil, ErrNilClient + } + + token := a.client.Subscribe(event, byte(qos), func(client paho.Client, msg paho.Message) { + f(msg) + }) + + return token, nil +} + +// On subscribes to a topic, and then calls the message handler function when data is received +func (a *Adaptor) On(event string, f func(msg Message)) bool { + _, err := a.OnWithQOS(event, a.qos, f) + if err != nil { + return false + } + return true +} + +func (a *Adaptor) createClientOptions() *paho.ClientOptions { + opts := paho.NewClientOptions() + opts.AddBroker(a.Host) + opts.SetClientID(a.clientID) + if a.username != "" && a.password != "" { + opts.SetPassword(a.password) + opts.SetUsername(a.username) + } + opts.AutoReconnect = a.autoReconnect + opts.CleanSession = a.cleanSession + + if a.UseSSL() { + opts.SetTLSConfig(a.newTLSConfig()) + } + return opts +} + +// newTLSConfig sets the TLS config in the case that we are using +// an MQTT broker with TLS +func (a *Adaptor) newTLSConfig() *tls.Config { + // Import server certificate + var certpool *x509.CertPool + if len(a.ServerCert()) > 0 { + certpool = x509.NewCertPool() + pemCerts, err := ioutil.ReadFile(a.ServerCert()) + if err == nil { + certpool.AppendCertsFromPEM(pemCerts) + } + } + + // Import client certificate/key pair + var certs []tls.Certificate + if len(a.ClientCert()) > 0 && len(a.ClientKey()) > 0 { + cert, err := tls.LoadX509KeyPair(a.ClientCert(), a.ClientKey()) + if err != nil { + // TODO: proper error handling + panic(err) + } + certs = append(certs, cert) + } + + // Create tls.Config with desired tls properties + return &tls.Config{ + // RootCAs = certs used to verify server cert. + RootCAs: certpool, + // ClientAuth = whether to request cert from server. + // Since the server is set up for SSL, this happens + // anyways. + ClientAuth: tls.NoClientCert, + // ClientCAs = certs used to validate client cert. + ClientCAs: nil, + // InsecureSkipVerify = verify that cert contents + // match server. IP matches what is in cert etc. + InsecureSkipVerify: false, + // Certificates = list of certs client sends to server. + Certificates: certs, + } +} +``` + +## `platforms/mqtt/mqtt_adaptor_test.go` (changed lines (75, 82, 89)) + +```go +package mqtt + +import ( + "errors" + "fmt" + "strings" + "testing" + + multierror "github.com/hashicorp/go-multierror" + "gobot.io/x/gobot" + "gobot.io/x/gobot/gobottest" +) + +var _ gobot.Adaptor = (*Adaptor)(nil) + +func initTestMqttAdaptor() *Adaptor { + return NewAdaptor("tcp://localhost:1883", "client") +} + +func TestMqttAdaptorName(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, strings.HasPrefix(a.Name(), "MQTT"), true) + a.SetName("NewName") + gobottest.Assert(t, a.Name(), "NewName") +} + +func TestMqttAdaptorPort(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.Port(), "tcp://localhost:1883") +} + +func TestMqttAdaptorAutoReconnect(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.AutoReconnect(), false) + a.SetAutoReconnect(true) + gobottest.Assert(t, a.AutoReconnect(), true) +} + +func TestMqttAdaptorCleanSession(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.CleanSession(), true) + a.SetCleanSession(false) + gobottest.Assert(t, a.CleanSession(), false) +} + +func TestMqttAdaptorUseSSL(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.UseSSL(), false) + a.SetUseSSL(true) + gobottest.Assert(t, a.UseSSL(), true) +} + +func TestMqttAdaptorUseServerCert(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.ServerCert(), "") + a.SetServerCert("/path/to/server.cert") + gobottest.Assert(t, a.ServerCert(), "/path/to/server.cert") +} + +func TestMqttAdaptorUseClientCert(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.ClientCert(), "") + a.SetClientCert("/path/to/client.cert") + gobottest.Assert(t, a.ClientCert(), "/path/to/client.cert") +} + +func TestMqttAdaptorUseClientKey(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.ClientKey(), "") + a.SetClientKey("/path/to/client.key") + gobottest.Assert(t, a.ClientKey(), "/path/to/client.key") +} + +func TestMqttAdaptorConnectError(t *testing.T) { + a := NewAdaptor("tcp://localhost:1884", "client") + + err := a.Connect() + gobottest.Assert(t, strings.Contains(err.Error(), "connection refused"), true) +} + +func TestMqttAdaptorConnectSSLError(t *testing.T) { + a := NewAdaptor("tcp://localhost:1884", "client") + a.SetUseSSL(true) + err := a.Connect() + gobottest.Assert(t, strings.Contains(err.Error(), "connection refused"), true) +} + +func TestMqttAdaptorConnectWithAuthError(t *testing.T) { + a := NewAdaptorWithAuth("xyz://localhost:1883", "client", "user", "pass") + var expected error + expected = multierror.Append(expected, errors.New("Network Error : Unknown protocol")) + + gobottest.Assert(t, a.Connect(), expected) +} + +func TestMqttAdaptorFinalize(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.Finalize(), nil) +} + +func TestMqttAdaptorCannotPublishUnlessConnected(t *testing.T) { + a := initTestMqttAdaptor() + data := []byte("o") + gobottest.Assert(t, a.Publish("test", data), false) +} + +func TestMqttAdaptorPublishWhenConnected(t *testing.T) { + a := initTestMqttAdaptor() + a.Connect() + data := []byte("o") + gobottest.Assert(t, a.Publish("test", data), true) +} + +func TestMqttAdaptorCannotOnUnlessConnected(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.On("hola", func(msg Message) { + fmt.Println("hola") + }), false) +} + +func TestMqttAdaptorOnWhenConnected(t *testing.T) { + a := initTestMqttAdaptor() + a.Connect() + gobottest.Assert(t, a.On("hola", func(msg Message) { + fmt.Println("hola") + }), true) +} + +func TestMqttAdaptorQoS(t *testing.T) { + a := initTestMqttAdaptor() + a.SetQoS(1) + gobottest.Assert(t, 1, a.qos) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..12e3946a406f21d11c6ac087d173a031f4b660bb --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/pre_context.md @@ -0,0 +1,381 @@ +# Patch-overlapping Go context before the fix + +## `platforms/mqtt/mqtt_adaptor.go` (changed lines (233, 234)) + +```go +package mqtt + +import ( + "crypto/tls" + "crypto/x509" + "io/ioutil" + + "gobot.io/x/gobot" + + paho "github.com/eclipse/paho.mqtt.golang" + multierror "github.com/hashicorp/go-multierror" + "github.com/pkg/errors" +) + +var ( + // ErrNilClient is returned when a client action can't be taken because the struct has no client + ErrNilClient = errors.New("no MQTT client available") +) + +// Message is a message received from the broker. +type Message paho.Message + +// Adaptor is the Gobot Adaptor for MQTT +type Adaptor struct { + name string + Host string + clientID string + username string + password string + useSSL bool + serverCert string + clientCert string + clientKey string + autoReconnect bool + cleanSession bool + client paho.Client + qos int +} + +// NewAdaptor creates a new mqtt adaptor with specified host and client id +func NewAdaptor(host string, clientID string) *Adaptor { + return &Adaptor{ + name: gobot.DefaultName("MQTT"), + Host: host, + autoReconnect: false, + cleanSession: true, + useSSL: false, + clientID: clientID, + } +} + +// NewAdaptorWithAuth creates a new mqtt adaptor with specified host, client id, username, and password. +func NewAdaptorWithAuth(host, clientID, username, password string) *Adaptor { + return &Adaptor{ + name: "MQTT", + Host: host, + autoReconnect: false, + cleanSession: true, + useSSL: false, + clientID: clientID, + username: username, + password: password, + } +} + +// Name returns the MQTT Adaptor's name +func (a *Adaptor) Name() string { return a.name } + +// SetName sets the MQTT Adaptor's name +func (a *Adaptor) SetName(n string) { a.name = n } + +// Port returns the Host name +func (a *Adaptor) Port() string { return a.Host } + +// AutoReconnect returns the MQTT AutoReconnect setting +func (a *Adaptor) AutoReconnect() bool { return a.autoReconnect } + +// SetAutoReconnect sets the MQTT AutoReconnect setting +func (a *Adaptor) SetAutoReconnect(val bool) { a.autoReconnect = val } + +// CleanSession returns the MQTT CleanSession setting +func (a *Adaptor) CleanSession() bool { return a.cleanSession } + +// SetCleanSession sets the MQTT CleanSession setting. Should be false if reconnect is enabled. Otherwise all subscriptions will be lost +func (a *Adaptor) SetCleanSession(val bool) { a.cleanSession = val } + +// UseSSL returns the MQTT server SSL preference +func (a *Adaptor) UseSSL() bool { return a.useSSL } + +// SetUseSSL sets the MQTT server SSL preference +func (a *Adaptor) SetUseSSL(val bool) { a.useSSL = val } + +// ServerCert returns the MQTT server SSL cert file +func (a *Adaptor) ServerCert() string { return a.serverCert } + +// SetQoS sets the QoS value passed into the MTT client on Publish/Subscribe events +func (a *Adaptor) SetQoS(qos int) { a.qos = qos } + +// SetServerCert sets the MQTT server SSL cert file +func (a *Adaptor) SetServerCert(val string) { a.serverCert = val } + +// ClientCert returns the MQTT client SSL cert file +func (a *Adaptor) ClientCert() string { return a.clientCert } + +// SetClientCert sets the MQTT client SSL cert file +func (a *Adaptor) SetClientCert(val string) { a.clientCert = val } + +// ClientKey returns the MQTT client SSL key file +func (a *Adaptor) ClientKey() string { return a.clientKey } + +// SetClientKey sets the MQTT client SSL key file +func (a *Adaptor) SetClientKey(val string) { a.clientKey = val } + +// Connect returns true if connection to mqtt is established +func (a *Adaptor) Connect() (err error) { + a.client = paho.NewClient(a.createClientOptions()) + if token := a.client.Connect(); token.Wait() && token.Error() != nil { + err = multierror.Append(err, token.Error()) + } + + return +} + +// Disconnect returns true if connection to mqtt is closed +func (a *Adaptor) Disconnect() (err error) { + if a.client != nil { + a.client.Disconnect(500) + } + return +} + +// Finalize returns true if connection to mqtt is finalized successfully +func (a *Adaptor) Finalize() (err error) { + a.Disconnect() + return +} + +// Publish a message under a specific topic +func (a *Adaptor) Publish(topic string, message []byte) bool { + _, err := a.PublishWithQOS(topic, a.qos, message) + if err != nil { + return false + } + + return true +} + +// PublishWithQOS allows per-publish QOS values to be set and returns a poken.Token +func (a *Adaptor) PublishWithQOS(topic string, qos int, message []byte) (paho.Token, error) { + if a.client == nil { + return nil, ErrNilClient + } + + token := a.client.Publish(topic, byte(qos), false, message) + return token, nil +} + +// OnWithQOS allows per-subscribe QOS values to be set and returns a paho.Token +func (a *Adaptor) OnWithQOS(event string, qos int, f func(msg Message)) (paho.Token, error) { + if a.client == nil { + return nil, ErrNilClient + } + + token := a.client.Subscribe(event, byte(qos), func(client paho.Client, msg paho.Message) { + f(msg) + }) + + return token, nil +} + +// On subscribes to a topic, and then calls the message handler function when data is received +func (a *Adaptor) On(event string, f func(msg Message)) bool { + _, err := a.OnWithQOS(event, a.qos, f) + if err != nil { + return false + } + return true +} + +func (a *Adaptor) createClientOptions() *paho.ClientOptions { + opts := paho.NewClientOptions() + opts.AddBroker(a.Host) + opts.SetClientID(a.clientID) + if a.username != "" && a.password != "" { + opts.SetPassword(a.password) + opts.SetUsername(a.username) + } + opts.AutoReconnect = a.autoReconnect + opts.CleanSession = a.cleanSession + + if a.UseSSL() { + opts.SetTLSConfig(a.newTLSConfig()) + } + return opts +} + +// newTLSConfig sets the TLS config in the case that we are using +// an MQTT broker with TLS +func (a *Adaptor) newTLSConfig() *tls.Config { + // Import server certificate + var certpool *x509.CertPool + if len(a.ServerCert()) > 0 { + certpool = x509.NewCertPool() + pemCerts, err := ioutil.ReadFile(a.ServerCert()) + if err == nil { + certpool.AppendCertsFromPEM(pemCerts) + } + } + + // Import client certificate/key pair + var certs []tls.Certificate + if len(a.ClientCert()) > 0 && len(a.ClientKey()) > 0 { + cert, err := tls.LoadX509KeyPair(a.ClientCert(), a.ClientKey()) + if err != nil { + // TODO: proper error handling + panic(err) + } + certs = append(certs, cert) + } + + // Create tls.Config with desired tls properties + return &tls.Config{ + // RootCAs = certs used to verify server cert. + RootCAs: certpool, + // ClientAuth = whether to request cert from server. + // Since the server is set up for SSL, this happens + // anyways. + ClientAuth: tls.NoClientCert, + // ClientCAs = certs used to validate client cert. + ClientCAs: nil, + // InsecureSkipVerify = verify that cert contents + // match server. IP matches what is in cert etc. + InsecureSkipVerify: true, + // Certificates = list of certs client sends to server. + Certificates: certs, + } +} +``` + +## `platforms/mqtt/mqtt_adaptor_test.go` (changed lines (75, 76, 82, 83, 89, 90)) + +```go +package mqtt + +import ( + "errors" + "fmt" + "strings" + "testing" + + multierror "github.com/hashicorp/go-multierror" + "gobot.io/x/gobot" + "gobot.io/x/gobot/gobottest" +) + +var _ gobot.Adaptor = (*Adaptor)(nil) + +func initTestMqttAdaptor() *Adaptor { + return NewAdaptor("tcp://localhost:1883", "client") +} + +func TestMqttAdaptorName(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, strings.HasPrefix(a.Name(), "MQTT"), true) + a.SetName("NewName") + gobottest.Assert(t, a.Name(), "NewName") +} + +func TestMqttAdaptorPort(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.Port(), "tcp://localhost:1883") +} + +func TestMqttAdaptorAutoReconnect(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.AutoReconnect(), false) + a.SetAutoReconnect(true) + gobottest.Assert(t, a.AutoReconnect(), true) +} + +func TestMqttAdaptorCleanSession(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.CleanSession(), true) + a.SetCleanSession(false) + gobottest.Assert(t, a.CleanSession(), false) +} + +func TestMqttAdaptorUseSSL(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.UseSSL(), false) + a.SetUseSSL(true) + gobottest.Assert(t, a.UseSSL(), true) +} + +func TestMqttAdaptorUseServerCert(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.ServerCert(), "") + a.SetServerCert("/path/to/server.cert") + gobottest.Assert(t, a.ServerCert(), "/path/to/server.cert") +} + +func TestMqttAdaptorUseClientCert(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.ClientCert(), "") + a.SetClientCert("/path/to/client.cert") + gobottest.Assert(t, a.ClientCert(), "/path/to/client.cert") +} + +func TestMqttAdaptorUseClientKey(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.ClientKey(), "") + a.SetClientKey("/path/to/client.key") + gobottest.Assert(t, a.ClientKey(), "/path/to/client.key") +} + +func TestMqttAdaptorConnectError(t *testing.T) { + a := initTestMqttAdaptor() + + err := a.Connect() + gobottest.Assert(t, strings.Contains(err.Error(), "connection refused"), true) +} + +func TestMqttAdaptorConnectSSLError(t *testing.T) { + a := initTestMqttAdaptor() + a.SetUseSSL(true) + err := a.Connect() + gobottest.Assert(t, strings.Contains(err.Error(), "connection refused"), true) +} + +func TestMqttAdaptorConnectWithAuthError(t *testing.T) { + a := NewAdaptorWithAuth("localhost:1883", "client", "user", "pass") + var expected error + expected = multierror.Append(expected, errors.New("Network Error : Unknown protocol")) + + gobottest.Assert(t, a.Connect(), expected) +} + +func TestMqttAdaptorFinalize(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.Finalize(), nil) +} + +func TestMqttAdaptorCannotPublishUnlessConnected(t *testing.T) { + a := initTestMqttAdaptor() + data := []byte("o") + gobottest.Assert(t, a.Publish("test", data), false) +} + +func TestMqttAdaptorPublishWhenConnected(t *testing.T) { + a := initTestMqttAdaptor() + a.Connect() + data := []byte("o") + gobottest.Assert(t, a.Publish("test", data), true) +} + +func TestMqttAdaptorCannotOnUnlessConnected(t *testing.T) { + a := initTestMqttAdaptor() + gobottest.Assert(t, a.On("hola", func(msg Message) { + fmt.Println("hola") + }), false) +} + +func TestMqttAdaptorOnWhenConnected(t *testing.T) { + a := initTestMqttAdaptor() + a.Connect() + gobottest.Assert(t, a.On("hola", func(msg Message) { + fmt.Println("hola") + }), true) +} + +func TestMqttAdaptorQoS(t *testing.T) { + a := initTestMqttAdaptor() + a.SetQoS(1) + gobottest.Assert(t, 1, a.qos) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/task.json new file mode 100644 index 0000000000000000000000000000000000000000..3f898d20296f34814b178b3950b2c98fa98e5eb4 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-2cc25dee5f2a118bcb26", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-2cc25dee5f2a118bcb26", + "project_id": "morefixes__hybridgroup__gobot", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "platforms/mqtt/mqtt_adaptor.go", + "platforms/mqtt/mqtt_adaptor_test.go" + ], + "patch_units": { + "before": [ + "platforms/mqtt/mqtt_adaptor.go", + "platforms/mqtt/mqtt_adaptor_test.go" + ], + "after": [ + "platforms/mqtt/mqtt_adaptor.go", + "platforms/mqtt/mqtt_adaptor_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/b3db3157b01e49c6ecf4e368b8eb980dd85c32ba5158849f29c178d2a3485739/database", + "cache_key": "b3db3157b01e49c6ecf4e368b8eb980dd85c32ba5158849f29c178d2a3485739", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/382e8f02f6b569226c0e1aba4944323a53332f9549e34c2157303c20978f6761/database", + "cache_key": "382e8f02f6b569226c0e1aba4944323a53332f9549e34c2157303c20978f6761", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/7ff87a5d1eb336874ad1a6b66d0475b30c44bdcb7c9450f63f2bf141ab41c253/database", + "cache_key": "7ff87a5d1eb336874ad1a6b66d0475b30c44bdcb7c9450f63f2bf141ab41c253", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-2cc25dee5f2a118bcb26/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-2cc25dee5f2a118bcb26/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-2cc25dee5f2a118bcb26/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..2951add539177b1fbb4153e5a0a56e2f933b76fd --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/patch.diff @@ -0,0 +1,16 @@ +diff --git a/html/smartypants.go b/html/smartypants.go +index 706e4ff..dec784e 100644 +--- a/html/smartypants.go ++++ b/html/smartypants.go +@@ -371,7 +371,10 @@ func (r *SPRenderer) smartLeftAngle(out *bytes.Buffer, previousChar byte, text [ + i++ + } + +- out.Write(text[:i+1]) ++ if i == len(text) { // No > found until the end of the text ++ return i ++ } ++ out.Write(text[:i+1]) // include the '>' + return i + } + diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..9a270837e7d647fa8becf34c53b48804c2d6f44e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/post_context.md @@ -0,0 +1,461 @@ +# Patch-overlapping Go context after the fix + +## `html/smartypants.go` (changed lines (374, 375, 376, 377)) + +```go +package html + +import ( + "bytes" + "io" + + "github.com/gomarkdown/markdown/parser" +) + +// SmartyPants rendering + +var ( + isSpace = parser.IsSpace + isAlnum = parser.IsAlnum + isPunctuation = parser.IsPunctuation +) + +// SPRenderer is a struct containing state of a Smartypants renderer. +type SPRenderer struct { + inSingleQuote bool + inDoubleQuote bool + callbacks [256]smartCallback +} + +func wordBoundary(c byte) bool { + return c == 0 || isSpace(c) || isPunctuation(c) +} + +func tolower(c byte) byte { + if c >= 'A' && c <= 'Z' { + return c - 'A' + 'a' + } + return c +} + +func isdigit(c byte) bool { + return c >= '0' && c <= '9' +} + +func smartQuoteHelper(out *bytes.Buffer, previousChar byte, nextChar byte, quote byte, isOpen *bool, addNBSP bool) bool { + // edge of the buffer is likely to be a tag that we don't get to see, + // so we treat it like text sometimes + + // enumerate all sixteen possibilities for (previousChar, nextChar) + // each can be one of {0, space, punct, other} + switch { + case previousChar == 0 && nextChar == 0: + // context is not any help here, so toggle + *isOpen = !*isOpen + case isSpace(previousChar) && nextChar == 0: + // [ "] might be [ "foo...] + *isOpen = true + case isPunctuation(previousChar) && nextChar == 0: + // [!"] hmm... could be [Run!"] or [("...] + *isOpen = false + case /* isnormal(previousChar) && */ nextChar == 0: + // [a"] is probably a close + *isOpen = false + case previousChar == 0 && isSpace(nextChar): + // [" ] might be [...foo" ] + *isOpen = false + case isSpace(previousChar) && isSpace(nextChar): + // [ " ] context is not any help here, so toggle + *isOpen = !*isOpen + case isPunctuation(previousChar) && isSpace(nextChar): + // [!" ] is probably a close + *isOpen = false + case /* isnormal(previousChar) && */ isSpace(nextChar): + // [a" ] this is one of the easy cases + *isOpen = false + case previousChar == 0 && isPunctuation(nextChar): + // ["!] hmm... could be ["$1.95] or ["!...] + *isOpen = false + case isSpace(previousChar) && isPunctuation(nextChar): + // [ "!] looks more like [ "$1.95] + *isOpen = true + case isPunctuation(previousChar) && isPunctuation(nextChar): + // [!"!] context is not any help here, so toggle + *isOpen = !*isOpen + case /* isnormal(previousChar) && */ isPunctuation(nextChar): + // [a"!] is probably a close + *isOpen = false + case previousChar == 0 /* && isnormal(nextChar) */ : + // ["a] is probably an open + *isOpen = true + case isSpace(previousChar) /* && isnormal(nextChar) */ : + // [ "a] this is one of the easy cases + *isOpen = true + case isPunctuation(previousChar) /* && isnormal(nextChar) */ : + // [!"a] is probably an open + *isOpen = true + default: + // [a'b] maybe a contraction? + *isOpen = false + } + + // Note that with the limited lookahead, this non-breaking + // space will also be appended to single double quotes. + if addNBSP && !*isOpen { + out.WriteString(" ") + } + + out.WriteByte('&') + if *isOpen { + out.WriteByte('l') + } else { + out.WriteByte('r') + } + out.WriteByte(quote) + out.WriteString("quo;") + + if addNBSP && *isOpen { + out.WriteString(" ") + } + + return true +} + +func (r *SPRenderer) smartSingleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 2 { + t1 := tolower(text[1]) + + if t1 == '\'' { + nextChar := byte(0) + if len(text) >= 3 { + nextChar = text[2] + } + if smartQuoteHelper(out, previousChar, nextChar, 'd', &r.inDoubleQuote, false) { + return 1 + } + } + + if (t1 == 's' || t1 == 't' || t1 == 'm' || t1 == 'd') && (len(text) < 3 || wordBoundary(text[2])) { + out.WriteString("’") + return 0 + } + + if len(text) >= 3 { + t2 := tolower(text[2]) + + if ((t1 == 'r' && t2 == 'e') || (t1 == 'l' && t2 == 'l') || (t1 == 'v' && t2 == 'e')) && + (len(text) < 4 || wordBoundary(text[3])) { + out.WriteString("’") + return 0 + } + } + } + + nextChar := byte(0) + if len(text) > 1 { + nextChar = text[1] + } + if smartQuoteHelper(out, previousChar, nextChar, 's', &r.inSingleQuote, false) { + return 0 + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartParens(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 3 { + t1 := tolower(text[1]) + t2 := tolower(text[2]) + + if t1 == 'c' && t2 == ')' { + out.WriteString("©") + return 2 + } + + if t1 == 'r' && t2 == ')' { + out.WriteString("®") + return 2 + } + + if len(text) >= 4 && t1 == 't' && t2 == 'm' && text[3] == ')' { + out.WriteString("™") + return 3 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartDash(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 2 { + if text[1] == '-' { + out.WriteString("—") + return 1 + } + + if wordBoundary(previousChar) && wordBoundary(text[1]) { + out.WriteString("–") + return 0 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartDashLatex(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 3 && text[1] == '-' && text[2] == '-' { + out.WriteString("—") + return 2 + } + if len(text) >= 2 && text[1] == '-' { + out.WriteString("–") + return 1 + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartAmpVariant(out *bytes.Buffer, previousChar byte, text []byte, quote byte, addNBSP bool) int { + if bytes.HasPrefix(text, []byte(""")) { + nextChar := byte(0) + if len(text) >= 7 { + nextChar = text[6] + } + if smartQuoteHelper(out, previousChar, nextChar, quote, &r.inDoubleQuote, addNBSP) { + return 5 + } + } + + if bytes.HasPrefix(text, []byte("�")) { + return 3 + } + + out.WriteByte('&') + return 0 +} + +func (r *SPRenderer) smartAmp(angledQuotes, addNBSP bool) func(*bytes.Buffer, byte, []byte) int { + var quote byte = 'd' + if angledQuotes { + quote = 'a' + } + + return func(out *bytes.Buffer, previousChar byte, text []byte) int { + return r.smartAmpVariant(out, previousChar, text, quote, addNBSP) + } +} + +func (r *SPRenderer) smartPeriod(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 3 && text[1] == '.' && text[2] == '.' { + out.WriteString("…") + return 2 + } + + if len(text) >= 5 && text[1] == ' ' && text[2] == '.' && text[3] == ' ' && text[4] == '.' { + out.WriteString("…") + return 4 + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartBacktick(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 2 && text[1] == '`' { + nextChar := byte(0) + if len(text) >= 3 { + nextChar = text[2] + } + if smartQuoteHelper(out, previousChar, nextChar, 'd', &r.inDoubleQuote, false) { + return 1 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartNumberGeneric(out *bytes.Buffer, previousChar byte, text []byte) int { + if wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 { + // is it of the form digits/digits(word boundary)?, i.e., \d+/\d+\b + // note: check for regular slash (/) or fraction slash (⁄, 0x2044, or 0xe2 81 84 in utf-8) + // and avoid changing dates like 1/23/2005 into fractions. + numEnd := 0 + for len(text) > numEnd && isdigit(text[numEnd]) { + numEnd++ + } + if numEnd == 0 { + out.WriteByte(text[0]) + return 0 + } + denStart := numEnd + 1 + if len(text) > numEnd+3 && text[numEnd] == 0xe2 && text[numEnd+1] == 0x81 && text[numEnd+2] == 0x84 { + denStart = numEnd + 3 + } else if len(text) < numEnd+2 || text[numEnd] != '/' { + out.WriteByte(text[0]) + return 0 + } + denEnd := denStart + for len(text) > denEnd && isdigit(text[denEnd]) { + denEnd++ + } + if denEnd == denStart { + out.WriteByte(text[0]) + return 0 + } + if len(text) == denEnd || wordBoundary(text[denEnd]) && text[denEnd] != '/' { + out.WriteString("") + out.Write(text[:numEnd]) + out.WriteString("⁄") + out.Write(text[denStart:denEnd]) + out.WriteString("") + return denEnd - 1 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartNumber(out *bytes.Buffer, previousChar byte, text []byte) int { + if wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 { + if text[0] == '1' && text[1] == '/' && text[2] == '2' { + if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' { + out.WriteString("½") + return 2 + } + } + + if text[0] == '1' && text[1] == '/' && text[2] == '4' { + if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 5 && tolower(text[3]) == 't' && tolower(text[4]) == 'h') { + out.WriteString("¼") + return 2 + } + } + + if text[0] == '3' && text[1] == '/' && text[2] == '4' { + if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 6 && tolower(text[3]) == 't' && tolower(text[4]) == 'h' && tolower(text[5]) == 's') { + out.WriteString("¾") + return 2 + } + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartDoubleQuoteVariant(out *bytes.Buffer, previousChar byte, text []byte, quote byte) int { + nextChar := byte(0) + if len(text) > 1 { + nextChar = text[1] + } + if !smartQuoteHelper(out, previousChar, nextChar, quote, &r.inDoubleQuote, false) { + out.WriteString(""") + } + + return 0 +} + +func (r *SPRenderer) smartDoubleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { + return r.smartDoubleQuoteVariant(out, previousChar, text, 'd') +} + +func (r *SPRenderer) smartAngledDoubleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { + return r.smartDoubleQuoteVariant(out, previousChar, text, 'a') +} + +func (r *SPRenderer) smartLeftAngle(out *bytes.Buffer, previousChar byte, text []byte) int { + i := 0 + + for i < len(text) && text[i] != '>' { + i++ + } + + if i == len(text) { // No > found until the end of the text + return i + } + out.Write(text[:i+1]) // include the '>' + return i +} + +type smartCallback func(out *bytes.Buffer, previousChar byte, text []byte) int + +// NewSmartypantsRenderer constructs a Smartypants renderer object. +func NewSmartypantsRenderer(flags Flags) *SPRenderer { + var ( + r SPRenderer + + smartAmpAngled = r.smartAmp(true, false) + smartAmpAngledNBSP = r.smartAmp(true, true) + smartAmpRegular = r.smartAmp(false, false) + smartAmpRegularNBSP = r.smartAmp(false, true) + + addNBSP = flags&SmartypantsQuotesNBSP != 0 + ) + + if flags&SmartypantsAngledQuotes == 0 { + r.callbacks['"'] = r.smartDoubleQuote + if !addNBSP { + r.callbacks['&'] = smartAmpRegular + } else { + r.callbacks['&'] = smartAmpRegularNBSP + } + } else { + r.callbacks['"'] = r.smartAngledDoubleQuote + if !addNBSP { + r.callbacks['&'] = smartAmpAngled + } else { + r.callbacks['&'] = smartAmpAngledNBSP + } + } + r.callbacks['\''] = r.smartSingleQuote + r.callbacks['('] = r.smartParens + if flags&SmartypantsDashes != 0 { + if flags&SmartypantsLatexDashes == 0 { + r.callbacks['-'] = r.smartDash + } else { + r.callbacks['-'] = r.smartDashLatex + } + } + r.callbacks['.'] = r.smartPeriod + if flags&SmartypantsFractions == 0 { + r.callbacks['1'] = r.smartNumber + r.callbacks['3'] = r.smartNumber + } else { + for ch := '1'; ch <= '9'; ch++ { + r.callbacks[ch] = r.smartNumberGeneric + } + } + r.callbacks['<'] = r.smartLeftAngle + r.callbacks['`'] = r.smartBacktick + return &r +} + +// Process is the entry point of the Smartypants renderer. +func (r *SPRenderer) Process(w io.Writer, text []byte) { + mark := 0 + for i := 0; i < len(text); i++ { + if action := r.callbacks[text[i]]; action != nil { + if i > mark { + w.Write(text[mark:i]) + } + previousChar := byte(0) + if i > 0 { + previousChar = text[i-1] + } + var tmp bytes.Buffer + i += action(&tmp, previousChar, text[i:]) + w.Write(tmp.Bytes()) + mark = i + 1 + } + } + if mark < len(text) { + w.Write(text[mark:]) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..2e968f82848a59c537497ab2bfd7fa473ec63b78 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/pre_context.md @@ -0,0 +1,458 @@ +# Patch-overlapping Go context before the fix + +## `html/smartypants.go` (changed lines (374, 375)) + +```go +package html + +import ( + "bytes" + "io" + + "github.com/gomarkdown/markdown/parser" +) + +// SmartyPants rendering + +var ( + isSpace = parser.IsSpace + isAlnum = parser.IsAlnum + isPunctuation = parser.IsPunctuation +) + +// SPRenderer is a struct containing state of a Smartypants renderer. +type SPRenderer struct { + inSingleQuote bool + inDoubleQuote bool + callbacks [256]smartCallback +} + +func wordBoundary(c byte) bool { + return c == 0 || isSpace(c) || isPunctuation(c) +} + +func tolower(c byte) byte { + if c >= 'A' && c <= 'Z' { + return c - 'A' + 'a' + } + return c +} + +func isdigit(c byte) bool { + return c >= '0' && c <= '9' +} + +func smartQuoteHelper(out *bytes.Buffer, previousChar byte, nextChar byte, quote byte, isOpen *bool, addNBSP bool) bool { + // edge of the buffer is likely to be a tag that we don't get to see, + // so we treat it like text sometimes + + // enumerate all sixteen possibilities for (previousChar, nextChar) + // each can be one of {0, space, punct, other} + switch { + case previousChar == 0 && nextChar == 0: + // context is not any help here, so toggle + *isOpen = !*isOpen + case isSpace(previousChar) && nextChar == 0: + // [ "] might be [ "foo...] + *isOpen = true + case isPunctuation(previousChar) && nextChar == 0: + // [!"] hmm... could be [Run!"] or [("...] + *isOpen = false + case /* isnormal(previousChar) && */ nextChar == 0: + // [a"] is probably a close + *isOpen = false + case previousChar == 0 && isSpace(nextChar): + // [" ] might be [...foo" ] + *isOpen = false + case isSpace(previousChar) && isSpace(nextChar): + // [ " ] context is not any help here, so toggle + *isOpen = !*isOpen + case isPunctuation(previousChar) && isSpace(nextChar): + // [!" ] is probably a close + *isOpen = false + case /* isnormal(previousChar) && */ isSpace(nextChar): + // [a" ] this is one of the easy cases + *isOpen = false + case previousChar == 0 && isPunctuation(nextChar): + // ["!] hmm... could be ["$1.95] or ["!...] + *isOpen = false + case isSpace(previousChar) && isPunctuation(nextChar): + // [ "!] looks more like [ "$1.95] + *isOpen = true + case isPunctuation(previousChar) && isPunctuation(nextChar): + // [!"!] context is not any help here, so toggle + *isOpen = !*isOpen + case /* isnormal(previousChar) && */ isPunctuation(nextChar): + // [a"!] is probably a close + *isOpen = false + case previousChar == 0 /* && isnormal(nextChar) */ : + // ["a] is probably an open + *isOpen = true + case isSpace(previousChar) /* && isnormal(nextChar) */ : + // [ "a] this is one of the easy cases + *isOpen = true + case isPunctuation(previousChar) /* && isnormal(nextChar) */ : + // [!"a] is probably an open + *isOpen = true + default: + // [a'b] maybe a contraction? + *isOpen = false + } + + // Note that with the limited lookahead, this non-breaking + // space will also be appended to single double quotes. + if addNBSP && !*isOpen { + out.WriteString(" ") + } + + out.WriteByte('&') + if *isOpen { + out.WriteByte('l') + } else { + out.WriteByte('r') + } + out.WriteByte(quote) + out.WriteString("quo;") + + if addNBSP && *isOpen { + out.WriteString(" ") + } + + return true +} + +func (r *SPRenderer) smartSingleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 2 { + t1 := tolower(text[1]) + + if t1 == '\'' { + nextChar := byte(0) + if len(text) >= 3 { + nextChar = text[2] + } + if smartQuoteHelper(out, previousChar, nextChar, 'd', &r.inDoubleQuote, false) { + return 1 + } + } + + if (t1 == 's' || t1 == 't' || t1 == 'm' || t1 == 'd') && (len(text) < 3 || wordBoundary(text[2])) { + out.WriteString("’") + return 0 + } + + if len(text) >= 3 { + t2 := tolower(text[2]) + + if ((t1 == 'r' && t2 == 'e') || (t1 == 'l' && t2 == 'l') || (t1 == 'v' && t2 == 'e')) && + (len(text) < 4 || wordBoundary(text[3])) { + out.WriteString("’") + return 0 + } + } + } + + nextChar := byte(0) + if len(text) > 1 { + nextChar = text[1] + } + if smartQuoteHelper(out, previousChar, nextChar, 's', &r.inSingleQuote, false) { + return 0 + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartParens(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 3 { + t1 := tolower(text[1]) + t2 := tolower(text[2]) + + if t1 == 'c' && t2 == ')' { + out.WriteString("©") + return 2 + } + + if t1 == 'r' && t2 == ')' { + out.WriteString("®") + return 2 + } + + if len(text) >= 4 && t1 == 't' && t2 == 'm' && text[3] == ')' { + out.WriteString("™") + return 3 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartDash(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 2 { + if text[1] == '-' { + out.WriteString("—") + return 1 + } + + if wordBoundary(previousChar) && wordBoundary(text[1]) { + out.WriteString("–") + return 0 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartDashLatex(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 3 && text[1] == '-' && text[2] == '-' { + out.WriteString("—") + return 2 + } + if len(text) >= 2 && text[1] == '-' { + out.WriteString("–") + return 1 + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartAmpVariant(out *bytes.Buffer, previousChar byte, text []byte, quote byte, addNBSP bool) int { + if bytes.HasPrefix(text, []byte(""")) { + nextChar := byte(0) + if len(text) >= 7 { + nextChar = text[6] + } + if smartQuoteHelper(out, previousChar, nextChar, quote, &r.inDoubleQuote, addNBSP) { + return 5 + } + } + + if bytes.HasPrefix(text, []byte("�")) { + return 3 + } + + out.WriteByte('&') + return 0 +} + +func (r *SPRenderer) smartAmp(angledQuotes, addNBSP bool) func(*bytes.Buffer, byte, []byte) int { + var quote byte = 'd' + if angledQuotes { + quote = 'a' + } + + return func(out *bytes.Buffer, previousChar byte, text []byte) int { + return r.smartAmpVariant(out, previousChar, text, quote, addNBSP) + } +} + +func (r *SPRenderer) smartPeriod(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 3 && text[1] == '.' && text[2] == '.' { + out.WriteString("…") + return 2 + } + + if len(text) >= 5 && text[1] == ' ' && text[2] == '.' && text[3] == ' ' && text[4] == '.' { + out.WriteString("…") + return 4 + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartBacktick(out *bytes.Buffer, previousChar byte, text []byte) int { + if len(text) >= 2 && text[1] == '`' { + nextChar := byte(0) + if len(text) >= 3 { + nextChar = text[2] + } + if smartQuoteHelper(out, previousChar, nextChar, 'd', &r.inDoubleQuote, false) { + return 1 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartNumberGeneric(out *bytes.Buffer, previousChar byte, text []byte) int { + if wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 { + // is it of the form digits/digits(word boundary)?, i.e., \d+/\d+\b + // note: check for regular slash (/) or fraction slash (⁄, 0x2044, or 0xe2 81 84 in utf-8) + // and avoid changing dates like 1/23/2005 into fractions. + numEnd := 0 + for len(text) > numEnd && isdigit(text[numEnd]) { + numEnd++ + } + if numEnd == 0 { + out.WriteByte(text[0]) + return 0 + } + denStart := numEnd + 1 + if len(text) > numEnd+3 && text[numEnd] == 0xe2 && text[numEnd+1] == 0x81 && text[numEnd+2] == 0x84 { + denStart = numEnd + 3 + } else if len(text) < numEnd+2 || text[numEnd] != '/' { + out.WriteByte(text[0]) + return 0 + } + denEnd := denStart + for len(text) > denEnd && isdigit(text[denEnd]) { + denEnd++ + } + if denEnd == denStart { + out.WriteByte(text[0]) + return 0 + } + if len(text) == denEnd || wordBoundary(text[denEnd]) && text[denEnd] != '/' { + out.WriteString("") + out.Write(text[:numEnd]) + out.WriteString("⁄") + out.Write(text[denStart:denEnd]) + out.WriteString("") + return denEnd - 1 + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartNumber(out *bytes.Buffer, previousChar byte, text []byte) int { + if wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 { + if text[0] == '1' && text[1] == '/' && text[2] == '2' { + if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' { + out.WriteString("½") + return 2 + } + } + + if text[0] == '1' && text[1] == '/' && text[2] == '4' { + if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 5 && tolower(text[3]) == 't' && tolower(text[4]) == 'h') { + out.WriteString("¼") + return 2 + } + } + + if text[0] == '3' && text[1] == '/' && text[2] == '4' { + if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 6 && tolower(text[3]) == 't' && tolower(text[4]) == 'h' && tolower(text[5]) == 's') { + out.WriteString("¾") + return 2 + } + } + } + + out.WriteByte(text[0]) + return 0 +} + +func (r *SPRenderer) smartDoubleQuoteVariant(out *bytes.Buffer, previousChar byte, text []byte, quote byte) int { + nextChar := byte(0) + if len(text) > 1 { + nextChar = text[1] + } + if !smartQuoteHelper(out, previousChar, nextChar, quote, &r.inDoubleQuote, false) { + out.WriteString(""") + } + + return 0 +} + +func (r *SPRenderer) smartDoubleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { + return r.smartDoubleQuoteVariant(out, previousChar, text, 'd') +} + +func (r *SPRenderer) smartAngledDoubleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { + return r.smartDoubleQuoteVariant(out, previousChar, text, 'a') +} + +func (r *SPRenderer) smartLeftAngle(out *bytes.Buffer, previousChar byte, text []byte) int { + i := 0 + + for i < len(text) && text[i] != '>' { + i++ + } + + out.Write(text[:i+1]) + return i +} + +type smartCallback func(out *bytes.Buffer, previousChar byte, text []byte) int + +// NewSmartypantsRenderer constructs a Smartypants renderer object. +func NewSmartypantsRenderer(flags Flags) *SPRenderer { + var ( + r SPRenderer + + smartAmpAngled = r.smartAmp(true, false) + smartAmpAngledNBSP = r.smartAmp(true, true) + smartAmpRegular = r.smartAmp(false, false) + smartAmpRegularNBSP = r.smartAmp(false, true) + + addNBSP = flags&SmartypantsQuotesNBSP != 0 + ) + + if flags&SmartypantsAngledQuotes == 0 { + r.callbacks['"'] = r.smartDoubleQuote + if !addNBSP { + r.callbacks['&'] = smartAmpRegular + } else { + r.callbacks['&'] = smartAmpRegularNBSP + } + } else { + r.callbacks['"'] = r.smartAngledDoubleQuote + if !addNBSP { + r.callbacks['&'] = smartAmpAngled + } else { + r.callbacks['&'] = smartAmpAngledNBSP + } + } + r.callbacks['\''] = r.smartSingleQuote + r.callbacks['('] = r.smartParens + if flags&SmartypantsDashes != 0 { + if flags&SmartypantsLatexDashes == 0 { + r.callbacks['-'] = r.smartDash + } else { + r.callbacks['-'] = r.smartDashLatex + } + } + r.callbacks['.'] = r.smartPeriod + if flags&SmartypantsFractions == 0 { + r.callbacks['1'] = r.smartNumber + r.callbacks['3'] = r.smartNumber + } else { + for ch := '1'; ch <= '9'; ch++ { + r.callbacks[ch] = r.smartNumberGeneric + } + } + r.callbacks['<'] = r.smartLeftAngle + r.callbacks['`'] = r.smartBacktick + return &r +} + +// Process is the entry point of the Smartypants renderer. +func (r *SPRenderer) Process(w io.Writer, text []byte) { + mark := 0 + for i := 0; i < len(text); i++ { + if action := r.callbacks[text[i]]; action != nil { + if i > mark { + w.Write(text[mark:i]) + } + previousChar := byte(0) + if i > 0 { + previousChar = text[i-1] + } + var tmp bytes.Buffer + i += action(&tmp, previousChar, text[i:]) + w.Write(tmp.Bytes()) + mark = i + 1 + } + } + if mark < len(text) { + w.Write(text[mark:]) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/task.json new file mode 100644 index 0000000000000000000000000000000000000000..b6cf2be836df419294991c84fbaef22a9be75ccf --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-30e495de2402bd4bed4b", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-30e495de2402bd4bed4b", + "project_id": "morefixes__gomarkdown__markdown", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "html/smartypants.go" + ], + "patch_units": { + "before": [ + "html/smartypants.go" + ], + "after": [ + "html/smartypants.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/eef62265fd1f73c374320cb1292f8973749f61e6b47f09e22edf67f7a30b13b0/database", + "cache_key": "eef62265fd1f73c374320cb1292f8973749f61e6b47f09e22edf67f7a30b13b0", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/03c0b2a1eb1c8ce37f1464ff0ca9d1fdc3825ba2b9d5575c807d9dc36a8a9b80/database", + "cache_key": "03c0b2a1eb1c8ce37f1464ff0ca9d1fdc3825ba2b9d5575c807d9dc36a8a9b80", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/b0b10a74714dcba1d9d1a26532ecee15e44891ca6bbaa5d5f9d09669fee60caa/database", + "cache_key": "b0b10a74714dcba1d9d1a26532ecee15e44891ca6bbaa5d5f9d09669fee60caa", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-30e495de2402bd4bed4b/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-30e495de2402bd4bed4b/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-30e495de2402bd4bed4b/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..3d0a35690f6fb7d10fca63cb789037760c3f6f55 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/patch.diff @@ -0,0 +1,242 @@ +diff --git a/cmd/cmd.go b/cmd/cmd.go +index 89b551f4..909e8e4b 100644 +--- a/cmd/cmd.go ++++ b/cmd/cmd.go +@@ -162,9 +162,6 @@ func tempZipFiles(path string) (string, error) { + } + defer tempfile.Close() + +- zipfile := zip.NewWriter(tempfile) +- defer zipfile.Close() +- + detectContentType := func(path string) (string, error) { + f, err := os.Open(path) + if err != nil { +@@ -233,6 +230,9 @@ func tempZipFiles(path string) (string, error) { + files = append(files, tks...) + } + ++ zipfile := zip.NewWriter(tempfile) ++ defer zipfile.Close() ++ + for _, file := range files { + f, err := os.Open(file) + if err != nil { +diff --git a/server/model.go b/server/model.go +index 055ffd63..d56e641b 100644 +--- a/server/model.go ++++ b/server/model.go +@@ -11,6 +11,7 @@ import ( + "net/http" + "os" + "path/filepath" ++ "strings" + + "github.com/ollama/ollama/api" + "github.com/ollama/ollama/convert" +@@ -77,62 +78,80 @@ func parseFromModel(ctx context.Context, name model.Name, fn func(api.ProgressRe + return layers, nil + } + +-func parseFromZipFile(_ context.Context, file *os.File, digest string, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { ++func extractFromZipFile(p string, file *os.File, fn func(api.ProgressResponse)) error { + stat, err := file.Stat() + if err != nil { +- return nil, err ++ return err + } + + r, err := zip.NewReader(file, stat.Size()) + if err != nil { +- return nil, err +- } +- +- tempdir, err := os.MkdirTemp(filepath.Dir(file.Name()), "") +- if err != nil { +- return nil, err ++ return err + } +- defer os.RemoveAll(tempdir) + + fn(api.ProgressResponse{Status: "unpacking model metadata"}) + for _, f := range r.File { ++ n := filepath.Join(p, f.Name) ++ if !strings.HasPrefix(n, p) { ++ slog.Warn("skipped extracting file outside of context", "name", f.Name) ++ continue ++ } ++ ++ if err := os.MkdirAll(filepath.Dir(n), 0o750); err != nil { ++ return err ++ } ++ + // TODO(mxyng): this should not write out all files to disk +- outfile, err := os.Create(filepath.Join(tempdir, f.Name)) ++ outfile, err := os.Create(n) + if err != nil { +- return nil, err ++ return err + } + defer outfile.Close() + + infile, err := f.Open() + if err != nil { +- return nil, err ++ return err + } + defer infile.Close() + + if _, err = io.Copy(outfile, infile); err != nil { +- return nil, err ++ return err + } + + if err := outfile.Close(); err != nil { +- return nil, err ++ return err + } + + if err := infile.Close(); err != nil { +- return nil, err ++ return err + } + } + +- mf, err := convert.GetModelFormat(tempdir) ++ return nil ++} ++ ++func parseFromZipFile(_ context.Context, file *os.File, digest string, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { ++ tempDir, err := os.MkdirTemp(filepath.Dir(file.Name()), "") ++ if err != nil { ++ return nil, err ++ } ++ defer os.RemoveAll(tempDir) ++ ++ if err := extractFromZipFile(tempDir, file, fn); err != nil { ++ return nil, err ++ } ++ ++ mf, err := convert.GetModelFormat(tempDir) + if err != nil { + return nil, err + } + +- params, err := mf.GetParams(tempdir) ++ params, err := mf.GetParams(tempDir) + if err != nil { + return nil, err + } + +- mArch, err := mf.GetModelArch("", tempdir, params) ++ mArch, err := mf.GetModelArch("", tempDir, params) + if err != nil { + return nil, err + } +@@ -150,7 +169,7 @@ func parseFromZipFile(_ context.Context, file *os.File, digest string, fn func(a + + // TODO(mxyng): this should write directly into a layer + // e.g. NewLayer(arch.Reader(), "application/vnd.ollama.image.model") +- temp, err := os.CreateTemp(tempdir, "fp16") ++ temp, err := os.CreateTemp(tempDir, "fp16") + if err != nil { + return nil, err + } +diff --git a/server/model_test.go b/server/model_test.go +new file mode 100644 +index 00000000..c3023eb2 +--- /dev/null ++++ b/server/model_test.go +@@ -0,0 +1,92 @@ ++package server ++ ++import ( ++ "archive/zip" ++ "bytes" ++ "io" ++ "os" ++ "path/filepath" ++ "slices" ++ "testing" ++ ++ "github.com/ollama/ollama/api" ++) ++ ++func createZipFile(t *testing.T, name string) *os.File { ++ t.Helper() ++ ++ f, err := os.CreateTemp(t.TempDir(), "") ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ zf := zip.NewWriter(f) ++ defer zf.Close() ++ ++ zh, err := zf.CreateHeader(&zip.FileHeader{Name: name}) ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ if _, err := io.Copy(zh, bytes.NewReader([]byte(""))); err != nil { ++ t.Fatal(err) ++ } ++ ++ return f ++} ++ ++func TestExtractFromZipFile(t *testing.T) { ++ cases := []struct { ++ name string ++ expect []string ++ }{ ++ { ++ name: "good", ++ expect: []string{"good"}, ++ }, ++ { ++ name: filepath.Join("..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "bad"), ++ }, ++ } ++ ++ for _, tt := range cases { ++ t.Run(tt.name, func(t *testing.T) { ++ f := createZipFile(t, tt.name) ++ defer f.Close() ++ ++ tempDir := t.TempDir() ++ if err := extractFromZipFile(tempDir, f, func(api.ProgressResponse) {}); err != nil { ++ t.Fatal(err) ++ } ++ ++ var matches []string ++ if err := filepath.Walk(tempDir, func(p string, fi os.FileInfo, err error) error { ++ if err != nil { ++ return err ++ } ++ ++ if !fi.IsDir() { ++ matches = append(matches, p) ++ } ++ ++ return nil ++ }); err != nil { ++ t.Fatal(err) ++ } ++ ++ var actual []string ++ for _, match := range matches { ++ rel, err := filepath.Rel(tempDir, match) ++ if err != nil { ++ t.Error(err) ++ } ++ ++ actual = append(actual, rel) ++ } ++ ++ if !slices.Equal(actual, tt.expect) { ++ t.Fatalf("expected %d files, got %d", len(tt.expect), len(matches)) ++ } ++ }) ++ } ++} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..c659b704b8fbf270e3a2dc5496514ccf291458ff --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/post_context.md @@ -0,0 +1,1767 @@ +# Patch-overlapping Go context after the fix + +## `cmd/cmd.go` (changed lines (165, 233, 234, 235)) + +```go +package cmd + +import ( + "archive/zip" + "bytes" + "context" + "crypto/ed25519" + "crypto/rand" + "crypto/sha256" + "encoding/pem" + "errors" + "fmt" + "io" + "log" + "math" + "net" + "net/http" + "os" + "os/signal" + "path/filepath" + "regexp" + "runtime" + "slices" + "strings" + "syscall" + "time" + + "github.com/containerd/console" + "github.com/mattn/go-runewidth" + "github.com/olekukonko/tablewriter" + "github.com/spf13/cobra" + "golang.org/x/crypto/ssh" + "golang.org/x/term" + + "github.com/ollama/ollama/api" + "github.com/ollama/ollama/auth" + "github.com/ollama/ollama/envconfig" + "github.com/ollama/ollama/format" + "github.com/ollama/ollama/parser" + "github.com/ollama/ollama/progress" + "github.com/ollama/ollama/server" + "github.com/ollama/ollama/types/errtypes" + "github.com/ollama/ollama/types/model" + "github.com/ollama/ollama/version" +) + +func CreateHandler(cmd *cobra.Command, args []string) error { + filename, _ := cmd.Flags().GetString("file") + filename, err := filepath.Abs(filename) + if err != nil { + return err + } + + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.Stop() + + f, err := os.Open(filename) + if err != nil { + return err + } + defer f.Close() + + modelfile, err := parser.ParseFile(f) + if err != nil { + return err + } + + home, err := os.UserHomeDir() + if err != nil { + return err + } + + status := "transferring model data" + spinner := progress.NewSpinner(status) + p.Add(status, spinner) + + for i := range modelfile.Commands { + switch modelfile.Commands[i].Name { + case "model", "adapter": + path := modelfile.Commands[i].Args + if path == "~" { + path = home + } else if strings.HasPrefix(path, "~/") { + path = filepath.Join(home, path[2:]) + } + + if !filepath.IsAbs(path) { + path = filepath.Join(filepath.Dir(filename), path) + } + + fi, err := os.Stat(path) + if errors.Is(err, os.ErrNotExist) && modelfile.Commands[i].Name == "model" { + continue + } else if err != nil { + return err + } + + if fi.IsDir() { + // this is likely a safetensors or pytorch directory + // TODO make this work w/ adapters + tempfile, err := tempZipFiles(path) + if err != nil { + return err + } + defer os.RemoveAll(tempfile) + + path = tempfile + } + + digest, err := createBlob(cmd, client, path) + if err != nil { + return err + } + + modelfile.Commands[i].Args = "@" + digest + } + } + + bars := make(map[string]*progress.Bar) + fn := func(resp api.ProgressResponse) error { + if resp.Digest != "" { + spinner.Stop() + + bar, ok := bars[resp.Digest] + if !ok { + bar = progress.NewBar(fmt.Sprintf("pulling %s...", resp.Digest[7:19]), resp.Total, resp.Completed) + bars[resp.Digest] = bar + p.Add(resp.Digest, bar) + } + + bar.Set(resp.Completed) + } else if status != resp.Status { + spinner.Stop() + + status = resp.Status + spinner = progress.NewSpinner(status) + p.Add(status, spinner) + } + + return nil + } + + quantize, _ := cmd.Flags().GetString("quantize") + + request := api.CreateRequest{Name: args[0], Modelfile: modelfile.String(), Quantize: quantize} + if err := client.Create(cmd.Context(), &request, fn); err != nil { + return err + } + + return nil +} + +func tempZipFiles(path string) (string, error) { + tempfile, err := os.CreateTemp("", "ollama-tf") + if err != nil { + return "", err + } + defer tempfile.Close() + + detectContentType := func(path string) (string, error) { + f, err := os.Open(path) + if err != nil { + return "", err + } + defer f.Close() + + var b bytes.Buffer + b.Grow(512) + + if _, err := io.CopyN(&b, f, 512); err != nil && !errors.Is(err, io.EOF) { + return "", err + } + + contentType, _, _ := strings.Cut(http.DetectContentType(b.Bytes()), ";") + return contentType, nil + } + + glob := func(pattern, contentType string) ([]string, error) { + matches, err := filepath.Glob(pattern) + if err != nil { + return nil, err + } + + for _, safetensor := range matches { + if ct, err := detectContentType(safetensor); err != nil { + return nil, err + } else if ct != contentType { + return nil, fmt.Errorf("invalid content type: expected %s for %s", ct, safetensor) + } + } + + return matches, nil + } + + var files []string + if st, _ := glob(filepath.Join(path, "model*.safetensors"), "application/octet-stream"); len(st) > 0 { + // safetensors files might be unresolved git lfs references; skip if they are + // covers model-x-of-y.safetensors, model.fp32-x-of-y.safetensors, model.safetensors + files = append(files, st...) + } else if pt, _ := glob(filepath.Join(path, "pytorch_model*.bin"), "application/zip"); len(pt) > 0 { + // pytorch files might also be unresolved git lfs references; skip if they are + // covers pytorch_model-x-of-y.bin, pytorch_model.fp32-x-of-y.bin, pytorch_model.bin + files = append(files, pt...) + } else if pt, _ := glob(filepath.Join(path, "consolidated*.pth"), "application/zip"); len(pt) > 0 { + // pytorch files might also be unresolved git lfs references; skip if they are + // covers consolidated.x.pth, consolidated.pth + files = append(files, pt...) + } else { + return "", errors.New("no safetensors or torch files found") + } + + // add configuration files, json files are detected as text/plain + js, err := glob(filepath.Join(path, "*.json"), "text/plain") + if err != nil { + return "", err + } + files = append(files, js...) + + if tks, _ := glob(filepath.Join(path, "tokenizer.model"), "application/octet-stream"); len(tks) > 0 { + // add tokenizer.model if it exists, tokenizer.json is automatically picked up by the previous glob + // tokenizer.model might be a unresolved git lfs reference; error if it is + files = append(files, tks...) + } else if tks, _ := glob(filepath.Join(path, "**/tokenizer.model"), "text/plain"); len(tks) > 0 { + // some times tokenizer.model is in a subdirectory (e.g. meta-llama/Meta-Llama-3-8B) + files = append(files, tks...) + } + + zipfile := zip.NewWriter(tempfile) + defer zipfile.Close() + + for _, file := range files { + f, err := os.Open(file) + if err != nil { + return "", err + } + defer f.Close() + + fi, err := f.Stat() + if err != nil { + return "", err + } + + zfi, err := zip.FileInfoHeader(fi) + if err != nil { + return "", err + } + + zf, err := zipfile.CreateHeader(zfi) + if err != nil { + return "", err + } + + if _, err := io.Copy(zf, f); err != nil { + return "", err + } + } + + return tempfile.Name(), nil +} + +func createBlob(cmd *cobra.Command, client *api.Client, path string) (string, error) { + bin, err := os.Open(path) + if err != nil { + return "", err + } + defer bin.Close() + + hash := sha256.New() + if _, err := io.Copy(hash, bin); err != nil { + return "", err + } + + if _, err := bin.Seek(0, io.SeekStart); err != nil { + return "", err + } + + digest := fmt.Sprintf("sha256:%x", hash.Sum(nil)) + if err = client.CreateBlob(cmd.Context(), digest, bin); err != nil { + return "", err + } + return digest, nil +} + +func RunHandler(cmd *cobra.Command, args []string) error { + interactive := true + + opts := runOptions{ + Model: args[0], + WordWrap: os.Getenv("TERM") == "xterm-256color", + Options: map[string]interface{}{}, + } + + format, err := cmd.Flags().GetString("format") + if err != nil { + return err + } + opts.Format = format + + keepAlive, err := cmd.Flags().GetString("keepalive") + if err != nil { + return err + } + if keepAlive != "" { + d, err := time.ParseDuration(keepAlive) + if err != nil { + return err + } + opts.KeepAlive = &api.Duration{Duration: d} + } + + prompts := args[1:] + // prepend stdin to the prompt if provided + if !term.IsTerminal(int(os.Stdin.Fd())) { + in, err := io.ReadAll(os.Stdin) + if err != nil { + return err + } + + prompts = append([]string{string(in)}, prompts...) + opts.WordWrap = false + interactive = false + } + opts.Prompt = strings.Join(prompts, " ") + if len(prompts) > 0 { + interactive = false + } + + nowrap, err := cmd.Flags().GetBool("nowordwrap") + if err != nil { + return err + } + opts.WordWrap = !nowrap + + // Fill out the rest of the options based on information about the + // model. + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + name := args[0] + info, err := func() (*api.ShowResponse, error) { + showReq := &api.ShowRequest{Name: name} + info, err := client.Show(cmd.Context(), showReq) + var se api.StatusError + if errors.As(err, &se) && se.StatusCode == http.StatusNotFound { + if err := PullHandler(cmd, []string{name}); err != nil { + return nil, err + } + return client.Show(cmd.Context(), &api.ShowRequest{Name: name}) + } + return info, err + }() + if err != nil { + return err + } + + opts.MultiModal = slices.Contains(info.Details.Families, "clip") + opts.ParentModel = info.Details.ParentModel + opts.Messages = append(opts.Messages, info.Messages...) + + if interactive { + return generateInteractive(cmd, opts) + } + return generate(cmd, opts) +} + +func errFromUnknownKey(unknownKeyErr error) error { + // find SSH public key in the error message + sshKeyPattern := `ssh-\w+ [^\s"]+` + re := regexp.MustCompile(sshKeyPattern) + matches := re.FindStringSubmatch(unknownKeyErr.Error()) + + if len(matches) > 0 { + serverPubKey := matches[0] + + localPubKey, err := auth.GetPublicKey() + if err != nil { + return unknownKeyErr + } + + if runtime.GOOS == "linux" && serverPubKey != localPubKey { + // try the ollama service public key + svcPubKey, err := os.ReadFile("/usr/share/ollama/.ollama/id_ed25519.pub") + if err != nil { + return unknownKeyErr + } + localPubKey = strings.TrimSpace(string(svcPubKey)) + } + + // check if the returned public key matches the local public key, this prevents adding a remote key to the user's account + if serverPubKey != localPubKey { + return unknownKeyErr + } + + var msg strings.Builder + msg.WriteString(unknownKeyErr.Error()) + msg.WriteString("\n\nYour ollama key is:\n") + msg.WriteString(localPubKey) + msg.WriteString("\nAdd your key at:\n") + msg.WriteString("https://ollama.com/settings/keys") + + return errors.New(msg.String()) + } + + return unknownKeyErr +} + +func PushHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + insecure, err := cmd.Flags().GetBool("insecure") + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.Stop() + + bars := make(map[string]*progress.Bar) + var status string + var spinner *progress.Spinner + + fn := func(resp api.ProgressResponse) error { + if resp.Digest != "" { + if spinner != nil { + spinner.Stop() + } + + bar, ok := bars[resp.Digest] + if !ok { + bar = progress.NewBar(fmt.Sprintf("pushing %s...", resp.Digest[7:19]), resp.Total, resp.Completed) + bars[resp.Digest] = bar + p.Add(resp.Digest, bar) + } + + bar.Set(resp.Completed) + } else if status != resp.Status { + if spinner != nil { + spinner.Stop() + } + + status = resp.Status + spinner = progress.NewSpinner(status) + p.Add(status, spinner) + } + + return nil + } + + request := api.PushRequest{Name: args[0], Insecure: insecure} + if err := client.Push(cmd.Context(), &request, fn); err != nil { + if spinner != nil { + spinner.Stop() + } + if strings.Contains(err.Error(), "access denied") { + return errors.New("you are not authorized to push to this namespace, create the model under a namespace you own") + } + host := model.ParseName(args[0]).Host + isOllamaHost := strings.HasSuffix(host, ".ollama.ai") || strings.HasSuffix(host, ".ollama.com") + if strings.Contains(err.Error(), errtypes.UnknownOllamaKeyErrMsg) && isOllamaHost { + // the user has not added their ollama key to ollama.com + // re-throw an error with a more user-friendly message + return errFromUnknownKey(err) + } + + return err + } + + spinner.Stop() + return nil +} + +func ListHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + models, err := client.List(cmd.Context()) + if err != nil { + return err + } + + var data [][]string + + for _, m := range models.Models { + if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) { + data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), format.HumanTime(m.ModifiedAt, "Never")}) + } + } + + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"NAME", "ID", "SIZE", "MODIFIED"}) + table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) + table.SetAlignment(tablewriter.ALIGN_LEFT) + table.SetHeaderLine(false) + table.SetBorder(false) + table.SetNoWhiteSpace(true) + table.SetTablePadding("\t") + table.AppendBulk(data) + table.Render() + + return nil +} + +func ListRunningHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + models, err := client.ListRunning(cmd.Context()) + if err != nil { + return err + } + + var data [][]string + + for _, m := range models.Models { + if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) { + var procStr string + switch { + case m.SizeVRAM == 0: + procStr = "100% CPU" + case m.SizeVRAM == m.Size: + procStr = "100% GPU" + case m.SizeVRAM > m.Size || m.Size == 0: + procStr = "Unknown" + default: + sizeCPU := m.Size - m.SizeVRAM + cpuPercent := math.Round(float64(sizeCPU) / float64(m.Size) * 100) + procStr = fmt.Sprintf("%d%%/%d%% CPU/GPU", int(cpuPercent), int(100-cpuPercent)) + } + data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), procStr, format.HumanTime(m.ExpiresAt, "Never")}) + } + } + + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"NAME", "ID", "SIZE", "PROCESSOR", "UNTIL"}) + table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) + table.SetAlignment(tablewriter.ALIGN_LEFT) + table.SetHeaderLine(false) + table.SetBorder(false) + table.SetNoWhiteSpace(true) + table.SetTablePadding("\t") + table.AppendBulk(data) + table.Render() + + return nil +} + +func DeleteHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + for _, name := range args { + req := api.DeleteRequest{Name: name} + if err := client.Delete(cmd.Context(), &req); err != nil { + return err + } + fmt.Printf("deleted '%s'\n", name) + } + return nil +} + +func ShowHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + license, errLicense := cmd.Flags().GetBool("license") + modelfile, errModelfile := cmd.Flags().GetBool("modelfile") + parameters, errParams := cmd.Flags().GetBool("parameters") + system, errSystem := cmd.Flags().GetBool("system") + template, errTemplate := cmd.Flags().GetBool("template") + + for _, boolErr := range []error{errLicense, errModelfile, errParams, errSystem, errTemplate} { + if boolErr != nil { + return errors.New("error retrieving flags") + } + } + + flagsSet := 0 + showType := "" + + if license { + flagsSet++ + showType = "license" + } + + if modelfile { + flagsSet++ + showType = "modelfile" + } + + if parameters { + flagsSet++ + showType = "parameters" + } + + if system { + flagsSet++ + showType = "system" + } + + if template { + flagsSet++ + showType = "template" + } + + if flagsSet > 1 { + return errors.New("only one of '--license', '--modelfile', '--parameters', '--system', or '--template' can be specified") + } + + if flagsSet == 1 { + req := api.ShowRequest{Name: args[0]} + resp, err := client.Show(cmd.Context(), &req) + if err != nil { + return err + } + + switch showType { + case "license": + fmt.Println(resp.License) + case "modelfile": + fmt.Println(resp.Modelfile) + case "parameters": + fmt.Println(resp.Parameters) + case "system": + fmt.Println(resp.System) + case "template": + fmt.Println(resp.Template) + } + + return nil + } + + req := api.ShowRequest{Name: args[0]} + resp, err := client.Show(cmd.Context(), &req) + if err != nil { + return err + } + + arch := resp.ModelInfo["general.architecture"].(string) + + modelData := [][]string{ + {"arch", arch}, + {"parameters", resp.Details.ParameterSize}, + {"quantization", resp.Details.QuantizationLevel}, + {"context length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.context_length", arch)].(float64))}, + {"embedding length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.embedding_length", arch)].(float64))}, + } + + mainTableData := [][]string{ + {"Model"}, + {renderSubTable(modelData, false)}, + } + + if resp.ProjectorInfo != nil { + projectorData := [][]string{ + {"arch", "clip"}, + {"parameters", format.HumanNumber(uint64(resp.ProjectorInfo["general.parameter_count"].(float64)))}, + {"projector type", resp.ProjectorInfo["clip.projector_type"].(string)}, + {"embedding length", fmt.Sprintf("%v", resp.ProjectorInfo["clip.vision.embedding_length"].(float64))}, + {"projection dimensionality", fmt.Sprintf("%v", resp.ProjectorInfo["clip.vision.projection_dim"].(float64))}, + } + + mainTableData = append(mainTableData, + []string{"Projector"}, + []string{renderSubTable(projectorData, false)}, + ) + } + + if resp.Parameters != "" { + mainTableData = append(mainTableData, []string{"Parameters"}, []string{formatParams(resp.Parameters)}) + } + + if resp.System != "" { + mainTableData = append(mainTableData, []string{"System"}, []string{renderSubTable(twoLines(resp.System), true)}) + } + + if resp.License != "" { + mainTableData = append(mainTableData, []string{"License"}, []string{renderSubTable(twoLines(resp.License), true)}) + } + + table := tablewriter.NewWriter(os.Stdout) + table.SetAutoWrapText(false) + table.SetBorder(false) + table.SetAlignment(tablewriter.ALIGN_LEFT) + + for _, v := range mainTableData { + table.Append(v) + } + + table.Render() + + return nil +} + +func renderSubTable(data [][]string, file bool) string { + var buf bytes.Buffer + table := tablewriter.NewWriter(&buf) + table.SetAutoWrapText(!file) + table.SetBorder(false) + table.SetNoWhiteSpace(true) + table.SetTablePadding("\t") + table.SetAlignment(tablewriter.ALIGN_LEFT) + + for _, v := range data { + table.Append(v) + } + + table.Render() + + renderedTable := buf.String() + lines := strings.Split(renderedTable, "\n") + for i, line := range lines { + lines[i] = "\t" + line + } + + return strings.Join(lines, "\n") +} + +func twoLines(s string) [][]string { + lines := strings.Split(s, "\n") + res := [][]string{} + + count := 0 + for _, line := range lines { + line = strings.TrimSpace(line) + if line != "" { + count++ + res = append(res, []string{line}) + if count == 2 { + return res + } + } + } + return res +} + +func formatParams(s string) string { + lines := strings.Split(s, "\n") + table := [][]string{} + + for _, line := range lines { + table = append(table, strings.Fields(line)) + } + return renderSubTable(table, false) +} + +func CopyHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + req := api.CopyRequest{Source: args[0], Destination: args[1]} + if err := client.Copy(cmd.Context(), &req); err != nil { + return err + } + fmt.Printf("copied '%s' to '%s'\n", args[0], args[1]) + return nil +} + +func PullHandler(cmd *cobra.Command, args []string) error { + insecure, err := cmd.Flags().GetBool("insecure") + if err != nil { + return err + } + + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.Stop() + + bars := make(map[string]*progress.Bar) + + var status string + var spinner *progress.Spinner + + fn := func(resp api.ProgressResponse) error { + if resp.Digest != "" { + if spinner != nil { + spinner.Stop() + } + + bar, ok := bars[resp.Digest] + if !ok { + bar = progress.NewBar(fmt.Sprintf("pulling %s...", resp.Digest[7:19]), resp.Total, resp.Completed) + bars[resp.Digest] = bar + p.Add(resp.Digest, bar) + } + + bar.Set(resp.Completed) + } else if status != resp.Status { + if spinner != nil { + spinner.Stop() + } + + status = resp.Status + spinner = progress.NewSpinner(status) + p.Add(status, spinner) + } + + return nil + } + + request := api.PullRequest{Name: args[0], Insecure: insecure} + if err := client.Pull(cmd.Context(), &request, fn); err != nil { + return err + } + + return nil +} + +type generateContextKey string + +type runOptions struct { + Model string + ParentModel string + Prompt string + Messages []api.Message + WordWrap bool + Format string + System string + Template string + Images []api.ImageData + Options map[string]interface{} + MultiModal bool + KeepAlive *api.Duration +} + +type displayResponseState struct { + lineLength int + wordBuffer string +} + +func displayResponse(content string, wordWrap bool, state *displayResponseState) { + termWidth, _, _ := term.GetSize(int(os.Stdout.Fd())) + if wordWrap && termWidth >= 10 { + for _, ch := range content { + if state.lineLength+1 > termWidth-5 { + if runewidth.StringWidth(state.wordBuffer) > termWidth-10 { + fmt.Printf("%s%c", state.wordBuffer, ch) + state.wordBuffer = "" + state.lineLength = 0 + continue + } + + // backtrack the length of the last word and clear to the end of the line + a := runewidth.StringWidth(state.wordBuffer) + if a > 0 { + fmt.Printf("\x1b[%dD", a) + } + fmt.Printf("\x1b[K\n") + fmt.Printf("%s%c", state.wordBuffer, ch) + chWidth := runewidth.RuneWidth(ch) + + state.lineLength = runewidth.StringWidth(state.wordBuffer) + chWidth + } else { + fmt.Print(string(ch)) + state.lineLength += runewidth.RuneWidth(ch) + if runewidth.RuneWidth(ch) >= 2 { + state.wordBuffer = "" + continue + } + + switch ch { + case ' ': + state.wordBuffer = "" + case '\n': + state.lineLength = 0 + default: + state.wordBuffer += string(ch) + } + } + } + } else { + fmt.Printf("%s%s", state.wordBuffer, content) + if len(state.wordBuffer) > 0 { + state.wordBuffer = "" + } + } +} + +func chat(cmd *cobra.Command, opts runOptions) (*api.Message, error) { + client, err := api.ClientFromEnvironment() + if err != nil { + return nil, err + } + + p := progress.NewProgress(os.Stderr) + defer p.StopAndClear() + + spinner := progress.NewSpinner("") + p.Add("", spinner) + + cancelCtx, cancel := context.WithCancel(cmd.Context()) + defer cancel() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT) + + go func() { + <-sigChan + cancel() + }() + + var state *displayResponseState = &displayResponseState{} + var latest api.ChatResponse + var fullResponse strings.Builder + var role string + + fn := func(response api.ChatResponse) error { + p.StopAndClear() + + latest = response + + role = response.Message.Role + content := response.Message.Content + fullResponse.WriteString(content) + + displayResponse(content, opts.WordWrap, state) + + return nil + } + + req := &api.ChatRequest{ + Model: opts.Model, + Messages: opts.Messages, + Format: opts.Format, + Options: opts.Options, + } + + if opts.KeepAlive != nil { + req.KeepAlive = opts.KeepAlive + } + + if err := client.Chat(cancelCtx, req, fn); err != nil { + if errors.Is(err, context.Canceled) { + return nil, nil + } + return nil, err + } + + if len(opts.Messages) > 0 { + fmt.Println() + fmt.Println() + } + + verbose, err := cmd.Flags().GetBool("verbose") + if err != nil { + return nil, err + } + + if verbose { + latest.Summary() + } + + return &api.Message{Role: role, Content: fullResponse.String()}, nil +} + +func generate(cmd *cobra.Command, opts runOptions) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.StopAndClear() + + spinner := progress.NewSpinner("") + p.Add("", spinner) + + var latest api.GenerateResponse + + generateContext, ok := cmd.Context().Value(generateContextKey("context")).([]int) + if !ok { + generateContext = []int{} + } + + ctx, cancel := context.WithCancel(cmd.Context()) + defer cancel() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT) + + go func() { + <-sigChan + cancel() + }() + + var state *displayResponseState = &displayResponseState{} + + fn := func(response api.GenerateResponse) error { + p.StopAndClear() + + latest = response + content := response.Response + + displayResponse(content, opts.WordWrap, state) + + return nil + } + + if opts.MultiModal { + opts.Prompt, opts.Images, err = extractFileData(opts.Prompt) + if err != nil { + return err + } + } + + request := api.GenerateRequest{ + Model: opts.Model, + Prompt: opts.Prompt, + Context: generateContext, + Images: opts.Images, + Format: opts.Format, + System: opts.System, + Template: opts.Template, + Options: opts.Options, + KeepAlive: opts.KeepAlive, + } + + if err := client.Generate(ctx, &request, fn); err != nil { + if errors.Is(err, context.Canceled) { + return nil + } + return err + } + + if opts.Prompt != "" { + fmt.Println() + fmt.Println() + } + + if !latest.Done { + return nil + } + + verbose, err := cmd.Flags().GetBool("verbose") + if err != nil { + return err + } + + if verbose { + latest.Summary() + } + + ctx = context.WithValue(cmd.Context(), generateContextKey("context"), latest.Context) + cmd.SetContext(ctx) + + return nil +} + +func RunServer(cmd *cobra.Command, _ []string) error { + if err := initializeKeypair(); err != nil { + return err + } + + ln, err := net.Listen("tcp", net.JoinHostPort(envconfig.Host.Host, envconfig.Host.Port)) + if err != nil { + return err + } + + err = server.Serve(ln) + if errors.Is(err, http.ErrServerClosed) { + return nil + } + + return err +} + +func initializeKeypair() error { + home, err := os.UserHomeDir() + if err != nil { + return err + } + + privKeyPath := filepath.Join(home, ".ollama", "id_ed25519") + pubKeyPath := filepath.Join(home, ".ollama", "id_ed25519.pub") + + _, err = os.Stat(privKeyPath) + if os.IsNotExist(err) { + fmt.Printf("Couldn't find '%s'. Generating new private key.\n", privKeyPath) + cryptoPublicKey, cryptoPrivateKey, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + return err + } + + privateKeyBytes, err := ssh.MarshalPrivateKey(cryptoPrivateKey, "") + if err != nil { + return err + } + + if err := os.MkdirAll(filepath.Dir(privKeyPath), 0o755); err != nil { + return fmt.Errorf("could not create directory %w", err) + } + + if err := os.WriteFile(privKeyPath, pem.EncodeToMemory(privateKeyBytes), 0o600); err != nil { + return err + } + + sshPublicKey, err := ssh.NewPublicKey(cryptoPublicKey) + if err != nil { + return err + } + + publicKeyBytes := ssh.MarshalAuthorizedKey(sshPublicKey) + + if err := os.WriteFile(pubKeyPath, publicKeyBytes, 0o644); err != nil { + return err + } + + fmt.Printf("Your new public key is: \n\n%s\n", publicKeyBytes) + } + return nil +} + +func checkServerHeartbeat(cmd *cobra.Command, _ []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + if err := client.Heartbeat(cmd.Context()); err != nil { + if !strings.Contains(err.Error(), " refused") { + return err + } + if err := startApp(cmd.Context(), client); err != nil { + return fmt.Errorf("could not connect to ollama app, is it running?") + } + } + return nil +} + +func versionHandler(cmd *cobra.Command, _ []string) { + client, err := api.ClientFromEnvironment() + if err != nil { + return + } + + serverVersion, err := client.Version(cmd.Context()) + if err != nil { + fmt.Println("Warning: could not connect to a running Ollama instance") + } + + if serverVersion != "" { + fmt.Printf("ollama version is %s\n", serverVersion) + } + + if serverVersion != version.Version { + fmt.Printf("Warning: client version is %s\n", version.Version) + } +} + +func appendEnvDocs(cmd *cobra.Command, envs []envconfig.EnvVar) { + if len(envs) == 0 { + return + } + + envUsage := ` +Environment Variables: +` + for _, e := range envs { + envUsage += fmt.Sprintf(" %-24s %s\n", e.Name, e.Description) + } + + cmd.SetUsageTemplate(cmd.UsageTemplate() + envUsage) +} + +func NewCLI() *cobra.Command { + log.SetFlags(log.LstdFlags | log.Lshortfile) + cobra.EnableCommandSorting = false + + if runtime.GOOS == "windows" { + console.ConsoleFromFile(os.Stdin) //nolint:errcheck + } + + rootCmd := &cobra.Command{ + Use: "ollama", + Short: "Large language model runner", + SilenceUsage: true, + SilenceErrors: true, + CompletionOptions: cobra.CompletionOptions{ + DisableDefaultCmd: true, + }, + Run: func(cmd *cobra.Command, args []string) { + if version, _ := cmd.Flags().GetBool("version"); version { + versionHandler(cmd, args) + return + } + + cmd.Print(cmd.UsageString()) + }, + } + + rootCmd.Flags().BoolP("version", "v", false, "Show version information") + + createCmd := &cobra.Command{ + Use: "create MODEL", + Short: "Create a model from a Modelfile", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: CreateHandler, + } + + createCmd.Flags().StringP("file", "f", "Modelfile", "Name of the Modelfile") + createCmd.Flags().StringP("quantize", "q", "", "Quantize model to this level (e.g. q4_0)") + + showCmd := &cobra.Command{ + Use: "show MODEL", + Short: "Show information for a model", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: ShowHandler, + } + + showCmd.Flags().Bool("license", false, "Show license of a model") + showCmd.Flags().Bool("modelfile", false, "Show Modelfile of a model") + showCmd.Flags().Bool("parameters", false, "Show parameters of a model") + showCmd.Flags().Bool("template", false, "Show template of a model") + showCmd.Flags().Bool("system", false, "Show system message of a model") + + runCmd := &cobra.Command{ + Use: "run MODEL [PROMPT]", + Short: "Run a model", + Args: cobra.MinimumNArgs(1), + PreRunE: checkServerHeartbeat, + RunE: RunHandler, + } + + runCmd.Flags().String("keepalive", "", "Duration to keep a model loaded (e.g. 5m)") + runCmd.Flags().Bool("verbose", false, "Show timings for response") + runCmd.Flags().Bool("insecure", false, "Use an insecure registry") + runCmd.Flags().Bool("nowordwrap", false, "Don't wrap words to the next line automatically") + runCmd.Flags().String("format", "", "Response format (e.g. json)") + serveCmd := &cobra.Command{ + Use: "serve", + Aliases: []string{"start"}, + Short: "Start ollama", + Args: cobra.ExactArgs(0), + RunE: RunServer, + } + + pullCmd := &cobra.Command{ + Use: "pull MODEL", + Short: "Pull a model from a registry", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: PullHandler, + } + + pullCmd.Flags().Bool("insecure", false, "Use an insecure registry") + + pushCmd := &cobra.Command{ + Use: "push MODEL", + Short: "Push a model to a registry", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: PushHandler, + } + + pushCmd.Flags().Bool("insecure", false, "Use an insecure registry") + + listCmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List models", + PreRunE: checkServerHeartbeat, + RunE: ListHandler, + } + + psCmd := &cobra.Command{ + Use: "ps", + Short: "List running models", + PreRunE: checkServerHeartbeat, + RunE: ListRunningHandler, + } + + copyCmd := &cobra.Command{ + Use: "cp SOURCE DESTINATION", + Short: "Copy a model", + Args: cobra.ExactArgs(2), + PreRunE: checkServerHeartbeat, + RunE: CopyHandler, + } + + deleteCmd := &cobra.Command{ + Use: "rm MODEL [MODEL...]", + Short: "Remove a model", + Args: cobra.MinimumNArgs(1), + PreRunE: checkServerHeartbeat, + RunE: DeleteHandler, + } + + envVars := envconfig.AsMap() + + envs := []envconfig.EnvVar{envVars["OLLAMA_HOST"]} + + for _, cmd := range []*cobra.Command{ + createCmd, + showCmd, + runCmd, + pullCmd, + pushCmd, + listCmd, + psCmd, + copyCmd, + deleteCmd, + serveCmd, + } { + switch cmd { + case runCmd: + appendEnvDocs(cmd, []envconfig.EnvVar{envVars["OLLAMA_HOST"], envVars["OLLAMA_NOHISTORY"]}) + case serveCmd: + appendEnvDocs(cmd, []envconfig.EnvVar{ + envVars["OLLAMA_DEBUG"], + envVars["OLLAMA_HOST"], + envVars["OLLAMA_KEEP_ALIVE"], + envVars["OLLAMA_MAX_LOADED_MODELS"], + envVars["OLLAMA_MAX_QUEUE"], + envVars["OLLAMA_MODELS"], + envVars["OLLAMA_NUM_PARALLEL"], + envVars["OLLAMA_NOPRUNE"], + envVars["OLLAMA_ORIGINS"], + envVars["OLLAMA_TMPDIR"], + envVars["OLLAMA_FLASH_ATTENTION"], + envVars["OLLAMA_LLM_LIBRARY"], + envVars["OLLAMA_MAX_VRAM"], + }) + default: + appendEnvDocs(cmd, envs) + } + } + + rootCmd.AddCommand( + serveCmd, + createCmd, + showCmd, + runCmd, + pullCmd, + pushCmd, + listCmd, + psCmd, + copyCmd, + deleteCmd, + ) + + return rootCmd +} +``` + +## `server/model.go` (changed lines (14, 81, 84, 89, 91, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 105, 107, 113, 118, 122, 126, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 149, 154, 172)) + +```go +package server + +import ( + "archive/zip" + "bytes" + "context" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "os" + "path/filepath" + "strings" + + "github.com/ollama/ollama/api" + "github.com/ollama/ollama/convert" + "github.com/ollama/ollama/llm" + "github.com/ollama/ollama/templates" + "github.com/ollama/ollama/types/model" +) + +var intermediateBlobs map[string]string = make(map[string]string) + +type layerGGML struct { + *Layer + *llm.GGML +} + +func parseFromModel(ctx context.Context, name model.Name, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { + m, err := ParseNamedManifest(name) + switch { + case errors.Is(err, os.ErrNotExist): + if err := PullModel(ctx, name.String(), ®istryOptions{}, fn); err != nil { + return nil, err + } + + m, err = ParseNamedManifest(name) + if err != nil { + return nil, err + } + case err != nil: + return nil, err + } + + for _, layer := range m.Layers { + layer, err := NewLayerFromLayer(layer.Digest, layer.MediaType, name.DisplayShortest()) + if err != nil { + return nil, err + } + + switch layer.MediaType { + case "application/vnd.ollama.image.model", + "application/vnd.ollama.image.projector", + "application/vnd.ollama.image.adapter": + blobpath, err := GetBlobsPath(layer.Digest) + if err != nil { + return nil, err + } + + blob, err := os.Open(blobpath) + if err != nil { + return nil, err + } + defer blob.Close() + + ggml, _, err := llm.DecodeGGML(blob, 0) + if err != nil { + return nil, err + } + + layers = append(layers, &layerGGML{layer, ggml}) + default: + layers = append(layers, &layerGGML{layer, nil}) + } + } + + return layers, nil +} + +func extractFromZipFile(p string, file *os.File, fn func(api.ProgressResponse)) error { + stat, err := file.Stat() + if err != nil { + return err + } + + r, err := zip.NewReader(file, stat.Size()) + if err != nil { + return err + } + + fn(api.ProgressResponse{Status: "unpacking model metadata"}) + for _, f := range r.File { + n := filepath.Join(p, f.Name) + if !strings.HasPrefix(n, p) { + slog.Warn("skipped extracting file outside of context", "name", f.Name) + continue + } + + if err := os.MkdirAll(filepath.Dir(n), 0o750); err != nil { + return err + } + + // TODO(mxyng): this should not write out all files to disk + outfile, err := os.Create(n) + if err != nil { + return err + } + defer outfile.Close() + + infile, err := f.Open() + if err != nil { + return err + } + defer infile.Close() + + if _, err = io.Copy(outfile, infile); err != nil { + return err + } + + if err := outfile.Close(); err != nil { + return err + } + + if err := infile.Close(); err != nil { + return err + } + } + + return nil +} + +func parseFromZipFile(_ context.Context, file *os.File, digest string, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { + tempDir, err := os.MkdirTemp(filepath.Dir(file.Name()), "") + if err != nil { + return nil, err + } + defer os.RemoveAll(tempDir) + + if err := extractFromZipFile(tempDir, file, fn); err != nil { + return nil, err + } + + mf, err := convert.GetModelFormat(tempDir) + if err != nil { + return nil, err + } + + params, err := mf.GetParams(tempDir) + if err != nil { + return nil, err + } + + mArch, err := mf.GetModelArch("", tempDir, params) + if err != nil { + return nil, err + } + + fn(api.ProgressResponse{Status: "processing tensors"}) + if err := mArch.GetTensors(); err != nil { + return nil, err + } + + if err := mArch.LoadVocab(); err != nil { + return nil, err + } + + fn(api.ProgressResponse{Status: "converting model"}) + + // TODO(mxyng): this should write directly into a layer + // e.g. NewLayer(arch.Reader(), "application/vnd.ollama.image.model") + temp, err := os.CreateTemp(tempDir, "fp16") + if err != nil { + return nil, err + } + defer temp.Close() + defer os.Remove(temp.Name()) + + if err = mArch.WriteGGUF(temp); err != nil { + return nil, err + } + + if _, err := temp.Seek(0, io.SeekStart); err != nil { + return nil, err + } + + layer, err := NewLayer(temp, "application/vnd.ollama.image.model") + if err != nil { + return nil, err + } + + bin, err := layer.Open() + if err != nil { + return nil, err + } + defer bin.Close() + + ggml, _, err := llm.DecodeGGML(bin, 0) + if err != nil { + return nil, err + } + + layers = append(layers, &layerGGML{layer, ggml}) + + intermediateBlobs[digest] = layer.Digest + return detectChatTemplate(layers) +} + +func parseFromFile(ctx context.Context, file *os.File, digest string, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { + sr := io.NewSectionReader(file, 0, 512) + contentType, err := detectContentType(sr) + if err != nil { + return nil, err + } + + switch contentType { + case "gguf", "ggla": + // noop + case "application/zip": + return parseFromZipFile(ctx, file, digest, fn) + default: + return nil, fmt.Errorf("unsupported content type: %s", contentType) + } + + stat, err := file.Stat() + if err != nil { + return nil, err + } + + var offset int64 + for offset < stat.Size() { + ggml, n, err := llm.DecodeGGML(file, 0) + if errors.Is(err, io.EOF) { + break + } else if err != nil { + return nil, err + } + + mediatype := "application/vnd.ollama.image.model" + if ggml.Name() == "ggla" { + mediatype = "application/vnd.ollama.image.adapter" + } else if ggml.KV().Architecture() == "clip" { + mediatype = "application/vnd.ollama.image.projector" + } + + layer, err := NewLayer(io.NewSectionReader(file, offset, n), mediatype) + if err != nil { + return nil, err + } + + layers = append(layers, &layerGGML{layer, ggml}) + offset = n + } + + return detectChatTemplate(layers) +} + +func detectChatTemplate(layers []*layerGGML) ([]*layerGGML, error) { + for _, layer := range layers { + if s := layer.GGML.KV().ChatTemplate(); s != "" { + if t, err := templates.NamedTemplate(s); err != nil { + slog.Debug("template detection", "error", err) + } else { + tmpl, err := NewLayer(t.Reader(), "application/vnd.ollama.image.template") + if err != nil { + return nil, err + } + + tmpl.status = fmt.Sprintf("using autodetected template %s", t.Name) + layers = append(layers, &layerGGML{tmpl, nil}) + } + } + } + + return layers, nil +} + +func detectContentType(r io.Reader) (string, error) { + var b bytes.Buffer + if _, err := io.Copy(&b, r); err != nil { + return "", err + } + + if contentType := llm.DetectGGMLType(b.Bytes()); contentType != "" { + return contentType, nil + } + + if contentType := http.DetectContentType(b.Bytes()); contentType != "application/octet-stream" { + return contentType, nil + } + + return "unknown", nil +} +``` + +## `server/model_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92)) + +```go +package server + +import ( + "archive/zip" + "bytes" + "io" + "os" + "path/filepath" + "slices" + "testing" + + "github.com/ollama/ollama/api" +) + +func createZipFile(t *testing.T, name string) *os.File { + t.Helper() + + f, err := os.CreateTemp(t.TempDir(), "") + if err != nil { + t.Fatal(err) + } + + zf := zip.NewWriter(f) + defer zf.Close() + + zh, err := zf.CreateHeader(&zip.FileHeader{Name: name}) + if err != nil { + t.Fatal(err) + } + + if _, err := io.Copy(zh, bytes.NewReader([]byte(""))); err != nil { + t.Fatal(err) + } + + return f +} + +func TestExtractFromZipFile(t *testing.T) { + cases := []struct { + name string + expect []string + }{ + { + name: "good", + expect: []string{"good"}, + }, + { + name: filepath.Join("..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "..", "bad"), + }, + } + + for _, tt := range cases { + t.Run(tt.name, func(t *testing.T) { + f := createZipFile(t, tt.name) + defer f.Close() + + tempDir := t.TempDir() + if err := extractFromZipFile(tempDir, f, func(api.ProgressResponse) {}); err != nil { + t.Fatal(err) + } + + var matches []string + if err := filepath.Walk(tempDir, func(p string, fi os.FileInfo, err error) error { + if err != nil { + return err + } + + if !fi.IsDir() { + matches = append(matches, p) + } + + return nil + }); err != nil { + t.Fatal(err) + } + + var actual []string + for _, match := range matches { + rel, err := filepath.Rel(tempDir, match) + if err != nil { + t.Error(err) + } + + actual = append(actual, rel) + } + + if !slices.Equal(actual, tt.expect) { + t.Fatalf("expected %d files, got %d", len(tt.expect), len(matches)) + } + }) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..d9085165d56c29b0fad14cc11040eb644b952d3b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/pre_context.md @@ -0,0 +1,1651 @@ +# Patch-overlapping Go context before the fix + +## `cmd/cmd.go` (changed lines (165, 166, 167, 236)) + +```go +package cmd + +import ( + "archive/zip" + "bytes" + "context" + "crypto/ed25519" + "crypto/rand" + "crypto/sha256" + "encoding/pem" + "errors" + "fmt" + "io" + "log" + "math" + "net" + "net/http" + "os" + "os/signal" + "path/filepath" + "regexp" + "runtime" + "slices" + "strings" + "syscall" + "time" + + "github.com/containerd/console" + "github.com/mattn/go-runewidth" + "github.com/olekukonko/tablewriter" + "github.com/spf13/cobra" + "golang.org/x/crypto/ssh" + "golang.org/x/term" + + "github.com/ollama/ollama/api" + "github.com/ollama/ollama/auth" + "github.com/ollama/ollama/envconfig" + "github.com/ollama/ollama/format" + "github.com/ollama/ollama/parser" + "github.com/ollama/ollama/progress" + "github.com/ollama/ollama/server" + "github.com/ollama/ollama/types/errtypes" + "github.com/ollama/ollama/types/model" + "github.com/ollama/ollama/version" +) + +func CreateHandler(cmd *cobra.Command, args []string) error { + filename, _ := cmd.Flags().GetString("file") + filename, err := filepath.Abs(filename) + if err != nil { + return err + } + + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.Stop() + + f, err := os.Open(filename) + if err != nil { + return err + } + defer f.Close() + + modelfile, err := parser.ParseFile(f) + if err != nil { + return err + } + + home, err := os.UserHomeDir() + if err != nil { + return err + } + + status := "transferring model data" + spinner := progress.NewSpinner(status) + p.Add(status, spinner) + + for i := range modelfile.Commands { + switch modelfile.Commands[i].Name { + case "model", "adapter": + path := modelfile.Commands[i].Args + if path == "~" { + path = home + } else if strings.HasPrefix(path, "~/") { + path = filepath.Join(home, path[2:]) + } + + if !filepath.IsAbs(path) { + path = filepath.Join(filepath.Dir(filename), path) + } + + fi, err := os.Stat(path) + if errors.Is(err, os.ErrNotExist) && modelfile.Commands[i].Name == "model" { + continue + } else if err != nil { + return err + } + + if fi.IsDir() { + // this is likely a safetensors or pytorch directory + // TODO make this work w/ adapters + tempfile, err := tempZipFiles(path) + if err != nil { + return err + } + defer os.RemoveAll(tempfile) + + path = tempfile + } + + digest, err := createBlob(cmd, client, path) + if err != nil { + return err + } + + modelfile.Commands[i].Args = "@" + digest + } + } + + bars := make(map[string]*progress.Bar) + fn := func(resp api.ProgressResponse) error { + if resp.Digest != "" { + spinner.Stop() + + bar, ok := bars[resp.Digest] + if !ok { + bar = progress.NewBar(fmt.Sprintf("pulling %s...", resp.Digest[7:19]), resp.Total, resp.Completed) + bars[resp.Digest] = bar + p.Add(resp.Digest, bar) + } + + bar.Set(resp.Completed) + } else if status != resp.Status { + spinner.Stop() + + status = resp.Status + spinner = progress.NewSpinner(status) + p.Add(status, spinner) + } + + return nil + } + + quantize, _ := cmd.Flags().GetString("quantize") + + request := api.CreateRequest{Name: args[0], Modelfile: modelfile.String(), Quantize: quantize} + if err := client.Create(cmd.Context(), &request, fn); err != nil { + return err + } + + return nil +} + +func tempZipFiles(path string) (string, error) { + tempfile, err := os.CreateTemp("", "ollama-tf") + if err != nil { + return "", err + } + defer tempfile.Close() + + zipfile := zip.NewWriter(tempfile) + defer zipfile.Close() + + detectContentType := func(path string) (string, error) { + f, err := os.Open(path) + if err != nil { + return "", err + } + defer f.Close() + + var b bytes.Buffer + b.Grow(512) + + if _, err := io.CopyN(&b, f, 512); err != nil && !errors.Is(err, io.EOF) { + return "", err + } + + contentType, _, _ := strings.Cut(http.DetectContentType(b.Bytes()), ";") + return contentType, nil + } + + glob := func(pattern, contentType string) ([]string, error) { + matches, err := filepath.Glob(pattern) + if err != nil { + return nil, err + } + + for _, safetensor := range matches { + if ct, err := detectContentType(safetensor); err != nil { + return nil, err + } else if ct != contentType { + return nil, fmt.Errorf("invalid content type: expected %s for %s", ct, safetensor) + } + } + + return matches, nil + } + + var files []string + if st, _ := glob(filepath.Join(path, "model*.safetensors"), "application/octet-stream"); len(st) > 0 { + // safetensors files might be unresolved git lfs references; skip if they are + // covers model-x-of-y.safetensors, model.fp32-x-of-y.safetensors, model.safetensors + files = append(files, st...) + } else if pt, _ := glob(filepath.Join(path, "pytorch_model*.bin"), "application/zip"); len(pt) > 0 { + // pytorch files might also be unresolved git lfs references; skip if they are + // covers pytorch_model-x-of-y.bin, pytorch_model.fp32-x-of-y.bin, pytorch_model.bin + files = append(files, pt...) + } else if pt, _ := glob(filepath.Join(path, "consolidated*.pth"), "application/zip"); len(pt) > 0 { + // pytorch files might also be unresolved git lfs references; skip if they are + // covers consolidated.x.pth, consolidated.pth + files = append(files, pt...) + } else { + return "", errors.New("no safetensors or torch files found") + } + + // add configuration files, json files are detected as text/plain + js, err := glob(filepath.Join(path, "*.json"), "text/plain") + if err != nil { + return "", err + } + files = append(files, js...) + + if tks, _ := glob(filepath.Join(path, "tokenizer.model"), "application/octet-stream"); len(tks) > 0 { + // add tokenizer.model if it exists, tokenizer.json is automatically picked up by the previous glob + // tokenizer.model might be a unresolved git lfs reference; error if it is + files = append(files, tks...) + } else if tks, _ := glob(filepath.Join(path, "**/tokenizer.model"), "text/plain"); len(tks) > 0 { + // some times tokenizer.model is in a subdirectory (e.g. meta-llama/Meta-Llama-3-8B) + files = append(files, tks...) + } + + for _, file := range files { + f, err := os.Open(file) + if err != nil { + return "", err + } + defer f.Close() + + fi, err := f.Stat() + if err != nil { + return "", err + } + + zfi, err := zip.FileInfoHeader(fi) + if err != nil { + return "", err + } + + zf, err := zipfile.CreateHeader(zfi) + if err != nil { + return "", err + } + + if _, err := io.Copy(zf, f); err != nil { + return "", err + } + } + + return tempfile.Name(), nil +} + +func createBlob(cmd *cobra.Command, client *api.Client, path string) (string, error) { + bin, err := os.Open(path) + if err != nil { + return "", err + } + defer bin.Close() + + hash := sha256.New() + if _, err := io.Copy(hash, bin); err != nil { + return "", err + } + + if _, err := bin.Seek(0, io.SeekStart); err != nil { + return "", err + } + + digest := fmt.Sprintf("sha256:%x", hash.Sum(nil)) + if err = client.CreateBlob(cmd.Context(), digest, bin); err != nil { + return "", err + } + return digest, nil +} + +func RunHandler(cmd *cobra.Command, args []string) error { + interactive := true + + opts := runOptions{ + Model: args[0], + WordWrap: os.Getenv("TERM") == "xterm-256color", + Options: map[string]interface{}{}, + } + + format, err := cmd.Flags().GetString("format") + if err != nil { + return err + } + opts.Format = format + + keepAlive, err := cmd.Flags().GetString("keepalive") + if err != nil { + return err + } + if keepAlive != "" { + d, err := time.ParseDuration(keepAlive) + if err != nil { + return err + } + opts.KeepAlive = &api.Duration{Duration: d} + } + + prompts := args[1:] + // prepend stdin to the prompt if provided + if !term.IsTerminal(int(os.Stdin.Fd())) { + in, err := io.ReadAll(os.Stdin) + if err != nil { + return err + } + + prompts = append([]string{string(in)}, prompts...) + opts.WordWrap = false + interactive = false + } + opts.Prompt = strings.Join(prompts, " ") + if len(prompts) > 0 { + interactive = false + } + + nowrap, err := cmd.Flags().GetBool("nowordwrap") + if err != nil { + return err + } + opts.WordWrap = !nowrap + + // Fill out the rest of the options based on information about the + // model. + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + name := args[0] + info, err := func() (*api.ShowResponse, error) { + showReq := &api.ShowRequest{Name: name} + info, err := client.Show(cmd.Context(), showReq) + var se api.StatusError + if errors.As(err, &se) && se.StatusCode == http.StatusNotFound { + if err := PullHandler(cmd, []string{name}); err != nil { + return nil, err + } + return client.Show(cmd.Context(), &api.ShowRequest{Name: name}) + } + return info, err + }() + if err != nil { + return err + } + + opts.MultiModal = slices.Contains(info.Details.Families, "clip") + opts.ParentModel = info.Details.ParentModel + opts.Messages = append(opts.Messages, info.Messages...) + + if interactive { + return generateInteractive(cmd, opts) + } + return generate(cmd, opts) +} + +func errFromUnknownKey(unknownKeyErr error) error { + // find SSH public key in the error message + sshKeyPattern := `ssh-\w+ [^\s"]+` + re := regexp.MustCompile(sshKeyPattern) + matches := re.FindStringSubmatch(unknownKeyErr.Error()) + + if len(matches) > 0 { + serverPubKey := matches[0] + + localPubKey, err := auth.GetPublicKey() + if err != nil { + return unknownKeyErr + } + + if runtime.GOOS == "linux" && serverPubKey != localPubKey { + // try the ollama service public key + svcPubKey, err := os.ReadFile("/usr/share/ollama/.ollama/id_ed25519.pub") + if err != nil { + return unknownKeyErr + } + localPubKey = strings.TrimSpace(string(svcPubKey)) + } + + // check if the returned public key matches the local public key, this prevents adding a remote key to the user's account + if serverPubKey != localPubKey { + return unknownKeyErr + } + + var msg strings.Builder + msg.WriteString(unknownKeyErr.Error()) + msg.WriteString("\n\nYour ollama key is:\n") + msg.WriteString(localPubKey) + msg.WriteString("\nAdd your key at:\n") + msg.WriteString("https://ollama.com/settings/keys") + + return errors.New(msg.String()) + } + + return unknownKeyErr +} + +func PushHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + insecure, err := cmd.Flags().GetBool("insecure") + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.Stop() + + bars := make(map[string]*progress.Bar) + var status string + var spinner *progress.Spinner + + fn := func(resp api.ProgressResponse) error { + if resp.Digest != "" { + if spinner != nil { + spinner.Stop() + } + + bar, ok := bars[resp.Digest] + if !ok { + bar = progress.NewBar(fmt.Sprintf("pushing %s...", resp.Digest[7:19]), resp.Total, resp.Completed) + bars[resp.Digest] = bar + p.Add(resp.Digest, bar) + } + + bar.Set(resp.Completed) + } else if status != resp.Status { + if spinner != nil { + spinner.Stop() + } + + status = resp.Status + spinner = progress.NewSpinner(status) + p.Add(status, spinner) + } + + return nil + } + + request := api.PushRequest{Name: args[0], Insecure: insecure} + if err := client.Push(cmd.Context(), &request, fn); err != nil { + if spinner != nil { + spinner.Stop() + } + if strings.Contains(err.Error(), "access denied") { + return errors.New("you are not authorized to push to this namespace, create the model under a namespace you own") + } + host := model.ParseName(args[0]).Host + isOllamaHost := strings.HasSuffix(host, ".ollama.ai") || strings.HasSuffix(host, ".ollama.com") + if strings.Contains(err.Error(), errtypes.UnknownOllamaKeyErrMsg) && isOllamaHost { + // the user has not added their ollama key to ollama.com + // re-throw an error with a more user-friendly message + return errFromUnknownKey(err) + } + + return err + } + + spinner.Stop() + return nil +} + +func ListHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + models, err := client.List(cmd.Context()) + if err != nil { + return err + } + + var data [][]string + + for _, m := range models.Models { + if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) { + data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), format.HumanTime(m.ModifiedAt, "Never")}) + } + } + + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"NAME", "ID", "SIZE", "MODIFIED"}) + table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) + table.SetAlignment(tablewriter.ALIGN_LEFT) + table.SetHeaderLine(false) + table.SetBorder(false) + table.SetNoWhiteSpace(true) + table.SetTablePadding("\t") + table.AppendBulk(data) + table.Render() + + return nil +} + +func ListRunningHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + models, err := client.ListRunning(cmd.Context()) + if err != nil { + return err + } + + var data [][]string + + for _, m := range models.Models { + if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) { + var procStr string + switch { + case m.SizeVRAM == 0: + procStr = "100% CPU" + case m.SizeVRAM == m.Size: + procStr = "100% GPU" + case m.SizeVRAM > m.Size || m.Size == 0: + procStr = "Unknown" + default: + sizeCPU := m.Size - m.SizeVRAM + cpuPercent := math.Round(float64(sizeCPU) / float64(m.Size) * 100) + procStr = fmt.Sprintf("%d%%/%d%% CPU/GPU", int(cpuPercent), int(100-cpuPercent)) + } + data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), procStr, format.HumanTime(m.ExpiresAt, "Never")}) + } + } + + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"NAME", "ID", "SIZE", "PROCESSOR", "UNTIL"}) + table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) + table.SetAlignment(tablewriter.ALIGN_LEFT) + table.SetHeaderLine(false) + table.SetBorder(false) + table.SetNoWhiteSpace(true) + table.SetTablePadding("\t") + table.AppendBulk(data) + table.Render() + + return nil +} + +func DeleteHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + for _, name := range args { + req := api.DeleteRequest{Name: name} + if err := client.Delete(cmd.Context(), &req); err != nil { + return err + } + fmt.Printf("deleted '%s'\n", name) + } + return nil +} + +func ShowHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + license, errLicense := cmd.Flags().GetBool("license") + modelfile, errModelfile := cmd.Flags().GetBool("modelfile") + parameters, errParams := cmd.Flags().GetBool("parameters") + system, errSystem := cmd.Flags().GetBool("system") + template, errTemplate := cmd.Flags().GetBool("template") + + for _, boolErr := range []error{errLicense, errModelfile, errParams, errSystem, errTemplate} { + if boolErr != nil { + return errors.New("error retrieving flags") + } + } + + flagsSet := 0 + showType := "" + + if license { + flagsSet++ + showType = "license" + } + + if modelfile { + flagsSet++ + showType = "modelfile" + } + + if parameters { + flagsSet++ + showType = "parameters" + } + + if system { + flagsSet++ + showType = "system" + } + + if template { + flagsSet++ + showType = "template" + } + + if flagsSet > 1 { + return errors.New("only one of '--license', '--modelfile', '--parameters', '--system', or '--template' can be specified") + } + + if flagsSet == 1 { + req := api.ShowRequest{Name: args[0]} + resp, err := client.Show(cmd.Context(), &req) + if err != nil { + return err + } + + switch showType { + case "license": + fmt.Println(resp.License) + case "modelfile": + fmt.Println(resp.Modelfile) + case "parameters": + fmt.Println(resp.Parameters) + case "system": + fmt.Println(resp.System) + case "template": + fmt.Println(resp.Template) + } + + return nil + } + + req := api.ShowRequest{Name: args[0]} + resp, err := client.Show(cmd.Context(), &req) + if err != nil { + return err + } + + arch := resp.ModelInfo["general.architecture"].(string) + + modelData := [][]string{ + {"arch", arch}, + {"parameters", resp.Details.ParameterSize}, + {"quantization", resp.Details.QuantizationLevel}, + {"context length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.context_length", arch)].(float64))}, + {"embedding length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.embedding_length", arch)].(float64))}, + } + + mainTableData := [][]string{ + {"Model"}, + {renderSubTable(modelData, false)}, + } + + if resp.ProjectorInfo != nil { + projectorData := [][]string{ + {"arch", "clip"}, + {"parameters", format.HumanNumber(uint64(resp.ProjectorInfo["general.parameter_count"].(float64)))}, + {"projector type", resp.ProjectorInfo["clip.projector_type"].(string)}, + {"embedding length", fmt.Sprintf("%v", resp.ProjectorInfo["clip.vision.embedding_length"].(float64))}, + {"projection dimensionality", fmt.Sprintf("%v", resp.ProjectorInfo["clip.vision.projection_dim"].(float64))}, + } + + mainTableData = append(mainTableData, + []string{"Projector"}, + []string{renderSubTable(projectorData, false)}, + ) + } + + if resp.Parameters != "" { + mainTableData = append(mainTableData, []string{"Parameters"}, []string{formatParams(resp.Parameters)}) + } + + if resp.System != "" { + mainTableData = append(mainTableData, []string{"System"}, []string{renderSubTable(twoLines(resp.System), true)}) + } + + if resp.License != "" { + mainTableData = append(mainTableData, []string{"License"}, []string{renderSubTable(twoLines(resp.License), true)}) + } + + table := tablewriter.NewWriter(os.Stdout) + table.SetAutoWrapText(false) + table.SetBorder(false) + table.SetAlignment(tablewriter.ALIGN_LEFT) + + for _, v := range mainTableData { + table.Append(v) + } + + table.Render() + + return nil +} + +func renderSubTable(data [][]string, file bool) string { + var buf bytes.Buffer + table := tablewriter.NewWriter(&buf) + table.SetAutoWrapText(!file) + table.SetBorder(false) + table.SetNoWhiteSpace(true) + table.SetTablePadding("\t") + table.SetAlignment(tablewriter.ALIGN_LEFT) + + for _, v := range data { + table.Append(v) + } + + table.Render() + + renderedTable := buf.String() + lines := strings.Split(renderedTable, "\n") + for i, line := range lines { + lines[i] = "\t" + line + } + + return strings.Join(lines, "\n") +} + +func twoLines(s string) [][]string { + lines := strings.Split(s, "\n") + res := [][]string{} + + count := 0 + for _, line := range lines { + line = strings.TrimSpace(line) + if line != "" { + count++ + res = append(res, []string{line}) + if count == 2 { + return res + } + } + } + return res +} + +func formatParams(s string) string { + lines := strings.Split(s, "\n") + table := [][]string{} + + for _, line := range lines { + table = append(table, strings.Fields(line)) + } + return renderSubTable(table, false) +} + +func CopyHandler(cmd *cobra.Command, args []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + req := api.CopyRequest{Source: args[0], Destination: args[1]} + if err := client.Copy(cmd.Context(), &req); err != nil { + return err + } + fmt.Printf("copied '%s' to '%s'\n", args[0], args[1]) + return nil +} + +func PullHandler(cmd *cobra.Command, args []string) error { + insecure, err := cmd.Flags().GetBool("insecure") + if err != nil { + return err + } + + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.Stop() + + bars := make(map[string]*progress.Bar) + + var status string + var spinner *progress.Spinner + + fn := func(resp api.ProgressResponse) error { + if resp.Digest != "" { + if spinner != nil { + spinner.Stop() + } + + bar, ok := bars[resp.Digest] + if !ok { + bar = progress.NewBar(fmt.Sprintf("pulling %s...", resp.Digest[7:19]), resp.Total, resp.Completed) + bars[resp.Digest] = bar + p.Add(resp.Digest, bar) + } + + bar.Set(resp.Completed) + } else if status != resp.Status { + if spinner != nil { + spinner.Stop() + } + + status = resp.Status + spinner = progress.NewSpinner(status) + p.Add(status, spinner) + } + + return nil + } + + request := api.PullRequest{Name: args[0], Insecure: insecure} + if err := client.Pull(cmd.Context(), &request, fn); err != nil { + return err + } + + return nil +} + +type generateContextKey string + +type runOptions struct { + Model string + ParentModel string + Prompt string + Messages []api.Message + WordWrap bool + Format string + System string + Template string + Images []api.ImageData + Options map[string]interface{} + MultiModal bool + KeepAlive *api.Duration +} + +type displayResponseState struct { + lineLength int + wordBuffer string +} + +func displayResponse(content string, wordWrap bool, state *displayResponseState) { + termWidth, _, _ := term.GetSize(int(os.Stdout.Fd())) + if wordWrap && termWidth >= 10 { + for _, ch := range content { + if state.lineLength+1 > termWidth-5 { + if runewidth.StringWidth(state.wordBuffer) > termWidth-10 { + fmt.Printf("%s%c", state.wordBuffer, ch) + state.wordBuffer = "" + state.lineLength = 0 + continue + } + + // backtrack the length of the last word and clear to the end of the line + a := runewidth.StringWidth(state.wordBuffer) + if a > 0 { + fmt.Printf("\x1b[%dD", a) + } + fmt.Printf("\x1b[K\n") + fmt.Printf("%s%c", state.wordBuffer, ch) + chWidth := runewidth.RuneWidth(ch) + + state.lineLength = runewidth.StringWidth(state.wordBuffer) + chWidth + } else { + fmt.Print(string(ch)) + state.lineLength += runewidth.RuneWidth(ch) + if runewidth.RuneWidth(ch) >= 2 { + state.wordBuffer = "" + continue + } + + switch ch { + case ' ': + state.wordBuffer = "" + case '\n': + state.lineLength = 0 + default: + state.wordBuffer += string(ch) + } + } + } + } else { + fmt.Printf("%s%s", state.wordBuffer, content) + if len(state.wordBuffer) > 0 { + state.wordBuffer = "" + } + } +} + +func chat(cmd *cobra.Command, opts runOptions) (*api.Message, error) { + client, err := api.ClientFromEnvironment() + if err != nil { + return nil, err + } + + p := progress.NewProgress(os.Stderr) + defer p.StopAndClear() + + spinner := progress.NewSpinner("") + p.Add("", spinner) + + cancelCtx, cancel := context.WithCancel(cmd.Context()) + defer cancel() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT) + + go func() { + <-sigChan + cancel() + }() + + var state *displayResponseState = &displayResponseState{} + var latest api.ChatResponse + var fullResponse strings.Builder + var role string + + fn := func(response api.ChatResponse) error { + p.StopAndClear() + + latest = response + + role = response.Message.Role + content := response.Message.Content + fullResponse.WriteString(content) + + displayResponse(content, opts.WordWrap, state) + + return nil + } + + req := &api.ChatRequest{ + Model: opts.Model, + Messages: opts.Messages, + Format: opts.Format, + Options: opts.Options, + } + + if opts.KeepAlive != nil { + req.KeepAlive = opts.KeepAlive + } + + if err := client.Chat(cancelCtx, req, fn); err != nil { + if errors.Is(err, context.Canceled) { + return nil, nil + } + return nil, err + } + + if len(opts.Messages) > 0 { + fmt.Println() + fmt.Println() + } + + verbose, err := cmd.Flags().GetBool("verbose") + if err != nil { + return nil, err + } + + if verbose { + latest.Summary() + } + + return &api.Message{Role: role, Content: fullResponse.String()}, nil +} + +func generate(cmd *cobra.Command, opts runOptions) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + + p := progress.NewProgress(os.Stderr) + defer p.StopAndClear() + + spinner := progress.NewSpinner("") + p.Add("", spinner) + + var latest api.GenerateResponse + + generateContext, ok := cmd.Context().Value(generateContextKey("context")).([]int) + if !ok { + generateContext = []int{} + } + + ctx, cancel := context.WithCancel(cmd.Context()) + defer cancel() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT) + + go func() { + <-sigChan + cancel() + }() + + var state *displayResponseState = &displayResponseState{} + + fn := func(response api.GenerateResponse) error { + p.StopAndClear() + + latest = response + content := response.Response + + displayResponse(content, opts.WordWrap, state) + + return nil + } + + if opts.MultiModal { + opts.Prompt, opts.Images, err = extractFileData(opts.Prompt) + if err != nil { + return err + } + } + + request := api.GenerateRequest{ + Model: opts.Model, + Prompt: opts.Prompt, + Context: generateContext, + Images: opts.Images, + Format: opts.Format, + System: opts.System, + Template: opts.Template, + Options: opts.Options, + KeepAlive: opts.KeepAlive, + } + + if err := client.Generate(ctx, &request, fn); err != nil { + if errors.Is(err, context.Canceled) { + return nil + } + return err + } + + if opts.Prompt != "" { + fmt.Println() + fmt.Println() + } + + if !latest.Done { + return nil + } + + verbose, err := cmd.Flags().GetBool("verbose") + if err != nil { + return err + } + + if verbose { + latest.Summary() + } + + ctx = context.WithValue(cmd.Context(), generateContextKey("context"), latest.Context) + cmd.SetContext(ctx) + + return nil +} + +func RunServer(cmd *cobra.Command, _ []string) error { + if err := initializeKeypair(); err != nil { + return err + } + + ln, err := net.Listen("tcp", net.JoinHostPort(envconfig.Host.Host, envconfig.Host.Port)) + if err != nil { + return err + } + + err = server.Serve(ln) + if errors.Is(err, http.ErrServerClosed) { + return nil + } + + return err +} + +func initializeKeypair() error { + home, err := os.UserHomeDir() + if err != nil { + return err + } + + privKeyPath := filepath.Join(home, ".ollama", "id_ed25519") + pubKeyPath := filepath.Join(home, ".ollama", "id_ed25519.pub") + + _, err = os.Stat(privKeyPath) + if os.IsNotExist(err) { + fmt.Printf("Couldn't find '%s'. Generating new private key.\n", privKeyPath) + cryptoPublicKey, cryptoPrivateKey, err := ed25519.GenerateKey(rand.Reader) + if err != nil { + return err + } + + privateKeyBytes, err := ssh.MarshalPrivateKey(cryptoPrivateKey, "") + if err != nil { + return err + } + + if err := os.MkdirAll(filepath.Dir(privKeyPath), 0o755); err != nil { + return fmt.Errorf("could not create directory %w", err) + } + + if err := os.WriteFile(privKeyPath, pem.EncodeToMemory(privateKeyBytes), 0o600); err != nil { + return err + } + + sshPublicKey, err := ssh.NewPublicKey(cryptoPublicKey) + if err != nil { + return err + } + + publicKeyBytes := ssh.MarshalAuthorizedKey(sshPublicKey) + + if err := os.WriteFile(pubKeyPath, publicKeyBytes, 0o644); err != nil { + return err + } + + fmt.Printf("Your new public key is: \n\n%s\n", publicKeyBytes) + } + return nil +} + +func checkServerHeartbeat(cmd *cobra.Command, _ []string) error { + client, err := api.ClientFromEnvironment() + if err != nil { + return err + } + if err := client.Heartbeat(cmd.Context()); err != nil { + if !strings.Contains(err.Error(), " refused") { + return err + } + if err := startApp(cmd.Context(), client); err != nil { + return fmt.Errorf("could not connect to ollama app, is it running?") + } + } + return nil +} + +func versionHandler(cmd *cobra.Command, _ []string) { + client, err := api.ClientFromEnvironment() + if err != nil { + return + } + + serverVersion, err := client.Version(cmd.Context()) + if err != nil { + fmt.Println("Warning: could not connect to a running Ollama instance") + } + + if serverVersion != "" { + fmt.Printf("ollama version is %s\n", serverVersion) + } + + if serverVersion != version.Version { + fmt.Printf("Warning: client version is %s\n", version.Version) + } +} + +func appendEnvDocs(cmd *cobra.Command, envs []envconfig.EnvVar) { + if len(envs) == 0 { + return + } + + envUsage := ` +Environment Variables: +` + for _, e := range envs { + envUsage += fmt.Sprintf(" %-24s %s\n", e.Name, e.Description) + } + + cmd.SetUsageTemplate(cmd.UsageTemplate() + envUsage) +} + +func NewCLI() *cobra.Command { + log.SetFlags(log.LstdFlags | log.Lshortfile) + cobra.EnableCommandSorting = false + + if runtime.GOOS == "windows" { + console.ConsoleFromFile(os.Stdin) //nolint:errcheck + } + + rootCmd := &cobra.Command{ + Use: "ollama", + Short: "Large language model runner", + SilenceUsage: true, + SilenceErrors: true, + CompletionOptions: cobra.CompletionOptions{ + DisableDefaultCmd: true, + }, + Run: func(cmd *cobra.Command, args []string) { + if version, _ := cmd.Flags().GetBool("version"); version { + versionHandler(cmd, args) + return + } + + cmd.Print(cmd.UsageString()) + }, + } + + rootCmd.Flags().BoolP("version", "v", false, "Show version information") + + createCmd := &cobra.Command{ + Use: "create MODEL", + Short: "Create a model from a Modelfile", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: CreateHandler, + } + + createCmd.Flags().StringP("file", "f", "Modelfile", "Name of the Modelfile") + createCmd.Flags().StringP("quantize", "q", "", "Quantize model to this level (e.g. q4_0)") + + showCmd := &cobra.Command{ + Use: "show MODEL", + Short: "Show information for a model", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: ShowHandler, + } + + showCmd.Flags().Bool("license", false, "Show license of a model") + showCmd.Flags().Bool("modelfile", false, "Show Modelfile of a model") + showCmd.Flags().Bool("parameters", false, "Show parameters of a model") + showCmd.Flags().Bool("template", false, "Show template of a model") + showCmd.Flags().Bool("system", false, "Show system message of a model") + + runCmd := &cobra.Command{ + Use: "run MODEL [PROMPT]", + Short: "Run a model", + Args: cobra.MinimumNArgs(1), + PreRunE: checkServerHeartbeat, + RunE: RunHandler, + } + + runCmd.Flags().String("keepalive", "", "Duration to keep a model loaded (e.g. 5m)") + runCmd.Flags().Bool("verbose", false, "Show timings for response") + runCmd.Flags().Bool("insecure", false, "Use an insecure registry") + runCmd.Flags().Bool("nowordwrap", false, "Don't wrap words to the next line automatically") + runCmd.Flags().String("format", "", "Response format (e.g. json)") + serveCmd := &cobra.Command{ + Use: "serve", + Aliases: []string{"start"}, + Short: "Start ollama", + Args: cobra.ExactArgs(0), + RunE: RunServer, + } + + pullCmd := &cobra.Command{ + Use: "pull MODEL", + Short: "Pull a model from a registry", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: PullHandler, + } + + pullCmd.Flags().Bool("insecure", false, "Use an insecure registry") + + pushCmd := &cobra.Command{ + Use: "push MODEL", + Short: "Push a model to a registry", + Args: cobra.ExactArgs(1), + PreRunE: checkServerHeartbeat, + RunE: PushHandler, + } + + pushCmd.Flags().Bool("insecure", false, "Use an insecure registry") + + listCmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List models", + PreRunE: checkServerHeartbeat, + RunE: ListHandler, + } + + psCmd := &cobra.Command{ + Use: "ps", + Short: "List running models", + PreRunE: checkServerHeartbeat, + RunE: ListRunningHandler, + } + + copyCmd := &cobra.Command{ + Use: "cp SOURCE DESTINATION", + Short: "Copy a model", + Args: cobra.ExactArgs(2), + PreRunE: checkServerHeartbeat, + RunE: CopyHandler, + } + + deleteCmd := &cobra.Command{ + Use: "rm MODEL [MODEL...]", + Short: "Remove a model", + Args: cobra.MinimumNArgs(1), + PreRunE: checkServerHeartbeat, + RunE: DeleteHandler, + } + + envVars := envconfig.AsMap() + + envs := []envconfig.EnvVar{envVars["OLLAMA_HOST"]} + + for _, cmd := range []*cobra.Command{ + createCmd, + showCmd, + runCmd, + pullCmd, + pushCmd, + listCmd, + psCmd, + copyCmd, + deleteCmd, + serveCmd, + } { + switch cmd { + case runCmd: + appendEnvDocs(cmd, []envconfig.EnvVar{envVars["OLLAMA_HOST"], envVars["OLLAMA_NOHISTORY"]}) + case serveCmd: + appendEnvDocs(cmd, []envconfig.EnvVar{ + envVars["OLLAMA_DEBUG"], + envVars["OLLAMA_HOST"], + envVars["OLLAMA_KEEP_ALIVE"], + envVars["OLLAMA_MAX_LOADED_MODELS"], + envVars["OLLAMA_MAX_QUEUE"], + envVars["OLLAMA_MODELS"], + envVars["OLLAMA_NUM_PARALLEL"], + envVars["OLLAMA_NOPRUNE"], + envVars["OLLAMA_ORIGINS"], + envVars["OLLAMA_TMPDIR"], + envVars["OLLAMA_FLASH_ATTENTION"], + envVars["OLLAMA_LLM_LIBRARY"], + envVars["OLLAMA_MAX_VRAM"], + }) + default: + appendEnvDocs(cmd, envs) + } + } + + rootCmd.AddCommand( + serveCmd, + createCmd, + showCmd, + runCmd, + pullCmd, + pushCmd, + listCmd, + psCmd, + copyCmd, + deleteCmd, + ) + + return rootCmd +} +``` + +## `server/model.go` (changed lines (14, 80, 81, 83, 84, 88, 89, 90, 91, 92, 93, 94, 95, 99, 100, 101, 102, 103, 108, 109, 113, 114, 117, 118, 121, 122, 125, 126, 130, 131, 135, 136, 153, 154)) + +```go +package server + +import ( + "archive/zip" + "bytes" + "context" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "os" + "path/filepath" + + "github.com/ollama/ollama/api" + "github.com/ollama/ollama/convert" + "github.com/ollama/ollama/llm" + "github.com/ollama/ollama/templates" + "github.com/ollama/ollama/types/model" +) + +var intermediateBlobs map[string]string = make(map[string]string) + +type layerGGML struct { + *Layer + *llm.GGML +} + +func parseFromModel(ctx context.Context, name model.Name, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { + m, err := ParseNamedManifest(name) + switch { + case errors.Is(err, os.ErrNotExist): + if err := PullModel(ctx, name.String(), ®istryOptions{}, fn); err != nil { + return nil, err + } + + m, err = ParseNamedManifest(name) + if err != nil { + return nil, err + } + case err != nil: + return nil, err + } + + for _, layer := range m.Layers { + layer, err := NewLayerFromLayer(layer.Digest, layer.MediaType, name.DisplayShortest()) + if err != nil { + return nil, err + } + + switch layer.MediaType { + case "application/vnd.ollama.image.model", + "application/vnd.ollama.image.projector", + "application/vnd.ollama.image.adapter": + blobpath, err := GetBlobsPath(layer.Digest) + if err != nil { + return nil, err + } + + blob, err := os.Open(blobpath) + if err != nil { + return nil, err + } + defer blob.Close() + + ggml, _, err := llm.DecodeGGML(blob, 0) + if err != nil { + return nil, err + } + + layers = append(layers, &layerGGML{layer, ggml}) + default: + layers = append(layers, &layerGGML{layer, nil}) + } + } + + return layers, nil +} + +func parseFromZipFile(_ context.Context, file *os.File, digest string, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { + stat, err := file.Stat() + if err != nil { + return nil, err + } + + r, err := zip.NewReader(file, stat.Size()) + if err != nil { + return nil, err + } + + tempdir, err := os.MkdirTemp(filepath.Dir(file.Name()), "") + if err != nil { + return nil, err + } + defer os.RemoveAll(tempdir) + + fn(api.ProgressResponse{Status: "unpacking model metadata"}) + for _, f := range r.File { + // TODO(mxyng): this should not write out all files to disk + outfile, err := os.Create(filepath.Join(tempdir, f.Name)) + if err != nil { + return nil, err + } + defer outfile.Close() + + infile, err := f.Open() + if err != nil { + return nil, err + } + defer infile.Close() + + if _, err = io.Copy(outfile, infile); err != nil { + return nil, err + } + + if err := outfile.Close(); err != nil { + return nil, err + } + + if err := infile.Close(); err != nil { + return nil, err + } + } + + mf, err := convert.GetModelFormat(tempdir) + if err != nil { + return nil, err + } + + params, err := mf.GetParams(tempdir) + if err != nil { + return nil, err + } + + mArch, err := mf.GetModelArch("", tempdir, params) + if err != nil { + return nil, err + } + + fn(api.ProgressResponse{Status: "processing tensors"}) + if err := mArch.GetTensors(); err != nil { + return nil, err + } + + if err := mArch.LoadVocab(); err != nil { + return nil, err + } + + fn(api.ProgressResponse{Status: "converting model"}) + + // TODO(mxyng): this should write directly into a layer + // e.g. NewLayer(arch.Reader(), "application/vnd.ollama.image.model") + temp, err := os.CreateTemp(tempdir, "fp16") + if err != nil { + return nil, err + } + defer temp.Close() + defer os.Remove(temp.Name()) + + if err = mArch.WriteGGUF(temp); err != nil { + return nil, err + } + + if _, err := temp.Seek(0, io.SeekStart); err != nil { + return nil, err + } + + layer, err := NewLayer(temp, "application/vnd.ollama.image.model") + if err != nil { + return nil, err + } + + bin, err := layer.Open() + if err != nil { + return nil, err + } + defer bin.Close() + + ggml, _, err := llm.DecodeGGML(bin, 0) + if err != nil { + return nil, err + } + + layers = append(layers, &layerGGML{layer, ggml}) + + intermediateBlobs[digest] = layer.Digest + return detectChatTemplate(layers) +} + +func parseFromFile(ctx context.Context, file *os.File, digest string, fn func(api.ProgressResponse)) (layers []*layerGGML, err error) { + sr := io.NewSectionReader(file, 0, 512) + contentType, err := detectContentType(sr) + if err != nil { + return nil, err + } + + switch contentType { + case "gguf", "ggla": + // noop + case "application/zip": + return parseFromZipFile(ctx, file, digest, fn) + default: + return nil, fmt.Errorf("unsupported content type: %s", contentType) + } + + stat, err := file.Stat() + if err != nil { + return nil, err + } + + var offset int64 + for offset < stat.Size() { + ggml, n, err := llm.DecodeGGML(file, 0) + if errors.Is(err, io.EOF) { + break + } else if err != nil { + return nil, err + } + + mediatype := "application/vnd.ollama.image.model" + if ggml.Name() == "ggla" { + mediatype = "application/vnd.ollama.image.adapter" + } else if ggml.KV().Architecture() == "clip" { + mediatype = "application/vnd.ollama.image.projector" + } + + layer, err := NewLayer(io.NewSectionReader(file, offset, n), mediatype) + if err != nil { + return nil, err + } + + layers = append(layers, &layerGGML{layer, ggml}) + offset = n + } + + return detectChatTemplate(layers) +} + +func detectChatTemplate(layers []*layerGGML) ([]*layerGGML, error) { + for _, layer := range layers { + if s := layer.GGML.KV().ChatTemplate(); s != "" { + if t, err := templates.NamedTemplate(s); err != nil { + slog.Debug("template detection", "error", err) + } else { + tmpl, err := NewLayer(t.Reader(), "application/vnd.ollama.image.template") + if err != nil { + return nil, err + } + + tmpl.status = fmt.Sprintf("using autodetected template %s", t.Name) + layers = append(layers, &layerGGML{tmpl, nil}) + } + } + } + + return layers, nil +} + +func detectContentType(r io.Reader) (string, error) { + var b bytes.Buffer + if _, err := io.Copy(&b, r); err != nil { + return "", err + } + + if contentType := llm.DetectGGMLType(b.Bytes()); contentType != "" { + return contentType, nil + } + + if contentType := http.DetectContentType(b.Bytes()); contentType != "application/octet-stream" { + return contentType, nil + } + + return "unknown", nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/task.json new file mode 100644 index 0000000000000000000000000000000000000000..898167fb1d56bc8599d56a428d7b8c12029d46b1 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/task.json @@ -0,0 +1,49 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-32ed35a8bd8aba7b47ad", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-32ed35a8bd8aba7b47ad", + "project_id": "morefixes__ollama__ollama", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "cmd/cmd.go", + "server/model.go", + "server/model_test.go" + ], + "patch_units": { + "before": [ + "cmd/cmd.go", + "server/model.go" + ], + "after": [ + "cmd/cmd.go", + "server/model.go", + "server/model_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/1948cc3aae5315830c746c15f71c05aca83565e00028cf8756417e4e634156c5/database", + "cache_key": "1948cc3aae5315830c746c15f71c05aca83565e00028cf8756417e4e634156c5", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/2b5760e527d31570e21bf8cbb8dacdd0b0e438d8b34ad9c3a81506e359f64104/database", + "cache_key": "2b5760e527d31570e21bf8cbb8dacdd0b0e438d8b34ad9c3a81506e359f64104", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/e0040d9b3a126dd8c2da12d1c041767a85691e3fef63384c5104fd4c05be63f8/database", + "cache_key": "e0040d9b3a126dd8c2da12d1c041767a85691e3fef63384c5104fd4c05be63f8", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-32ed35a8bd8aba7b47ad/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-32ed35a8bd8aba7b47ad/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-32ed35a8bd8aba7b47ad/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..6cb4c522a799031f8df4880461e12ba8a5b5d4b5 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/patch.diff @@ -0,0 +1,46 @@ +diff --git a/internal/bodyprocessors/multipart.go b/internal/bodyprocessors/multipart.go +index efdcf628..1efea691 100644 +--- a/internal/bodyprocessors/multipart.go ++++ b/internal/bodyprocessors/multipart.go +@@ -7,7 +7,6 @@ import ( + "errors" + "fmt" + "io" +- "log" + "mime" + "mime/multipart" + "os" +@@ -25,7 +24,7 @@ func (mbp *multipartBodyProcessor) ProcessRequest(reader io.Reader, v plugintype + storagePath := options.StoragePath + mediaType, params, err := mime.ParseMediaType(mimeType) + if err != nil { +- log.Fatalf("failed to parse media type: %s", err.Error()) ++ return err + } + if !strings.HasPrefix(mediaType, "multipart/") { + return errors.New("not a multipart body") +diff --git a/internal/bodyprocessors/multipart_test.go b/internal/bodyprocessors/multipart_test.go +index 4a0ffefb..5173a5cb 100644 +--- a/internal/bodyprocessors/multipart_test.go ++++ b/internal/bodyprocessors/multipart_test.go +@@ -77,3 +77,20 @@ Content-Type: text/html + } + } + } ++ ++func TestInvalidMultipartCT(t *testing.T) { ++ payload := strings.TrimSpace(` ++-----------------------------9051914041544843365972754266 ++Content-Disposition: form-data; name="text" ++ ++text default ++-----------------------------9051914041544843365972754266 ++`) ++ mp := multipartProcessor(t) ++ v := corazawaf.NewTransactionVariables() ++ if err := mp.ProcessRequest(strings.NewReader(payload), v, plugintypes.BodyProcessorOptions{ ++ Mime: "multipart/form-data; boundary=---------------------------9051914041544843365972754266; a=1; a=2", ++ }); err == nil { ++ t.Error("multipart processor should fail for invalid content-type") ++ } ++} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..cbc73994973a5bd80604aa94c2a0b8cf83af3ce0 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/post_context.md @@ -0,0 +1,230 @@ +# Patch-overlapping Go context after the fix + +## `internal/bodyprocessors/multipart.go` (changed lines (10, 27)) + +```go +// Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors +// SPDX-License-Identifier: Apache-2.0 + +package bodyprocessors + +import ( + "errors" + "fmt" + "io" + "mime" + "mime/multipart" + "os" + "strings" + + "github.com/corazawaf/coraza/v3/experimental/plugins/plugintypes" + "github.com/corazawaf/coraza/v3/internal/collections" + "github.com/corazawaf/coraza/v3/internal/environment" +) + +type multipartBodyProcessor struct{} + +func (mbp *multipartBodyProcessor) ProcessRequest(reader io.Reader, v plugintypes.TransactionVariables, options plugintypes.BodyProcessorOptions) error { + mimeType := options.Mime + storagePath := options.StoragePath + mediaType, params, err := mime.ParseMediaType(mimeType) + if err != nil { + return err + } + if !strings.HasPrefix(mediaType, "multipart/") { + return errors.New("not a multipart body") + } + mr := multipart.NewReader(reader, params["boundary"]) + totalSize := int64(0) + filesCol := v.Files() + filesTmpNamesCol := v.FilesTmpNames() + fileSizesCol := v.FilesSizes() + postCol := v.ArgsPost() + filesCombinedSizeCol := v.FilesCombinedSize() + filesNamesCol := v.FilesNames() + headersNames := v.MultipartPartHeaders() + for { + p, err := mr.NextPart() + if err == io.EOF { + break + } + if err != nil { + return err + } + partName := p.FormName() + for key, values := range p.Header { + for _, value := range values { + headersNames.Add(partName, fmt.Sprintf("%s: %s", key, value)) + } + } + // if is a file + filename := originFileName(p) + if filename != "" { + var size int64 + if environment.HasAccessToFS { + // Only copy file to temp when not running in TinyGo + temp, err := os.CreateTemp(storagePath, "crzmp*") + if err != nil { + return err + } + sz, err := io.Copy(temp, p) + if err != nil { + return err + } + size = sz + filesTmpNamesCol.Add("", temp.Name()) + } else { + sz, err := io.Copy(io.Discard, p) + if err != nil { + return err + } + size = sz + } + totalSize += size + filesCol.Add("", filename) + fileSizesCol.SetIndex(filename, 0, fmt.Sprintf("%d", size)) + filesNamesCol.Add("", p.FormName()) + } else { + // if is a field + data, err := io.ReadAll(p) + if err != nil { + return err + } + totalSize += int64(len(data)) + postCol.Add(p.FormName(), string(data)) + } + filesCombinedSizeCol.(*collections.Single).Set(fmt.Sprintf("%d", totalSize)) + } + return nil +} + +func (mbp *multipartBodyProcessor) ProcessResponse(_ io.Reader, _ plugintypes.TransactionVariables, options plugintypes.BodyProcessorOptions) error { + return nil +} + +var ( + _ plugintypes.BodyProcessor = (*multipartBodyProcessor)(nil) +) + +// OriginFileName returns the filename parameter of the Part's Content-Disposition header. +// This function is based on (multipart.Part).parseContentDisposition, +// See https://go.googlesource.com/go/+/refs/tags/go1.17.9/src/mime/multipart/multipart.go#87 +// for the current implementation and also notice this function hasn't change since go1.4, as in +// https://go.googlesource.com/go/+/refs/tags/go1.4/src/mime/multipart/multipart.go#75 +func originFileName(p *multipart.Part) string { + v := p.Header.Get("Content-Disposition") + _, dispositionParams, err := mime.ParseMediaType(v) + if err != nil { + return "" + } + + return dispositionParams["filename"] +} + +func init() { + RegisterBodyProcessor("multipart", func() plugintypes.BodyProcessor { + return &multipartBodyProcessor{} + }) +} +``` + +## `internal/bodyprocessors/multipart_test.go` (changed lines (80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96)) + +```go +// Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors +// SPDX-License-Identifier: Apache-2.0 + +package bodyprocessors_test + +import ( + "strings" + "testing" + + "github.com/corazawaf/coraza/v3/experimental/plugins/plugintypes" + "github.com/corazawaf/coraza/v3/internal/bodyprocessors" + "github.com/corazawaf/coraza/v3/internal/corazawaf" +) + +func multipartProcessor(t *testing.T) plugintypes.BodyProcessor { + t.Helper() + mp, err := bodyprocessors.GetBodyProcessor("multipart") + if err != nil { + t.Fatal(err) + } + return mp +} + +func TestProcessRequestFailsDueToIncorrectMimeType(t *testing.T) { + mp := multipartProcessor(t) + + expectedError := "not a multipart body" + + if err := mp.ProcessRequest(strings.NewReader(""), corazawaf.NewTransactionVariables(), plugintypes.BodyProcessorOptions{ + Mime: "application/json", + }); err == nil || err.Error() != expectedError { + t.Fatal("expected error") + } +} + +func TestMultipartPayload(t *testing.T) { + payload := strings.TrimSpace(` +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="text" + +text default +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="file1"; filename="a.txt" +Content-Type: text/plain + +Content of a.txt. + +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="file2"; filename="a.html" +Content-Type: text/html + +Content of a.html. + +-----------------------------9051914041544843365972754266-- +`) + + mp := multipartProcessor(t) + + v := corazawaf.NewTransactionVariables() + if err := mp.ProcessRequest(strings.NewReader(payload), v, plugintypes.BodyProcessorOptions{ + Mime: "multipart/form-data; boundary=---------------------------9051914041544843365972754266", + }); err != nil { + t.Fatal(err) + } + // first we validate we got the headers + headers := v.MultipartPartHeaders() + header1 := "Content-Disposition: form-data; name=\"file2\"; filename=\"a.html\"" + header2 := "Content-Type: text/html" + if h := headers.Get("file2"); len(h) == 0 { + t.Fatal("expected headers for file2") + } else { + if len(h) != 2 { + t.Fatal("expected 2 headers for file2") + } + if (h[0] != header1 && h[0] != header2) || (h[1] != header1 && h[1] != header2) { + t.Fatalf("Got invalid multipart headers") + } + } +} + +func TestInvalidMultipartCT(t *testing.T) { + payload := strings.TrimSpace(` +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="text" + +text default +-----------------------------9051914041544843365972754266 +`) + mp := multipartProcessor(t) + v := corazawaf.NewTransactionVariables() + if err := mp.ProcessRequest(strings.NewReader(payload), v, plugintypes.BodyProcessorOptions{ + Mime: "multipart/form-data; boundary=---------------------------9051914041544843365972754266; a=1; a=2", + }); err == nil { + t.Error("multipart processor should fail for invalid content-type") + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..06a28f72c5ce0a745bab4759af09e1b61c43c150 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/pre_context.md @@ -0,0 +1,214 @@ +# Patch-overlapping Go context before the fix + +## `internal/bodyprocessors/multipart.go` (changed lines (10, 28, 29)) + +```go +// Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors +// SPDX-License-Identifier: Apache-2.0 + +package bodyprocessors + +import ( + "errors" + "fmt" + "io" + "log" + "mime" + "mime/multipart" + "os" + "strings" + + "github.com/corazawaf/coraza/v3/experimental/plugins/plugintypes" + "github.com/corazawaf/coraza/v3/internal/collections" + "github.com/corazawaf/coraza/v3/internal/environment" +) + +type multipartBodyProcessor struct{} + +func (mbp *multipartBodyProcessor) ProcessRequest(reader io.Reader, v plugintypes.TransactionVariables, options plugintypes.BodyProcessorOptions) error { + mimeType := options.Mime + storagePath := options.StoragePath + mediaType, params, err := mime.ParseMediaType(mimeType) + if err != nil { + log.Fatalf("failed to parse media type: %s", err.Error()) + } + if !strings.HasPrefix(mediaType, "multipart/") { + return errors.New("not a multipart body") + } + mr := multipart.NewReader(reader, params["boundary"]) + totalSize := int64(0) + filesCol := v.Files() + filesTmpNamesCol := v.FilesTmpNames() + fileSizesCol := v.FilesSizes() + postCol := v.ArgsPost() + filesCombinedSizeCol := v.FilesCombinedSize() + filesNamesCol := v.FilesNames() + headersNames := v.MultipartPartHeaders() + for { + p, err := mr.NextPart() + if err == io.EOF { + break + } + if err != nil { + return err + } + partName := p.FormName() + for key, values := range p.Header { + for _, value := range values { + headersNames.Add(partName, fmt.Sprintf("%s: %s", key, value)) + } + } + // if is a file + filename := originFileName(p) + if filename != "" { + var size int64 + if environment.HasAccessToFS { + // Only copy file to temp when not running in TinyGo + temp, err := os.CreateTemp(storagePath, "crzmp*") + if err != nil { + return err + } + sz, err := io.Copy(temp, p) + if err != nil { + return err + } + size = sz + filesTmpNamesCol.Add("", temp.Name()) + } else { + sz, err := io.Copy(io.Discard, p) + if err != nil { + return err + } + size = sz + } + totalSize += size + filesCol.Add("", filename) + fileSizesCol.SetIndex(filename, 0, fmt.Sprintf("%d", size)) + filesNamesCol.Add("", p.FormName()) + } else { + // if is a field + data, err := io.ReadAll(p) + if err != nil { + return err + } + totalSize += int64(len(data)) + postCol.Add(p.FormName(), string(data)) + } + filesCombinedSizeCol.(*collections.Single).Set(fmt.Sprintf("%d", totalSize)) + } + return nil +} + +func (mbp *multipartBodyProcessor) ProcessResponse(_ io.Reader, _ plugintypes.TransactionVariables, options plugintypes.BodyProcessorOptions) error { + return nil +} + +var ( + _ plugintypes.BodyProcessor = (*multipartBodyProcessor)(nil) +) + +// OriginFileName returns the filename parameter of the Part's Content-Disposition header. +// This function is based on (multipart.Part).parseContentDisposition, +// See https://go.googlesource.com/go/+/refs/tags/go1.17.9/src/mime/multipart/multipart.go#87 +// for the current implementation and also notice this function hasn't change since go1.4, as in +// https://go.googlesource.com/go/+/refs/tags/go1.4/src/mime/multipart/multipart.go#75 +func originFileName(p *multipart.Part) string { + v := p.Header.Get("Content-Disposition") + _, dispositionParams, err := mime.ParseMediaType(v) + if err != nil { + return "" + } + + return dispositionParams["filename"] +} + +func init() { + RegisterBodyProcessor("multipart", func() plugintypes.BodyProcessor { + return &multipartBodyProcessor{} + }) +} +``` + +## `internal/bodyprocessors/multipart_test.go` (changed lines (80,)) + +```go +// Copyright 2022 Juan Pablo Tosso and the OWASP Coraza contributors +// SPDX-License-Identifier: Apache-2.0 + +package bodyprocessors_test + +import ( + "strings" + "testing" + + "github.com/corazawaf/coraza/v3/experimental/plugins/plugintypes" + "github.com/corazawaf/coraza/v3/internal/bodyprocessors" + "github.com/corazawaf/coraza/v3/internal/corazawaf" +) + +func multipartProcessor(t *testing.T) plugintypes.BodyProcessor { + t.Helper() + mp, err := bodyprocessors.GetBodyProcessor("multipart") + if err != nil { + t.Fatal(err) + } + return mp +} + +func TestProcessRequestFailsDueToIncorrectMimeType(t *testing.T) { + mp := multipartProcessor(t) + + expectedError := "not a multipart body" + + if err := mp.ProcessRequest(strings.NewReader(""), corazawaf.NewTransactionVariables(), plugintypes.BodyProcessorOptions{ + Mime: "application/json", + }); err == nil || err.Error() != expectedError { + t.Fatal("expected error") + } +} + +func TestMultipartPayload(t *testing.T) { + payload := strings.TrimSpace(` +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="text" + +text default +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="file1"; filename="a.txt" +Content-Type: text/plain + +Content of a.txt. + +-----------------------------9051914041544843365972754266 +Content-Disposition: form-data; name="file2"; filename="a.html" +Content-Type: text/html + +Content of a.html. + +-----------------------------9051914041544843365972754266-- +`) + + mp := multipartProcessor(t) + + v := corazawaf.NewTransactionVariables() + if err := mp.ProcessRequest(strings.NewReader(payload), v, plugintypes.BodyProcessorOptions{ + Mime: "multipart/form-data; boundary=---------------------------9051914041544843365972754266", + }); err != nil { + t.Fatal(err) + } + // first we validate we got the headers + headers := v.MultipartPartHeaders() + header1 := "Content-Disposition: form-data; name=\"file2\"; filename=\"a.html\"" + header2 := "Content-Type: text/html" + if h := headers.Get("file2"); len(h) == 0 { + t.Fatal("expected headers for file2") + } else { + if len(h) != 2 { + t.Fatal("expected 2 headers for file2") + } + if (h[0] != header1 && h[0] != header2) || (h[1] != header1 && h[1] != header2) { + t.Fatalf("Got invalid multipart headers") + } + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/task.json new file mode 100644 index 0000000000000000000000000000000000000000..63f3621b8346a4e390d3db8cda370f05b616c1bc --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-398ac78e3981b77e4ee2", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-398ac78e3981b77e4ee2", + "project_id": "morefixes__corazawaf__coraza", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/bodyprocessors/multipart.go", + "internal/bodyprocessors/multipart_test.go" + ], + "patch_units": { + "before": [ + "internal/bodyprocessors/multipart.go", + "internal/bodyprocessors/multipart_test.go" + ], + "after": [ + "internal/bodyprocessors/multipart.go", + "internal/bodyprocessors/multipart_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/551b98dd07a412821004f08212bbfe249a89fcaa5dbaa6f9897e8c41d20e9fad/database", + "cache_key": "551b98dd07a412821004f08212bbfe249a89fcaa5dbaa6f9897e8c41d20e9fad", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/02bbe845c2c8cb461e3895a0a869159845dbf3fc8f0da5bcf944b48692868b47/database", + "cache_key": "02bbe845c2c8cb461e3895a0a869159845dbf3fc8f0da5bcf944b48692868b47", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/9e890c0a64900e123956fd2fe8bf96387702f45a55e58f7ab76048708c381705/database", + "cache_key": "9e890c0a64900e123956fd2fe8bf96387702f45a55e58f7ab76048708c381705", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-398ac78e3981b77e4ee2/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-398ac78e3981b77e4ee2/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-398ac78e3981b77e4ee2/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..6e24f2bd36fe67fa47b8712424020b1090839b69 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/patch.diff @@ -0,0 +1,43 @@ +diff --git a/fileutil/file.go b/fileutil/file.go +index 9fe7a28..f2fe11c 100644 +--- a/fileutil/file.go ++++ b/fileutil/file.go +@@ -8,6 +8,7 @@ import ( + "archive/zip" + "bufio" + "errors" ++ "fmt" + "io" + "io/fs" + "io/ioutil" +@@ -220,7 +221,11 @@ func UnZip(zipFile string, destPath string) error { + defer zipReader.Close() + + for _, f := range zipReader.File { +- path := filepath.Join(destPath, f.Name) ++ //issue#62: fix ZipSlip bug ++ path, err := safeFilepathJoin(destPath, f.Name) ++ if err != nil { ++ return err ++ } + if f.FileInfo().IsDir() { + os.MkdirAll(path, os.ModePerm) + } else { +@@ -249,6 +254,17 @@ func UnZip(zipFile string, destPath string) error { + return nil + } + ++func safeFilepathJoin(path1, path2 string) (string, error) { ++ relPath, err := filepath.Rel(".", path2) ++ if err != nil || strings.HasPrefix(relPath, "..") { ++ return "", fmt.Errorf("(zipslip) filepath is unsafe %q: %v", path2, err) ++ } ++ if path1 == "" { ++ path1 = "." ++ } ++ return filepath.Join(path1, filepath.Join("/", relPath)), nil ++} ++ + // IsLink checks if a file is symbol link or not + func IsLink(path string) bool { + fi, err := os.Lstat(path) diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..8368bd88d735b21cb9e8df79c22811720d4bccda --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/post_context.md @@ -0,0 +1,326 @@ +# Patch-overlapping Go context after the fix + +## `fileutil/file.go` (changed lines (11, 224, 225, 226, 227, 228, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267)) + +```go +// Copyright 2021 dudaodong@gmail.com. All rights reserved. +// Use of this source code is governed by MIT license. + +// Package fileutil implements some basic functions for file operations +package fileutil + +import ( + "archive/zip" + "bufio" + "errors" + "fmt" + "io" + "io/fs" + "io/ioutil" + "net/http" + "os" + "path" + "path/filepath" + "strings" +) + +// IsExist checks if a file or directory exists +func IsExist(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if errors.Is(err, os.ErrNotExist) { + return false + } + return false +} + +// CreateFile create a file in path +func CreateFile(path string) bool { + file, err := os.Create(path) + if err != nil { + return false + } + + defer file.Close() + return true +} + +// CreateDir create directory in absolute path. param `absPath` like /a/, /a/b/ +func CreateDir(absPath string) error { + return os.MkdirAll(path.Dir(absPath), os.ModePerm) +} + +// IsDir checks if the path is directory or not +func IsDir(path string) bool { + file, err := os.Stat(path) + if err != nil { + return false + } + return file.IsDir() +} + +// RemoveFile remove the path file +func RemoveFile(path string) error { + return os.Remove(path) +} + +// CopyFile copy src file to dest file +func CopyFile(srcFilePath string, dstFilePath string) error { + srcFile, err := os.Open(srcFilePath) + if err != nil { + return err + } + defer srcFile.Close() + + distFile, err := os.Create(dstFilePath) + if err != nil { + return err + } + defer distFile.Close() + + var tmp = make([]byte, 1024*4) + for { + n, err := srcFile.Read(tmp) + distFile.Write(tmp[:n]) + if err != nil { + if err == io.EOF { + return nil + } + return err + } + } +} + +//ClearFile write empty string to path file +func ClearFile(path string) error { + f, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC, 0777) + if err != nil { + return err + } + defer f.Close() + + _, err = f.WriteString("") + return err +} + +//ReadFileToString return string of file content +func ReadFileToString(path string) (string, error) { + bytes, err := ioutil.ReadFile(path) + if err != nil { + return "", err + } + return string(bytes), nil +} + +// ReadFileByLine read file line by line +func ReadFileByLine(path string) ([]string, error) { + f, err := os.Open(path) + if err != nil { + return nil, err + } + defer f.Close() + + res := make([]string, 0) + buf := bufio.NewReader(f) + + for { + line, _, err := buf.ReadLine() + l := string(line) + if err == io.EOF { + break + } + if err != nil { + continue + } + res = append(res, l) + } + + return res, nil +} + +// ListFileNames return all file names in the path +func ListFileNames(path string) ([]string, error) { + if !IsExist(path) { + return []string{}, nil + } + + fs, err := ioutil.ReadDir(path) + if err != nil { + return []string{}, err + } + + sz := len(fs) + if sz == 0 { + return []string{}, nil + } + + res := []string{} + for i := 0; i < sz; i++ { + if !fs[i].IsDir() { + res = append(res, fs[i].Name()) + } + } + + return res, nil +} + +// Zip create zip file, fpath could be a single file or a directory +func Zip(fpath string, destPath string) error { + zipFile, err := os.Create(destPath) + if err != nil { + return err + } + defer zipFile.Close() + + archive := zip.NewWriter(zipFile) + defer archive.Close() + + filepath.Walk(fpath, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + header, err := zip.FileInfoHeader(info) + if err != nil { + return err + } + + header.Name = strings.TrimPrefix(path, filepath.Dir(fpath)+"/") + + if info.IsDir() { + header.Name += "/" + } else { + header.Method = zip.Deflate + } + + writer, err := archive.CreateHeader(header) + if err != nil { + return err + } + + if !info.IsDir() { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + _, err = io.Copy(writer, file) + if err != nil { + return err + } + } + return nil + }) + + return nil +} + +// UnZip unzip the file and save it to destPath +func UnZip(zipFile string, destPath string) error { + zipReader, err := zip.OpenReader(zipFile) + if err != nil { + return err + } + defer zipReader.Close() + + for _, f := range zipReader.File { + //issue#62: fix ZipSlip bug + path, err := safeFilepathJoin(destPath, f.Name) + if err != nil { + return err + } + if f.FileInfo().IsDir() { + os.MkdirAll(path, os.ModePerm) + } else { + if err = os.MkdirAll(filepath.Dir(path), os.ModePerm); err != nil { + return err + } + + inFile, err := f.Open() + if err != nil { + return err + } + defer inFile.Close() + + outFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode()) + if err != nil { + return err + } + defer outFile.Close() + + _, err = io.Copy(outFile, inFile) + if err != nil { + return err + } + } + } + return nil +} + +func safeFilepathJoin(path1, path2 string) (string, error) { + relPath, err := filepath.Rel(".", path2) + if err != nil || strings.HasPrefix(relPath, "..") { + return "", fmt.Errorf("(zipslip) filepath is unsafe %q: %v", path2, err) + } + if path1 == "" { + path1 = "." + } + return filepath.Join(path1, filepath.Join("/", relPath)), nil +} + +// IsLink checks if a file is symbol link or not +func IsLink(path string) bool { + fi, err := os.Lstat(path) + if err != nil { + return false + } + return fi.Mode()&os.ModeSymlink != 0 +} + +// FileMode return file's mode and permission +func FileMode(path string) (fs.FileMode, error) { + fi, err := os.Lstat(path) + if err != nil { + return 0, err + } + return fi.Mode(), nil +} + +// MiMeType return file mime type +// param `file` should be string(file path) or *os.File +func MiMeType(file interface{}) string { + var mediatype string + + readBuffer := func(f *os.File) ([]byte, error) { + buffer := make([]byte, 512) + _, err := f.Read(buffer) + if err != nil { + return nil, err + } + return buffer, nil + } + + if filePath, ok := file.(string); ok { + f, err := os.Open(filePath) + if err != nil { + return mediatype + } + buffer, err := readBuffer(f) + if err != nil { + return mediatype + } + return http.DetectContentType(buffer) + } + + if f, ok := file.(*os.File); ok { + buffer, err := readBuffer(f) + if err != nil { + return mediatype + } + return http.DetectContentType(buffer) + } + return mediatype +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..2bf860db99b318149156b2fc64401f3bcd2d8fed --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/pre_context.md @@ -0,0 +1,310 @@ +# Patch-overlapping Go context before the fix + +## `fileutil/file.go` (changed lines (11, 223, 224, 252)) + +```go +// Copyright 2021 dudaodong@gmail.com. All rights reserved. +// Use of this source code is governed by MIT license. + +// Package fileutil implements some basic functions for file operations +package fileutil + +import ( + "archive/zip" + "bufio" + "errors" + "io" + "io/fs" + "io/ioutil" + "net/http" + "os" + "path" + "path/filepath" + "strings" +) + +// IsExist checks if a file or directory exists +func IsExist(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if errors.Is(err, os.ErrNotExist) { + return false + } + return false +} + +// CreateFile create a file in path +func CreateFile(path string) bool { + file, err := os.Create(path) + if err != nil { + return false + } + + defer file.Close() + return true +} + +// CreateDir create directory in absolute path. param `absPath` like /a/, /a/b/ +func CreateDir(absPath string) error { + return os.MkdirAll(path.Dir(absPath), os.ModePerm) +} + +// IsDir checks if the path is directory or not +func IsDir(path string) bool { + file, err := os.Stat(path) + if err != nil { + return false + } + return file.IsDir() +} + +// RemoveFile remove the path file +func RemoveFile(path string) error { + return os.Remove(path) +} + +// CopyFile copy src file to dest file +func CopyFile(srcFilePath string, dstFilePath string) error { + srcFile, err := os.Open(srcFilePath) + if err != nil { + return err + } + defer srcFile.Close() + + distFile, err := os.Create(dstFilePath) + if err != nil { + return err + } + defer distFile.Close() + + var tmp = make([]byte, 1024*4) + for { + n, err := srcFile.Read(tmp) + distFile.Write(tmp[:n]) + if err != nil { + if err == io.EOF { + return nil + } + return err + } + } +} + +//ClearFile write empty string to path file +func ClearFile(path string) error { + f, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC, 0777) + if err != nil { + return err + } + defer f.Close() + + _, err = f.WriteString("") + return err +} + +//ReadFileToString return string of file content +func ReadFileToString(path string) (string, error) { + bytes, err := ioutil.ReadFile(path) + if err != nil { + return "", err + } + return string(bytes), nil +} + +// ReadFileByLine read file line by line +func ReadFileByLine(path string) ([]string, error) { + f, err := os.Open(path) + if err != nil { + return nil, err + } + defer f.Close() + + res := make([]string, 0) + buf := bufio.NewReader(f) + + for { + line, _, err := buf.ReadLine() + l := string(line) + if err == io.EOF { + break + } + if err != nil { + continue + } + res = append(res, l) + } + + return res, nil +} + +// ListFileNames return all file names in the path +func ListFileNames(path string) ([]string, error) { + if !IsExist(path) { + return []string{}, nil + } + + fs, err := ioutil.ReadDir(path) + if err != nil { + return []string{}, err + } + + sz := len(fs) + if sz == 0 { + return []string{}, nil + } + + res := []string{} + for i := 0; i < sz; i++ { + if !fs[i].IsDir() { + res = append(res, fs[i].Name()) + } + } + + return res, nil +} + +// Zip create zip file, fpath could be a single file or a directory +func Zip(fpath string, destPath string) error { + zipFile, err := os.Create(destPath) + if err != nil { + return err + } + defer zipFile.Close() + + archive := zip.NewWriter(zipFile) + defer archive.Close() + + filepath.Walk(fpath, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + header, err := zip.FileInfoHeader(info) + if err != nil { + return err + } + + header.Name = strings.TrimPrefix(path, filepath.Dir(fpath)+"/") + + if info.IsDir() { + header.Name += "/" + } else { + header.Method = zip.Deflate + } + + writer, err := archive.CreateHeader(header) + if err != nil { + return err + } + + if !info.IsDir() { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + _, err = io.Copy(writer, file) + if err != nil { + return err + } + } + return nil + }) + + return nil +} + +// UnZip unzip the file and save it to destPath +func UnZip(zipFile string, destPath string) error { + zipReader, err := zip.OpenReader(zipFile) + if err != nil { + return err + } + defer zipReader.Close() + + for _, f := range zipReader.File { + path := filepath.Join(destPath, f.Name) + if f.FileInfo().IsDir() { + os.MkdirAll(path, os.ModePerm) + } else { + if err = os.MkdirAll(filepath.Dir(path), os.ModePerm); err != nil { + return err + } + + inFile, err := f.Open() + if err != nil { + return err + } + defer inFile.Close() + + outFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode()) + if err != nil { + return err + } + defer outFile.Close() + + _, err = io.Copy(outFile, inFile) + if err != nil { + return err + } + } + } + return nil +} + +// IsLink checks if a file is symbol link or not +func IsLink(path string) bool { + fi, err := os.Lstat(path) + if err != nil { + return false + } + return fi.Mode()&os.ModeSymlink != 0 +} + +// FileMode return file's mode and permission +func FileMode(path string) (fs.FileMode, error) { + fi, err := os.Lstat(path) + if err != nil { + return 0, err + } + return fi.Mode(), nil +} + +// MiMeType return file mime type +// param `file` should be string(file path) or *os.File +func MiMeType(file interface{}) string { + var mediatype string + + readBuffer := func(f *os.File) ([]byte, error) { + buffer := make([]byte, 512) + _, err := f.Read(buffer) + if err != nil { + return nil, err + } + return buffer, nil + } + + if filePath, ok := file.(string); ok { + f, err := os.Open(filePath) + if err != nil { + return mediatype + } + buffer, err := readBuffer(f) + if err != nil { + return mediatype + } + return http.DetectContentType(buffer) + } + + if f, ok := file.(*os.File); ok { + buffer, err := readBuffer(f) + if err != nil { + return mediatype + } + return http.DetectContentType(buffer) + } + return mediatype +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/task.json new file mode 100644 index 0000000000000000000000000000000000000000..3a89b88247bbef44560735965428a130fe215bd9 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-461c7bace102119cf443", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-461c7bace102119cf443", + "project_id": "morefixes__duke-git__lancet", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "fileutil/file.go" + ], + "patch_units": { + "before": [ + "fileutil/file.go" + ], + "after": [ + "fileutil/file.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/3bd1b643d4d658488ff75b34a7408f63e3e7c48bbcf20b8b851f5d2586a4074f/database", + "cache_key": "3bd1b643d4d658488ff75b34a7408f63e3e7c48bbcf20b8b851f5d2586a4074f", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/e3aec19fe853ea77aae05e80146065b40cdf4f0c26609690dc1fa506fda65079/database", + "cache_key": "e3aec19fe853ea77aae05e80146065b40cdf4f0c26609690dc1fa506fda65079", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/29c3f2fc77a1f798684693af1c740f407431b34eb0f47ef6a05f3bbb6a540366/database", + "cache_key": "29c3f2fc77a1f798684693af1c740f407431b34eb0f47ef6a05f3bbb6a540366", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-461c7bace102119cf443/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-461c7bace102119cf443/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-461c7bace102119cf443/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..b87279b317da41bacc22f967b9ea7f4d0a469592 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/patch.diff @@ -0,0 +1,22 @@ +diff --git a/btf/btf.go b/btf/btf.go +index cdc95425..a9160c67 100644 +--- a/btf/btf.go ++++ b/btf/btf.go +@@ -214,7 +214,7 @@ func loadRawSpec(btf []byte, base *Spec) (*Spec, error) { + } + btf = btf[header.HdrLen:] + +- if int(header.StringOff+header.StringLen) > len(btf) { ++ if uint64(header.StringOff)+uint64(header.StringLen) > uint64(len(btf)) { + return nil, fmt.Errorf("string table is out of bounds") + } + stringsSection := btf[header.StringOff : header.StringOff+header.StringLen] +@@ -224,7 +224,7 @@ func loadRawSpec(btf []byte, base *Spec) (*Spec, error) { + return nil, fmt.Errorf("read string section: %w", err) + } + +- if int(header.TypeOff+header.TypeLen) > len(btf) { ++ if uint64(header.TypeOff)+uint64(header.TypeLen) > uint64(len(btf)) { + return nil, fmt.Errorf("types section is out of bounds") + } + typesSection := btf[header.TypeOff : header.TypeOff+header.TypeLen] diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..3319bcfbd4e25b77fe0410cc7200003bf9078f83 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/post_context.md @@ -0,0 +1,562 @@ +# Patch-overlapping Go context after the fix + +## `btf/btf.go` (changed lines (217, 227)) + +```go +package btf + +import ( + "debug/elf" + "errors" + "fmt" + "io" + "iter" + "maps" + "math" + "os" + "reflect" + "slices" + + "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/sys" +) + +const btfMagic = 0xeB9F + +// Errors returned by BTF functions. +var ( + ErrNotSupported = internal.ErrNotSupported + ErrNotFound = errors.New("not found") + ErrNoExtendedInfo = errors.New("no extended info") + ErrMultipleMatches = errors.New("multiple matching types") +) + +// ID represents the unique ID of a BTF object. +type ID = sys.BTFID + +type elfData struct { + sectionSizes map[string]uint32 + symbolOffsets map[elfSymbol]uint32 + fixups map[Type]bool +} + +type elfSymbol struct { + section string + name string +} + +// Spec allows querying a set of Types and loading the set into the +// kernel. +type Spec struct { + *decoder + + // Additional data from ELF, may be nil. + elf *elfData +} + +// LoadSpec opens file and calls LoadSpecFromReader on it. +func LoadSpec(file string) (*Spec, error) { + fh, err := os.Open(file) + if err != nil { + return nil, err + } + defer fh.Close() + + return LoadSpecFromReader(fh) +} + +// LoadSpecFromReader reads from an ELF or a raw BTF blob. +// +// Returns ErrNotFound if reading from an ELF which contains no BTF. ExtInfos +// may be nil. +func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { + file, err := internal.NewSafeELFFile(rd) + if err != nil { + raw, err := io.ReadAll(io.NewSectionReader(rd, 0, math.MaxInt64)) + if err != nil { + return nil, fmt.Errorf("read raw BTF: %w", err) + } + + return loadRawSpec(raw, nil) + } + + return loadSpecFromELF(file) +} + +// LoadSpecAndExtInfosFromReader reads from an ELF. +// +// ExtInfos may be nil if the ELF doesn't contain section metadata. +// Returns ErrNotFound if the ELF contains no BTF. +func LoadSpecAndExtInfosFromReader(rd io.ReaderAt) (*Spec, *ExtInfos, error) { + file, err := internal.NewSafeELFFile(rd) + if err != nil { + return nil, nil, err + } + + spec, err := loadSpecFromELF(file) + if err != nil { + return nil, nil, err + } + + extInfos, err := loadExtInfosFromELF(file, spec) + if err != nil && !errors.Is(err, ErrNotFound) { + return nil, nil, err + } + + return spec, extInfos, nil +} + +// symbolOffsets extracts all symbols offsets from an ELF and indexes them by +// section and variable name. +// +// References to variables in BTF data sections carry unsigned 32-bit offsets. +// Some ELF symbols (e.g. in vmlinux) may point to virtual memory that is well +// beyond this range. Since these symbols cannot be described by BTF info, +// ignore them here. +func symbolOffsets(file *internal.SafeELFFile) (map[elfSymbol]uint32, error) { + symbols, err := file.Symbols() + if err != nil { + return nil, fmt.Errorf("can't read symbols: %v", err) + } + + offsets := make(map[elfSymbol]uint32) + for _, sym := range symbols { + if idx := sym.Section; idx >= elf.SHN_LORESERVE && idx <= elf.SHN_HIRESERVE { + // Ignore things like SHN_ABS + continue + } + + if sym.Value > math.MaxUint32 { + // VarSecinfo offset is u32, cannot reference symbols in higher regions. + continue + } + + if int(sym.Section) >= len(file.Sections) { + return nil, fmt.Errorf("symbol %s: invalid section %d", sym.Name, sym.Section) + } + + secName := file.Sections[sym.Section].Name + offsets[elfSymbol{secName, sym.Name}] = uint32(sym.Value) + } + + return offsets, nil +} + +func loadSpecFromELF(file *internal.SafeELFFile) (*Spec, error) { + var ( + btfSection *elf.Section + sectionSizes = make(map[string]uint32) + ) + + for _, sec := range file.Sections { + switch sec.Name { + case ".BTF": + btfSection = sec + default: + if sec.Type != elf.SHT_PROGBITS && sec.Type != elf.SHT_NOBITS { + break + } + + if sec.Size > math.MaxUint32 { + return nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) + } + + sectionSizes[sec.Name] = uint32(sec.Size) + } + } + + if btfSection == nil { + return nil, fmt.Errorf("btf: %w", ErrNotFound) + } + + offsets, err := symbolOffsets(file) + if err != nil { + return nil, err + } + + rawBTF, err := btfSection.Data() + if err != nil { + return nil, fmt.Errorf("reading .BTF section: %w", err) + } + + spec, err := loadRawSpec(rawBTF, nil) + if err != nil { + return nil, err + } + + if spec.decoder.byteOrder != file.ByteOrder { + return nil, fmt.Errorf("BTF byte order %s does not match ELF byte order %s", spec.decoder.byteOrder, file.ByteOrder) + } + + spec.elf = &elfData{ + sectionSizes, + offsets, + make(map[Type]bool), + } + + return spec, nil +} + +func loadRawSpec(btf []byte, base *Spec) (*Spec, error) { + var ( + baseDecoder *decoder + baseStrings *stringTable + err error + ) + + if base != nil { + baseDecoder = base.decoder + baseStrings = base.strings + } + + header, bo, err := parseBTFHeader(btf) + if err != nil { + return nil, fmt.Errorf("parsing .BTF header: %v", err) + } + + if header.HdrLen > uint32(len(btf)) { + return nil, fmt.Errorf("BTF header length is out of bounds") + } + btf = btf[header.HdrLen:] + + if uint64(header.StringOff)+uint64(header.StringLen) > uint64(len(btf)) { + return nil, fmt.Errorf("string table is out of bounds") + } + stringsSection := btf[header.StringOff : header.StringOff+header.StringLen] + + rawStrings, err := newStringTable(stringsSection, baseStrings) + if err != nil { + return nil, fmt.Errorf("read string section: %w", err) + } + + if uint64(header.TypeOff)+uint64(header.TypeLen) > uint64(len(btf)) { + return nil, fmt.Errorf("types section is out of bounds") + } + typesSection := btf[header.TypeOff : header.TypeOff+header.TypeLen] + + decoder, err := newDecoder(typesSection, bo, rawStrings, baseDecoder) + if err != nil { + return nil, err + } + + return &Spec{decoder, nil}, nil +} + +// fixupDatasec attempts to patch up missing info in Datasecs and its members by +// supplementing them with information from the ELF headers and symbol table. +func (elf *elfData) fixupDatasec(typ Type) error { + if elf == nil { + return nil + } + + if ds, ok := typ.(*Datasec); ok { + if elf.fixups[ds] { + return nil + } + elf.fixups[ds] = true + + name := ds.Name + + // Some Datasecs are virtual and don't have corresponding ELF sections. + switch name { + case ".ksyms": + // .ksyms describes forward declarations of kfunc signatures, as well as + // references to kernel symbols. + // Nothing to fix up, all sizes and offsets are 0. + for _, vsi := range ds.Vars { + switch t := vsi.Type.(type) { + case *Func: + continue + case *Var: + if _, ok := t.Type.(*Void); !ok { + return fmt.Errorf("data section %s: expected %s to be *Void, not %T: %w", name, vsi.Type.TypeName(), vsi.Type, ErrNotSupported) + } + default: + return fmt.Errorf("data section %s: expected to be either *btf.Func or *btf.Var, not %T: %w", name, vsi.Type, ErrNotSupported) + } + } + + return nil + case ".kconfig": + // .kconfig has a size of 0 and has all members' offsets set to 0. + // Fix up all offsets and set the Datasec's size. + if err := fixupDatasecLayout(ds); err != nil { + return err + } + + // Fix up extern to global linkage to avoid a BTF verifier error. + for _, vsi := range ds.Vars { + vsi.Type.(*Var).Linkage = GlobalVar + } + + return nil + } + + if ds.Size != 0 { + return nil + } + + ds.Size, ok = elf.sectionSizes[name] + if !ok { + return fmt.Errorf("data section %s: missing size", name) + } + + for i := range ds.Vars { + symName := ds.Vars[i].Type.TypeName() + ds.Vars[i].Offset, ok = elf.symbolOffsets[elfSymbol{name, symName}] + if !ok { + return fmt.Errorf("data section %s: missing offset for symbol %s", name, symName) + } + } + } + + return nil +} + +// fixupDatasecLayout populates ds.Vars[].Offset according to var sizes and +// alignment. Calculate and set ds.Size. +func fixupDatasecLayout(ds *Datasec) error { + var off uint32 + + for i, vsi := range ds.Vars { + v, ok := vsi.Type.(*Var) + if !ok { + return fmt.Errorf("member %d: unsupported type %T", i, vsi.Type) + } + + size, err := Sizeof(v.Type) + if err != nil { + return fmt.Errorf("variable %s: getting size: %w", v.Name, err) + } + align, err := alignof(v.Type) + if err != nil { + return fmt.Errorf("variable %s: getting alignment: %w", v.Name, err) + } + + // Align the current member based on the offset of the end of the previous + // member and the alignment of the current member. + off = internal.Align(off, uint32(align)) + + ds.Vars[i].Offset = off + + off += uint32(size) + } + + ds.Size = off + + return nil +} + +// Copy a Spec. +// +// All contained types are duplicated while preserving any modifications made +// to them. +func (s *Spec) Copy() *Spec { + if s == nil { + return nil + } + + cpy := &Spec{ + s.decoder.Copy(), + nil, + } + + if s.elf != nil { + cpy.elf = &elfData{ + s.elf.sectionSizes, + s.elf.symbolOffsets, + maps.Clone(s.elf.fixups), + } + } + + return cpy +} + +// TypeByID returns the BTF Type with the given type ID. +// +// Returns an error wrapping ErrNotFound if a Type with the given ID +// does not exist in the Spec. +func (s *Spec) TypeByID(id TypeID) (Type, error) { + typ, err := s.decoder.TypeByID(id) + if err != nil { + return nil, fmt.Errorf("inflate type: %w", err) + } + + if err := s.elf.fixupDatasec(typ); err != nil { + return nil, err + } + + return typ, nil +} + +// TypeID returns the ID for a given Type. +// +// Returns an error wrapping [ErrNotFound] if the type isn't part of the Spec. +func (s *Spec) TypeID(typ Type) (TypeID, error) { + return s.decoder.TypeID(typ) +} + +// AnyTypesByName returns a list of BTF Types with the given name. +// +// If the BTF blob describes multiple compilation units like vmlinux, multiple +// Types with the same name and kind can exist, but might not describe the same +// data structure. +// +// Returns an error wrapping ErrNotFound if no matching Type exists in the Spec. +func (s *Spec) AnyTypesByName(name string) ([]Type, error) { + types, err := s.TypesByName(newEssentialName(name)) + if err != nil { + return nil, err + } + + for i := 0; i < len(types); i++ { + // Match against the full name, not just the essential one + // in case the type being looked up is a struct flavor. + if types[i].TypeName() != name { + types = slices.Delete(types, i, i+1) + continue + } + + if err := s.elf.fixupDatasec(types[i]); err != nil { + return nil, err + } + } + + return types, nil +} + +// AnyTypeByName returns a Type with the given name. +// +// Returns an error if multiple types of that name exist. +func (s *Spec) AnyTypeByName(name string) (Type, error) { + types, err := s.AnyTypesByName(name) + if err != nil { + return nil, err + } + + if len(types) > 1 { + return nil, fmt.Errorf("found multiple types: %v", types) + } + + return types[0], nil +} + +// TypeByName searches for a Type with a specific name. Since multiple Types +// with the same name can exist, the parameter typ is taken to narrow down the +// search in case of a clash. +// +// typ must be a non-nil pointer to an implementation of a Type. On success, the +// address of the found Type will be copied to typ. +// +// Returns an error wrapping ErrNotFound if no matching Type exists in the Spec. +// Returns an error wrapping ErrMultipleTypes if multiple candidates are found. +func (s *Spec) TypeByName(name string, typ any) error { + if err := internal.IsNilPointer(typ); err != nil { + return fmt.Errorf("type argument: %w", err) + } + + typeInterface := reflect.TypeFor[Type]() + + // typ may be **T or *Type + typValue := reflect.ValueOf(typ) + if typValue.Kind() != reflect.Pointer { + return fmt.Errorf("%T is not a pointer", typ) + } + typPtr := typValue.Elem() + if !typPtr.CanSet() { + return fmt.Errorf("%T cannot be set", typ) + } + + wanted := typPtr.Type() + if wanted == typeInterface { + // This is *Type. Unwrap the value's type. + if typPtr.IsNil() { + return fmt.Errorf("%T points to a nil Type", typ) + } + wanted = typPtr.Elem().Type() + } + + if !wanted.AssignableTo(typeInterface) { + return fmt.Errorf("%T does not satisfy Type interface", typ) + } + + types, err := s.AnyTypesByName(name) + if err != nil { + return err + } + + var candidate Type + for _, typ := range types { + if reflect.TypeOf(typ) != wanted { + continue + } + + if candidate != nil { + return fmt.Errorf("type %s(%T): %w", name, typ, ErrMultipleMatches) + } + + candidate = typ + } + + if candidate == nil { + return fmt.Errorf("%s %s: %w", wanted, name, ErrNotFound) + } + + typPtr.Set(reflect.ValueOf(candidate)) + + return nil +} + +// LoadSplitSpec loads split BTF from the given file. +// +// Types from base are used to resolve references in the split BTF. +// The returned Spec only contains types from the split BTF, not from the base. +func LoadSplitSpec(file string, base *Spec) (*Spec, error) { + fh, err := os.Open(file) + if err != nil { + return nil, err + } + defer fh.Close() + + return LoadSplitSpecFromReader(fh, base) +} + +// LoadSplitSpecFromReader loads split BTF from a reader. +// +// Types from base are used to resolve references in the split BTF. +// The returned Spec only contains types from the split BTF, not from the base. +func LoadSplitSpecFromReader(r io.ReaderAt, base *Spec) (*Spec, error) { + raw, err := io.ReadAll(io.NewSectionReader(r, 0, math.MaxInt64)) + if err != nil { + return nil, fmt.Errorf("read raw BTF: %w", err) + } + + return loadRawSpec(raw, base) +} + +// All iterates over all types. +func (s *Spec) All() iter.Seq2[Type, error] { + return func(yield func(Type, error) bool) { + for id := s.firstTypeID; ; id++ { + typ, err := s.TypeByID(id) + if errors.Is(err, ErrNotFound) { + return + } else if err != nil { + yield(nil, err) + return + } + + // Skip declTags, during unmarshaling declTags become `Tags` fields of other types. + // We keep them in the spec to avoid holes in the ID space, but for the purposes of + // iteration, they are not useful to the user. + if _, ok := typ.(*declTag); ok { + continue + } + + if !yield(typ, nil) { + return + } + } + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..1ced41b603eaf0874c67a510e1a4f6d2baad1103 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/pre_context.md @@ -0,0 +1,562 @@ +# Patch-overlapping Go context before the fix + +## `btf/btf.go` (changed lines (217, 218, 227, 228)) + +```go +package btf + +import ( + "debug/elf" + "errors" + "fmt" + "io" + "iter" + "maps" + "math" + "os" + "reflect" + "slices" + + "github.com/cilium/ebpf/internal" + "github.com/cilium/ebpf/internal/sys" +) + +const btfMagic = 0xeB9F + +// Errors returned by BTF functions. +var ( + ErrNotSupported = internal.ErrNotSupported + ErrNotFound = errors.New("not found") + ErrNoExtendedInfo = errors.New("no extended info") + ErrMultipleMatches = errors.New("multiple matching types") +) + +// ID represents the unique ID of a BTF object. +type ID = sys.BTFID + +type elfData struct { + sectionSizes map[string]uint32 + symbolOffsets map[elfSymbol]uint32 + fixups map[Type]bool +} + +type elfSymbol struct { + section string + name string +} + +// Spec allows querying a set of Types and loading the set into the +// kernel. +type Spec struct { + *decoder + + // Additional data from ELF, may be nil. + elf *elfData +} + +// LoadSpec opens file and calls LoadSpecFromReader on it. +func LoadSpec(file string) (*Spec, error) { + fh, err := os.Open(file) + if err != nil { + return nil, err + } + defer fh.Close() + + return LoadSpecFromReader(fh) +} + +// LoadSpecFromReader reads from an ELF or a raw BTF blob. +// +// Returns ErrNotFound if reading from an ELF which contains no BTF. ExtInfos +// may be nil. +func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { + file, err := internal.NewSafeELFFile(rd) + if err != nil { + raw, err := io.ReadAll(io.NewSectionReader(rd, 0, math.MaxInt64)) + if err != nil { + return nil, fmt.Errorf("read raw BTF: %w", err) + } + + return loadRawSpec(raw, nil) + } + + return loadSpecFromELF(file) +} + +// LoadSpecAndExtInfosFromReader reads from an ELF. +// +// ExtInfos may be nil if the ELF doesn't contain section metadata. +// Returns ErrNotFound if the ELF contains no BTF. +func LoadSpecAndExtInfosFromReader(rd io.ReaderAt) (*Spec, *ExtInfos, error) { + file, err := internal.NewSafeELFFile(rd) + if err != nil { + return nil, nil, err + } + + spec, err := loadSpecFromELF(file) + if err != nil { + return nil, nil, err + } + + extInfos, err := loadExtInfosFromELF(file, spec) + if err != nil && !errors.Is(err, ErrNotFound) { + return nil, nil, err + } + + return spec, extInfos, nil +} + +// symbolOffsets extracts all symbols offsets from an ELF and indexes them by +// section and variable name. +// +// References to variables in BTF data sections carry unsigned 32-bit offsets. +// Some ELF symbols (e.g. in vmlinux) may point to virtual memory that is well +// beyond this range. Since these symbols cannot be described by BTF info, +// ignore them here. +func symbolOffsets(file *internal.SafeELFFile) (map[elfSymbol]uint32, error) { + symbols, err := file.Symbols() + if err != nil { + return nil, fmt.Errorf("can't read symbols: %v", err) + } + + offsets := make(map[elfSymbol]uint32) + for _, sym := range symbols { + if idx := sym.Section; idx >= elf.SHN_LORESERVE && idx <= elf.SHN_HIRESERVE { + // Ignore things like SHN_ABS + continue + } + + if sym.Value > math.MaxUint32 { + // VarSecinfo offset is u32, cannot reference symbols in higher regions. + continue + } + + if int(sym.Section) >= len(file.Sections) { + return nil, fmt.Errorf("symbol %s: invalid section %d", sym.Name, sym.Section) + } + + secName := file.Sections[sym.Section].Name + offsets[elfSymbol{secName, sym.Name}] = uint32(sym.Value) + } + + return offsets, nil +} + +func loadSpecFromELF(file *internal.SafeELFFile) (*Spec, error) { + var ( + btfSection *elf.Section + sectionSizes = make(map[string]uint32) + ) + + for _, sec := range file.Sections { + switch sec.Name { + case ".BTF": + btfSection = sec + default: + if sec.Type != elf.SHT_PROGBITS && sec.Type != elf.SHT_NOBITS { + break + } + + if sec.Size > math.MaxUint32 { + return nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) + } + + sectionSizes[sec.Name] = uint32(sec.Size) + } + } + + if btfSection == nil { + return nil, fmt.Errorf("btf: %w", ErrNotFound) + } + + offsets, err := symbolOffsets(file) + if err != nil { + return nil, err + } + + rawBTF, err := btfSection.Data() + if err != nil { + return nil, fmt.Errorf("reading .BTF section: %w", err) + } + + spec, err := loadRawSpec(rawBTF, nil) + if err != nil { + return nil, err + } + + if spec.decoder.byteOrder != file.ByteOrder { + return nil, fmt.Errorf("BTF byte order %s does not match ELF byte order %s", spec.decoder.byteOrder, file.ByteOrder) + } + + spec.elf = &elfData{ + sectionSizes, + offsets, + make(map[Type]bool), + } + + return spec, nil +} + +func loadRawSpec(btf []byte, base *Spec) (*Spec, error) { + var ( + baseDecoder *decoder + baseStrings *stringTable + err error + ) + + if base != nil { + baseDecoder = base.decoder + baseStrings = base.strings + } + + header, bo, err := parseBTFHeader(btf) + if err != nil { + return nil, fmt.Errorf("parsing .BTF header: %v", err) + } + + if header.HdrLen > uint32(len(btf)) { + return nil, fmt.Errorf("BTF header length is out of bounds") + } + btf = btf[header.HdrLen:] + + if int(header.StringOff+header.StringLen) > len(btf) { + return nil, fmt.Errorf("string table is out of bounds") + } + stringsSection := btf[header.StringOff : header.StringOff+header.StringLen] + + rawStrings, err := newStringTable(stringsSection, baseStrings) + if err != nil { + return nil, fmt.Errorf("read string section: %w", err) + } + + if int(header.TypeOff+header.TypeLen) > len(btf) { + return nil, fmt.Errorf("types section is out of bounds") + } + typesSection := btf[header.TypeOff : header.TypeOff+header.TypeLen] + + decoder, err := newDecoder(typesSection, bo, rawStrings, baseDecoder) + if err != nil { + return nil, err + } + + return &Spec{decoder, nil}, nil +} + +// fixupDatasec attempts to patch up missing info in Datasecs and its members by +// supplementing them with information from the ELF headers and symbol table. +func (elf *elfData) fixupDatasec(typ Type) error { + if elf == nil { + return nil + } + + if ds, ok := typ.(*Datasec); ok { + if elf.fixups[ds] { + return nil + } + elf.fixups[ds] = true + + name := ds.Name + + // Some Datasecs are virtual and don't have corresponding ELF sections. + switch name { + case ".ksyms": + // .ksyms describes forward declarations of kfunc signatures, as well as + // references to kernel symbols. + // Nothing to fix up, all sizes and offsets are 0. + for _, vsi := range ds.Vars { + switch t := vsi.Type.(type) { + case *Func: + continue + case *Var: + if _, ok := t.Type.(*Void); !ok { + return fmt.Errorf("data section %s: expected %s to be *Void, not %T: %w", name, vsi.Type.TypeName(), vsi.Type, ErrNotSupported) + } + default: + return fmt.Errorf("data section %s: expected to be either *btf.Func or *btf.Var, not %T: %w", name, vsi.Type, ErrNotSupported) + } + } + + return nil + case ".kconfig": + // .kconfig has a size of 0 and has all members' offsets set to 0. + // Fix up all offsets and set the Datasec's size. + if err := fixupDatasecLayout(ds); err != nil { + return err + } + + // Fix up extern to global linkage to avoid a BTF verifier error. + for _, vsi := range ds.Vars { + vsi.Type.(*Var).Linkage = GlobalVar + } + + return nil + } + + if ds.Size != 0 { + return nil + } + + ds.Size, ok = elf.sectionSizes[name] + if !ok { + return fmt.Errorf("data section %s: missing size", name) + } + + for i := range ds.Vars { + symName := ds.Vars[i].Type.TypeName() + ds.Vars[i].Offset, ok = elf.symbolOffsets[elfSymbol{name, symName}] + if !ok { + return fmt.Errorf("data section %s: missing offset for symbol %s", name, symName) + } + } + } + + return nil +} + +// fixupDatasecLayout populates ds.Vars[].Offset according to var sizes and +// alignment. Calculate and set ds.Size. +func fixupDatasecLayout(ds *Datasec) error { + var off uint32 + + for i, vsi := range ds.Vars { + v, ok := vsi.Type.(*Var) + if !ok { + return fmt.Errorf("member %d: unsupported type %T", i, vsi.Type) + } + + size, err := Sizeof(v.Type) + if err != nil { + return fmt.Errorf("variable %s: getting size: %w", v.Name, err) + } + align, err := alignof(v.Type) + if err != nil { + return fmt.Errorf("variable %s: getting alignment: %w", v.Name, err) + } + + // Align the current member based on the offset of the end of the previous + // member and the alignment of the current member. + off = internal.Align(off, uint32(align)) + + ds.Vars[i].Offset = off + + off += uint32(size) + } + + ds.Size = off + + return nil +} + +// Copy a Spec. +// +// All contained types are duplicated while preserving any modifications made +// to them. +func (s *Spec) Copy() *Spec { + if s == nil { + return nil + } + + cpy := &Spec{ + s.decoder.Copy(), + nil, + } + + if s.elf != nil { + cpy.elf = &elfData{ + s.elf.sectionSizes, + s.elf.symbolOffsets, + maps.Clone(s.elf.fixups), + } + } + + return cpy +} + +// TypeByID returns the BTF Type with the given type ID. +// +// Returns an error wrapping ErrNotFound if a Type with the given ID +// does not exist in the Spec. +func (s *Spec) TypeByID(id TypeID) (Type, error) { + typ, err := s.decoder.TypeByID(id) + if err != nil { + return nil, fmt.Errorf("inflate type: %w", err) + } + + if err := s.elf.fixupDatasec(typ); err != nil { + return nil, err + } + + return typ, nil +} + +// TypeID returns the ID for a given Type. +// +// Returns an error wrapping [ErrNotFound] if the type isn't part of the Spec. +func (s *Spec) TypeID(typ Type) (TypeID, error) { + return s.decoder.TypeID(typ) +} + +// AnyTypesByName returns a list of BTF Types with the given name. +// +// If the BTF blob describes multiple compilation units like vmlinux, multiple +// Types with the same name and kind can exist, but might not describe the same +// data structure. +// +// Returns an error wrapping ErrNotFound if no matching Type exists in the Spec. +func (s *Spec) AnyTypesByName(name string) ([]Type, error) { + types, err := s.TypesByName(newEssentialName(name)) + if err != nil { + return nil, err + } + + for i := 0; i < len(types); i++ { + // Match against the full name, not just the essential one + // in case the type being looked up is a struct flavor. + if types[i].TypeName() != name { + types = slices.Delete(types, i, i+1) + continue + } + + if err := s.elf.fixupDatasec(types[i]); err != nil { + return nil, err + } + } + + return types, nil +} + +// AnyTypeByName returns a Type with the given name. +// +// Returns an error if multiple types of that name exist. +func (s *Spec) AnyTypeByName(name string) (Type, error) { + types, err := s.AnyTypesByName(name) + if err != nil { + return nil, err + } + + if len(types) > 1 { + return nil, fmt.Errorf("found multiple types: %v", types) + } + + return types[0], nil +} + +// TypeByName searches for a Type with a specific name. Since multiple Types +// with the same name can exist, the parameter typ is taken to narrow down the +// search in case of a clash. +// +// typ must be a non-nil pointer to an implementation of a Type. On success, the +// address of the found Type will be copied to typ. +// +// Returns an error wrapping ErrNotFound if no matching Type exists in the Spec. +// Returns an error wrapping ErrMultipleTypes if multiple candidates are found. +func (s *Spec) TypeByName(name string, typ any) error { + if err := internal.IsNilPointer(typ); err != nil { + return fmt.Errorf("type argument: %w", err) + } + + typeInterface := reflect.TypeFor[Type]() + + // typ may be **T or *Type + typValue := reflect.ValueOf(typ) + if typValue.Kind() != reflect.Pointer { + return fmt.Errorf("%T is not a pointer", typ) + } + typPtr := typValue.Elem() + if !typPtr.CanSet() { + return fmt.Errorf("%T cannot be set", typ) + } + + wanted := typPtr.Type() + if wanted == typeInterface { + // This is *Type. Unwrap the value's type. + if typPtr.IsNil() { + return fmt.Errorf("%T points to a nil Type", typ) + } + wanted = typPtr.Elem().Type() + } + + if !wanted.AssignableTo(typeInterface) { + return fmt.Errorf("%T does not satisfy Type interface", typ) + } + + types, err := s.AnyTypesByName(name) + if err != nil { + return err + } + + var candidate Type + for _, typ := range types { + if reflect.TypeOf(typ) != wanted { + continue + } + + if candidate != nil { + return fmt.Errorf("type %s(%T): %w", name, typ, ErrMultipleMatches) + } + + candidate = typ + } + + if candidate == nil { + return fmt.Errorf("%s %s: %w", wanted, name, ErrNotFound) + } + + typPtr.Set(reflect.ValueOf(candidate)) + + return nil +} + +// LoadSplitSpec loads split BTF from the given file. +// +// Types from base are used to resolve references in the split BTF. +// The returned Spec only contains types from the split BTF, not from the base. +func LoadSplitSpec(file string, base *Spec) (*Spec, error) { + fh, err := os.Open(file) + if err != nil { + return nil, err + } + defer fh.Close() + + return LoadSplitSpecFromReader(fh, base) +} + +// LoadSplitSpecFromReader loads split BTF from a reader. +// +// Types from base are used to resolve references in the split BTF. +// The returned Spec only contains types from the split BTF, not from the base. +func LoadSplitSpecFromReader(r io.ReaderAt, base *Spec) (*Spec, error) { + raw, err := io.ReadAll(io.NewSectionReader(r, 0, math.MaxInt64)) + if err != nil { + return nil, fmt.Errorf("read raw BTF: %w", err) + } + + return loadRawSpec(raw, base) +} + +// All iterates over all types. +func (s *Spec) All() iter.Seq2[Type, error] { + return func(yield func(Type, error) bool) { + for id := s.firstTypeID; ; id++ { + typ, err := s.TypeByID(id) + if errors.Is(err, ErrNotFound) { + return + } else if err != nil { + yield(nil, err) + return + } + + // Skip declTags, during unmarshaling declTags become `Tags` fields of other types. + // We keep them in the spec to avoid holes in the ID space, but for the purposes of + // iteration, they are not useful to the user. + if _, ok := typ.(*declTag); ok { + continue + } + + if !yield(typ, nil) { + return + } + } + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/task.json new file mode 100644 index 0000000000000000000000000000000000000000..1a75014357b11c2abb9698f4f67190143a686165 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-50b28fbf07dd2d79022e", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-50b28fbf07dd2d79022e", + "project_id": "morefixes__cilium__ebpf", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "btf/btf.go" + ], + "patch_units": { + "before": [ + "btf/btf.go" + ], + "after": [ + "btf/btf.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/73f634bd3320b19d83c698c6b16d7c987d1a2187b2b581fd73612eb9f6f8a32b/database", + "cache_key": "73f634bd3320b19d83c698c6b16d7c987d1a2187b2b581fd73612eb9f6f8a32b", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/9310f4ca0a56ecfbd5f938880ff7107667e471966316d6253a08ce16134c5901/database", + "cache_key": "9310f4ca0a56ecfbd5f938880ff7107667e471966316d6253a08ce16134c5901", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/c382231dcfb382c7f329cc314404827452a98b2729e54bc72c77fc7dd753a8f5/database", + "cache_key": "c382231dcfb382c7f329cc314404827452a98b2729e54bc72c77fc7dd753a8f5", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-50b28fbf07dd2d79022e/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-50b28fbf07dd2d79022e/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-50b28fbf07dd2d79022e/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..bb10c96e907150a0c671112fb205c781ca6152c6 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/patch.diff @@ -0,0 +1,53 @@ +diff --git a/cli/cmd/cmd.go b/cli/cmd/cmd.go +index c1d111c..5891593 100644 +--- a/cli/cmd/cmd.go ++++ b/cli/cmd/cmd.go +@@ -55,12 +55,7 @@ func CmdInit() *baseCommand { + queryCommand.AddCommand(&QueryJvmCommand{}) + queryCommand.AddCommand(&QueryK8sCommand{}) + +- // add server command +- serverCommand := &ServerCommand{} +- baseCmd.AddCommand(serverCommand) +- serverCommand.AddCommand(&StartServerCommand{}) +- serverCommand.AddCommand(&StopServerCommand{}) +- serverCommand.AddCommand(&StatusServerCommand{}) ++ // UPDATE 2023-12-30 Disable server command mode. + + // add check command + checkCommand := &CheckCommand{} +diff --git a/cli/cmd/server_start.go b/cli/cmd/server_start.go +index 2bf1c33..8e5227a 100644 +--- a/cli/cmd/server_start.go ++++ b/cli/cmd/server_start.go +@@ -123,7 +123,7 @@ func (ssc *StartServerCommand) start0() { + go func() { + err := http.ListenAndServe(ssc.ip+":"+ssc.port, nil) + if err != nil { +- log.Errorf(context.Background(),"start blade server error, %v", err) ++ log.Errorf(context.Background(), "start blade server error, %v", err) + //log.Error(err, "start blade server error") + os.Exit(1) + } +@@ -134,20 +134,7 @@ func (ssc *StartServerCommand) start0() { + + func Register(requestPath string) { + http.HandleFunc(requestPath, func(writer http.ResponseWriter, request *http.Request) { +- err := request.ParseForm() +- if err != nil { +- fmt.Fprintf(writer, spec.ReturnFail(spec.ParameterRequestFailed, err.Error()).Print()) +- return +- } +- cmds := request.Form["cmd"] +- if len(cmds) != 1 { +- fmt.Fprintf(writer, spec.ResponseFailWithFlags(spec.ParameterLess, "cmd").Print()) +- return +- } +- ctx := context.WithValue(context.Background(), "mode", "server") +- response := channel.NewLocalChannel().Run(ctx, path.Join(util.GetProgramPath(), "blade"), cmds[0]) +- log.Debugf(ctx, "Server response: %v", response) +- fmt.Fprintf(writer, response.Print()) ++ fmt.Fprintf(writer, spec.ReturnFail(spec.CommandIllegal, "Server mode is disabled").Print()) + }) + } + diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..2368031f971b481c78cb2b08abe0eca8f5225ed3 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/post_context.md @@ -0,0 +1,221 @@ +# Patch-overlapping Go context after the fix + +## `cli/cmd/cmd.go` (changed lines (58,)) + +```go +/* + * Copyright 1999-2020 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cmd + +//import logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" +// +//var log = logf.Log.WithName("cmd") + +func CmdInit() *baseCommand { + cli := NewCli() + baseCmd := &baseCommand{ + command: cli.rootCmd, + } + // add version command + baseCmd.AddCommand(&VersionCommand{}) + // add prepare command + prepareCommand := &PrepareCommand{} + baseCmd.AddCommand(prepareCommand) + prepareCommand.AddCommand(&PrepareJvmCommand{}) + prepareCommand.AddCommand(&PrepareCPlusCommand{}) + + // add revoke command + baseCmd.AddCommand(&RevokeCommand{}) + + // add create command + createCommand := &CreateCommand{} + baseCmd.AddCommand(createCommand) + + // add destroy command + destroyCommand := &DestroyCommand{} + baseCmd.AddCommand(destroyCommand) + + // add status command + baseCmd.AddCommand(&StatusCommand{}) + + // add query command + queryCommand := &QueryCommand{} + baseCmd.AddCommand(queryCommand) + queryCommand.AddCommand(&QueryDiskCommand{}) + queryCommand.AddCommand(&QueryNetworkCommand{}) + queryCommand.AddCommand(&QueryJvmCommand{}) + queryCommand.AddCommand(&QueryK8sCommand{}) + + // UPDATE 2023-12-30 Disable server command mode. + + // add check command + checkCommand := &CheckCommand{} + baseCmd.AddCommand(checkCommand) + checkCommand.AddCommand(&CheckJavaCommand{}) + checkCommand.AddCommand(&CheckOsCommand{}) + + return baseCmd +} +``` + +## `cli/cmd/server_start.go` (changed lines (126, 137)) + +```go +/* + * Copyright 1999-2020 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cmd + +import ( + "context" + "fmt" + "github.com/chaosblade-io/chaosblade-spec-go/log" + "net/http" + "os" + "path" + "time" + + "github.com/chaosblade-io/chaosblade-spec-go/channel" + "github.com/chaosblade-io/chaosblade-spec-go/spec" + "github.com/chaosblade-io/chaosblade-spec-go/util" + "github.com/spf13/cobra" +) + +const startServerKey = "blade server start --nohup" + +type StartServerCommand struct { + baseCommand + ip string + port string + nohup bool +} + +func (ssc *StartServerCommand) Init() { + ssc.command = &cobra.Command{ + Use: "start", + Short: "Start server mode, exposes web services", + Long: "Start server mode, exposes web services. Under the mode, you can send http request to trigger experiments", + Aliases: []string{"s"}, + RunE: func(cmd *cobra.Command, args []string) error { + return ssc.run(cmd, args) + }, + Example: startServerExample(), + } + ssc.command.Flags().StringVarP(&ssc.ip, "ip", "i", "", "service ip address, default value is *") + ssc.command.Flags().StringVarP(&ssc.port, "port", "p", "9526", "service port") + ssc.command.Flags().BoolVarP(&ssc.nohup, "nohup", "n", false, "used by internal") +} + +func (ssc *StartServerCommand) run(cmd *cobra.Command, args []string) error { + // check if the process named `blade server --start` exists or not + pids, err := channel.NewLocalChannel().GetPidsByProcessName(startServerKey, context.TODO()) + if err != nil { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, err) + } + if len(pids) > 0 { + return spec.ResponseFailWithFlags(spec.ChaosbladeServerStarted) + } + if ssc.nohup { + ssc.start0() + } + err = ssc.start() + if err != nil { + return err + } + cmd.Println(fmt.Sprintf("success, listening on %s:%s", ssc.ip, ssc.port)) + return nil +} + +// start used nohup command and check the process +func (ssc *StartServerCommand) start() error { + // use nohup to invoke blade server start command + cl := channel.NewLocalChannel() + bladeBin := path.Join(util.GetProgramPath(), "blade") + args := fmt.Sprintf("%s server start --nohup --port %s", bladeBin, ssc.port) + if ssc.ip != "" { + args = fmt.Sprintf("%s --ip %s", args, ssc.ip) + } + ctx := context.Background() + response := cl.Run(ctx, "nohup", fmt.Sprintf("%s > /dev/null 2>&1 &", args)) + if !response.Success { + return response + } + time.Sleep(time.Second) + // check process + pids, err := channel.NewLocalChannel().GetPidsByProcessName(startServerKey, context.TODO()) + if err != nil { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, err) + } + if len(pids) == 0 { + // read logs + logFile, err := util.GetLogFile(util.Blade) + if err != nil { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, + "start blade server failed and can't get log file") + } + if !util.IsExist(logFile) { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, + "start blade server failed and log file does not exist") + } + response := cl.Run(context.TODO(), "tail", fmt.Sprintf("-1 %s", logFile)) + if !response.Success { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, + "start blade server failed and can't read log file") + } + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, response.Err) + } + log.Infof(ctx, "start blade server success, listen on %s:%s", ssc.ip, ssc.port) + return nil +} + +// start0 starts web service +func (ssc *StartServerCommand) start0() { + go func() { + err := http.ListenAndServe(ssc.ip+":"+ssc.port, nil) + if err != nil { + log.Errorf(context.Background(), "start blade server error, %v", err) + //log.Error(err, "start blade server error") + os.Exit(1) + } + }() + Register("/chaosblade") + util.Hold() +} + +func Register(requestPath string) { + http.HandleFunc(requestPath, func(writer http.ResponseWriter, request *http.Request) { + fmt.Fprintf(writer, spec.ReturnFail(spec.CommandIllegal, "Server mode is disabled").Print()) + }) +} + +func startServerExample() string { + return `blade server start --port 8000` +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..e8fdcd81d93d6af4dcefded42303c164369fd046 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/pre_context.md @@ -0,0 +1,239 @@ +# Patch-overlapping Go context before the fix + +## `cli/cmd/cmd.go` (changed lines (58, 59, 60, 61, 62, 63, 64)) + +```go +/* + * Copyright 1999-2020 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cmd + +//import logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" +// +//var log = logf.Log.WithName("cmd") + +func CmdInit() *baseCommand { + cli := NewCli() + baseCmd := &baseCommand{ + command: cli.rootCmd, + } + // add version command + baseCmd.AddCommand(&VersionCommand{}) + // add prepare command + prepareCommand := &PrepareCommand{} + baseCmd.AddCommand(prepareCommand) + prepareCommand.AddCommand(&PrepareJvmCommand{}) + prepareCommand.AddCommand(&PrepareCPlusCommand{}) + + // add revoke command + baseCmd.AddCommand(&RevokeCommand{}) + + // add create command + createCommand := &CreateCommand{} + baseCmd.AddCommand(createCommand) + + // add destroy command + destroyCommand := &DestroyCommand{} + baseCmd.AddCommand(destroyCommand) + + // add status command + baseCmd.AddCommand(&StatusCommand{}) + + // add query command + queryCommand := &QueryCommand{} + baseCmd.AddCommand(queryCommand) + queryCommand.AddCommand(&QueryDiskCommand{}) + queryCommand.AddCommand(&QueryNetworkCommand{}) + queryCommand.AddCommand(&QueryJvmCommand{}) + queryCommand.AddCommand(&QueryK8sCommand{}) + + // add server command + serverCommand := &ServerCommand{} + baseCmd.AddCommand(serverCommand) + serverCommand.AddCommand(&StartServerCommand{}) + serverCommand.AddCommand(&StopServerCommand{}) + serverCommand.AddCommand(&StatusServerCommand{}) + + // add check command + checkCommand := &CheckCommand{} + baseCmd.AddCommand(checkCommand) + checkCommand.AddCommand(&CheckJavaCommand{}) + checkCommand.AddCommand(&CheckOsCommand{}) + + return baseCmd +} +``` + +## `cli/cmd/server_start.go` (changed lines (126, 127, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151)) + +```go +/* + * Copyright 1999-2020 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cmd + +import ( + "context" + "fmt" + "github.com/chaosblade-io/chaosblade-spec-go/log" + "net/http" + "os" + "path" + "time" + + "github.com/chaosblade-io/chaosblade-spec-go/channel" + "github.com/chaosblade-io/chaosblade-spec-go/spec" + "github.com/chaosblade-io/chaosblade-spec-go/util" + "github.com/spf13/cobra" +) + +const startServerKey = "blade server start --nohup" + +type StartServerCommand struct { + baseCommand + ip string + port string + nohup bool +} + +func (ssc *StartServerCommand) Init() { + ssc.command = &cobra.Command{ + Use: "start", + Short: "Start server mode, exposes web services", + Long: "Start server mode, exposes web services. Under the mode, you can send http request to trigger experiments", + Aliases: []string{"s"}, + RunE: func(cmd *cobra.Command, args []string) error { + return ssc.run(cmd, args) + }, + Example: startServerExample(), + } + ssc.command.Flags().StringVarP(&ssc.ip, "ip", "i", "", "service ip address, default value is *") + ssc.command.Flags().StringVarP(&ssc.port, "port", "p", "9526", "service port") + ssc.command.Flags().BoolVarP(&ssc.nohup, "nohup", "n", false, "used by internal") +} + +func (ssc *StartServerCommand) run(cmd *cobra.Command, args []string) error { + // check if the process named `blade server --start` exists or not + pids, err := channel.NewLocalChannel().GetPidsByProcessName(startServerKey, context.TODO()) + if err != nil { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, err) + } + if len(pids) > 0 { + return spec.ResponseFailWithFlags(spec.ChaosbladeServerStarted) + } + if ssc.nohup { + ssc.start0() + } + err = ssc.start() + if err != nil { + return err + } + cmd.Println(fmt.Sprintf("success, listening on %s:%s", ssc.ip, ssc.port)) + return nil +} + +// start used nohup command and check the process +func (ssc *StartServerCommand) start() error { + // use nohup to invoke blade server start command + cl := channel.NewLocalChannel() + bladeBin := path.Join(util.GetProgramPath(), "blade") + args := fmt.Sprintf("%s server start --nohup --port %s", bladeBin, ssc.port) + if ssc.ip != "" { + args = fmt.Sprintf("%s --ip %s", args, ssc.ip) + } + ctx := context.Background() + response := cl.Run(ctx, "nohup", fmt.Sprintf("%s > /dev/null 2>&1 &", args)) + if !response.Success { + return response + } + time.Sleep(time.Second) + // check process + pids, err := channel.NewLocalChannel().GetPidsByProcessName(startServerKey, context.TODO()) + if err != nil { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, err) + } + if len(pids) == 0 { + // read logs + logFile, err := util.GetLogFile(util.Blade) + if err != nil { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, + "start blade server failed and can't get log file") + } + if !util.IsExist(logFile) { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, + "start blade server failed and log file does not exist") + } + response := cl.Run(context.TODO(), "tail", fmt.Sprintf("-1 %s", logFile)) + if !response.Success { + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, + "start blade server failed and can't read log file") + } + return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, response.Err) + } + log.Infof(ctx, "start blade server success, listen on %s:%s", ssc.ip, ssc.port) + return nil +} + +// start0 starts web service +func (ssc *StartServerCommand) start0() { + go func() { + err := http.ListenAndServe(ssc.ip+":"+ssc.port, nil) + if err != nil { + log.Errorf(context.Background(),"start blade server error, %v", err) + //log.Error(err, "start blade server error") + os.Exit(1) + } + }() + Register("/chaosblade") + util.Hold() +} + +func Register(requestPath string) { + http.HandleFunc(requestPath, func(writer http.ResponseWriter, request *http.Request) { + err := request.ParseForm() + if err != nil { + fmt.Fprintf(writer, spec.ReturnFail(spec.ParameterRequestFailed, err.Error()).Print()) + return + } + cmds := request.Form["cmd"] + if len(cmds) != 1 { + fmt.Fprintf(writer, spec.ResponseFailWithFlags(spec.ParameterLess, "cmd").Print()) + return + } + ctx := context.WithValue(context.Background(), "mode", "server") + response := channel.NewLocalChannel().Run(ctx, path.Join(util.GetProgramPath(), "blade"), cmds[0]) + log.Debugf(ctx, "Server response: %v", response) + fmt.Fprintf(writer, response.Print()) + }) +} + +func startServerExample() string { + return `blade server start --port 8000` +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c0becbfea1198d9492140d1363cc5519a467d0c4 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-5ad30634efaa1d03593c", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-5ad30634efaa1d03593c", + "project_id": "morefixes__chaosblade-io__chaosblade", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "cli/cmd/cmd.go", + "cli/cmd/server_start.go" + ], + "patch_units": { + "before": [ + "cli/cmd/cmd.go", + "cli/cmd/server_start.go" + ], + "after": [ + "cli/cmd/cmd.go", + "cli/cmd/server_start.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/06b981c51cac1cff44f10450c4710e4e43d791c16b7f34eb03719a79e2375fad/database", + "cache_key": "06b981c51cac1cff44f10450c4710e4e43d791c16b7f34eb03719a79e2375fad", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/98233b1254c1ca20553b35e55beb32de14c9f94c8048053d698e91f11a4ccc73/database", + "cache_key": "98233b1254c1ca20553b35e55beb32de14c9f94c8048053d698e91f11a4ccc73", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/3369f879f102338be9595ad4c4d7a0df70b6b5afc50cf725324584b0674eb36d/database", + "cache_key": "3369f879f102338be9595ad4c4d7a0df70b6b5afc50cf725324584b0674eb36d", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-5ad30634efaa1d03593c/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-5ad30634efaa1d03593c/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5ad30634efaa1d03593c/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..40335f10e484a68bbf9b3c0ff899c133eb87ebc7 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/patch.diff @@ -0,0 +1,38 @@ +diff --git a/internal/exec/exec.go b/internal/exec/exec.go +index 19c0fecc..af1a5259 100644 +--- a/internal/exec/exec.go ++++ b/internal/exec/exec.go +@@ -86,7 +86,6 @@ func executePublisher(ctx *context.Context, publisher config.Publisher) error { + + func executeCommand(c *command, artifact *artifact.Artifact) error { + log.WithField("args", c.Args). +- WithField("env", c.Env). + WithField("artifact", artifact.Name). + Debug("executing command") + +diff --git a/internal/pipe/sbom/sbom.go b/internal/pipe/sbom/sbom.go +index 8e713e3a..594a211f 100644 +--- a/internal/pipe/sbom/sbom.go ++++ b/internal/pipe/sbom/sbom.go +@@ -201,8 +201,7 @@ func catalogArtifact(ctx *context.Context, cfg config.SBOM, a *artifact.Artifact + cmd.Env = append(cmd.Env, envs...) + cmd.Dir = ctx.Config.Dist + +- log.WithField("env", cmd.Env). +- WithField("dir", cmd.Dir). ++ log.WithField("dir", cmd.Dir). + WithField("cmd", cmd.Args). + Debug("running") + +diff --git a/internal/shell/shell.go b/internal/shell/shell.go +index a879dd19..3d24cf47 100644 +--- a/internal/shell/shell.go ++++ b/internal/shell/shell.go +@@ -18,7 +18,6 @@ import ( + func Run(ctx *context.Context, dir string, command, env []string, output bool) error { + log := log. + WithField("cmd", command). +- WithField("env", env). + WithField("dir", dir) + + /* #nosec */ diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..26b77bcd68472e0dae9dd544b17d327fba31479d --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/post_context.md @@ -0,0 +1,599 @@ +# Patch-overlapping Go context after the fix + +## `internal/exec/exec.go` (changed lines (89,)) + +```go +// Package exec can execute commands on the OS. +package exec + +import ( + "bytes" + "fmt" + "io" + "os" + "os/exec" + + "github.com/caarlos0/go-shellwords" + "github.com/caarlos0/log" + "github.com/goreleaser/goreleaser/internal/artifact" + "github.com/goreleaser/goreleaser/internal/extrafiles" + "github.com/goreleaser/goreleaser/internal/gio" + "github.com/goreleaser/goreleaser/internal/logext" + "github.com/goreleaser/goreleaser/internal/pipe" + "github.com/goreleaser/goreleaser/internal/semerrgroup" + "github.com/goreleaser/goreleaser/internal/tmpl" + "github.com/goreleaser/goreleaser/pkg/config" + "github.com/goreleaser/goreleaser/pkg/context" +) + +// Environment variables to pass through to exec +var passthroughEnvVars = []string{"HOME", "USER", "USERPROFILE", "TMPDIR", "TMP", "TEMP", "PATH"} + +// Execute the given publisher +func Execute(ctx *context.Context, publishers []config.Publisher) error { + skips := pipe.SkipMemento{} + for _, p := range publishers { + log.WithField("name", p.Name).Debug("executing custom publisher") + err := executePublisher(ctx, p) + if err != nil && pipe.IsSkip(err) { + skips.Remember(err) + continue + } + if err != nil { + return err + } + } + return skips.Evaluate() +} + +func executePublisher(ctx *context.Context, publisher config.Publisher) error { + disabled, err := tmpl.New(ctx).Bool(publisher.Disable) + if err != nil { + return err + } + if disabled { + return pipe.Skip("publisher is disabled") + } + + log.Debugf("filtering %d artifacts", len(ctx.Artifacts.List())) + artifacts := filterArtifacts(ctx.Artifacts, publisher) + + extraFiles, err := extrafiles.Find(ctx, publisher.ExtraFiles) + if err != nil { + return err + } + + for name, path := range extraFiles { + artifacts = append(artifacts, &artifact.Artifact{ + Name: name, + Path: path, + Type: artifact.UploadableFile, + }) + } + + log.Debugf("will execute custom publisher with %d artifacts", len(artifacts)) + + g := semerrgroup.New(ctx.Parallelism) + for _, artifact := range artifacts { + artifact := artifact + g.Go(func() error { + c, err := resolveCommand(ctx, publisher, artifact) + if err != nil { + return err + } + + return executeCommand(c, artifact) + }) + } + + return g.Wait() +} + +func executeCommand(c *command, artifact *artifact.Artifact) error { + log.WithField("args", c.Args). + WithField("artifact", artifact.Name). + Debug("executing command") + + // nolint: gosec + cmd := exec.CommandContext(c.Ctx, c.Args[0], c.Args[1:]...) + cmd.Env = []string{} + for _, key := range passthroughEnvVars { + if value := os.Getenv(key); value != "" { + cmd.Env = append(cmd.Env, key+"="+value) + } + } + cmd.Env = append(cmd.Env, c.Env...) + + if c.Dir != "" { + cmd.Dir = c.Dir + } + + var b bytes.Buffer + w := gio.Safe(&b) + cmd.Stderr = io.MultiWriter(logext.NewWriter(), w) + cmd.Stdout = io.MultiWriter(logext.NewWriter(), w) + + log := log.WithField("cmd", c.Args[0]). + WithField("artifact", artifact.Name) + + log.Info("publishing") + if err := cmd.Run(); err != nil { + return fmt.Errorf("publishing: %s failed: %w: %s", c.Args[0], err, b.String()) + } + + log.Debug("command finished successfully") + return nil +} + +func filterArtifacts(artifacts *artifact.Artifacts, publisher config.Publisher) []*artifact.Artifact { + filters := []artifact.Filter{ + artifact.ByType(artifact.UploadableArchive), + artifact.ByType(artifact.UploadableFile), + artifact.ByType(artifact.LinuxPackage), + artifact.ByType(artifact.UploadableBinary), + artifact.ByType(artifact.DockerImage), + artifact.ByType(artifact.DockerManifest), + } + + if publisher.Checksum { + filters = append(filters, artifact.ByType(artifact.Checksum)) + } + + if publisher.Signature { + filters = append(filters, artifact.ByType(artifact.Signature), artifact.ByType(artifact.Certificate)) + } + + filter := artifact.Or(filters...) + + if len(publisher.IDs) > 0 { + filter = artifact.And(filter, artifact.ByIDs(publisher.IDs...)) + } + + return artifacts.Filter(filter).List() +} + +type command struct { + Ctx *context.Context + Dir string + Env []string + Args []string +} + +// resolveCommand returns the a command based on publisher template with replaced variables +// Those variables can be replaced by the given context, goos, goarch, goarm and more. +func resolveCommand(ctx *context.Context, publisher config.Publisher, artifact *artifact.Artifact) (*command, error) { + var err error + dir := publisher.Dir + + // nolint:staticcheck + tpl := tmpl.New(ctx).WithArtifact(artifact) + if dir != "" { + dir, err = tpl.Apply(dir) + if err != nil { + return nil, err + } + } + + cmd := publisher.Cmd + if cmd != "" { + cmd, err = tpl.Apply(cmd) + if err != nil { + return nil, err + } + } + + args, err := shellwords.Parse(cmd) + if err != nil { + return nil, err + } + + env := make([]string, len(publisher.Env)) + for i, e := range publisher.Env { + e, err = tpl.Apply(e) + if err != nil { + return nil, err + } + env[i] = e + } + + return &command{ + Ctx: ctx, + Dir: dir, + Env: env, + Args: args, + }, nil +} +``` + +## `internal/pipe/sbom/sbom.go` (changed lines (204,)) + +```go +package sbom + +import ( + "bytes" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" + + "github.com/caarlos0/log" + "github.com/goreleaser/goreleaser/internal/artifact" + "github.com/goreleaser/goreleaser/internal/gio" + "github.com/goreleaser/goreleaser/internal/ids" + "github.com/goreleaser/goreleaser/internal/logext" + "github.com/goreleaser/goreleaser/internal/semerrgroup" + "github.com/goreleaser/goreleaser/internal/skips" + "github.com/goreleaser/goreleaser/internal/tmpl" + "github.com/goreleaser/goreleaser/pkg/config" + "github.com/goreleaser/goreleaser/pkg/context" +) + +// Environment variables to pass through to exec +var passthroughEnvVars = []string{"HOME", "USER", "USERPROFILE", "TMPDIR", "TMP", "TEMP", "PATH", "LOCALAPPDATA"} + +// Pipe that catalogs common artifacts as an SBOM. +type Pipe struct{} + +func (Pipe) String() string { return "cataloging artifacts" } +func (Pipe) Skip(ctx *context.Context) bool { + return skips.Any(ctx, skips.SBOM) || len(ctx.Config.SBOMs) == 0 +} + +func (Pipe) Dependencies(ctx *context.Context) []string { + var cmds []string + for _, s := range ctx.Config.SBOMs { + cmds = append(cmds, s.Cmd) + } + return cmds +} + +// Default sets the Pipes defaults. +func (Pipe) Default(ctx *context.Context) error { + ids := ids.New("sboms") + for i := range ctx.Config.SBOMs { + cfg := &ctx.Config.SBOMs[i] + if err := setConfigDefaults(cfg); err != nil { + return err + } + ids.Inc(cfg.ID) + } + return ids.Validate() +} + +func setConfigDefaults(cfg *config.SBOM) error { + if cfg.Cmd == "" { + cfg.Cmd = "syft" + } + if cfg.Artifacts == "" { + cfg.Artifacts = "archive" + } + if len(cfg.Documents) == 0 { + switch cfg.Artifacts { + case "binary": + cfg.Documents = []string{"{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.sbom"} + case "any": + cfg.Documents = []string{} + default: + cfg.Documents = []string{"{{ .ArtifactName }}.sbom"} + } + } + if cfg.Cmd == "syft" { + if len(cfg.Args) == 0 { + cfg.Args = []string{"$artifact", "--output", "spdx-json=$document"} + } + if len(cfg.Env) == 0 && (cfg.Artifacts == "source" || cfg.Artifacts == "archive") { + cfg.Env = []string{ + "SYFT_FILE_METADATA_CATALOGER_ENABLED=true", + } + } + } + if cfg.ID == "" { + cfg.ID = "default" + } + + if cfg.Artifacts != "any" && len(cfg.Documents) > 1 { + return fmt.Errorf("multiple SBOM outputs when artifacts=%q is unsupported", cfg.Artifacts) + } + return nil +} + +// Run executes the Pipe. +func (Pipe) Run(ctx *context.Context) error { + g := semerrgroup.New(ctx.Parallelism) + for _, cfg := range ctx.Config.SBOMs { + g.Go(catalogTask(ctx, cfg)) + } + return g.Wait() +} + +func catalogTask(ctx *context.Context, cfg config.SBOM) func() error { + return func() error { + var filters []artifact.Filter + switch cfg.Artifacts { + case "source": + filters = append(filters, artifact.ByType(artifact.UploadableSourceArchive)) + if len(cfg.IDs) > 0 { + log.Warn("when artifacts is `source`, `ids` has no effect. ignoring") + } + case "archive": + filters = append(filters, artifact.ByType(artifact.UploadableArchive)) + case "binary": + filters = append(filters, artifact.ByBinaryLikeArtifacts(ctx.Artifacts)) + case "package": + filters = append(filters, artifact.ByType(artifact.LinuxPackage)) + case "any": + newArtifacts, err := catalogArtifact(ctx, cfg, nil) + if err != nil { + return err + } + for _, newArtifact := range newArtifacts { + ctx.Artifacts.Add(newArtifact) + } + return nil + default: + return fmt.Errorf("invalid list of artifacts to catalog: %s", cfg.Artifacts) + } + + if len(cfg.IDs) > 0 { + filters = append(filters, artifact.ByIDs(cfg.IDs...)) + } + artifacts := ctx.Artifacts.Filter(artifact.And(filters...)).List() + if len(artifacts) == 0 { + log.Warn("no artifacts matching current filters") + } + return catalog(ctx, cfg, artifacts) + } +} + +func catalog(ctx *context.Context, cfg config.SBOM, artifacts []*artifact.Artifact) error { + for _, a := range artifacts { + newArtifacts, err := catalogArtifact(ctx, cfg, a) + if err != nil { + return err + } + for _, newArtifact := range newArtifacts { + ctx.Artifacts.Add(newArtifact) + } + } + return nil +} + +func subprocessDistPath(distDir string, pathRelativeToCwd string) (string, error) { + distDir = filepath.Clean(distDir) + pathRelativeToCwd = filepath.Clean(pathRelativeToCwd) + cwd, err := os.Getwd() + if err != nil { + return "", err + } + if !filepath.IsAbs(distDir) { + distDir, err = filepath.Abs(distDir) + if err != nil { + return "", err + } + } + relativePath, err := filepath.Rel(cwd, distDir) + if err != nil { + return "", err + } + return strings.TrimPrefix(pathRelativeToCwd, relativePath+string(filepath.Separator)), nil +} + +func catalogArtifact(ctx *context.Context, cfg config.SBOM, a *artifact.Artifact) ([]*artifact.Artifact, error) { + artifactDisplayName := "(any)" + args, envs, paths, err := applyTemplate(ctx, cfg, a) + if err != nil { + return nil, fmt.Errorf("cataloging artifacts failed: %w", err) + } + + if a != nil { + artifactDisplayName = a.Path + } + + var names []string + for _, p := range paths { + names = append(names, filepath.Base(p)) + } + + // The GoASTScanner flags this as a security risk. + // However, this works as intended. The nosec annotation + // tells the scanner to ignore this. + // #nosec + cmd := exec.CommandContext(ctx, cfg.Cmd, args...) + cmd.Env = []string{} + for _, key := range passthroughEnvVars { + if value := os.Getenv(key); value != "" { + cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", key, value)) + } + } + cmd.Env = append(cmd.Env, envs...) + cmd.Dir = ctx.Config.Dist + + log.WithField("dir", cmd.Dir). + WithField("cmd", cmd.Args). + Debug("running") + + var b bytes.Buffer + w := gio.Safe(&b) + cmd.Stderr = io.MultiWriter(logext.NewWriter(), w) + cmd.Stdout = io.MultiWriter(logext.NewWriter(), w) + + log.WithField("cmd", cfg.Cmd). + WithField("artifact", artifactDisplayName). + WithField("sbom", names). + Info("cataloging") + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("cataloging artifacts: %s failed: %w: %s", cfg.Cmd, err, b.String()) + } + + var artifacts []*artifact.Artifact + + for _, path := range paths { + if !filepath.IsAbs(path) { + path = filepath.Join(ctx.Config.Dist, path) + } + + matches, err := filepath.Glob(path) + if err != nil { + return nil, fmt.Errorf("cataloging artifacts: failed to find SBOM artifact %q: %w", path, err) + } + for _, match := range matches { + artifacts = append(artifacts, &artifact.Artifact{ + Type: artifact.SBOM, + Name: filepath.Base(path), + Path: match, + Extra: map[string]interface{}{ + artifact.ExtraID: cfg.ID, + }, + }) + } + + } + + if len(artifacts) == 0 { + return nil, fmt.Errorf("cataloging artifacts: command did not write any files, check your configuration") + } + + return artifacts, nil +} + +func applyTemplate(ctx *context.Context, cfg config.SBOM, a *artifact.Artifact) ([]string, []string, []string, error) { + env := ctx.Env.Copy() + var extraEnvs []string + templater := tmpl.New(ctx).WithEnv(env) + + if a != nil { + procPath, err := subprocessDistPath(ctx.Config.Dist, a.Path) + if err != nil { + return nil, nil, nil, fmt.Errorf("cataloging artifacts failed: cannot determine artifact path for %q: %w", a.Path, err) + } + extraEnvs = appendExtraEnv("artifact", procPath, extraEnvs, env) + extraEnvs = appendExtraEnv("artifactID", a.ID(), extraEnvs, env) + templater = templater.WithArtifact(a) + } + + for _, keyValue := range cfg.Env { + renderedKeyValue, err := templater.Apply(expand(keyValue, env)) + if err != nil { + return nil, nil, nil, fmt.Errorf("env %q: invalid template: %w", keyValue, err) + } + extraEnvs = append(extraEnvs, renderedKeyValue) + + k, v, _ := strings.Cut(renderedKeyValue, "=") + env[k] = v + } + + var paths []string + for idx, sbom := range cfg.Documents { + input := expand(sbom, env) + if !filepath.IsAbs(input) { + // assume any absolute path is handled correctly and assume that any relative path is not already + // adjusted to reference the dist path + input = filepath.Join(ctx.Config.Dist, input) + } + + path, err := templater.Apply(input) + if err != nil { + return nil, nil, nil, fmt.Errorf("input %q: invalid template: %w", input, err) + } + + path, err = filepath.Abs(path) + if err != nil { + return nil, nil, nil, fmt.Errorf("unable to create artifact path %q: %w", sbom, err) + } + + procPath, err := subprocessDistPath(ctx.Config.Dist, path) + if err != nil { + return nil, nil, nil, fmt.Errorf("cannot determine document path for %q: %w", path, err) + } + + extraEnvs = appendExtraEnv(fmt.Sprintf("document%d", idx), procPath, extraEnvs, env) + if idx == 0 { + extraEnvs = appendExtraEnv("document", procPath, extraEnvs, env) + } + + paths = append(paths, procPath) + } + + // nolint:prealloc + var args []string + for _, arg := range cfg.Args { + renderedArg, err := templater.Apply(expand(arg, env)) + if err != nil { + return nil, nil, nil, fmt.Errorf("arg %q: invalid template: %w", arg, err) + } + args = append(args, renderedArg) + } + + return args, extraEnvs, paths, nil +} + +func appendExtraEnv(key, value string, envs []string, env map[string]string) []string { + env[key] = value + return append(envs, fmt.Sprintf("%s=%s", key, value)) +} + +func expand(s string, env map[string]string) string { + return os.Expand(s, func(key string) string { + return env[key] + }) +} +``` + +## `internal/shell/shell.go` (changed lines (21,)) + +```go +package shell + +import ( + "bytes" + "fmt" + "io" + "os/exec" + "strings" + + "github.com/caarlos0/log" + "github.com/charmbracelet/x/exp/ordered" + "github.com/goreleaser/goreleaser/internal/gio" + "github.com/goreleaser/goreleaser/internal/logext" + "github.com/goreleaser/goreleaser/pkg/context" +) + +// Run a shell command with given arguments and envs +func Run(ctx *context.Context, dir string, command, env []string, output bool) error { + log := log. + WithField("cmd", command). + WithField("dir", dir) + + /* #nosec */ + cmd := exec.CommandContext(ctx, command[0], command[1:]...) + cmd.Env = env + + var b bytes.Buffer + w := gio.Safe(&b) + + cmd.Stderr = io.MultiWriter(logext.NewConditionalWriter(output), w) + cmd.Stdout = io.MultiWriter(logext.NewConditionalWriter(output), w) + + if dir != "" { + cmd.Dir = dir + } + + log.Debug("running") + if err := cmd.Run(); err != nil { + return fmt.Errorf( + "shell: '%s': %w: %s", + strings.Join(command, " "), + err, + ordered.First( + strings.TrimSpace(b.String()), + "[no output]", + ), + ) + } + + return nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..b04afe78b9088c0daaea1b65aa15dc19484948d1 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/pre_context.md @@ -0,0 +1,602 @@ +# Patch-overlapping Go context before the fix + +## `internal/exec/exec.go` (changed lines (89,)) + +```go +// Package exec can execute commands on the OS. +package exec + +import ( + "bytes" + "fmt" + "io" + "os" + "os/exec" + + "github.com/caarlos0/go-shellwords" + "github.com/caarlos0/log" + "github.com/goreleaser/goreleaser/internal/artifact" + "github.com/goreleaser/goreleaser/internal/extrafiles" + "github.com/goreleaser/goreleaser/internal/gio" + "github.com/goreleaser/goreleaser/internal/logext" + "github.com/goreleaser/goreleaser/internal/pipe" + "github.com/goreleaser/goreleaser/internal/semerrgroup" + "github.com/goreleaser/goreleaser/internal/tmpl" + "github.com/goreleaser/goreleaser/pkg/config" + "github.com/goreleaser/goreleaser/pkg/context" +) + +// Environment variables to pass through to exec +var passthroughEnvVars = []string{"HOME", "USER", "USERPROFILE", "TMPDIR", "TMP", "TEMP", "PATH"} + +// Execute the given publisher +func Execute(ctx *context.Context, publishers []config.Publisher) error { + skips := pipe.SkipMemento{} + for _, p := range publishers { + log.WithField("name", p.Name).Debug("executing custom publisher") + err := executePublisher(ctx, p) + if err != nil && pipe.IsSkip(err) { + skips.Remember(err) + continue + } + if err != nil { + return err + } + } + return skips.Evaluate() +} + +func executePublisher(ctx *context.Context, publisher config.Publisher) error { + disabled, err := tmpl.New(ctx).Bool(publisher.Disable) + if err != nil { + return err + } + if disabled { + return pipe.Skip("publisher is disabled") + } + + log.Debugf("filtering %d artifacts", len(ctx.Artifacts.List())) + artifacts := filterArtifacts(ctx.Artifacts, publisher) + + extraFiles, err := extrafiles.Find(ctx, publisher.ExtraFiles) + if err != nil { + return err + } + + for name, path := range extraFiles { + artifacts = append(artifacts, &artifact.Artifact{ + Name: name, + Path: path, + Type: artifact.UploadableFile, + }) + } + + log.Debugf("will execute custom publisher with %d artifacts", len(artifacts)) + + g := semerrgroup.New(ctx.Parallelism) + for _, artifact := range artifacts { + artifact := artifact + g.Go(func() error { + c, err := resolveCommand(ctx, publisher, artifact) + if err != nil { + return err + } + + return executeCommand(c, artifact) + }) + } + + return g.Wait() +} + +func executeCommand(c *command, artifact *artifact.Artifact) error { + log.WithField("args", c.Args). + WithField("env", c.Env). + WithField("artifact", artifact.Name). + Debug("executing command") + + // nolint: gosec + cmd := exec.CommandContext(c.Ctx, c.Args[0], c.Args[1:]...) + cmd.Env = []string{} + for _, key := range passthroughEnvVars { + if value := os.Getenv(key); value != "" { + cmd.Env = append(cmd.Env, key+"="+value) + } + } + cmd.Env = append(cmd.Env, c.Env...) + + if c.Dir != "" { + cmd.Dir = c.Dir + } + + var b bytes.Buffer + w := gio.Safe(&b) + cmd.Stderr = io.MultiWriter(logext.NewWriter(), w) + cmd.Stdout = io.MultiWriter(logext.NewWriter(), w) + + log := log.WithField("cmd", c.Args[0]). + WithField("artifact", artifact.Name) + + log.Info("publishing") + if err := cmd.Run(); err != nil { + return fmt.Errorf("publishing: %s failed: %w: %s", c.Args[0], err, b.String()) + } + + log.Debug("command finished successfully") + return nil +} + +func filterArtifacts(artifacts *artifact.Artifacts, publisher config.Publisher) []*artifact.Artifact { + filters := []artifact.Filter{ + artifact.ByType(artifact.UploadableArchive), + artifact.ByType(artifact.UploadableFile), + artifact.ByType(artifact.LinuxPackage), + artifact.ByType(artifact.UploadableBinary), + artifact.ByType(artifact.DockerImage), + artifact.ByType(artifact.DockerManifest), + } + + if publisher.Checksum { + filters = append(filters, artifact.ByType(artifact.Checksum)) + } + + if publisher.Signature { + filters = append(filters, artifact.ByType(artifact.Signature), artifact.ByType(artifact.Certificate)) + } + + filter := artifact.Or(filters...) + + if len(publisher.IDs) > 0 { + filter = artifact.And(filter, artifact.ByIDs(publisher.IDs...)) + } + + return artifacts.Filter(filter).List() +} + +type command struct { + Ctx *context.Context + Dir string + Env []string + Args []string +} + +// resolveCommand returns the a command based on publisher template with replaced variables +// Those variables can be replaced by the given context, goos, goarch, goarm and more. +func resolveCommand(ctx *context.Context, publisher config.Publisher, artifact *artifact.Artifact) (*command, error) { + var err error + dir := publisher.Dir + + // nolint:staticcheck + tpl := tmpl.New(ctx).WithArtifact(artifact) + if dir != "" { + dir, err = tpl.Apply(dir) + if err != nil { + return nil, err + } + } + + cmd := publisher.Cmd + if cmd != "" { + cmd, err = tpl.Apply(cmd) + if err != nil { + return nil, err + } + } + + args, err := shellwords.Parse(cmd) + if err != nil { + return nil, err + } + + env := make([]string, len(publisher.Env)) + for i, e := range publisher.Env { + e, err = tpl.Apply(e) + if err != nil { + return nil, err + } + env[i] = e + } + + return &command{ + Ctx: ctx, + Dir: dir, + Env: env, + Args: args, + }, nil +} +``` + +## `internal/pipe/sbom/sbom.go` (changed lines (204, 205, 206)) + +```go +package sbom + +import ( + "bytes" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" + + "github.com/caarlos0/log" + "github.com/goreleaser/goreleaser/internal/artifact" + "github.com/goreleaser/goreleaser/internal/gio" + "github.com/goreleaser/goreleaser/internal/ids" + "github.com/goreleaser/goreleaser/internal/logext" + "github.com/goreleaser/goreleaser/internal/semerrgroup" + "github.com/goreleaser/goreleaser/internal/skips" + "github.com/goreleaser/goreleaser/internal/tmpl" + "github.com/goreleaser/goreleaser/pkg/config" + "github.com/goreleaser/goreleaser/pkg/context" +) + +// Environment variables to pass through to exec +var passthroughEnvVars = []string{"HOME", "USER", "USERPROFILE", "TMPDIR", "TMP", "TEMP", "PATH", "LOCALAPPDATA"} + +// Pipe that catalogs common artifacts as an SBOM. +type Pipe struct{} + +func (Pipe) String() string { return "cataloging artifacts" } +func (Pipe) Skip(ctx *context.Context) bool { + return skips.Any(ctx, skips.SBOM) || len(ctx.Config.SBOMs) == 0 +} + +func (Pipe) Dependencies(ctx *context.Context) []string { + var cmds []string + for _, s := range ctx.Config.SBOMs { + cmds = append(cmds, s.Cmd) + } + return cmds +} + +// Default sets the Pipes defaults. +func (Pipe) Default(ctx *context.Context) error { + ids := ids.New("sboms") + for i := range ctx.Config.SBOMs { + cfg := &ctx.Config.SBOMs[i] + if err := setConfigDefaults(cfg); err != nil { + return err + } + ids.Inc(cfg.ID) + } + return ids.Validate() +} + +func setConfigDefaults(cfg *config.SBOM) error { + if cfg.Cmd == "" { + cfg.Cmd = "syft" + } + if cfg.Artifacts == "" { + cfg.Artifacts = "archive" + } + if len(cfg.Documents) == 0 { + switch cfg.Artifacts { + case "binary": + cfg.Documents = []string{"{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.sbom"} + case "any": + cfg.Documents = []string{} + default: + cfg.Documents = []string{"{{ .ArtifactName }}.sbom"} + } + } + if cfg.Cmd == "syft" { + if len(cfg.Args) == 0 { + cfg.Args = []string{"$artifact", "--output", "spdx-json=$document"} + } + if len(cfg.Env) == 0 && (cfg.Artifacts == "source" || cfg.Artifacts == "archive") { + cfg.Env = []string{ + "SYFT_FILE_METADATA_CATALOGER_ENABLED=true", + } + } + } + if cfg.ID == "" { + cfg.ID = "default" + } + + if cfg.Artifacts != "any" && len(cfg.Documents) > 1 { + return fmt.Errorf("multiple SBOM outputs when artifacts=%q is unsupported", cfg.Artifacts) + } + return nil +} + +// Run executes the Pipe. +func (Pipe) Run(ctx *context.Context) error { + g := semerrgroup.New(ctx.Parallelism) + for _, cfg := range ctx.Config.SBOMs { + g.Go(catalogTask(ctx, cfg)) + } + return g.Wait() +} + +func catalogTask(ctx *context.Context, cfg config.SBOM) func() error { + return func() error { + var filters []artifact.Filter + switch cfg.Artifacts { + case "source": + filters = append(filters, artifact.ByType(artifact.UploadableSourceArchive)) + if len(cfg.IDs) > 0 { + log.Warn("when artifacts is `source`, `ids` has no effect. ignoring") + } + case "archive": + filters = append(filters, artifact.ByType(artifact.UploadableArchive)) + case "binary": + filters = append(filters, artifact.ByBinaryLikeArtifacts(ctx.Artifacts)) + case "package": + filters = append(filters, artifact.ByType(artifact.LinuxPackage)) + case "any": + newArtifacts, err := catalogArtifact(ctx, cfg, nil) + if err != nil { + return err + } + for _, newArtifact := range newArtifacts { + ctx.Artifacts.Add(newArtifact) + } + return nil + default: + return fmt.Errorf("invalid list of artifacts to catalog: %s", cfg.Artifacts) + } + + if len(cfg.IDs) > 0 { + filters = append(filters, artifact.ByIDs(cfg.IDs...)) + } + artifacts := ctx.Artifacts.Filter(artifact.And(filters...)).List() + if len(artifacts) == 0 { + log.Warn("no artifacts matching current filters") + } + return catalog(ctx, cfg, artifacts) + } +} + +func catalog(ctx *context.Context, cfg config.SBOM, artifacts []*artifact.Artifact) error { + for _, a := range artifacts { + newArtifacts, err := catalogArtifact(ctx, cfg, a) + if err != nil { + return err + } + for _, newArtifact := range newArtifacts { + ctx.Artifacts.Add(newArtifact) + } + } + return nil +} + +func subprocessDistPath(distDir string, pathRelativeToCwd string) (string, error) { + distDir = filepath.Clean(distDir) + pathRelativeToCwd = filepath.Clean(pathRelativeToCwd) + cwd, err := os.Getwd() + if err != nil { + return "", err + } + if !filepath.IsAbs(distDir) { + distDir, err = filepath.Abs(distDir) + if err != nil { + return "", err + } + } + relativePath, err := filepath.Rel(cwd, distDir) + if err != nil { + return "", err + } + return strings.TrimPrefix(pathRelativeToCwd, relativePath+string(filepath.Separator)), nil +} + +func catalogArtifact(ctx *context.Context, cfg config.SBOM, a *artifact.Artifact) ([]*artifact.Artifact, error) { + artifactDisplayName := "(any)" + args, envs, paths, err := applyTemplate(ctx, cfg, a) + if err != nil { + return nil, fmt.Errorf("cataloging artifacts failed: %w", err) + } + + if a != nil { + artifactDisplayName = a.Path + } + + var names []string + for _, p := range paths { + names = append(names, filepath.Base(p)) + } + + // The GoASTScanner flags this as a security risk. + // However, this works as intended. The nosec annotation + // tells the scanner to ignore this. + // #nosec + cmd := exec.CommandContext(ctx, cfg.Cmd, args...) + cmd.Env = []string{} + for _, key := range passthroughEnvVars { + if value := os.Getenv(key); value != "" { + cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", key, value)) + } + } + cmd.Env = append(cmd.Env, envs...) + cmd.Dir = ctx.Config.Dist + + log.WithField("env", cmd.Env). + WithField("dir", cmd.Dir). + WithField("cmd", cmd.Args). + Debug("running") + + var b bytes.Buffer + w := gio.Safe(&b) + cmd.Stderr = io.MultiWriter(logext.NewWriter(), w) + cmd.Stdout = io.MultiWriter(logext.NewWriter(), w) + + log.WithField("cmd", cfg.Cmd). + WithField("artifact", artifactDisplayName). + WithField("sbom", names). + Info("cataloging") + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("cataloging artifacts: %s failed: %w: %s", cfg.Cmd, err, b.String()) + } + + var artifacts []*artifact.Artifact + + for _, path := range paths { + if !filepath.IsAbs(path) { + path = filepath.Join(ctx.Config.Dist, path) + } + + matches, err := filepath.Glob(path) + if err != nil { + return nil, fmt.Errorf("cataloging artifacts: failed to find SBOM artifact %q: %w", path, err) + } + for _, match := range matches { + artifacts = append(artifacts, &artifact.Artifact{ + Type: artifact.SBOM, + Name: filepath.Base(path), + Path: match, + Extra: map[string]interface{}{ + artifact.ExtraID: cfg.ID, + }, + }) + } + + } + + if len(artifacts) == 0 { + return nil, fmt.Errorf("cataloging artifacts: command did not write any files, check your configuration") + } + + return artifacts, nil +} + +func applyTemplate(ctx *context.Context, cfg config.SBOM, a *artifact.Artifact) ([]string, []string, []string, error) { + env := ctx.Env.Copy() + var extraEnvs []string + templater := tmpl.New(ctx).WithEnv(env) + + if a != nil { + procPath, err := subprocessDistPath(ctx.Config.Dist, a.Path) + if err != nil { + return nil, nil, nil, fmt.Errorf("cataloging artifacts failed: cannot determine artifact path for %q: %w", a.Path, err) + } + extraEnvs = appendExtraEnv("artifact", procPath, extraEnvs, env) + extraEnvs = appendExtraEnv("artifactID", a.ID(), extraEnvs, env) + templater = templater.WithArtifact(a) + } + + for _, keyValue := range cfg.Env { + renderedKeyValue, err := templater.Apply(expand(keyValue, env)) + if err != nil { + return nil, nil, nil, fmt.Errorf("env %q: invalid template: %w", keyValue, err) + } + extraEnvs = append(extraEnvs, renderedKeyValue) + + k, v, _ := strings.Cut(renderedKeyValue, "=") + env[k] = v + } + + var paths []string + for idx, sbom := range cfg.Documents { + input := expand(sbom, env) + if !filepath.IsAbs(input) { + // assume any absolute path is handled correctly and assume that any relative path is not already + // adjusted to reference the dist path + input = filepath.Join(ctx.Config.Dist, input) + } + + path, err := templater.Apply(input) + if err != nil { + return nil, nil, nil, fmt.Errorf("input %q: invalid template: %w", input, err) + } + + path, err = filepath.Abs(path) + if err != nil { + return nil, nil, nil, fmt.Errorf("unable to create artifact path %q: %w", sbom, err) + } + + procPath, err := subprocessDistPath(ctx.Config.Dist, path) + if err != nil { + return nil, nil, nil, fmt.Errorf("cannot determine document path for %q: %w", path, err) + } + + extraEnvs = appendExtraEnv(fmt.Sprintf("document%d", idx), procPath, extraEnvs, env) + if idx == 0 { + extraEnvs = appendExtraEnv("document", procPath, extraEnvs, env) + } + + paths = append(paths, procPath) + } + + // nolint:prealloc + var args []string + for _, arg := range cfg.Args { + renderedArg, err := templater.Apply(expand(arg, env)) + if err != nil { + return nil, nil, nil, fmt.Errorf("arg %q: invalid template: %w", arg, err) + } + args = append(args, renderedArg) + } + + return args, extraEnvs, paths, nil +} + +func appendExtraEnv(key, value string, envs []string, env map[string]string) []string { + env[key] = value + return append(envs, fmt.Sprintf("%s=%s", key, value)) +} + +func expand(s string, env map[string]string) string { + return os.Expand(s, func(key string) string { + return env[key] + }) +} +``` + +## `internal/shell/shell.go` (changed lines (21,)) + +```go +package shell + +import ( + "bytes" + "fmt" + "io" + "os/exec" + "strings" + + "github.com/caarlos0/log" + "github.com/charmbracelet/x/exp/ordered" + "github.com/goreleaser/goreleaser/internal/gio" + "github.com/goreleaser/goreleaser/internal/logext" + "github.com/goreleaser/goreleaser/pkg/context" +) + +// Run a shell command with given arguments and envs +func Run(ctx *context.Context, dir string, command, env []string, output bool) error { + log := log. + WithField("cmd", command). + WithField("env", env). + WithField("dir", dir) + + /* #nosec */ + cmd := exec.CommandContext(ctx, command[0], command[1:]...) + cmd.Env = env + + var b bytes.Buffer + w := gio.Safe(&b) + + cmd.Stderr = io.MultiWriter(logext.NewConditionalWriter(output), w) + cmd.Stdout = io.MultiWriter(logext.NewConditionalWriter(output), w) + + if dir != "" { + cmd.Dir = dir + } + + log.Debug("running") + if err := cmd.Run(); err != nil { + return fmt.Errorf( + "shell: '%s': %w: %s", + strings.Join(command, " "), + err, + ordered.First( + strings.TrimSpace(b.String()), + "[no output]", + ), + ) + } + + return nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/task.json new file mode 100644 index 0000000000000000000000000000000000000000..330fc7bdf3984fa6b84b35436411907116d5bfd5 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/task.json @@ -0,0 +1,50 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-5c2773bb1de86a62a247", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-5c2773bb1de86a62a247", + "project_id": "morefixes__goreleaser__goreleaser", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/exec/exec.go", + "internal/pipe/sbom/sbom.go", + "internal/shell/shell.go" + ], + "patch_units": { + "before": [ + "internal/exec/exec.go", + "internal/pipe/sbom/sbom.go", + "internal/shell/shell.go" + ], + "after": [ + "internal/exec/exec.go", + "internal/pipe/sbom/sbom.go", + "internal/shell/shell.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/7101a57f51065780434ced8244fd715b05331408762f04b83b457c4f352ca052/database", + "cache_key": "7101a57f51065780434ced8244fd715b05331408762f04b83b457c4f352ca052", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/5da2ed8209e8b00fd03136ed2e3a48dfdbf924bbdfeb154d3d5f772001c88596/database", + "cache_key": "5da2ed8209e8b00fd03136ed2e3a48dfdbf924bbdfeb154d3d5f772001c88596", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/0607a32b2ab1389fbd71d9ba9aeccd92208f806ca720d338c800612d1435f501/database", + "cache_key": "0607a32b2ab1389fbd71d9ba9aeccd92208f806ca720d338c800612d1435f501", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-5c2773bb1de86a62a247/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-5c2773bb1de86a62a247/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5c2773bb1de86a62a247/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..f496e2fd2163194c77274131043f19e5de0c81f6 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/patch.diff @@ -0,0 +1,84 @@ +diff --git a/internal/controllers/admin/setting/adminSystemController.go b/internal/controllers/admin/setting/adminSystemController.go +index 7b84e56..c2d8e3b 100644 +--- a/internal/controllers/admin/setting/adminSystemController.go ++++ b/internal/controllers/admin/setting/adminSystemController.go +@@ -20,6 +20,7 @@ import ( + "github.com/gphper/ginadmin/internal/controllers/admin" + "github.com/gphper/ginadmin/internal/redis" + "github.com/gphper/ginadmin/pkg/loggers" ++ "github.com/gphper/ginadmin/pkg/utils/filesystem" + gstrings "github.com/gphper/ginadmin/pkg/utils/strings" + + "github.com/gin-gonic/gin" +@@ -80,7 +81,11 @@ func (con adminSystemController) GetDir(c *gin.Context) { + ) + + fileSlice = make([]FileNode, 0) +- path = gstrings.JoinStr(configs.RootPath, c.Query("path")) ++ path, err = filesystem.FilterPath(configs.RootPath+"logs", c.Query("path")) ++ if err != nil { ++ con.Error(c, err.Error()) ++ return ++ } + + files, err = ioutil.ReadDir(path) + if err != nil { +@@ -132,7 +137,12 @@ func (con adminSystemController) View(c *gin.Context) { + } + + var filecontents []string +- filePath := gstrings.JoinStr(configs.RootPath, c.Query("path")) ++ filePath, err := filesystem.FilterPath(configs.RootPath+"logs", c.Query("path")) ++ if err != nil { ++ con.ErrorHtml(c, err) ++ return ++ } ++ + fi, err := os.Open(filePath) + if err != nil { + con.ErrorHtml(c, err) +diff --git a/pkg/utils/filesystem/filesystem.go b/pkg/utils/filesystem/filesystem.go +index 7a8b9f3..2cead86 100644 +--- a/pkg/utils/filesystem/filesystem.go ++++ b/pkg/utils/filesystem/filesystem.go +@@ -6,6 +6,8 @@ + package filesystem + + import ( ++ "errors" ++ "fmt" + "io/fs" + "log" + "os" +@@ -89,15 +91,23 @@ func OpenFile(filepath string) (file *os.File, err error) { + } + + /** +-* 组装字符串 ++* 过滤非法访问的路径 + */ +-func JoinStr(items ...interface{}) string { +- if len(items) == 0 { +- return "" ++func FilterPath(root, path string) (string, error) { ++ ++ newPath := fmt.Sprintf("%s%s", root, path) ++ absPath, err := filepath.Abs(newPath) ++ if err != nil { ++ return "", err + } +- var builder strings.Builder +- for _, v := range items { +- builder.WriteString(v.(string)) ++ ++ absPath = filepath.FromSlash(absPath) ++ ifOver := filepath.HasPrefix(absPath, filepath.FromSlash(root)) ++ fmt.Println(absPath) ++ fmt.Println(filepath.FromSlash(root)) ++ if !ifOver { ++ return "", errors.New("access to the path is prohibited") + } +- return builder.String() ++ ++ return absPath, nil + } diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..71141c9a12b6a1624d177cf2ad716fb03e72ece9 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/post_context.md @@ -0,0 +1,413 @@ +# Patch-overlapping Go context after the fix + +## `internal/controllers/admin/setting/adminSystemController.go` (changed lines (23, 84, 85, 86, 87, 88, 140, 141, 142, 143, 144, 145)) + +```go +/* + * @Description:系统管理 + * @Author: gphper + * @Date: 2021-06-01 20:15:04 + */ + +package setting + +import ( + "bufio" + "io/fs" + "io/ioutil" + "net/http" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/gphper/ginadmin/configs" + "github.com/gphper/ginadmin/internal/controllers/admin" + "github.com/gphper/ginadmin/internal/redis" + "github.com/gphper/ginadmin/pkg/loggers" + "github.com/gphper/ginadmin/pkg/utils/filesystem" + gstrings "github.com/gphper/ginadmin/pkg/utils/strings" + + "github.com/gin-gonic/gin" +) + +type adminSystemController struct { + admin.BaseController +} + +var Asc = adminSystemController{} + +/** +日志目录页面 +*/ +func (con adminSystemController) Index(c *gin.Context) { + + var ( + path string + err error + log_path string + ) + + path = gstrings.JoinStr(configs.RootPath, string(filepath.Separator), "logs") + + files, err := ioutil.ReadDir(path) + + log_path = gstrings.JoinStr(string(filepath.Separator), "logs") + + if err != nil { + loggers.LogError("admin", "读取目录失败", map[string]string{"error": err.Error()}) + con.ErrorHtml(c, err) + return + } + + c.HTML(http.StatusOK, "setting/systemlog.html", gin.H{ + "log_path": log_path, + "files": files, + "line": string(filepath.Separator), + }) +} + +/** +获取目录 +*/ +func (con adminSystemController) GetDir(c *gin.Context) { + + type FileNode struct { + Name string `json:"name"` + Path string `json:"path"` + Type string `json:"type"` + } + + var ( + path string + err error + fileSlice []FileNode + files []fs.FileInfo + ) + + fileSlice = make([]FileNode, 0) + path, err = filesystem.FilterPath(configs.RootPath+"logs", c.Query("path")) + if err != nil { + con.Error(c, err.Error()) + return + } + + files, err = ioutil.ReadDir(path) + if err != nil { + con.Error(c, "获取目录失败") + return + } + + for _, v := range files { + var fileType string + if v.IsDir() { + fileType = "dir" + } else { + fileType = "file" + } + fileSlice = append(fileSlice, FileNode{ + Name: v.Name(), + Path: gstrings.JoinStr(c.Query("path"), string(filepath.Separator), v.Name()), + Type: fileType, + }) + } + + c.JSON(http.StatusOK, gin.H{ + "data": fileSlice, + }) +} + +/** +获取日志详情 +*/ +func (con adminSystemController) View(c *gin.Context) { + + var ( + err error + startLine int + endLine int + scanner *bufio.Scanner + line int + ) + + startLine, err = strconv.Atoi(c.DefaultQuery("start_line", "1")) + if err != nil { + con.ErrorHtml(c, err) + return + } + endLine, err = strconv.Atoi(c.DefaultQuery("end_line", "20")) + if err != nil { + con.ErrorHtml(c, err) + return + } + + var filecontents []string + filePath, err := filesystem.FilterPath(configs.RootPath+"logs", c.Query("path")) + if err != nil { + con.ErrorHtml(c, err) + return + } + + fi, err := os.Open(filePath) + if err != nil { + con.ErrorHtml(c, err) + return + } + defer fi.Close() + + scanner = bufio.NewScanner(fi) + for scanner.Scan() { + line++ + if line >= startLine && line <= endLine { + // 在要求行数内取得数据 + filecontents = append(filecontents, scanner.Text()) + } else { + continue + } + } + + c.HTML(http.StatusOK, "setting/systemlog_view.html", gin.H{ + "file_path": c.Query("path"), + "filecontents": filecontents, + "start_line": startLine, + "end_line": endLine, + "line": line, + }) + +} + +/** +日志目录页面 +*/ +func (con adminSystemController) IndexRedis(c *gin.Context) { + + path := "logs" + + dateSlice, err := redis.RedisClient.Keys("logs:*").Result() + + if err != nil { + loggers.LogError("admin", "读取目录失败", map[string]string{"error": err.Error()}) + con.ErrorHtml(c, err) + return + } + + dates := make(map[string]struct{}) + + for _, v := range dateSlice { + temp := strings.Split(v, ":") + + if _, ok := dates[temp[1]]; !ok { + dates[temp[1]] = struct{}{} + } + } + + c.HTML(http.StatusOK, "setting/systemlog_redis.html", gin.H{ + "log_path": path, + "files": dates, + }) +} + +/** +获取目录 +*/ +func (con adminSystemController) GetDirRedis(c *gin.Context) { + + path := c.Query("path") + + type FileNode struct { + Name string `json:"name"` + Path string `json:"path"` + Type string `json:"type"` + } + + pathSlice := strings.Split(path, "_") + + pattern := pathSlice[0] + ":*" + + dateSlice, err := redis.RedisClient.Keys(pattern).Result() + + if err != nil { + loggers.LogError("admin", "读取目录失败", map[string]string{"error": err.Error()}) + con.ErrorHtml(c, err) + return + } + + fileSlice := make([]FileNode, 0) + + tempMap := make(map[string]struct{}) + + for _, v := range dateSlice { + temp := strings.Split(v, ":") + index, _ := strconv.Atoi(pathSlice[1]) + var fileType string + + if index+2 == len(temp) { + fileType = "file" + } else { + fileType = "dir" + } + + if _, ok := tempMap[temp[index+1]]; ok { + continue + } else { + tempMap[temp[index+1]] = struct{}{} + } + + fileSlice = append(fileSlice, FileNode{ + Name: temp[index+1], + Path: pathSlice[0] + ":" + temp[index+1] + "_" + strconv.Itoa(index+1), + Type: fileType, + }) + + } + + c.JSON(http.StatusOK, gin.H{ + "data": fileSlice, + }) +} + +/** +获取日志详情 +*/ +func (con adminSystemController) ViewRedis(c *gin.Context) { + + startLine, _ := strconv.Atoi(c.DefaultQuery("start_line", "1")) + + endLine, _ := strconv.Atoi(c.DefaultQuery("end_line", "20")) + + filePath := c.Query("path") + + pathSlice := strings.Split(filePath, "_") + + filecontents, _ := redis.RedisClient.LRange(pathSlice[0], int64(startLine-1), int64(endLine-1)).Result() + + line, _ := redis.RedisClient.LLen(pathSlice[0]).Result() + + c.HTML(http.StatusOK, "setting/systemlog_viewredis.html", gin.H{ + "file_path": filePath, + "filecontents": filecontents, + "start_line": startLine, + "end_line": endLine, + "line": line, + }) + +} +``` + +## `pkg/utils/filesystem/filesystem.go` (changed lines (9, 10, 94, 96, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 108, 109, 111, 112)) + +```go +/* + * @Description: + * @Author: gphper + * @Date: 2022-03-27 10:57:10 + */ +package filesystem + +import ( + "errors" + "fmt" + "io/fs" + "log" + "os" + "path" + "path/filepath" + "runtime" + "strings" +) + +/** +获取项目根目录 +*/ +func RootPath() (path string, err error) { + path = getCurrentAbPathByExecutable() + if strings.Contains(path, getTmpDir()) { + path = getCurrentAbPathByCaller() + } + path = strings.Replace(path, "pkg/utils/filesystem", "", 1) + return +} + +// 获取系统临时目录,兼容go run +func getTmpDir() string { + dir := os.Getenv("TEMP") + if dir == "" { + dir = os.Getenv("TMP") + } + if dir == "" { + dir = "tmp" + } + + res, _ := filepath.EvalSymlinks(dir) + return res +} + +// 获取当前执行文件绝对路径 +func getCurrentAbPathByExecutable() string { + exePath, err := os.Executable() + if err != nil { + log.Fatal(err) + } + res, _ := filepath.EvalSymlinks(filepath.Dir(exePath)) + return res +} + +// 获取当前执行文件绝对路径(go run) +func getCurrentAbPathByCaller() string { + var abPath string + _, filename, _, ok := runtime.Caller(0) + if ok { + abPath = path.Dir(filename) + } + return abPath +} + +/** +* 打开文件句柄 +**/ +func OpenFile(filepath string) (file *os.File, err error) { + + file, err = os.OpenFile(filepath, os.O_WRONLY|os.O_CREATE, 0666) + if err == nil { + return + } + + dir := path.Dir(filepath) + _, err = os.Stat(dir) + if err != nil { + if os.IsNotExist(err) { + err = os.MkdirAll(dir, fs.FileMode(os.O_CREATE)) + if err != nil { + return + } + } + } + file, err = os.OpenFile(filepath, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + return + } + return +} + +/** +* 过滤非法访问的路径 + */ +func FilterPath(root, path string) (string, error) { + + newPath := fmt.Sprintf("%s%s", root, path) + absPath, err := filepath.Abs(newPath) + if err != nil { + return "", err + } + + absPath = filepath.FromSlash(absPath) + ifOver := filepath.HasPrefix(absPath, filepath.FromSlash(root)) + fmt.Println(absPath) + fmt.Println(filepath.FromSlash(root)) + if !ifOver { + return "", errors.New("access to the path is prohibited") + } + + return absPath, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..d81154165e0d4f6f8224172bdb5ac5a738f92f36 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/pre_context.md @@ -0,0 +1,393 @@ +# Patch-overlapping Go context before the fix + +## `internal/controllers/admin/setting/adminSystemController.go` (changed lines (23, 83, 84, 135, 136)) + +```go +/* + * @Description:系统管理 + * @Author: gphper + * @Date: 2021-06-01 20:15:04 + */ + +package setting + +import ( + "bufio" + "io/fs" + "io/ioutil" + "net/http" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/gphper/ginadmin/configs" + "github.com/gphper/ginadmin/internal/controllers/admin" + "github.com/gphper/ginadmin/internal/redis" + "github.com/gphper/ginadmin/pkg/loggers" + gstrings "github.com/gphper/ginadmin/pkg/utils/strings" + + "github.com/gin-gonic/gin" +) + +type adminSystemController struct { + admin.BaseController +} + +var Asc = adminSystemController{} + +/** +日志目录页面 +*/ +func (con adminSystemController) Index(c *gin.Context) { + + var ( + path string + err error + log_path string + ) + + path = gstrings.JoinStr(configs.RootPath, string(filepath.Separator), "logs") + + files, err := ioutil.ReadDir(path) + + log_path = gstrings.JoinStr(string(filepath.Separator), "logs") + + if err != nil { + loggers.LogError("admin", "读取目录失败", map[string]string{"error": err.Error()}) + con.ErrorHtml(c, err) + return + } + + c.HTML(http.StatusOK, "setting/systemlog.html", gin.H{ + "log_path": log_path, + "files": files, + "line": string(filepath.Separator), + }) +} + +/** +获取目录 +*/ +func (con adminSystemController) GetDir(c *gin.Context) { + + type FileNode struct { + Name string `json:"name"` + Path string `json:"path"` + Type string `json:"type"` + } + + var ( + path string + err error + fileSlice []FileNode + files []fs.FileInfo + ) + + fileSlice = make([]FileNode, 0) + path = gstrings.JoinStr(configs.RootPath, c.Query("path")) + + files, err = ioutil.ReadDir(path) + if err != nil { + con.Error(c, "获取目录失败") + return + } + + for _, v := range files { + var fileType string + if v.IsDir() { + fileType = "dir" + } else { + fileType = "file" + } + fileSlice = append(fileSlice, FileNode{ + Name: v.Name(), + Path: gstrings.JoinStr(c.Query("path"), string(filepath.Separator), v.Name()), + Type: fileType, + }) + } + + c.JSON(http.StatusOK, gin.H{ + "data": fileSlice, + }) +} + +/** +获取日志详情 +*/ +func (con adminSystemController) View(c *gin.Context) { + + var ( + err error + startLine int + endLine int + scanner *bufio.Scanner + line int + ) + + startLine, err = strconv.Atoi(c.DefaultQuery("start_line", "1")) + if err != nil { + con.ErrorHtml(c, err) + return + } + endLine, err = strconv.Atoi(c.DefaultQuery("end_line", "20")) + if err != nil { + con.ErrorHtml(c, err) + return + } + + var filecontents []string + filePath := gstrings.JoinStr(configs.RootPath, c.Query("path")) + fi, err := os.Open(filePath) + if err != nil { + con.ErrorHtml(c, err) + return + } + defer fi.Close() + + scanner = bufio.NewScanner(fi) + for scanner.Scan() { + line++ + if line >= startLine && line <= endLine { + // 在要求行数内取得数据 + filecontents = append(filecontents, scanner.Text()) + } else { + continue + } + } + + c.HTML(http.StatusOK, "setting/systemlog_view.html", gin.H{ + "file_path": c.Query("path"), + "filecontents": filecontents, + "start_line": startLine, + "end_line": endLine, + "line": line, + }) + +} + +/** +日志目录页面 +*/ +func (con adminSystemController) IndexRedis(c *gin.Context) { + + path := "logs" + + dateSlice, err := redis.RedisClient.Keys("logs:*").Result() + + if err != nil { + loggers.LogError("admin", "读取目录失败", map[string]string{"error": err.Error()}) + con.ErrorHtml(c, err) + return + } + + dates := make(map[string]struct{}) + + for _, v := range dateSlice { + temp := strings.Split(v, ":") + + if _, ok := dates[temp[1]]; !ok { + dates[temp[1]] = struct{}{} + } + } + + c.HTML(http.StatusOK, "setting/systemlog_redis.html", gin.H{ + "log_path": path, + "files": dates, + }) +} + +/** +获取目录 +*/ +func (con adminSystemController) GetDirRedis(c *gin.Context) { + + path := c.Query("path") + + type FileNode struct { + Name string `json:"name"` + Path string `json:"path"` + Type string `json:"type"` + } + + pathSlice := strings.Split(path, "_") + + pattern := pathSlice[0] + ":*" + + dateSlice, err := redis.RedisClient.Keys(pattern).Result() + + if err != nil { + loggers.LogError("admin", "读取目录失败", map[string]string{"error": err.Error()}) + con.ErrorHtml(c, err) + return + } + + fileSlice := make([]FileNode, 0) + + tempMap := make(map[string]struct{}) + + for _, v := range dateSlice { + temp := strings.Split(v, ":") + index, _ := strconv.Atoi(pathSlice[1]) + var fileType string + + if index+2 == len(temp) { + fileType = "file" + } else { + fileType = "dir" + } + + if _, ok := tempMap[temp[index+1]]; ok { + continue + } else { + tempMap[temp[index+1]] = struct{}{} + } + + fileSlice = append(fileSlice, FileNode{ + Name: temp[index+1], + Path: pathSlice[0] + ":" + temp[index+1] + "_" + strconv.Itoa(index+1), + Type: fileType, + }) + + } + + c.JSON(http.StatusOK, gin.H{ + "data": fileSlice, + }) +} + +/** +获取日志详情 +*/ +func (con adminSystemController) ViewRedis(c *gin.Context) { + + startLine, _ := strconv.Atoi(c.DefaultQuery("start_line", "1")) + + endLine, _ := strconv.Atoi(c.DefaultQuery("end_line", "20")) + + filePath := c.Query("path") + + pathSlice := strings.Split(filePath, "_") + + filecontents, _ := redis.RedisClient.LRange(pathSlice[0], int64(startLine-1), int64(endLine-1)).Result() + + line, _ := redis.RedisClient.LLen(pathSlice[0]).Result() + + c.HTML(http.StatusOK, "setting/systemlog_viewredis.html", gin.H{ + "file_path": filePath, + "filecontents": filecontents, + "start_line": startLine, + "end_line": endLine, + "line": line, + }) + +} +``` + +## `pkg/utils/filesystem/filesystem.go` (changed lines (9, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103)) + +```go +/* + * @Description: + * @Author: gphper + * @Date: 2022-03-27 10:57:10 + */ +package filesystem + +import ( + "io/fs" + "log" + "os" + "path" + "path/filepath" + "runtime" + "strings" +) + +/** +获取项目根目录 +*/ +func RootPath() (path string, err error) { + path = getCurrentAbPathByExecutable() + if strings.Contains(path, getTmpDir()) { + path = getCurrentAbPathByCaller() + } + path = strings.Replace(path, "pkg/utils/filesystem", "", 1) + return +} + +// 获取系统临时目录,兼容go run +func getTmpDir() string { + dir := os.Getenv("TEMP") + if dir == "" { + dir = os.Getenv("TMP") + } + if dir == "" { + dir = "tmp" + } + + res, _ := filepath.EvalSymlinks(dir) + return res +} + +// 获取当前执行文件绝对路径 +func getCurrentAbPathByExecutable() string { + exePath, err := os.Executable() + if err != nil { + log.Fatal(err) + } + res, _ := filepath.EvalSymlinks(filepath.Dir(exePath)) + return res +} + +// 获取当前执行文件绝对路径(go run) +func getCurrentAbPathByCaller() string { + var abPath string + _, filename, _, ok := runtime.Caller(0) + if ok { + abPath = path.Dir(filename) + } + return abPath +} + +/** +* 打开文件句柄 +**/ +func OpenFile(filepath string) (file *os.File, err error) { + + file, err = os.OpenFile(filepath, os.O_WRONLY|os.O_CREATE, 0666) + if err == nil { + return + } + + dir := path.Dir(filepath) + _, err = os.Stat(dir) + if err != nil { + if os.IsNotExist(err) { + err = os.MkdirAll(dir, fs.FileMode(os.O_CREATE)) + if err != nil { + return + } + } + } + file, err = os.OpenFile(filepath, os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + return + } + return +} + +/** +* 组装字符串 + */ +func JoinStr(items ...interface{}) string { + if len(items) == 0 { + return "" + } + var builder strings.Builder + for _, v := range items { + builder.WriteString(v.(string)) + } + return builder.String() +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0b5799033b8e05c9ae892e1c7a24f17beccc7036 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-5cfa41b8575717ecee17", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-5cfa41b8575717ecee17", + "project_id": "morefixes__gphper__ginadmin", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/controllers/admin/setting/adminSystemController.go", + "pkg/utils/filesystem/filesystem.go" + ], + "patch_units": { + "before": [ + "internal/controllers/admin/setting/adminSystemController.go", + "pkg/utils/filesystem/filesystem.go" + ], + "after": [ + "internal/controllers/admin/setting/adminSystemController.go", + "pkg/utils/filesystem/filesystem.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/ceedc26314cd526e12d7070ebafe9b628ba768dd6a5e261fbeff8d7fc8c953c2/database", + "cache_key": "ceedc26314cd526e12d7070ebafe9b628ba768dd6a5e261fbeff8d7fc8c953c2", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/06a58c60bb5c7c838f2af01e0755e1e82efe78b44ba5415ed98e42bd180f9eea/database", + "cache_key": "06a58c60bb5c7c838f2af01e0755e1e82efe78b44ba5415ed98e42bd180f9eea", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/8ee0eb6c3b465b58a2aa9b0751eac59cd89bf2ee8c056400597c5bb78055a6b4/database", + "cache_key": "8ee0eb6c3b465b58a2aa9b0751eac59cd89bf2ee8c056400597c5bb78055a6b4", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-5cfa41b8575717ecee17/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-5cfa41b8575717ecee17/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-5cfa41b8575717ecee17/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..f1b99521354e192c57ed98ef91c0ebc331fdf3f7 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/patch.diff @@ -0,0 +1,67 @@ +diff --git a/binder.go b/binder.go +index a42ed21..784e014 100644 +--- a/binder.go ++++ b/binder.go +@@ -213,6 +213,8 @@ func bindSlice(params *Params, name string, typ reflect.Type) reflect.Value { + numNoIndex := 0 + sliceValues := []sliceValue{} + ++ maxIndexBound := Config.IntDefault("params.max_index", 4096) ++ + // Factor out the common slice logic (between form values and files). + processElement := func(key string, vals []string, files []*multipart.FileHeader) { + if !strings.HasPrefix(key, name+"[") { +@@ -229,6 +231,11 @@ func bindSlice(params *Params, name string, typ reflect.Type) reflect.Value { + + // Handle the indexed case. + if index > -1 { ++ // Just ignore illegal index, fix issue #1424 ++ if index > maxIndexBound { ++ binderLog.Error("Ignoring parameter for security reason", "index", index, "key", key) ++ return ++ } + if index > maxIndex { + maxIndex = index + } +diff --git a/binder_test.go b/binder_test.go +index 5ffd5cd..23749dd 100644 +--- a/binder_test.go ++++ b/binder_test.go +@@ -7,6 +7,7 @@ package revel + import ( + "encoding/json" + "fmt" ++ "github.com/revel/config" + "io" + "io/ioutil" + "os" +@@ -98,6 +99,8 @@ var ( + "invalidArr": {"xyz"}, + "int8-overflow": {"1024"}, + "uint8-overflow": {"1024"}, ++ "arrDoS[2]": {"2"}, ++ "arrDoS[65535]": {"65535"}, + } + + testDate = time.Date(1982, time.July, 9, 0, 0, 0, 0, time.UTC) +@@ -168,6 +171,7 @@ var binderTestCases = map[string]interface{}{ + "priv": A{}, + "int8-overflow": int8(0), + "uint8-overflow": uint8(0), ++ "arrDoS": []int{0, 0, 2}, + } + + // Types that files may be bound to, and a func that can read the content from +@@ -213,6 +217,12 @@ func TestBinder(t *testing.T) { + // Reuse the mvc_test.go multipart request to test the binder. + params := &Params{} + c := NewTestController(nil, getMultipartRequest()) ++ if Config == nil { ++ Config = config.NewContext() ++ defer func() { ++ Config = nil ++ }() ++ } + ParseParams(params, NewRequest(c.Request.In)) + params.Values = ParamTestValues + diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..fd744c4b89e78c0e3e2bafc31d496183381fd216 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/post_context.md @@ -0,0 +1,990 @@ +# Patch-overlapping Go context after the fix + +## `binder.go` (changed lines (216, 217, 234, 235, 236, 237, 238)) + +```go +// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. +// Revel Framework source code and usage is governed by a MIT style +// license that can be found in the LICENSE file. + +package revel + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "os" + "reflect" + "strconv" + "strings" + "time" +) + +// A Binder translates between string parameters and Go data structures. +type Binder struct { + // Bind takes the name and type of the desired parameter and constructs it + // from one or more values from Params. + // + // Example + // + // Request: + // url?id=123&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=rob + // + // Action: + // Example.Action(id int, ol []int, ul []string, user User) + // + // Calls: + // Bind(params, "id", int): 123 + // Bind(params, "ol", []int): {1, 2} + // Bind(params, "ul", []string): {"str", "array"} + // Bind(params, "user", User): User{Name:"rob"} + // + // Note that only exported struct fields may be bound. + Bind func(params *Params, name string, typ reflect.Type) reflect.Value + + // Unbind serializes a given value to one or more URL parameters of the given + // name. + Unbind func(output map[string]string, name string, val interface{}) +} + +var binderLog = RevelLog.New("section", "binder") + +// ValueBinder is adapter for easily making one-key-value binders. +func ValueBinder(f func(value string, typ reflect.Type) reflect.Value) func(*Params, string, reflect.Type) reflect.Value { + return func(params *Params, name string, typ reflect.Type) reflect.Value { + vals, ok := params.Values[name] + if !ok || len(vals) == 0 { + return reflect.Zero(typ) + } + return f(vals[0], typ) + } +} + +// Revel's default date and time constants +const ( + DefaultDateFormat = "2006-01-02" + DefaultDateTimeFormat = "2006-01-02 15:04" +) + +// Binders type and kind definition +var ( + // These are the lookups to find a Binder for any type of data. + // The most specific binder found will be used (Type before Kind) + TypeBinders = make(map[reflect.Type]Binder) + KindBinders = make(map[reflect.Kind]Binder) + + // Applications can add custom time formats to this array, and they will be + // automatically attempted when binding a time.Time. + TimeFormats = []string{} + + DateFormat string + DateTimeFormat string + TimeZone = time.UTC + + IntBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + if len(val) == 0 { + return reflect.Zero(typ) + } + intValue, err := strconv.ParseInt(val, 10, 64) + if err != nil { + binderLog.Warn("IntBinder Conversion Error", "error", err) + return reflect.Zero(typ) + } + pValue := reflect.New(typ) + pValue.Elem().SetInt(intValue) + return pValue.Elem() + }), + Unbind: func(output map[string]string, key string, val interface{}) { + output[key] = fmt.Sprintf("%d", val) + }, + } + + UintBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + if len(val) == 0 { + return reflect.Zero(typ) + } + uintValue, err := strconv.ParseUint(val, 10, 64) + if err != nil { + binderLog.Warn("UintBinder Conversion Error", "error", err) + return reflect.Zero(typ) + } + pValue := reflect.New(typ) + pValue.Elem().SetUint(uintValue) + return pValue.Elem() + }), + Unbind: func(output map[string]string, key string, val interface{}) { + output[key] = fmt.Sprintf("%d", val) + }, + } + + FloatBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + if len(val) == 0 { + return reflect.Zero(typ) + } + floatValue, err := strconv.ParseFloat(val, 64) + if err != nil { + binderLog.Warn("FloatBinder Conversion Error", "error", err) + return reflect.Zero(typ) + } + pValue := reflect.New(typ) + pValue.Elem().SetFloat(floatValue) + return pValue.Elem() + }), + Unbind: func(output map[string]string, key string, val interface{}) { + output[key] = fmt.Sprintf("%f", val) + }, + } + + StringBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + return reflect.ValueOf(val) + }), + Unbind: func(output map[string]string, name string, val interface{}) { + output[name] = val.(string) + }, + } + + // Booleans support a various value formats, + // refer `revel.Atob` method. + BoolBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + return reflect.ValueOf(Atob(val)) + }), + Unbind: func(output map[string]string, name string, val interface{}) { + output[name] = fmt.Sprintf("%t", val) + }, + } + + PointerBinder = Binder{ + Bind: func(params *Params, name string, typ reflect.Type) reflect.Value { + v := Bind(params, name, typ.Elem()) + if v.CanAddr() { + return v.Addr() + } + + return v + }, + Unbind: func(output map[string]string, name string, val interface{}) { + Unbind(output, name, reflect.ValueOf(val).Elem().Interface()) + }, + } + + TimeBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + for _, f := range TimeFormats { + if r, err := time.ParseInLocation(f, val, TimeZone); err == nil { + return reflect.ValueOf(r) + } + } + return reflect.Zero(typ) + }), + Unbind: func(output map[string]string, name string, val interface{}) { + var ( + t = val.(time.Time) + format = DateTimeFormat + h, m, s = t.Clock() + ) + if h == 0 && m == 0 && s == 0 { + format = DateFormat + } + output[name] = t.Format(format) + }, + } + + MapBinder = Binder{ + Bind: bindMap, + Unbind: unbindMap, + } +) + +// Used to keep track of the index for individual keyvalues. +type sliceValue struct { + index int // Index extracted from brackets. If -1, no index was provided. + value reflect.Value // the bound value for this slice element. +} + +// This function creates a slice of the given type, Binds each of the individual +// elements, and then sets them to their appropriate location in the slice. +// If elements are provided without an explicit index, they are added (in +// unspecified order) to the end of the slice. +func bindSlice(params *Params, name string, typ reflect.Type) reflect.Value { + // Collect an array of slice elements with their indexes (and the max index). + maxIndex := -1 + numNoIndex := 0 + sliceValues := []sliceValue{} + + maxIndexBound := Config.IntDefault("params.max_index", 4096) + + // Factor out the common slice logic (between form values and files). + processElement := func(key string, vals []string, files []*multipart.FileHeader) { + if !strings.HasPrefix(key, name+"[") { + return + } + + // Extract the index, and the index where a sub-key starts. (e.g. field[0].subkey) + index := -1 + leftBracket, rightBracket := len(name), strings.Index(key[len(name):], "]")+len(name) + if rightBracket > leftBracket+1 { + index, _ = strconv.Atoi(key[leftBracket+1 : rightBracket]) + } + subKeyIndex := rightBracket + 1 + + // Handle the indexed case. + if index > -1 { + // Just ignore illegal index, fix issue #1424 + if index > maxIndexBound { + binderLog.Error("Ignoring parameter for security reason", "index", index, "key", key) + return + } + if index > maxIndex { + maxIndex = index + } + sliceValues = append(sliceValues, sliceValue{ + index: index, + value: Bind(params, key[:subKeyIndex], typ.Elem()), + }) + return + } + + // It's an un-indexed element. (e.g. element[]) + numNoIndex += len(vals) + len(files) + for _, val := range vals { + // Unindexed values can only be direct-bound. + sliceValues = append(sliceValues, sliceValue{ + index: -1, + value: BindValue(val, typ.Elem()), + }) + } + + for _, fileHeader := range files { + sliceValues = append(sliceValues, sliceValue{ + index: -1, + value: BindFile(fileHeader, typ.Elem()), + }) + } + } + + for key, vals := range params.Values { + processElement(key, vals, nil) + } + for key, fileHeaders := range params.Files { + processElement(key, nil, fileHeaders) + } + + resultArray := reflect.MakeSlice(typ, maxIndex+1, maxIndex+1+numNoIndex) + for _, sv := range sliceValues { + if sv.index != -1 { + resultArray.Index(sv.index).Set(sv.value) + } else { + resultArray = reflect.Append(resultArray, sv.value) + } + } + + return resultArray +} + +// Break on dots and brackets. +// e.g. bar => "bar", bar.baz => "bar", bar[0] => "bar" +func nextKey(key string) string { + fieldLen := strings.IndexAny(key, ".[") + if fieldLen == -1 { + return key + } + return key[:fieldLen] +} + +func unbindSlice(output map[string]string, name string, val interface{}) { + v := reflect.ValueOf(val) + for i := 0; i < v.Len(); i++ { + Unbind(output, fmt.Sprintf("%s[%d]", name, i), v.Index(i).Interface()) + } +} + +func bindStruct(params *Params, name string, typ reflect.Type) reflect.Value { + resultPointer := reflect.New(typ) + result := resultPointer.Elem() + if params.JSON != nil { + // Try to inject the response as a json into the created result + if err := json.Unmarshal(params.JSON, resultPointer.Interface()); err != nil { + binderLog.Error("bindStruct Unable to unmarshal request", "name", name, "error", err, "data", string(params.JSON)) + } + return result + } + fieldValues := make(map[string]reflect.Value) + for key := range params.Values { + if !strings.HasPrefix(key, name+".") { + continue + } + + // Get the name of the struct property. + // Strip off the prefix. e.g. foo.bar.baz => bar.baz + suffix := key[len(name)+1:] + fieldName := nextKey(suffix) + fieldLen := len(fieldName) + + if _, ok := fieldValues[fieldName]; !ok { + // Time to bind this field. Get it and make sure we can set it. + fieldValue := result.FieldByName(fieldName) + if !fieldValue.IsValid() { + binderLog.Warn("bindStruct Field not found", "name", fieldName) + continue + } + if !fieldValue.CanSet() { + binderLog.Warn("bindStruct Field not settable", "name", fieldName) + continue + } + boundVal := Bind(params, key[:len(name)+1+fieldLen], fieldValue.Type()) + fieldValue.Set(boundVal) + fieldValues[fieldName] = boundVal + } + } + + return result +} + +func unbindStruct(output map[string]string, name string, iface interface{}) { + val := reflect.ValueOf(iface) + typ := val.Type() + for i := 0; i < val.NumField(); i++ { + structField := typ.Field(i) + fieldValue := val.Field(i) + + // PkgPath is specified to be empty exactly for exported fields. + if structField.PkgPath == "" { + Unbind(output, fmt.Sprintf("%s.%s", name, structField.Name), fieldValue.Interface()) + } + } +} + +// Helper that returns an upload of the given name, or nil. +func getMultipartFile(params *Params, name string) multipart.File { + for _, fileHeader := range params.Files[name] { + file, err := fileHeader.Open() + if err == nil { + return file + } + binderLog.Warn("getMultipartFile: Failed to open uploaded file", "name", name, "error", err) + } + return nil +} + +func bindFile(params *Params, name string, typ reflect.Type) reflect.Value { + reader := getMultipartFile(params, name) + if reader == nil { + return reflect.Zero(typ) + } + + // If it's already stored in a temp file, just return that. + if osFile, ok := reader.(*os.File); ok { + return reflect.ValueOf(osFile) + } + + // Otherwise, have to store it. + tmpFile, err := ioutil.TempFile("", "revel-upload") + if err != nil { + binderLog.Warn("bindFile: Failed to create a temp file to store upload", "name", name, "error", err) + return reflect.Zero(typ) + } + + // Register it to be deleted after the request is done. + params.tmpFiles = append(params.tmpFiles, tmpFile) + + _, err = io.Copy(tmpFile, reader) + if err != nil { + binderLog.Warn("bindFile: Failed to copy upload to temp file", "name", name, "error", err) + return reflect.Zero(typ) + } + + _, err = tmpFile.Seek(0, 0) + if err != nil { + binderLog.Warn("bindFile: Failed to seek to beginning of temp file", "name", name, "error", err) + return reflect.Zero(typ) + } + + return reflect.ValueOf(tmpFile) +} + +func bindByteArray(params *Params, name string, typ reflect.Type) reflect.Value { + if reader := getMultipartFile(params, name); reader != nil { + b, err := ioutil.ReadAll(reader) + if err == nil { + return reflect.ValueOf(b) + } + binderLog.Warn("bindByteArray: Error reading uploaded file contents", "name", name, "error", err) + } + return reflect.Zero(typ) +} + +func bindReadSeeker(params *Params, name string, typ reflect.Type) reflect.Value { + if reader := getMultipartFile(params, name); reader != nil { + return reflect.ValueOf(reader.(io.ReadSeeker)) + } + return reflect.Zero(typ) +} + +// bindMap converts parameters using map syntax into the corresponding map. e.g.: +// params["a[5]"]=foo, name="a", typ=map[int]string => map[int]string{5: "foo"} +func bindMap(params *Params, name string, typ reflect.Type) reflect.Value { + var ( + keyType = typ.Key() + valueType = typ.Elem() + resultPtr = reflect.New(reflect.MapOf(keyType, valueType)) + result = resultPtr.Elem() + ) + result.Set(reflect.MakeMap(typ)) + if params.JSON != nil { + // Try to inject the response as a json into the created result + if err := json.Unmarshal(params.JSON, resultPtr.Interface()); err != nil { + binderLog.Warn("bindMap: Unable to unmarshal request", "name", name, "error", err) + } + return result + } + + for paramName := range params.Values { + // The paramName string must start with the value in the "name" parameter, + // otherwise there is no way the parameter is part of the map + if !strings.HasPrefix(paramName, name) { + continue + } + + suffix := paramName[len(name)+1:] + fieldName := nextKey(suffix) + if fieldName != "" { + fieldName = fieldName[:len(fieldName)-1] + } + if !strings.HasPrefix(paramName, name+"["+fieldName+"]") { + continue + } + + result.SetMapIndex(BindValue(fieldName, keyType), Bind(params, name+"["+fieldName+"]", valueType)) + } + return result +} + +func unbindMap(output map[string]string, name string, iface interface{}) { + mapValue := reflect.ValueOf(iface) + for _, key := range mapValue.MapKeys() { + Unbind(output, name+"["+fmt.Sprintf("%v", key.Interface())+"]", + mapValue.MapIndex(key).Interface()) + } +} + +// Bind takes the name and type of the desired parameter and constructs it +// from one or more values from Params. +// Returns the zero value of the type upon any sort of failure. +func Bind(params *Params, name string, typ reflect.Type) reflect.Value { + if binder, found := binderForType(typ); found { + return binder.Bind(params, name, typ) + } + return reflect.Zero(typ) +} + +func BindValue(val string, typ reflect.Type) reflect.Value { + return Bind(&Params{Values: map[string][]string{"": {val}}}, "", typ) +} + +func BindFile(fileHeader *multipart.FileHeader, typ reflect.Type) reflect.Value { + return Bind(&Params{Files: map[string][]*multipart.FileHeader{"": {fileHeader}}}, "", typ) +} + +func Unbind(output map[string]string, name string, val interface{}) { + if binder, found := binderForType(reflect.TypeOf(val)); found { + if binder.Unbind != nil { + binder.Unbind(output, name, val) + } else { + binderLog.Error("Unbind: Unable to unmarshal request", "name", name, "value", val) + } + } +} + +func binderForType(typ reflect.Type) (Binder, bool) { + binder, ok := TypeBinders[typ] + if !ok { + binder, ok = KindBinders[typ.Kind()] + if !ok { + binderLog.Error("binderForType: no binder for type", "type", typ) + return Binder{}, false + } + } + return binder, true +} + +// Sadly, the binder lookups can not be declared initialized -- that results in +// an "initialization loop" compile error. +func init() { + KindBinders[reflect.Int] = IntBinder + KindBinders[reflect.Int8] = IntBinder + KindBinders[reflect.Int16] = IntBinder + KindBinders[reflect.Int32] = IntBinder + KindBinders[reflect.Int64] = IntBinder + + KindBinders[reflect.Uint] = UintBinder + KindBinders[reflect.Uint8] = UintBinder + KindBinders[reflect.Uint16] = UintBinder + KindBinders[reflect.Uint32] = UintBinder + KindBinders[reflect.Uint64] = UintBinder + + KindBinders[reflect.Float32] = FloatBinder + KindBinders[reflect.Float64] = FloatBinder + + KindBinders[reflect.String] = StringBinder + KindBinders[reflect.Bool] = BoolBinder + KindBinders[reflect.Slice] = Binder{bindSlice, unbindSlice} + KindBinders[reflect.Struct] = Binder{bindStruct, unbindStruct} + KindBinders[reflect.Ptr] = PointerBinder + KindBinders[reflect.Map] = MapBinder + + TypeBinders[reflect.TypeOf(time.Time{})] = TimeBinder + + // Uploads + TypeBinders[reflect.TypeOf(&os.File{})] = Binder{bindFile, nil} + TypeBinders[reflect.TypeOf([]byte{})] = Binder{bindByteArray, nil} + TypeBinders[reflect.TypeOf((*io.Reader)(nil)).Elem()] = Binder{bindReadSeeker, nil} + TypeBinders[reflect.TypeOf((*io.ReadSeeker)(nil)).Elem()] = Binder{bindReadSeeker, nil} + + OnAppStart(func() { + DateTimeFormat = Config.StringDefault("format.datetime", DefaultDateTimeFormat) + DateFormat = Config.StringDefault("format.date", DefaultDateFormat) + TimeFormats = append(TimeFormats, DateTimeFormat, DateFormat) + }) +} +``` + +## `binder_test.go` (changed lines (10, 102, 103, 174, 220, 221, 222, 223, 224, 225)) + +```go +// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. +// Revel Framework source code and usage is governed by a MIT style +// license that can be found in the LICENSE file. + +package revel + +import ( + "encoding/json" + "fmt" + "github.com/revel/config" + "io" + "io/ioutil" + "os" + "reflect" + "sort" + "strings" + "testing" + "time" +) + +type A struct { + ID int + Name string + B B + private int +} + +type B struct { + Extra string +} + +var ( + ParamTestValues = map[string][]string{ + "int": {"1"}, + "int8": {"1"}, + "int16": {"1"}, + "int32": {"1"}, + "int64": {"1"}, + "uint": {"1"}, + "uint8": {"1"}, + "uint16": {"1"}, + "uint32": {"1"}, + "uint64": {"1"}, + "float32": {"1.000000"}, + "float64": {"1.000000"}, + "str": {"hello"}, + "bool-true": {"true"}, + "bool-1": {"1"}, + "bool-on": {"on"}, + "bool-false": {"false"}, + "bool-0": {"0"}, + "bool-0.0": {"0.0"}, + "bool-off": {"off"}, + "bool-f": {"f"}, + "date": {"1982-07-09"}, + "datetime": {"1982-07-09 21:30"}, + "customDate": {"07/09/1982"}, + "arr[0]": {"1"}, + "arr[1]": {"2"}, + "arr[3]": {"3"}, + "uarr[]": {"1", "2"}, + "arruarr[0][]": {"1", "2"}, + "arruarr[1][]": {"3", "4"}, + "2darr[0][0]": {"0"}, + "2darr[0][1]": {"1"}, + "2darr[1][0]": {"10"}, + "2darr[1][1]": {"11"}, + "A.ID": {"123"}, + "A.Name": {"rob"}, + "B.ID": {"123"}, + "B.Name": {"rob"}, + "B.B.Extra": {"hello"}, + "pB.ID": {"123"}, + "pB.Name": {"rob"}, + "pB.B.Extra": {"hello"}, + "priv.private": {"123"}, + "arrC[0].ID": {"5"}, + "arrC[0].Name": {"rob"}, + "arrC[0].B.Extra": {"foo"}, + "arrC[1].ID": {"8"}, + "arrC[1].Name": {"bill"}, + "m[a]": {"foo"}, + "m[b]": {"bar"}, + "m2[1]": {"foo"}, + "m2[2]": {"bar"}, + "m3[a]": {"1"}, + "m3[b]": {"2"}, + "m4[a].ID": {"1"}, + "m4[a].Name": {"foo"}, + "m4[b].ID": {"2"}, + "m4[b].Name": {"bar"}, + "mapWithAMuchLongerName[a].ID": {"1"}, + "mapWithAMuchLongerName[a].Name": {"foo"}, + "mapWithAMuchLongerName[b].ID": {"2"}, + "mapWithAMuchLongerName[b].Name": {"bar"}, + "invalidInt": {"xyz"}, + "invalidInt2": {""}, + "invalidBool": {"xyz"}, + "invalidArr": {"xyz"}, + "int8-overflow": {"1024"}, + "uint8-overflow": {"1024"}, + "arrDoS[2]": {"2"}, + "arrDoS[65535]": {"65535"}, + } + + testDate = time.Date(1982, time.July, 9, 0, 0, 0, 0, time.UTC) + testDatetime = time.Date(1982, time.July, 9, 21, 30, 0, 0, time.UTC) +) + +var binderTestCases = map[string]interface{}{ + "int": 1, + "int8": int8(1), + "int16": int16(1), + "int32": int32(1), + "int64": int64(1), + "uint": 1, + "uint8": uint8(1), + "uint16": uint16(1), + "uint32": uint32(1), + "uint64": uint64(1), + "float32": float32(1.0), + "float64": float64(1.0), + "str": "hello", + "bool-true": true, + "bool-1": true, + "bool-on": true, + "bool-false": false, + "bool-0": false, + "bool-0.0": false, + "bool-off": false, + "bool-f": false, + "date": testDate, + "datetime": testDatetime, + "customDate": testDate, + "arr": []int{1, 2, 0, 3}, + "uarr": []int{1, 2}, + "arruarr": [][]int{{1, 2}, {3, 4}}, + "2darr": [][]int{{0, 1}, {10, 11}}, + "A": A{ID: 123, Name: "rob"}, + "B": A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "pB": &A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "arrC": []A{ + { + ID: 5, + Name: "rob", + B: B{"foo"}, + }, + { + ID: 8, + Name: "bill", + }, + }, + "m": map[string]string{"a": "foo", "b": "bar"}, + "m2": map[int]string{1: "foo", 2: "bar"}, + "m3": map[string]int{"a": 1, "b": 2}, + "m4": map[string]A{"a": {ID: 1, Name: "foo"}, "b": {ID: 2, Name: "bar"}}, + + // NOTE: We also include a map with a longer name than the others since this has caused problems + // described in github issue #1285, resolved in pull request #1344. This test case should + // prevent regression. + "mapWithAMuchLongerName": map[string]A{"a": {ID: 1, Name: "foo"}, "b": {ID: 2, Name: "bar"}}, + + // TODO: Tests that use TypeBinders + + // Invalid value tests (the result should always be the zero value for that type) + // The point of these is to ensure that invalid user input does not cause panics. + "invalidInt": 0, + "invalidInt2": 0, + "invalidBool": true, + "invalidArr": []int{}, + "priv": A{}, + "int8-overflow": int8(0), + "uint8-overflow": uint8(0), + "arrDoS": []int{0, 0, 2}, +} + +// Types that files may be bound to, and a func that can read the content from +// that type. +// TODO: Is there any way to create a slice, given only the element Type? +var fileBindings = []struct{ val, arrval, f interface{} }{ + {(**os.File)(nil), []*os.File{}, ioutil.ReadAll}, + {(*[]byte)(nil), [][]byte{}, func(b []byte) []byte { return b }}, + {(*io.Reader)(nil), []io.Reader{}, ioutil.ReadAll}, + {(*io.ReadSeeker)(nil), []io.ReadSeeker{}, ioutil.ReadAll}, +} + +func TestJsonBinder(t *testing.T) { + // create a structure to be populated + { + d, _ := json.Marshal(map[string]int{"a": 1}) + params := &Params{JSON: d} + foo := struct{ A int }{} + c := NewTestController(nil, getMultipartRequest()) + + ParseParams(params, NewRequest(c.Request.In)) + actual := Bind(params, "test", reflect.TypeOf(foo)) + valEq(t, "TestJsonBinder", reflect.ValueOf(actual.Interface().(struct{ A int }).A), reflect.ValueOf(1)) + } + { + d, _ := json.Marshal(map[string]interface{}{"a": map[string]int{"b": 45}}) + params := &Params{JSON: d} + testMap := map[string]interface{}{} + actual := Bind(params, "test", reflect.TypeOf(testMap)).Interface().(map[string]interface{}) + if actual["a"].(map[string]interface{})["b"].(float64) != 45 { + t.Errorf("Failed to fetch map value %#v", actual["a"]) + } + // Check to see if a named map works + actualb := Bind(params, "test", reflect.TypeOf(map[string]map[string]float64{})).Interface().(map[string]map[string]float64) + if actualb["a"]["b"] != 45 { + t.Errorf("Failed to fetch map value %#v", actual["a"]) + } + + } +} + +func TestBinder(t *testing.T) { + // Reuse the mvc_test.go multipart request to test the binder. + params := &Params{} + c := NewTestController(nil, getMultipartRequest()) + if Config == nil { + Config = config.NewContext() + defer func() { + Config = nil + }() + } + ParseParams(params, NewRequest(c.Request.In)) + params.Values = ParamTestValues + + // Values + for k, v := range binderTestCases { + actual := Bind(params, k, reflect.TypeOf(v)) + expected := reflect.ValueOf(v) + valEq(t, k, actual, expected) + } + + // Files + + // Get the keys in sorted order to make the expectation right. + keys := []string{} + for k := range expectedFiles { + keys = append(keys, k) + } + sort.Strings(keys) + + expectedBoundFiles := make(map[string][]fh) + for _, k := range keys { + fhs := expectedFiles[k] + k := nextKey(k) + expectedBoundFiles[k] = append(expectedBoundFiles[k], fhs...) + } + + for k, fhs := range expectedBoundFiles { + + if len(fhs) == 1 { + // Test binding single files to: *os.File, []byte, io.Reader, io.ReadSeeker + for _, binding := range fileBindings { + typ := reflect.TypeOf(binding.val).Elem() + actual := Bind(params, k, typ) + if !actual.IsValid() || (actual.Kind() == reflect.Interface && actual.IsNil()) { + t.Errorf("%s (%s) - Returned nil.", k, typ) + continue + } + returns := reflect.ValueOf(binding.f).Call([]reflect.Value{actual}) + valEq(t, k, returns[0], reflect.ValueOf(fhs[0].content)) + } + + } else { + // Test binding multi to: + // []*os.File, [][]byte, []io.Reader, []io.ReadSeeker + for _, binding := range fileBindings { + typ := reflect.TypeOf(binding.arrval) + actual := Bind(params, k, typ) + if actual.Len() != len(fhs) { + t.Fatalf("%s (%s) - Number of files: (expected) %d != %d (actual)", + k, typ, len(fhs), actual.Len()) + } + for i := range fhs { + returns := reflect.ValueOf(binding.f).Call([]reflect.Value{actual.Index(i)}) + if !returns[0].IsValid() { + t.Errorf("%s (%s) - Returned nil.", k, typ) + continue + } + valEq(t, k, returns[0], reflect.ValueOf(fhs[i].content)) + } + } + } + } +} + +// Unbinding tests + +var unbinderTestCases = map[string]interface{}{ + "int": 1, + "int8": int8(1), + "int16": int16(1), + "int32": int32(1), + "int64": int64(1), + "uint": 1, + "uint8": uint8(1), + "uint16": uint16(1), + "uint32": uint32(1), + "uint64": uint64(1), + "float32": float32(1.0), + "float64": float64(1.0), + "str": "hello", + "bool-true": true, + "bool-false": false, + "date": testDate, + "datetime": testDatetime, + "arr": []int{1, 2, 0, 3}, + "2darr": [][]int{{0, 1}, {10, 11}}, + "A": A{ID: 123, Name: "rob"}, + "B": A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "pB": &A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "arrC": []A{ + { + ID: 5, + Name: "rob", + B: B{"foo"}, + }, + { + ID: 8, + Name: "bill", + }, + }, + "m": map[string]string{"a": "foo", "b": "bar"}, + "m2": map[int]string{1: "foo", 2: "bar"}, + "m3": map[string]int{"a": 1, "b": 2}, +} + +// Some of the unbinding results are not exactly what is in ParamTestValues, since it +// serializes implicit zero values explicitly. +var unbinderOverrideAnswers = map[string]map[string]string{ + "arr": { + "arr[0]": "1", + "arr[1]": "2", + "arr[2]": "0", + "arr[3]": "3", + }, + "A": { + "A.ID": "123", + "A.Name": "rob", + "A.B.Extra": "", + }, + "arrC": { + "arrC[0].ID": "5", + "arrC[0].Name": "rob", + "arrC[0].B.Extra": "foo", + "arrC[1].ID": "8", + "arrC[1].Name": "bill", + "arrC[1].B.Extra": "", + }, + "m": {"m[a]": "foo", "m[b]": "bar"}, + "m2": {"m2[1]": "foo", "m2[2]": "bar"}, + "m3": {"m3[a]": "1", "m3[b]": "2"}, +} + +func TestUnbinder(t *testing.T) { + for k, v := range unbinderTestCases { + actual := make(map[string]string) + Unbind(actual, k, v) + + // Get the expected key/values. + expected, ok := unbinderOverrideAnswers[k] + if !ok { + expected = make(map[string]string) + for k2, v2 := range ParamTestValues { + if k == k2 || strings.HasPrefix(k2, k+".") || strings.HasPrefix(k2, k+"[") { + expected[k2] = v2[0] + } + } + } + + // Compare length and values. + if len(actual) != len(expected) { + t.Errorf("Length mismatch\nExpected length %d, actual %d\nExpected: %s\nActual: %s", + len(expected), len(actual), expected, actual) + } + for k, v := range actual { + if expected[k] != v { + t.Errorf("Value mismatch.\nExpected: %s\nActual: %s", expected, actual) + } + } + } +} + +// Helpers + +func valEq(t *testing.T, name string, actual, expected reflect.Value) { + switch expected.Kind() { + case reflect.Slice: + // Check the type/length/element type + if !eq(t, name+" (type)", actual.Kind(), expected.Kind()) || + !eq(t, name+" (len)", actual.Len(), expected.Len()) || + !eq(t, name+" (elem)", actual.Type().Elem(), expected.Type().Elem()) { + return + } + + // Check value equality for each element. + for i := 0; i < actual.Len(); i++ { + valEq(t, fmt.Sprintf("%s[%d]", name, i), actual.Index(i), expected.Index(i)) + } + + case reflect.Ptr: + // Check equality on the element type. + valEq(t, name, actual.Elem(), expected.Elem()) + case reflect.Map: + if !eq(t, name+" (len)", actual.Len(), expected.Len()) { + return + } + for _, key := range expected.MapKeys() { + expectedValue := expected.MapIndex(key) + actualValue := actual.MapIndex(key) + if actualValue.IsValid() { + valEq(t, fmt.Sprintf("%s[%s]", name, key), actualValue, expectedValue) + } else { + t.Errorf("Expected key %s not found", key) + } + } + default: + eq(t, name, actual.Interface(), expected.Interface()) + } +} + +func init() { + DateFormat = DefaultDateFormat + DateTimeFormat = DefaultDateTimeFormat + TimeFormats = append(TimeFormats, DefaultDateFormat, DefaultDateTimeFormat, "01/02/2006") +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..8a9c96f68ce2feb7c3a8074f0a4e98e3ce09d509 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/pre_context.md @@ -0,0 +1,973 @@ +# Patch-overlapping Go context before the fix + +## `binder.go` (changed lines (216, 232)) + +```go +// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. +// Revel Framework source code and usage is governed by a MIT style +// license that can be found in the LICENSE file. + +package revel + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "os" + "reflect" + "strconv" + "strings" + "time" +) + +// A Binder translates between string parameters and Go data structures. +type Binder struct { + // Bind takes the name and type of the desired parameter and constructs it + // from one or more values from Params. + // + // Example + // + // Request: + // url?id=123&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=rob + // + // Action: + // Example.Action(id int, ol []int, ul []string, user User) + // + // Calls: + // Bind(params, "id", int): 123 + // Bind(params, "ol", []int): {1, 2} + // Bind(params, "ul", []string): {"str", "array"} + // Bind(params, "user", User): User{Name:"rob"} + // + // Note that only exported struct fields may be bound. + Bind func(params *Params, name string, typ reflect.Type) reflect.Value + + // Unbind serializes a given value to one or more URL parameters of the given + // name. + Unbind func(output map[string]string, name string, val interface{}) +} + +var binderLog = RevelLog.New("section", "binder") + +// ValueBinder is adapter for easily making one-key-value binders. +func ValueBinder(f func(value string, typ reflect.Type) reflect.Value) func(*Params, string, reflect.Type) reflect.Value { + return func(params *Params, name string, typ reflect.Type) reflect.Value { + vals, ok := params.Values[name] + if !ok || len(vals) == 0 { + return reflect.Zero(typ) + } + return f(vals[0], typ) + } +} + +// Revel's default date and time constants +const ( + DefaultDateFormat = "2006-01-02" + DefaultDateTimeFormat = "2006-01-02 15:04" +) + +// Binders type and kind definition +var ( + // These are the lookups to find a Binder for any type of data. + // The most specific binder found will be used (Type before Kind) + TypeBinders = make(map[reflect.Type]Binder) + KindBinders = make(map[reflect.Kind]Binder) + + // Applications can add custom time formats to this array, and they will be + // automatically attempted when binding a time.Time. + TimeFormats = []string{} + + DateFormat string + DateTimeFormat string + TimeZone = time.UTC + + IntBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + if len(val) == 0 { + return reflect.Zero(typ) + } + intValue, err := strconv.ParseInt(val, 10, 64) + if err != nil { + binderLog.Warn("IntBinder Conversion Error", "error", err) + return reflect.Zero(typ) + } + pValue := reflect.New(typ) + pValue.Elem().SetInt(intValue) + return pValue.Elem() + }), + Unbind: func(output map[string]string, key string, val interface{}) { + output[key] = fmt.Sprintf("%d", val) + }, + } + + UintBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + if len(val) == 0 { + return reflect.Zero(typ) + } + uintValue, err := strconv.ParseUint(val, 10, 64) + if err != nil { + binderLog.Warn("UintBinder Conversion Error", "error", err) + return reflect.Zero(typ) + } + pValue := reflect.New(typ) + pValue.Elem().SetUint(uintValue) + return pValue.Elem() + }), + Unbind: func(output map[string]string, key string, val interface{}) { + output[key] = fmt.Sprintf("%d", val) + }, + } + + FloatBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + if len(val) == 0 { + return reflect.Zero(typ) + } + floatValue, err := strconv.ParseFloat(val, 64) + if err != nil { + binderLog.Warn("FloatBinder Conversion Error", "error", err) + return reflect.Zero(typ) + } + pValue := reflect.New(typ) + pValue.Elem().SetFloat(floatValue) + return pValue.Elem() + }), + Unbind: func(output map[string]string, key string, val interface{}) { + output[key] = fmt.Sprintf("%f", val) + }, + } + + StringBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + return reflect.ValueOf(val) + }), + Unbind: func(output map[string]string, name string, val interface{}) { + output[name] = val.(string) + }, + } + + // Booleans support a various value formats, + // refer `revel.Atob` method. + BoolBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + return reflect.ValueOf(Atob(val)) + }), + Unbind: func(output map[string]string, name string, val interface{}) { + output[name] = fmt.Sprintf("%t", val) + }, + } + + PointerBinder = Binder{ + Bind: func(params *Params, name string, typ reflect.Type) reflect.Value { + v := Bind(params, name, typ.Elem()) + if v.CanAddr() { + return v.Addr() + } + + return v + }, + Unbind: func(output map[string]string, name string, val interface{}) { + Unbind(output, name, reflect.ValueOf(val).Elem().Interface()) + }, + } + + TimeBinder = Binder{ + Bind: ValueBinder(func(val string, typ reflect.Type) reflect.Value { + for _, f := range TimeFormats { + if r, err := time.ParseInLocation(f, val, TimeZone); err == nil { + return reflect.ValueOf(r) + } + } + return reflect.Zero(typ) + }), + Unbind: func(output map[string]string, name string, val interface{}) { + var ( + t = val.(time.Time) + format = DateTimeFormat + h, m, s = t.Clock() + ) + if h == 0 && m == 0 && s == 0 { + format = DateFormat + } + output[name] = t.Format(format) + }, + } + + MapBinder = Binder{ + Bind: bindMap, + Unbind: unbindMap, + } +) + +// Used to keep track of the index for individual keyvalues. +type sliceValue struct { + index int // Index extracted from brackets. If -1, no index was provided. + value reflect.Value // the bound value for this slice element. +} + +// This function creates a slice of the given type, Binds each of the individual +// elements, and then sets them to their appropriate location in the slice. +// If elements are provided without an explicit index, they are added (in +// unspecified order) to the end of the slice. +func bindSlice(params *Params, name string, typ reflect.Type) reflect.Value { + // Collect an array of slice elements with their indexes (and the max index). + maxIndex := -1 + numNoIndex := 0 + sliceValues := []sliceValue{} + + // Factor out the common slice logic (between form values and files). + processElement := func(key string, vals []string, files []*multipart.FileHeader) { + if !strings.HasPrefix(key, name+"[") { + return + } + + // Extract the index, and the index where a sub-key starts. (e.g. field[0].subkey) + index := -1 + leftBracket, rightBracket := len(name), strings.Index(key[len(name):], "]")+len(name) + if rightBracket > leftBracket+1 { + index, _ = strconv.Atoi(key[leftBracket+1 : rightBracket]) + } + subKeyIndex := rightBracket + 1 + + // Handle the indexed case. + if index > -1 { + if index > maxIndex { + maxIndex = index + } + sliceValues = append(sliceValues, sliceValue{ + index: index, + value: Bind(params, key[:subKeyIndex], typ.Elem()), + }) + return + } + + // It's an un-indexed element. (e.g. element[]) + numNoIndex += len(vals) + len(files) + for _, val := range vals { + // Unindexed values can only be direct-bound. + sliceValues = append(sliceValues, sliceValue{ + index: -1, + value: BindValue(val, typ.Elem()), + }) + } + + for _, fileHeader := range files { + sliceValues = append(sliceValues, sliceValue{ + index: -1, + value: BindFile(fileHeader, typ.Elem()), + }) + } + } + + for key, vals := range params.Values { + processElement(key, vals, nil) + } + for key, fileHeaders := range params.Files { + processElement(key, nil, fileHeaders) + } + + resultArray := reflect.MakeSlice(typ, maxIndex+1, maxIndex+1+numNoIndex) + for _, sv := range sliceValues { + if sv.index != -1 { + resultArray.Index(sv.index).Set(sv.value) + } else { + resultArray = reflect.Append(resultArray, sv.value) + } + } + + return resultArray +} + +// Break on dots and brackets. +// e.g. bar => "bar", bar.baz => "bar", bar[0] => "bar" +func nextKey(key string) string { + fieldLen := strings.IndexAny(key, ".[") + if fieldLen == -1 { + return key + } + return key[:fieldLen] +} + +func unbindSlice(output map[string]string, name string, val interface{}) { + v := reflect.ValueOf(val) + for i := 0; i < v.Len(); i++ { + Unbind(output, fmt.Sprintf("%s[%d]", name, i), v.Index(i).Interface()) + } +} + +func bindStruct(params *Params, name string, typ reflect.Type) reflect.Value { + resultPointer := reflect.New(typ) + result := resultPointer.Elem() + if params.JSON != nil { + // Try to inject the response as a json into the created result + if err := json.Unmarshal(params.JSON, resultPointer.Interface()); err != nil { + binderLog.Error("bindStruct Unable to unmarshal request", "name", name, "error", err, "data", string(params.JSON)) + } + return result + } + fieldValues := make(map[string]reflect.Value) + for key := range params.Values { + if !strings.HasPrefix(key, name+".") { + continue + } + + // Get the name of the struct property. + // Strip off the prefix. e.g. foo.bar.baz => bar.baz + suffix := key[len(name)+1:] + fieldName := nextKey(suffix) + fieldLen := len(fieldName) + + if _, ok := fieldValues[fieldName]; !ok { + // Time to bind this field. Get it and make sure we can set it. + fieldValue := result.FieldByName(fieldName) + if !fieldValue.IsValid() { + binderLog.Warn("bindStruct Field not found", "name", fieldName) + continue + } + if !fieldValue.CanSet() { + binderLog.Warn("bindStruct Field not settable", "name", fieldName) + continue + } + boundVal := Bind(params, key[:len(name)+1+fieldLen], fieldValue.Type()) + fieldValue.Set(boundVal) + fieldValues[fieldName] = boundVal + } + } + + return result +} + +func unbindStruct(output map[string]string, name string, iface interface{}) { + val := reflect.ValueOf(iface) + typ := val.Type() + for i := 0; i < val.NumField(); i++ { + structField := typ.Field(i) + fieldValue := val.Field(i) + + // PkgPath is specified to be empty exactly for exported fields. + if structField.PkgPath == "" { + Unbind(output, fmt.Sprintf("%s.%s", name, structField.Name), fieldValue.Interface()) + } + } +} + +// Helper that returns an upload of the given name, or nil. +func getMultipartFile(params *Params, name string) multipart.File { + for _, fileHeader := range params.Files[name] { + file, err := fileHeader.Open() + if err == nil { + return file + } + binderLog.Warn("getMultipartFile: Failed to open uploaded file", "name", name, "error", err) + } + return nil +} + +func bindFile(params *Params, name string, typ reflect.Type) reflect.Value { + reader := getMultipartFile(params, name) + if reader == nil { + return reflect.Zero(typ) + } + + // If it's already stored in a temp file, just return that. + if osFile, ok := reader.(*os.File); ok { + return reflect.ValueOf(osFile) + } + + // Otherwise, have to store it. + tmpFile, err := ioutil.TempFile("", "revel-upload") + if err != nil { + binderLog.Warn("bindFile: Failed to create a temp file to store upload", "name", name, "error", err) + return reflect.Zero(typ) + } + + // Register it to be deleted after the request is done. + params.tmpFiles = append(params.tmpFiles, tmpFile) + + _, err = io.Copy(tmpFile, reader) + if err != nil { + binderLog.Warn("bindFile: Failed to copy upload to temp file", "name", name, "error", err) + return reflect.Zero(typ) + } + + _, err = tmpFile.Seek(0, 0) + if err != nil { + binderLog.Warn("bindFile: Failed to seek to beginning of temp file", "name", name, "error", err) + return reflect.Zero(typ) + } + + return reflect.ValueOf(tmpFile) +} + +func bindByteArray(params *Params, name string, typ reflect.Type) reflect.Value { + if reader := getMultipartFile(params, name); reader != nil { + b, err := ioutil.ReadAll(reader) + if err == nil { + return reflect.ValueOf(b) + } + binderLog.Warn("bindByteArray: Error reading uploaded file contents", "name", name, "error", err) + } + return reflect.Zero(typ) +} + +func bindReadSeeker(params *Params, name string, typ reflect.Type) reflect.Value { + if reader := getMultipartFile(params, name); reader != nil { + return reflect.ValueOf(reader.(io.ReadSeeker)) + } + return reflect.Zero(typ) +} + +// bindMap converts parameters using map syntax into the corresponding map. e.g.: +// params["a[5]"]=foo, name="a", typ=map[int]string => map[int]string{5: "foo"} +func bindMap(params *Params, name string, typ reflect.Type) reflect.Value { + var ( + keyType = typ.Key() + valueType = typ.Elem() + resultPtr = reflect.New(reflect.MapOf(keyType, valueType)) + result = resultPtr.Elem() + ) + result.Set(reflect.MakeMap(typ)) + if params.JSON != nil { + // Try to inject the response as a json into the created result + if err := json.Unmarshal(params.JSON, resultPtr.Interface()); err != nil { + binderLog.Warn("bindMap: Unable to unmarshal request", "name", name, "error", err) + } + return result + } + + for paramName := range params.Values { + // The paramName string must start with the value in the "name" parameter, + // otherwise there is no way the parameter is part of the map + if !strings.HasPrefix(paramName, name) { + continue + } + + suffix := paramName[len(name)+1:] + fieldName := nextKey(suffix) + if fieldName != "" { + fieldName = fieldName[:len(fieldName)-1] + } + if !strings.HasPrefix(paramName, name+"["+fieldName+"]") { + continue + } + + result.SetMapIndex(BindValue(fieldName, keyType), Bind(params, name+"["+fieldName+"]", valueType)) + } + return result +} + +func unbindMap(output map[string]string, name string, iface interface{}) { + mapValue := reflect.ValueOf(iface) + for _, key := range mapValue.MapKeys() { + Unbind(output, name+"["+fmt.Sprintf("%v", key.Interface())+"]", + mapValue.MapIndex(key).Interface()) + } +} + +// Bind takes the name and type of the desired parameter and constructs it +// from one or more values from Params. +// Returns the zero value of the type upon any sort of failure. +func Bind(params *Params, name string, typ reflect.Type) reflect.Value { + if binder, found := binderForType(typ); found { + return binder.Bind(params, name, typ) + } + return reflect.Zero(typ) +} + +func BindValue(val string, typ reflect.Type) reflect.Value { + return Bind(&Params{Values: map[string][]string{"": {val}}}, "", typ) +} + +func BindFile(fileHeader *multipart.FileHeader, typ reflect.Type) reflect.Value { + return Bind(&Params{Files: map[string][]*multipart.FileHeader{"": {fileHeader}}}, "", typ) +} + +func Unbind(output map[string]string, name string, val interface{}) { + if binder, found := binderForType(reflect.TypeOf(val)); found { + if binder.Unbind != nil { + binder.Unbind(output, name, val) + } else { + binderLog.Error("Unbind: Unable to unmarshal request", "name", name, "value", val) + } + } +} + +func binderForType(typ reflect.Type) (Binder, bool) { + binder, ok := TypeBinders[typ] + if !ok { + binder, ok = KindBinders[typ.Kind()] + if !ok { + binderLog.Error("binderForType: no binder for type", "type", typ) + return Binder{}, false + } + } + return binder, true +} + +// Sadly, the binder lookups can not be declared initialized -- that results in +// an "initialization loop" compile error. +func init() { + KindBinders[reflect.Int] = IntBinder + KindBinders[reflect.Int8] = IntBinder + KindBinders[reflect.Int16] = IntBinder + KindBinders[reflect.Int32] = IntBinder + KindBinders[reflect.Int64] = IntBinder + + KindBinders[reflect.Uint] = UintBinder + KindBinders[reflect.Uint8] = UintBinder + KindBinders[reflect.Uint16] = UintBinder + KindBinders[reflect.Uint32] = UintBinder + KindBinders[reflect.Uint64] = UintBinder + + KindBinders[reflect.Float32] = FloatBinder + KindBinders[reflect.Float64] = FloatBinder + + KindBinders[reflect.String] = StringBinder + KindBinders[reflect.Bool] = BoolBinder + KindBinders[reflect.Slice] = Binder{bindSlice, unbindSlice} + KindBinders[reflect.Struct] = Binder{bindStruct, unbindStruct} + KindBinders[reflect.Ptr] = PointerBinder + KindBinders[reflect.Map] = MapBinder + + TypeBinders[reflect.TypeOf(time.Time{})] = TimeBinder + + // Uploads + TypeBinders[reflect.TypeOf(&os.File{})] = Binder{bindFile, nil} + TypeBinders[reflect.TypeOf([]byte{})] = Binder{bindByteArray, nil} + TypeBinders[reflect.TypeOf((*io.Reader)(nil)).Elem()] = Binder{bindReadSeeker, nil} + TypeBinders[reflect.TypeOf((*io.ReadSeeker)(nil)).Elem()] = Binder{bindReadSeeker, nil} + + OnAppStart(func() { + DateTimeFormat = Config.StringDefault("format.datetime", DefaultDateTimeFormat) + DateFormat = Config.StringDefault("format.date", DefaultDateFormat) + TimeFormats = append(TimeFormats, DateTimeFormat, DateFormat) + }) +} +``` + +## `binder_test.go` (changed lines (10, 101, 171, 216)) + +```go +// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. +// Revel Framework source code and usage is governed by a MIT style +// license that can be found in the LICENSE file. + +package revel + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "os" + "reflect" + "sort" + "strings" + "testing" + "time" +) + +type A struct { + ID int + Name string + B B + private int +} + +type B struct { + Extra string +} + +var ( + ParamTestValues = map[string][]string{ + "int": {"1"}, + "int8": {"1"}, + "int16": {"1"}, + "int32": {"1"}, + "int64": {"1"}, + "uint": {"1"}, + "uint8": {"1"}, + "uint16": {"1"}, + "uint32": {"1"}, + "uint64": {"1"}, + "float32": {"1.000000"}, + "float64": {"1.000000"}, + "str": {"hello"}, + "bool-true": {"true"}, + "bool-1": {"1"}, + "bool-on": {"on"}, + "bool-false": {"false"}, + "bool-0": {"0"}, + "bool-0.0": {"0.0"}, + "bool-off": {"off"}, + "bool-f": {"f"}, + "date": {"1982-07-09"}, + "datetime": {"1982-07-09 21:30"}, + "customDate": {"07/09/1982"}, + "arr[0]": {"1"}, + "arr[1]": {"2"}, + "arr[3]": {"3"}, + "uarr[]": {"1", "2"}, + "arruarr[0][]": {"1", "2"}, + "arruarr[1][]": {"3", "4"}, + "2darr[0][0]": {"0"}, + "2darr[0][1]": {"1"}, + "2darr[1][0]": {"10"}, + "2darr[1][1]": {"11"}, + "A.ID": {"123"}, + "A.Name": {"rob"}, + "B.ID": {"123"}, + "B.Name": {"rob"}, + "B.B.Extra": {"hello"}, + "pB.ID": {"123"}, + "pB.Name": {"rob"}, + "pB.B.Extra": {"hello"}, + "priv.private": {"123"}, + "arrC[0].ID": {"5"}, + "arrC[0].Name": {"rob"}, + "arrC[0].B.Extra": {"foo"}, + "arrC[1].ID": {"8"}, + "arrC[1].Name": {"bill"}, + "m[a]": {"foo"}, + "m[b]": {"bar"}, + "m2[1]": {"foo"}, + "m2[2]": {"bar"}, + "m3[a]": {"1"}, + "m3[b]": {"2"}, + "m4[a].ID": {"1"}, + "m4[a].Name": {"foo"}, + "m4[b].ID": {"2"}, + "m4[b].Name": {"bar"}, + "mapWithAMuchLongerName[a].ID": {"1"}, + "mapWithAMuchLongerName[a].Name": {"foo"}, + "mapWithAMuchLongerName[b].ID": {"2"}, + "mapWithAMuchLongerName[b].Name": {"bar"}, + "invalidInt": {"xyz"}, + "invalidInt2": {""}, + "invalidBool": {"xyz"}, + "invalidArr": {"xyz"}, + "int8-overflow": {"1024"}, + "uint8-overflow": {"1024"}, + } + + testDate = time.Date(1982, time.July, 9, 0, 0, 0, 0, time.UTC) + testDatetime = time.Date(1982, time.July, 9, 21, 30, 0, 0, time.UTC) +) + +var binderTestCases = map[string]interface{}{ + "int": 1, + "int8": int8(1), + "int16": int16(1), + "int32": int32(1), + "int64": int64(1), + "uint": 1, + "uint8": uint8(1), + "uint16": uint16(1), + "uint32": uint32(1), + "uint64": uint64(1), + "float32": float32(1.0), + "float64": float64(1.0), + "str": "hello", + "bool-true": true, + "bool-1": true, + "bool-on": true, + "bool-false": false, + "bool-0": false, + "bool-0.0": false, + "bool-off": false, + "bool-f": false, + "date": testDate, + "datetime": testDatetime, + "customDate": testDate, + "arr": []int{1, 2, 0, 3}, + "uarr": []int{1, 2}, + "arruarr": [][]int{{1, 2}, {3, 4}}, + "2darr": [][]int{{0, 1}, {10, 11}}, + "A": A{ID: 123, Name: "rob"}, + "B": A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "pB": &A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "arrC": []A{ + { + ID: 5, + Name: "rob", + B: B{"foo"}, + }, + { + ID: 8, + Name: "bill", + }, + }, + "m": map[string]string{"a": "foo", "b": "bar"}, + "m2": map[int]string{1: "foo", 2: "bar"}, + "m3": map[string]int{"a": 1, "b": 2}, + "m4": map[string]A{"a": {ID: 1, Name: "foo"}, "b": {ID: 2, Name: "bar"}}, + + // NOTE: We also include a map with a longer name than the others since this has caused problems + // described in github issue #1285, resolved in pull request #1344. This test case should + // prevent regression. + "mapWithAMuchLongerName": map[string]A{"a": {ID: 1, Name: "foo"}, "b": {ID: 2, Name: "bar"}}, + + // TODO: Tests that use TypeBinders + + // Invalid value tests (the result should always be the zero value for that type) + // The point of these is to ensure that invalid user input does not cause panics. + "invalidInt": 0, + "invalidInt2": 0, + "invalidBool": true, + "invalidArr": []int{}, + "priv": A{}, + "int8-overflow": int8(0), + "uint8-overflow": uint8(0), +} + +// Types that files may be bound to, and a func that can read the content from +// that type. +// TODO: Is there any way to create a slice, given only the element Type? +var fileBindings = []struct{ val, arrval, f interface{} }{ + {(**os.File)(nil), []*os.File{}, ioutil.ReadAll}, + {(*[]byte)(nil), [][]byte{}, func(b []byte) []byte { return b }}, + {(*io.Reader)(nil), []io.Reader{}, ioutil.ReadAll}, + {(*io.ReadSeeker)(nil), []io.ReadSeeker{}, ioutil.ReadAll}, +} + +func TestJsonBinder(t *testing.T) { + // create a structure to be populated + { + d, _ := json.Marshal(map[string]int{"a": 1}) + params := &Params{JSON: d} + foo := struct{ A int }{} + c := NewTestController(nil, getMultipartRequest()) + + ParseParams(params, NewRequest(c.Request.In)) + actual := Bind(params, "test", reflect.TypeOf(foo)) + valEq(t, "TestJsonBinder", reflect.ValueOf(actual.Interface().(struct{ A int }).A), reflect.ValueOf(1)) + } + { + d, _ := json.Marshal(map[string]interface{}{"a": map[string]int{"b": 45}}) + params := &Params{JSON: d} + testMap := map[string]interface{}{} + actual := Bind(params, "test", reflect.TypeOf(testMap)).Interface().(map[string]interface{}) + if actual["a"].(map[string]interface{})["b"].(float64) != 45 { + t.Errorf("Failed to fetch map value %#v", actual["a"]) + } + // Check to see if a named map works + actualb := Bind(params, "test", reflect.TypeOf(map[string]map[string]float64{})).Interface().(map[string]map[string]float64) + if actualb["a"]["b"] != 45 { + t.Errorf("Failed to fetch map value %#v", actual["a"]) + } + + } +} + +func TestBinder(t *testing.T) { + // Reuse the mvc_test.go multipart request to test the binder. + params := &Params{} + c := NewTestController(nil, getMultipartRequest()) + ParseParams(params, NewRequest(c.Request.In)) + params.Values = ParamTestValues + + // Values + for k, v := range binderTestCases { + actual := Bind(params, k, reflect.TypeOf(v)) + expected := reflect.ValueOf(v) + valEq(t, k, actual, expected) + } + + // Files + + // Get the keys in sorted order to make the expectation right. + keys := []string{} + for k := range expectedFiles { + keys = append(keys, k) + } + sort.Strings(keys) + + expectedBoundFiles := make(map[string][]fh) + for _, k := range keys { + fhs := expectedFiles[k] + k := nextKey(k) + expectedBoundFiles[k] = append(expectedBoundFiles[k], fhs...) + } + + for k, fhs := range expectedBoundFiles { + + if len(fhs) == 1 { + // Test binding single files to: *os.File, []byte, io.Reader, io.ReadSeeker + for _, binding := range fileBindings { + typ := reflect.TypeOf(binding.val).Elem() + actual := Bind(params, k, typ) + if !actual.IsValid() || (actual.Kind() == reflect.Interface && actual.IsNil()) { + t.Errorf("%s (%s) - Returned nil.", k, typ) + continue + } + returns := reflect.ValueOf(binding.f).Call([]reflect.Value{actual}) + valEq(t, k, returns[0], reflect.ValueOf(fhs[0].content)) + } + + } else { + // Test binding multi to: + // []*os.File, [][]byte, []io.Reader, []io.ReadSeeker + for _, binding := range fileBindings { + typ := reflect.TypeOf(binding.arrval) + actual := Bind(params, k, typ) + if actual.Len() != len(fhs) { + t.Fatalf("%s (%s) - Number of files: (expected) %d != %d (actual)", + k, typ, len(fhs), actual.Len()) + } + for i := range fhs { + returns := reflect.ValueOf(binding.f).Call([]reflect.Value{actual.Index(i)}) + if !returns[0].IsValid() { + t.Errorf("%s (%s) - Returned nil.", k, typ) + continue + } + valEq(t, k, returns[0], reflect.ValueOf(fhs[i].content)) + } + } + } + } +} + +// Unbinding tests + +var unbinderTestCases = map[string]interface{}{ + "int": 1, + "int8": int8(1), + "int16": int16(1), + "int32": int32(1), + "int64": int64(1), + "uint": 1, + "uint8": uint8(1), + "uint16": uint16(1), + "uint32": uint32(1), + "uint64": uint64(1), + "float32": float32(1.0), + "float64": float64(1.0), + "str": "hello", + "bool-true": true, + "bool-false": false, + "date": testDate, + "datetime": testDatetime, + "arr": []int{1, 2, 0, 3}, + "2darr": [][]int{{0, 1}, {10, 11}}, + "A": A{ID: 123, Name: "rob"}, + "B": A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "pB": &A{ID: 123, Name: "rob", B: B{Extra: "hello"}}, + "arrC": []A{ + { + ID: 5, + Name: "rob", + B: B{"foo"}, + }, + { + ID: 8, + Name: "bill", + }, + }, + "m": map[string]string{"a": "foo", "b": "bar"}, + "m2": map[int]string{1: "foo", 2: "bar"}, + "m3": map[string]int{"a": 1, "b": 2}, +} + +// Some of the unbinding results are not exactly what is in ParamTestValues, since it +// serializes implicit zero values explicitly. +var unbinderOverrideAnswers = map[string]map[string]string{ + "arr": { + "arr[0]": "1", + "arr[1]": "2", + "arr[2]": "0", + "arr[3]": "3", + }, + "A": { + "A.ID": "123", + "A.Name": "rob", + "A.B.Extra": "", + }, + "arrC": { + "arrC[0].ID": "5", + "arrC[0].Name": "rob", + "arrC[0].B.Extra": "foo", + "arrC[1].ID": "8", + "arrC[1].Name": "bill", + "arrC[1].B.Extra": "", + }, + "m": {"m[a]": "foo", "m[b]": "bar"}, + "m2": {"m2[1]": "foo", "m2[2]": "bar"}, + "m3": {"m3[a]": "1", "m3[b]": "2"}, +} + +func TestUnbinder(t *testing.T) { + for k, v := range unbinderTestCases { + actual := make(map[string]string) + Unbind(actual, k, v) + + // Get the expected key/values. + expected, ok := unbinderOverrideAnswers[k] + if !ok { + expected = make(map[string]string) + for k2, v2 := range ParamTestValues { + if k == k2 || strings.HasPrefix(k2, k+".") || strings.HasPrefix(k2, k+"[") { + expected[k2] = v2[0] + } + } + } + + // Compare length and values. + if len(actual) != len(expected) { + t.Errorf("Length mismatch\nExpected length %d, actual %d\nExpected: %s\nActual: %s", + len(expected), len(actual), expected, actual) + } + for k, v := range actual { + if expected[k] != v { + t.Errorf("Value mismatch.\nExpected: %s\nActual: %s", expected, actual) + } + } + } +} + +// Helpers + +func valEq(t *testing.T, name string, actual, expected reflect.Value) { + switch expected.Kind() { + case reflect.Slice: + // Check the type/length/element type + if !eq(t, name+" (type)", actual.Kind(), expected.Kind()) || + !eq(t, name+" (len)", actual.Len(), expected.Len()) || + !eq(t, name+" (elem)", actual.Type().Elem(), expected.Type().Elem()) { + return + } + + // Check value equality for each element. + for i := 0; i < actual.Len(); i++ { + valEq(t, fmt.Sprintf("%s[%d]", name, i), actual.Index(i), expected.Index(i)) + } + + case reflect.Ptr: + // Check equality on the element type. + valEq(t, name, actual.Elem(), expected.Elem()) + case reflect.Map: + if !eq(t, name+" (len)", actual.Len(), expected.Len()) { + return + } + for _, key := range expected.MapKeys() { + expectedValue := expected.MapIndex(key) + actualValue := actual.MapIndex(key) + if actualValue.IsValid() { + valEq(t, fmt.Sprintf("%s[%s]", name, key), actualValue, expectedValue) + } else { + t.Errorf("Expected key %s not found", key) + } + } + default: + eq(t, name, actual.Interface(), expected.Interface()) + } +} + +func init() { + DateFormat = DefaultDateFormat + DateTimeFormat = DefaultDateTimeFormat + TimeFormats = append(TimeFormats, DefaultDateFormat, DefaultDateTimeFormat, "01/02/2006") +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/task.json new file mode 100644 index 0000000000000000000000000000000000000000..d69be378a613a4e04baa11f8da186afcf8b2f2a1 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-6e40429ff01c5ab8b71b", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-6e40429ff01c5ab8b71b", + "project_id": "morefixes__revel__revel", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "binder.go", + "binder_test.go" + ], + "patch_units": { + "before": [ + "binder.go", + "binder_test.go" + ], + "after": [ + "binder.go", + "binder_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/5852ceea00f3d59d049d8512ccda7dfce1718f1db54553e9282ced8fd973f560/database", + "cache_key": "5852ceea00f3d59d049d8512ccda7dfce1718f1db54553e9282ced8fd973f560", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/ebfd28a049c5fa8068d83ff17ce8b06a4368e32746caf4ebe7d308fd58e6a10b/database", + "cache_key": "ebfd28a049c5fa8068d83ff17ce8b06a4368e32746caf4ebe7d308fd58e6a10b", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/863d8c2e06cd34b15733425f1127a6c63feeca211a769e94856675490f024d84/database", + "cache_key": "863d8c2e06cd34b15733425f1127a6c63feeca211a769e94856675490f024d84", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-6e40429ff01c5ab8b71b/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-6e40429ff01c5ab8b71b/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-6e40429ff01c5ab8b71b/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..081e65a9ef08a0fdc70af84c9814778d9d5de213 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/patch.diff @@ -0,0 +1,179 @@ +diff --git a/cli/brook/main.go b/cli/brook/main.go +index f69b992..b3e7a61 100644 +--- a/cli/brook/main.go ++++ b/cli/brook/main.go +@@ -975,7 +975,7 @@ func main() { + if err != nil { + return err + } +- s, err := brook.NewQUICServer(":"+p, c.String("password"), h, c.Int("tcpTimeout"), c.Int("udpTimeout"), c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.Int64("updateListInterval"), c.StringSlice("blockGeoIP"), c.Bool("withoutBrookProtocol")) ++ s, err := brook.NewQUICServer(":"+p, c.String("password"), h, c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } +@@ -1437,7 +1437,7 @@ func main() { + }, + &cli.BoolFlag{ + Name: "enableIPv6", +- Usage: "Your local and server must support IPv6 both", ++ Usage: "deprecated", + }, + &cli.BoolFlag{ + Name: "doNotRunScripts", +@@ -1514,7 +1514,55 @@ func main() { + lock := &sync.Mutex{} + m := http.NewServeMux() + m.Handle("/", http.FileServer(http.FS(web))) ++ m.HandleFunc("/hasp", func(w http.ResponseWriter, r *http.Request) { ++ lock.Lock() ++ defer lock.Unlock() ++ _, err := os.Stat("/tmp/.brook.web.password") ++ if os.IsNotExist(err) { ++ w.Write([]byte("no")) ++ return ++ } ++ w.Write([]byte("yes")) ++ }) ++ m.HandleFunc("/setp", func(w http.ResponseWriter, r *http.Request) { ++ lock.Lock() ++ defer lock.Unlock() ++ _, err := os.Stat("/tmp/.brook.web.password") ++ if !os.IsNotExist(err) { ++ http.Error(w, "file exsits", 500) ++ return ++ } ++ err = ioutil.WriteFile("/tmp/.brook.web.password", []byte(r.FormValue("p")), 0600) ++ if err != nil { ++ http.Error(w, err.Error(), 500) ++ return ++ } ++ w.WriteHeader(200) ++ }) ++ m.HandleFunc("/authp", func(w http.ResponseWriter, r *http.Request) { ++ lock.Lock() ++ defer lock.Unlock() ++ b, err := ioutil.ReadFile("/tmp/.brook.web.password") ++ if err != nil { ++ http.Error(w, err.Error(), 500) ++ return ++ } ++ if string(b) != r.FormValue("p") { ++ http.Error(w, "web ui password wrong", 500) ++ return ++ } ++ w.WriteHeader(200) ++ }) + m.HandleFunc("/start", func(w http.ResponseWriter, r *http.Request) { ++ b, err := ioutil.ReadFile("/root/.brook.web.password") ++ if err != nil { ++ http.Error(w, err.Error(), 500) ++ return ++ } ++ if string(b) != r.FormValue("p") { ++ http.Error(w, "web ui password wrong", 500) ++ return ++ } + s, err := os.Executable() + if err != nil { + http.Error(w, err.Error(), 500) +@@ -1523,7 +1571,6 @@ func main() { + lock.Lock() + defer lock.Unlock() + cmd = exec.Command("/bin/sh", "-c", s+" tproxy "+r.FormValue("args")) +- log.Println(s + " tproxy " + r.FormValue("args")) + done := make(chan byte) + defer close(done) + errch := make(chan error) +@@ -1552,6 +1599,15 @@ func main() { + } + }) + m.HandleFunc("/stop", func(w http.ResponseWriter, r *http.Request) { ++ b, err := ioutil.ReadFile("/root/.brook.web.password") ++ if err != nil { ++ http.Error(w, err.Error(), 500) ++ return ++ } ++ if string(b) != r.FormValue("p") { ++ http.Error(w, "web ui password wrong", 500) ++ return ++ } + lock.Lock() + defer lock.Unlock() + if cmd == nil { +@@ -1565,6 +1621,15 @@ func main() { + w.Write([]byte("disconnected")) + }) + m.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) { ++ b, err := ioutil.ReadFile("/tmp/.brook.web.password") ++ if err != nil { ++ http.Error(w, err.Error(), 500) ++ return ++ } ++ if string(b) != r.FormValue("p") { ++ http.Error(w, "web ui password wrong", 500) ++ return ++ } + lock.Lock() + defer lock.Unlock() + if cmd == nil { +diff --git a/quicserver.go b/quicserver.go +index 9dfbbf2..9992e10 100644 +--- a/quicserver.go ++++ b/quicserver.go +@@ -45,7 +45,7 @@ type QUICServer struct { + UDPServerConnFactory UDPServerConnFactory + } + +-func NewQUICServer(addr, password, domain string, tcpTimeout, udpTimeout int, blockDomainList, blockCIDR4List, blockCIDR6List string, updateListInterval int64, blockGeoIP []string, withoutbrook bool) (*QUICServer, error) { ++func NewQUICServer(addr, password, domain string, tcpTimeout, udpTimeout int, withoutbrook bool) (*QUICServer, error) { + if err := limits.Raise(); err != nil { + Log(&Error{"when": "try to raise system limits", "warning": err.Error()}) + } +diff --git a/streamclient.go b/streamclient.go +index 76165eb..dc971fe 100644 +--- a/streamclient.go ++++ b/streamclient.go +@@ -94,7 +94,7 @@ func NewStreamClient(network string, password []byte, src string, server net.Con + } + binary.BigEndian.PutUint32(c.WB[2+16:2+16+4], uint32(i)) + copy(c.WB[2+16+4:2+16+4+len(dst)], dst) +- if err := c.WriteL(4 + len(dst)); err != nil { ++ if err := c.Write(4 + len(dst)); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + return nil, err +@@ -150,7 +150,7 @@ func (c *StreamClient) Exchange(local net.Conn) error { + return + } + } +- l, err := c.ReadL() ++ l, err := c.Read() + if err != nil { + return + } +@@ -169,14 +169,14 @@ func (c *StreamClient) Exchange(local net.Conn) error { + if err != nil { + return nil + } +- if err := c.WriteL(l); err != nil { ++ if err := c.Write(l); err != nil { + return nil + } + } + return nil + } + +-func (c *StreamClient) WriteL(l int) error { ++func (c *StreamClient) Write(l int) error { + binary.BigEndian.PutUint16(c.WB[:2], uint16(l)) + c.ca.Seal(c.WB[:0], c.cn, c.WB[:2], nil) + NextNonce(c.cn) +@@ -188,7 +188,7 @@ func (c *StreamClient) WriteL(l int) error { + return nil + } + +-func (c *StreamClient) ReadL() (int, error) { ++func (c *StreamClient) Read() (int, error) { + if _, err := io.ReadFull(c.Server, c.RB[:2+16]); err != nil { + return 0, err + } diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..142299a21b16b47731107ee3392e64e9ece36485 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/post_context.md @@ -0,0 +1,3128 @@ +# Patch-overlapping Go context after the fix + +## `cli/brook/main.go` (changed lines (978, 1440, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1574, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632)) + +```go +// Copyright (c) 2016-present Cloud +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 3 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package main + +import ( + "context" + "crypto/x509" + "errors" + "fmt" + "io/fs" + "io/ioutil" + "log" + "net" + "os" + "os/exec" + "os/signal" + "path/filepath" + "runtime" + "strings" + "sync" + "syscall" + "time" + + "net/http" + "net/url" + + "github.com/txthinking/brook" + "github.com/txthinking/brook/plugins/block" + "github.com/txthinking/brook/plugins/pprof" + "github.com/txthinking/brook/plugins/socks5dial" + "github.com/txthinking/brook/plugins/thedns" + "github.com/txthinking/brook/plugins/tproxy" + "github.com/txthinking/runnergroup" + "github.com/txthinking/socks5" + "github.com/urfave/cli/v2" +) + +func main() { + g := runnergroup.New() + app := cli.NewApp() + app.Name = "Brook" + app.Version = "20230122.Beta.20230214" + app.Usage = "A cross-platform network tool designed for developers" + app.Authors = []*cli.Author{ + { + Name: "Cloud", + Email: "cloud@txthinking.com", + }, + } + app.Copyright = "https://github.com/txthinking/brook" + app.EnableBashCompletion = true + app.Flags = []cli.Flag{ + &cli.StringFlag{ + Name: "pprof", + Usage: "go http pprof listen addr, such as :6060", + }, + } + app.Before = func(c *cli.Context) error { + if c.String("pprof") != "" { + p, err := pprof.NewPprof(c.String("pprof")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return p.ListenAndServe() + }, + Stop: func() error { + return p.Shutdown() + }, + }) + } + return nil + } + app.Commands = []*cli.Command{ + &cli.Command{ + Name: "server", + Usage: "Run as brook server, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: ':9999'", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + &cli.StringFlag{ + Name: "toSocks5", + Usage: "Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "toSocks5Username", + Usage: "Forward to socks5 server, username", + }, + &cli.StringFlag{ + Name: "toSocks5Password", + Usage: "Forward to socks5 server, password", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + s, err := brook.NewServer(c.String("listen"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + if c.String("toSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("toSocks5"), c.String("toSocks5Username"), c.String("toSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "client", + Usage: "Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "Brook server address, like: 1.2.3.4:9999", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook server password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "UDP over TCP", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("server") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewClient(c.String("socks5"), ip, c.String("server"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.UDPOverTCP = c.Bool("udpovertcp") + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + go func() { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + <-sigs + g.Done() + }() + return g.Wait() + }, + }, + &cli.Command{ + Name: "wsserver", + Usage: "Run as brook wsserver, both TCP and UDP, it will start a standard http server and websocket server", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: ':80'", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.StringFlag{ + Name: "path", + Usage: "URL path", + Value: "/ws", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + &cli.StringFlag{ + Name: "toSocks5", + Usage: "Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "toSocks5Username", + Usage: "Forward to socks5 server, username", + }, + &cli.StringFlag{ + Name: "toSocks5Password", + Usage: "Forward to socks5 server, password", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + if c.String("toSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("toSocks5"), c.String("toSocks5Username"), c.String("toSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + s, err := brook.NewWSServer(c.String("listen"), c.String("password"), "", c.String("path"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "wsclient", + Usage: "Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wsclient <-> $ brook wsserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "wsserver", + Aliases: []string{"s"}, + Usage: "Brook wsserver address, like: ws://1.2.3.4:80, if no path then /ws will be used. Do not omit the port under any circumstances", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook wsserver password", + }, + &cli.StringFlag{ + Name: "address", + Usage: "Specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("wsserver") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewWSClient(c.String("socks5"), ip, c.String("wsserver"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("address") != "" { + s.ServerAddress = c.String("address") + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "wssserver", + Usage: "Run as brook wssserver, both TCP and UDP, it will start a standard https server and websocket server", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "domainaddress", + Usage: "Such as: domain.com:443. If you choose to automatically issue certificates, the domain must have been resolved to the server IP and 80 port also will be used", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.StringFlag{ + Name: "cert", + Usage: "The cert file absolute path for the domain, such as /path/to/cert.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.StringFlag{ + Name: "certkey", + Usage: "The cert key file absolute path for the domain, such as /path/to/certkey.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.StringFlag{ + Name: "path", + Usage: "URL path", + Value: "/ws", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + &cli.StringFlag{ + Name: "toSocks5", + Usage: "Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "toSocks5Username", + Usage: "Forward to socks5 server, username", + }, + &cli.StringFlag{ + Name: "toSocks5Password", + Usage: "Forward to socks5 server, password", + }, + }, + Action: func(c *cli.Context) error { + if c.String("domainaddress") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("cert") != "" && !filepath.IsAbs(c.String("cert")) { + return errors.New("--cert must be with absolute path") + } + if c.String("certkey") != "" && !filepath.IsAbs(c.String("certkey")) { + return errors.New("--certkey must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + if c.String("toSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("toSocks5"), c.String("toSocks5Username"), c.String("toSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + h, p, err := net.SplitHostPort(c.String("domainaddress")) + if err != nil { + return err + } + s, err := brook.NewWSServer(":"+p, c.String("password"), h, c.String("path"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("cert") != "" { + b, err := ioutil.ReadFile(c.String("cert")) + if err != nil { + return err + } + s.Cert = b + } + if c.String("certkey") != "" { + b, err := ioutil.ReadFile(c.String("certkey")) + if err != nil { + return err + } + s.CertKey = b + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "wssclient", + Usage: "Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wssclient <-> $ brook wssserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "wssserver", + Aliases: []string{"s"}, + Usage: "Brook wssserver address, like: wss://google.com:443, if no path then /ws will be used. Do not omit the port under any circumstances", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook wssserver password", + }, + &cli.StringFlag{ + Name: "address", + Usage: "Specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "Client do not verify the server's certificate chain and host name", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("wssserver") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewWSClient(c.String("socks5"), ip, c.String("wssserver"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("address") != "" { + s.ServerAddress = c.String("address") + } + if c.Bool("insecure") { + s.TLSConfig.InsecureSkipVerify = true + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM(b) + if !ok { + return errors.New("failed to parse root certificate") + } + s.TLSConfig.RootCAs = roots + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "quicserver", + Usage: "Run as brook quicserver, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "domainaddress", + Usage: "Such as: domain.com:443. If you choose to automatically issue certificates, the domain must have been resolved to the server IP and 80 port also will be used", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.StringFlag{ + Name: "cert", + Usage: "The cert file absolute path for the domain, such as /path/to/cert.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.StringFlag{ + Name: "certkey", + Usage: "The cert key file absolute path for the domain, such as /path/to/certkey.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + }, + Action: func(c *cli.Context) error { + if c.String("domainaddress") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("cert") != "" && !filepath.IsAbs(c.String("cert")) { + return errors.New("--cert must be with absolute path") + } + if c.String("certkey") != "" && !filepath.IsAbs(c.String("certkey")) { + return errors.New("--certkey must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + h, p, err := net.SplitHostPort(c.String("domainaddress")) + if err != nil { + return err + } + s, err := brook.NewQUICServer(":"+p, c.String("password"), h, c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("cert") != "" { + b, err := ioutil.ReadFile(c.String("cert")) + if err != nil { + return err + } + s.Cert = b + } + if c.String("certkey") != "" { + b, err := ioutil.ReadFile(c.String("certkey")) + if err != nil { + return err + } + s.CertKey = b + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "quicclient", + Usage: "Run as brook quicclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook quicclient <-> $ brook quicserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "quicserver", + Aliases: []string{"s"}, + Usage: "Brook quicserver address, like: quic://google.com:443. Do not omit the port under any circumstances", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook quicserver password", + }, + &cli.StringFlag{ + Name: "address", + Usage: "Specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("quicserver") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewQUICClient(c.String("socks5"), ip, c.String("quicserver"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("address") != "" { + s.ServerAddress = c.String("address") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM(b) + if !ok { + return errors.New("failed to parse root certificate") + } + s.TLSConfig.RootCAs = roots + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "relayoverbrook", + Usage: "Run as relay over brook, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> $ brook server/wsserver/wssserver/quicserver <-> to address]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "from", + Aliases: []string{"f", "l"}, + Usage: "Listen address: like ':9999'", + }, + &cli.StringFlag{ + Name: "to", + Aliases: []string{"t"}, + Usage: "Address which relay to, like: 1.2.3.4:9999", + }, + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain:443/ws, quic://domain.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("from") == "" || c.String("to") == "" || c.String("server") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + kind := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + kind = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + kind = "wssserver" + } + if strings.HasPrefix(c.String("server"), "quic://") { + kind = "quicserver" + } + v := url.Values{} + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + s, err := brook.NewRelayOverBrook(c.String("from"), brook.LinkExtra(kind, c.String("server"), "", c.String("password"), v), c.String("to"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "dnsserveroverbrook", + Usage: "Run as dns server over brook, both TCP and UDP, [src <-> $ brook dnserversoverbrook <-> $ brook server/wsserver/wssserver/quicserver <-> dns] or [src <-> $ brook dnsserveroverbrook <-> dnsForBypass]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: 127.0.0.1:53", + }, + &cli.StringFlag{ + Name: "dns", + Usage: "DNS server for resolving domains NOT in list", + Value: "8.8.8.8:53", + }, + &cli.StringFlag{ + Name: "dnsForBypass", + Usage: "DNS server for resolving domains in bypass list", + Value: "223.5.5.5:53", + }, + &cli.StringFlag{ + Name: "bypassDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.BoolFlag{ + Name: "disableA", + Usage: "Disable A query", + }, + &cli.BoolFlag{ + Name: "disableAAAA", + Usage: "Disable AAAA query", + }, + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("server") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("bypassDomainList") != "" && !strings.HasPrefix(c.String("bypassDomainList"), "http://") && !strings.HasPrefix(c.String("bypassDomainList"), "https://") && !filepath.IsAbs(c.String("bypassDomainList")) { + return errors.New("--bypassDomainList must be with absolute path") + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("bypassDomainList") != "" || c.Bool("disableA") || c.Bool("disableAAAA") { + p, err := thedns.NewTheDNS(c.String("blockDomainList"), c.String("bypassDomainList"), c.String("dnsForBypass"), c.Bool("disableA"), c.Bool("disableAAAA")) + if err != nil { + return err + } + p.TouchBrook() + } + kind := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + kind = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + kind = "wssserver" + } + if strings.HasPrefix(c.String("server"), "quic://") { + kind = "quicserver" + } + v := url.Values{} + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + s, err := brook.NewRelayOverBrook(c.String("listen"), brook.LinkExtra(kind, c.String("server"), "", c.String("password"), v), c.String("dns"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.IsDNS = true + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "tproxy", + Usage: "Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook server/wsserver/wssserver/quicserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, DO NOT contain IP, just like: ':1080'. No need to operate iptables by default!", + Value: ":1080", + }, + &cli.StringFlag{ + Name: "dnsListen", + Usage: "Start a smart DNS server, like: ':53'", + }, + &cli.StringFlag{ + Name: "dnsForDefault", + Usage: "DNS server for resolving domains NOT in list", + Value: "8.8.8.8:53", + }, + &cli.StringFlag{ + Name: "dnsForBypass", + Usage: "DNS server for resolving domains in bypass list", + Value: "223.5.5.5:53", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, Suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "bypassDomainList", + Usage: "One domain per line, Suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.BoolFlag{ + Name: "disableA", + Usage: "Disable A query", + }, + &cli.BoolFlag{ + Name: "disableAAAA", + Usage: "Disable AAAA query", + }, + &cli.StringFlag{ + Name: "bypassCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "bypassCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "bypassGeoIP", + Usage: "Bypass IP by Geo country code, such as US", + }, + &cli.BoolFlag{ + Name: "enableIPv6", + Usage: "deprecated", + }, + &cli.BoolFlag{ + Name: "doNotRunScripts", + Usage: "This will not change iptables and others if you want to do by yourself", + }, + &cli.StringFlag{ + Name: "webListen", + Usage: "Ignore all other parameters, run web UI, like: ':9999'", + }, + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.StringFlag{ + Name: "link", + Usage: "brook link. This will ignore server, password, udpovertcp, address, insecure, withoutBrookProtocol, ca", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("webListen") != "" { + web, err := fs.Sub(static, "static") + if err != nil { + return err + } + var cmd *exec.Cmd + lock := &sync.Mutex{} + m := http.NewServeMux() + m.Handle("/", http.FileServer(http.FS(web))) + m.HandleFunc("/hasp", func(w http.ResponseWriter, r *http.Request) { + lock.Lock() + defer lock.Unlock() + _, err := os.Stat("/tmp/.brook.web.password") + if os.IsNotExist(err) { + w.Write([]byte("no")) + return + } + w.Write([]byte("yes")) + }) + m.HandleFunc("/setp", func(w http.ResponseWriter, r *http.Request) { + lock.Lock() + defer lock.Unlock() + _, err := os.Stat("/tmp/.brook.web.password") + if !os.IsNotExist(err) { + http.Error(w, "file exsits", 500) + return + } + err = ioutil.WriteFile("/tmp/.brook.web.password", []byte(r.FormValue("p")), 0600) + if err != nil { + http.Error(w, err.Error(), 500) + return + } + w.WriteHeader(200) + }) + m.HandleFunc("/authp", func(w http.ResponseWriter, r *http.Request) { + lock.Lock() + defer lock.Unlock() + b, err := ioutil.ReadFile("/tmp/.brook.web.password") + if err != nil { + http.Error(w, err.Error(), 500) + return + } + if string(b) != r.FormValue("p") { + http.Error(w, "web ui password wrong", 500) + return + } + w.WriteHeader(200) + }) + m.HandleFunc("/start", func(w http.ResponseWriter, r *http.Request) { + b, err := ioutil.ReadFile("/root/.brook.web.password") + if err != nil { + http.Error(w, err.Error(), 500) + return + } + if string(b) != r.FormValue("p") { + http.Error(w, "web ui password wrong", 500) + return + } + s, err := os.Executable() + if err != nil { + http.Error(w, err.Error(), 500) + return + } + lock.Lock() + defer lock.Unlock() + cmd = exec.Command("/bin/sh", "-c", s+" tproxy "+r.FormValue("args")) + done := make(chan byte) + defer close(done) + errch := make(chan error) + go func() { + out, _ := cmd.CombinedOutput() + select { + case <-done: + log.Println(string(out)) + default: + select { + case <-done: + log.Println(string(out)) + case errch <- errors.New(string(out)): + } + } + lock.Lock() + cmd = nil + lock.Unlock() + }() + select { + case err := <-errch: + http.Error(w, err.Error(), 500) + return + case <-time.After(6 * time.Second): + w.Write([]byte("connected")) + } + }) + m.HandleFunc("/stop", func(w http.ResponseWriter, r *http.Request) { + b, err := ioutil.ReadFile("/root/.brook.web.password") + if err != nil { + http.Error(w, err.Error(), 500) + return + } + if string(b) != r.FormValue("p") { + http.Error(w, "web ui password wrong", 500) + return + } + lock.Lock() + defer lock.Unlock() + if cmd == nil { + w.Write([]byte("disconnected")) + return + } + if err := cmd.Process.Signal(syscall.SIGTERM); err != nil { + http.Error(w, err.Error(), 500) + return + } + w.Write([]byte("disconnected")) + }) + m.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) { + b, err := ioutil.ReadFile("/tmp/.brook.web.password") + if err != nil { + http.Error(w, err.Error(), 500) + return + } + if string(b) != r.FormValue("p") { + http.Error(w, "web ui password wrong", 500) + return + } + lock.Lock() + defer lock.Unlock() + if cmd == nil { + w.Write([]byte("disconnected")) + return + } + w.Write([]byte("connected")) + }) + s := &http.Server{ + Addr: c.String("webListen"), + Handler: m, + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + if cmd != nil { + cmd.Process.Signal(syscall.SIGTERM) + } + return s.Shutdown(context.Background()) + }, + }) + return nil + } + if c.String("listen") == "" || (c.String("link") == "" && (c.String("server") == "" || c.String("password") == "")) { + _ = cli.ShowSubcommandHelp(c) + return errors.New("") + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("bypassDomainList") != "" && !strings.HasPrefix(c.String("bypassDomainList"), "http://") && !strings.HasPrefix(c.String("bypassDomainList"), "https://") && !filepath.IsAbs(c.String("bypassDomainList")) { + return errors.New("--bypassDomainList must be with absolute path") + } + if c.String("bypassCIDR4List") != "" && !strings.HasPrefix(c.String("bypassCIDR4List"), "http://") && !strings.HasPrefix(c.String("bypassCIDR4List"), "https://") && !filepath.IsAbs(c.String("bypassCIDR4List")) { + return errors.New("--bypassCIDR4List must be with absolute path") + } + if c.String("bypassCIDR6List") != "" && !strings.HasPrefix(c.String("bypassCIDR6List"), "http://") && !strings.HasPrefix(c.String("bypassCIDR6List"), "https://") && !filepath.IsAbs(c.String("bypassCIDR6List")) { + return errors.New("--bypassCIDR6List must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("bypassDomainList") != "" || c.Bool("disableA") || c.Bool("disableAAAA") { + p, err := thedns.NewTheDNS(c.String("blockDomainList"), c.String("bypassDomainList"), c.String("dnsForBypass"), c.Bool("disableA"), c.Bool("disableAAAA")) + if err != nil { + return err + } + p.TouchBrook() + } + if c.String("bypassCIDR4List") != "" || c.String("bypassCIDR6List") != "" || len(c.StringSlice("bypassGeoIP")) != 0 { + p, err := tproxy.NewTproxy(c.String("bypassCIDR4List"), c.String("bypassCIDR6List"), c.StringSlice("bypassGeoIP"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + kind := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + kind = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + kind = "wssserver" + } + if strings.HasPrefix(c.String("server"), "quic://") { + kind = "quicserver" + } + v := url.Values{} + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + link := brook.LinkExtra(kind, c.String("server"), "", c.String("password"), v) + if c.String("link") != "" { + link = c.String("link") + } + s, err := brook.NewTproxy(c.String("listen"), link, c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + if !c.Bool("doNotRunScripts") { + s.ClearAutoScripts() + if err := s.RunAutoScripts(); err != nil { + return err + } + } + return s.ListenAndServe() + }, + Stop: func() error { + if !c.Bool("doNotRunScripts") { + if err := s.ClearAutoScripts(); err != nil { + log.Println(err) + } + } + return s.Shutdown() + }, + }) + if c.String("dnsListen") != "" { + s, err := brook.NewRelayOverBrook(c.String("dnsListen"), link, c.String("dnsForDefault"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.IsDNS = true + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "link", + Usage: "Generate brook link", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "Support brook server, brook wsserver, brook wssserver, socks5 server, brook quicserver. Like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://google.com:443/ws, socks5://1.2.3.4:1080, quic://google.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.StringFlag{ + Name: "username", + Aliases: []string{"u"}, + Usage: "Username, when server is socks5 server", + }, + &cli.StringFlag{ + Name: "name", + Usage: "Give this server a name", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca for untrusted cert, such as /path/to/ca.pem", + }, + }, + Action: func(c *cli.Context) error { + if c.String("server") == "" { + return cli.ShowSubcommandHelp(c) + } + s := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + s = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + s = "wssserver" + } + if strings.HasPrefix(c.String("server"), "socks5://") { + s = "socks5" + } + if strings.HasPrefix(c.String("server"), "quic://") { + s = "quicserver" + } + v := url.Values{} + if c.String("name") != "" { + v.Set("name", c.String("name")) + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + fmt.Println(brook.LinkExtra(s, c.String("server"), c.String("username"), c.String("password"), v)) + return nil + }, + }, + &cli.Command{ + Name: "connect", + Usage: "Run as client and connect to brook link, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook connect <-> $ brook server/wsserver/wssserver/quicserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "link", + Aliases: []string{"l"}, + Usage: "brook link, you can get it via $ brook link", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "If you already have a socks5, such as 127.0.0.1:1081, and want [src <-> listen socks5 <-> $ brook connect <-> dialWithSocks5 <-> $ brook server/wsserver/wssserver <-> dst]", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("link") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if c.String("socks5ServerIP") != "" { + h = c.String("socks5ServerIP") + } + if h == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + kind, _, _, _, _, err := brook.ParseLinkExtra(c.String("link")) + if err != nil { + return err + } + if kind == "socks5" { + return errors.New("Looks like you want create socks5 from a socks5, you may want $ brook socks5tohttp?") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + s, err := brook.NewBrookLink(c.String("link")) + if err != nil { + return err + } + err = s.PrepareSocks5Server(c.String("socks5"), h, c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(h, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "relay", + Usage: "Run as standalone relay, both TCP and UDP, this means access [from address] is equal to access [to address], [src <-> from address <-> to address]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "from", + Aliases: []string{"f", "l"}, + Usage: "Listen address: like ':9999'", + }, + &cli.StringFlag{ + Name: "to", + Aliases: []string{"t"}, + Usage: "Address which relay to, like: 1.2.3.4:9999", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("from") == "" || c.String("to") == "" { + return cli.ShowSubcommandHelp(c) + } + s, err := brook.NewRelay(c.String("from"), c.String("to"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "dnsserver", + Usage: "Run as standalone dns server, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: 127.0.0.1:53", + }, + &cli.StringFlag{ + Name: "dns", + Usage: "DNS server which forward to", + Value: "8.8.8.8:53", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.BoolFlag{ + Name: "disableA", + Usage: "Disable A query", + }, + &cli.BoolFlag{ + Name: "disableAAAA", + Usage: "Disable AAAA query", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockDomainList") != "" || c.Bool("disableA") || c.Bool("disableAAAA") { + p, err := thedns.NewTheDNS(c.String("blockDomainList"), "", "", c.Bool("disableA"), c.Bool("disableAAAA")) + if err != nil { + return err + } + p.TouchBrook() + } + s, err := brook.NewRelay(c.String("listen"), c.String("dns"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.IsDNS = true + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "socks5", + Usage: "Run as standalone standard socks5 server, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Socks5 server listen address, like: :1080 or 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "username", + Usage: "User name, optional", + }, + &cli.StringFlag{ + Name: "password", + Usage: "Password, optional", + }, + &cli.BoolFlag{ + Name: "limitUDP", + Usage: "The server MAY use this information to limit access to the UDP association", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "Connection deadline time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "Connection deadline time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" { + return cli.ShowSubcommandHelp(c) + } + h, _, err := net.SplitHostPort(c.String("listen")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use public IP or lan IP or other, we can not decide for you") + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewSocks5Server(c.String("listen"), ip, c.String("username"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.Server.LimitUDP = c.Bool("limitUDP") + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "socks5tohttp", + Usage: "Convert socks5 to http proxy, [src <-> listen address(http proxy) <-> socks5 address <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "socks5", + Aliases: []string{"s"}, + Usage: "Socks5 server address, like: 127.0.0.1:1080", + }, + &cli.StringFlag{ + Name: "socks5username", + Usage: "Socks5 username, optional", + }, + &cli.StringFlag{ + Name: "socks5password", + Usage: "Socks5 password, optional", + }, + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "HTTP proxy which will be create: like: 127.0.0.1:8010", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "Connection tcp timeout (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("socks5") == "" { + return cli.ShowSubcommandHelp(c) + } + s, err := brook.NewSocks5ToHTTP(c.String("listen"), c.String("socks5"), c.String("socks5username"), c.String("socks5password"), c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "pac", + Usage: "Run as PAC server or save PAC to file", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: 127.0.0.1:1980", + }, + &cli.StringFlag{ + Name: "proxy", + Aliases: []string{"p"}, + Value: "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT", + Usage: "Proxy, like: 'SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT'", + }, + &cli.StringFlag{ + Name: "bypassDomainList", + Aliases: []string{"b"}, + Usage: "One domain per line, suffix match mode. http(s):// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Save PAC to file, this will ignore listen address", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" && c.String("file") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("bypassDomainList") != "" && !strings.HasPrefix(c.String("bypassDomainList"), "http://") && !strings.HasPrefix(c.String("bypassDomainList"), "https://") && !filepath.IsAbs(c.String("bypassDomainList")) { + return errors.New("--bypassDomainList must be with absolute path") + } + s := brook.NewPAC(c.String("listen"), c.String("file"), c.String("proxy"), c.String("bypassDomainList")) + if c.String("file") != "" { + return s.WriteToFile() + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "testsocks5", + Usage: "Test UDP and TCP of socks5 server", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "socks5", + Aliases: []string{"s"}, + Usage: "Like: 127.0.0.1:1080", + }, + &cli.StringFlag{ + Name: "username", + Aliases: []string{"u"}, + Usage: "Socks5 username", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Socks5 password", + }, + &cli.StringFlag{ + Name: "dns", + Value: "8.8.8.8:53", + Usage: "DNS server for connecting", + }, + &cli.StringFlag{ + Name: "domain", + Value: "http3.ooo", + Usage: "Domain for query", + }, + &cli.StringFlag{ + Name: "a", + Value: "137.184.237.95", + Usage: "The A record of domain", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" { + return cli.ShowSubcommandHelp(c) + } + socks5.Debug = true + return brook.Socks5Test(c.String("socks5"), c.String("username"), c.String("password"), c.String("domain"), c.String("a"), c.String("dns")) + }, + }, + &cli.Command{ + Name: "testbrook", + Usage: "Test UDP and TCP of brook server/wsserver/wssserver", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "link", + Aliases: []string{"l"}, + Usage: "brook link. Get it via $ brook link", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:11080", + Usage: "Temporarily listening socks5", + }, + &cli.StringFlag{ + Name: "dns", + Value: "8.8.8.8:53", + Usage: "DNS server for connecting", + }, + &cli.StringFlag{ + Name: "domain", + Value: "http3.ooo", + Usage: "Domain for query", + }, + &cli.StringFlag{ + Name: "a", + Value: "137.184.237.95", + Usage: "The A record of domain", + }, + }, + Action: func(c *cli.Context) error { + if c.String("link") == "" { + return cli.ShowSubcommandHelp(c) + } + socks5.Debug = true + fmt.Println("Run brook connect to listen", c.String("socks5")) + var cmd *exec.Cmd + var err error + go func() { + var s string + s, err = os.Executable() + if err != nil { + return + } + cmd = exec.Command(s, "connect", "--link", c.String("link"), "--socks5", c.String("socks5")) + b, _ := cmd.CombinedOutput() + err = errors.New(string(b)) + }() + time.Sleep(3 * time.Second) + if err != nil { + return err + } + err1 := brook.Socks5Test(c.String("socks5"), "", "", c.String("domain"), c.String("a"), c.String("dns")) + _ = cmd.Process.Signal(syscall.SIGTERM) + return err1 + }, + }, + &cli.Command{ + Name: "echoserver", + Usage: "Echo server, echo UDP and TCP address of routes", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: ':7777'", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" { + return cli.ShowSubcommandHelp(c) + } + s, err := brook.NewEchoServer(c.String("listen")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "echoclient", + Usage: "Connect to echoserver, echo UDP and TCP address of routes", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "Echo server address, such as 1.2.3.4:7777", + }, + &cli.IntFlag{ + Name: "times", + Value: 1, + Usage: "Times of interactions", + }, + }, + Action: func(c *cli.Context) error { + if c.String("server") == "" { + return cli.ShowSubcommandHelp(c) + } + return brook.EchoClient(c.String("server"), c.Int("times")) + }, + }, + &cli.Command{ + Name: "completion", + Usage: "Generate shell completions", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Write to file", + Value: "brook_autocomplete", + }, + }, + Action: func(c *cli.Context) error { + l := c.App.VisibleCommands() + if strings.Contains(os.Getenv("SHELL"), "zsh") { + s := ` +_cli_zsh_autocomplete() { + local -a opts + local cur + cur=${words[-1]} + if [[ "$cur" == "-"* ]]; then + opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}") + else + opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}") + fi + + if [[ "${opts[1]}" != "" ]]; then + _describe 'values' opts + else + _files + fi +} +compdef _cli_zsh_autocomplete brook +` + for _, v := range l { + s += "compdef _cli_zsh_autocomplete brook " + v.Name + "\n" + } + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + fmt.Println("Generated") + fmt.Println("\t" + c.String("file")) + fmt.Println("To enable auto-completion for the current shell session") + fmt.Println("\t$ source " + c.String("file")) + fmt.Println("To enable persistent auto-completion, add this line to your .zsh") + fmt.Println("\t$ source /path/to/" + c.String("file")) + return nil + } + s := `#! /bin/bash +_cli_bash_autocomplete() { + if [[ "${COMP_WORDS[0]}" != "source" ]]; then + local cur opts base + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ "$cur" == "-"* ]]; then + opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion ) + else + opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) + fi + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi +} +complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete brook +` + for _, v := range l { + s += "complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete brook " + v.Name + "\n" + } + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + fmt.Println("Generated:") + fmt.Println("\t" + c.String("file")) + fmt.Println("To enable auto-completion for the current shell session") + fmt.Println("\t$ source " + c.String("file")) + if runtime.GOOS == "darwin" { + fmt.Println("To enable persistent auto-completion, add this line to your .bash_profile") + } + if runtime.GOOS != "darwin" { + fmt.Println("To enable persistent auto-completion, add this line to your .bashrc") + } + fmt.Println("\t$ source /path/to/" + c.String("file")) + return nil + }, + }, + &cli.Command{ + Name: "mdpage", + Usage: "Generate markdown page", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Write to file, default print to stdout", + }, + }, + Action: func(c *cli.Context) error { + s, err := c.App.ToMarkdown() + if err != nil { + return err + } + if c.String("file") != "" { + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + return nil + } + fmt.Println(s) + return nil + }, + }, + &cli.Command{ + Name: "manpage", + Usage: "Generate man.1 page", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Write to file, default print to stdout. You should put to /path/to/man/man1/brook.1 on linux or /usr/local/share/man/man1/brook.1 on macos", + }, + }, + Action: func(c *cli.Context) error { + s, err := c.App.ToManWithSection(1) + if err != nil { + return err + } + if c.String("file") != "" { + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + return nil + } + fmt.Println(s) + return nil + }, + }, + } + if os.Getenv("SOCKS5_DEBUG") != "" { + socks5.Debug = true + } + if err := app.Run(os.Args); err != nil { + log.Println(err) + return + } + if len(g.Runners) == 0 { + return + } + go func() { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + <-sigs + g.Done() + }() + log.Println(g.Wait()) +} +``` + +## `quicserver.go` (changed lines (48,)) + +```go +// Copyright (c) 2016-present Cloud +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 3 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package brook + +import ( + "context" + "crypto/tls" + "errors" + "net" + "net/http" + "os/exec" + "runtime" + "time" + + "github.com/quic-go/quic-go" + "github.com/txthinking/brook/limits" + crypto1 "github.com/txthinking/crypto" + "github.com/txthinking/runnergroup" + "github.com/txthinking/socks5" + "golang.org/x/crypto/acme/autocert" +) + +type QUICServer struct { + Password []byte + Domain string + Addr string + TCPTimeout int + UDPTimeout int + Cert []byte + CertKey []byte + RunnerGroup *runnergroup.RunnerGroup + WithoutBrook bool + UDPServerConnFactory UDPServerConnFactory +} + +func NewQUICServer(addr, password, domain string, tcpTimeout, udpTimeout int, withoutbrook bool) (*QUICServer, error) { + if err := limits.Raise(); err != nil { + Log(&Error{"when": "try to raise system limits", "warning": err.Error()}) + } + if runtime.GOOS == "linux" { + c := exec.Command("sysctl", "-w", "net.core.rmem_max=2500000") + b, err := c.CombinedOutput() + if err != nil { + Log(&Error{"when": "try to raise UDP Receive Buffer Size", "warning": string(b)}) + } + } + if runtime.GOOS == "darwin" { + c := exec.Command("sysctl", "-w", "kern.ipc.maxsockbuf=3014656") + b, err := c.CombinedOutput() + if err != nil { + Log(&Error{"when": "try to raise UDP Receive Buffer Size", "warning": string(b)}) + } + } + var p []byte + var f UDPServerConnFactory + if !withoutbrook { + p = []byte(password) + f = NewPacketServerConnFactory() + } + if withoutbrook { + var err error + p, err = crypto1.SHA256Bytes([]byte(password)) + if err != nil { + return nil, err + } + f = NewSimplePacketServerConnFactory() + } + s := &QUICServer{ + Password: p, + Domain: domain, + Addr: addr, + TCPTimeout: tcpTimeout, + UDPTimeout: udpTimeout, + UDPServerConnFactory: f, + RunnerGroup: runnergroup.New(), + WithoutBrook: withoutbrook, + } + return s, nil +} + +func (s *QUICServer) ListenAndServe() error { + var t *tls.Config + if s.Cert == nil || s.CertKey == nil { + m := autocert.Manager{ + Cache: autocert.DirCache(".letsencrypt"), + Prompt: autocert.AcceptTOS, + HostPolicy: autocert.HostWhitelist(s.Domain), + Email: "cloud@txthinking.com", + } + server := &http.Server{Addr: ":80", Handler: m.HTTPHandler(nil)} + s.RunnerGroup.Add(&runnergroup.Runner{ + Start: func() error { + return server.ListenAndServe() + }, + Stop: func() error { + return server.Shutdown(context.Background()) + }, + }) + t = &tls.Config{GetCertificate: m.GetCertificate, ServerName: s.Domain, NextProtos: []string{"h3"}} + } + if s.Cert != nil && s.CertKey != nil { + ct, err := tls.X509KeyPair(s.Cert, s.CertKey) + if err != nil { + return err + } + t = &tls.Config{Certificates: []tls.Certificate{ct}, ServerName: s.Domain, NextProtos: []string{"h3"}} + } + l, err := quic.ListenAddr(s.Addr, t, &quic.Config{MaxIdleTimeout: time.Duration(s.UDPTimeout) * time.Second, EnableDatagrams: true}) + if err != nil { + return err + } + s.RunnerGroup.Add(&runnergroup.Runner{ + Start: func() error { + for { + c, err := l.Accept(context.Background()) + if err != nil { + return err + } + go func(c quic.Connection) { + defer c.CloseWithError(0, "defer") + for { + st, err := c.AcceptStream(context.Background()) + if err != nil { + return + } + go func(c net.Conn) { + defer c.Close() + var ss Exchanger + if !s.WithoutBrook { + ss, err = NewStreamServer(s.Password, c.RemoteAddr().String(), c, s.TCPTimeout, s.UDPTimeout) + } + if s.WithoutBrook { + ss, err = NewSimpleStreamServer(s.Password, c.RemoteAddr().String(), c, s.TCPTimeout, s.UDPTimeout) + } + if err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "error": err.Error()}) + return + } + defer ss.Clean() + if err := s.TCPHandle(ss); err != nil { + Log(&Error{"from": ss.Src(), "dst": ss.Dst(), "error": err.Error()}) + } + }(&QUICConn{ + Conn: c, + Stream: st, + LAddr: &net.TCPAddr{ + IP: c.LocalAddr().(*net.UDPAddr).IP, + Port: c.LocalAddr().(*net.UDPAddr).Port, + Zone: c.LocalAddr().(*net.UDPAddr).Zone, + }, + RAddr: &net.TCPAddr{ + IP: c.RemoteAddr().(*net.UDPAddr).IP, + Port: c.RemoteAddr().(*net.UDPAddr).Port, + Zone: c.RemoteAddr().(*net.UDPAddr).Zone, + }, + }) + } + }(c) + if c.ConnectionState().SupportsDatagrams { + go func(c quic.Connection) { + defer c.CloseWithError(0, "defer") + for { + b, err := c.ReceiveMessage() + if err != nil { + return + } + conn, dstb, err := s.UDPServerConnFactory.Handle(c.RemoteAddr().(*net.UDPAddr), b, s.Password, func(b []byte) (int, error) { + if len(b) > 1197 { + err := errors.New("when write to client, quic max datagram size is 1197") + Log(&Error{"from": c.RemoteAddr().String(), "error": err.Error()}) + return 0, err + } + if err := c.SendMessage(b); err != nil { + return 0, err + } + return len(b), nil + }, s.UDPTimeout) + if err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "error": err.Error()}) + continue + } + if conn == nil { + continue + } + go func() { + defer conn.Close() + var ss Exchanger + if !s.WithoutBrook { + ss, err = NewPacketServer(s.Password, c.RemoteAddr().String(), conn, s.UDPTimeout, dstb) + } + if s.WithoutBrook { + ss, err = NewSimplePacketServer(s.Password, c.RemoteAddr().String(), conn, s.UDPTimeout, dstb) + } + if err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "dst": socks5.ToAddress(dstb[0], dstb[1:len(dstb)-2], dstb[len(dstb)-2:]), "error": err.Error()}) + return + } + defer ss.Clean() + if err := s.UDPHandle(ss); err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "dst": socks5.ToAddress(dstb[0], dstb[1:len(dstb)-2], dstb[len(dstb)-2:]), "error": err.Error()}) + } + }() + } + }(c) + } + } + return nil + }, + Stop: func() error { + return l.Close() + }, + }) + go func() { + time.Sleep(1 * time.Second) + _, _ = quic.DialAddr(net.JoinHostPort(s.Domain, s.Addr[1:]), &tls.Config{NextProtos: []string{"h3"}}, nil) + }() + return s.RunnerGroup.Wait() +} + +func (s *QUICServer) TCPHandle(ss Exchanger) error { + rc, err := DialTCP("tcp", "", ss.Dst()) + if err != nil { + return err + } + defer rc.Close() + if err := ss.Exchange(rc); err != nil { + return nil + } + return nil +} + +func (s *QUICServer) UDPHandle(ss Exchanger) error { + rc, err := NATDial("udp", ss.Src(), ss.Dst(), ss.Dst()) + if err != nil { + return err + } + defer rc.Close() + if err := ss.Exchange(rc); err != nil { + return nil + } + return nil +} + +func (s *QUICServer) Shutdown() error { + return s.RunnerGroup.Done() +} +``` + +## `streamclient.go` (changed lines (97, 153, 172, 179, 191)) + +```go +// Copyright (c) 2016-present Cloud +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 3 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package brook + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "crypto/sha256" + "encoding/binary" + "errors" + "io" + "net" + "time" + + "github.com/txthinking/socks5" + "github.com/txthinking/x" + "golang.org/x/crypto/hkdf" +) + +type StreamClient struct { + Server net.Conn + cn []byte + ca cipher.AEAD + sn []byte + sa cipher.AEAD + RB []byte + WB []byte + Timeout int + network string + src string + dst string +} + +func NewStreamClient(network string, password []byte, src string, server net.Conn, timeout int, dst []byte) (Exchanger, error) { + if timeout != 0 { + if err := server.SetDeadline(time.Now().Add(time.Duration(timeout) * time.Second)); err != nil { + return nil, err + } + } + if len(dst) > 2048-2-16-4-16 { + return nil, errors.New("dst too long") + } + c := &StreamClient{network: network, Server: server, Timeout: timeout, src: src, dst: socks5.ToAddress(dst[0], dst[1:len(dst)-2], dst[len(dst)-2:])} + + c.cn = x.BP12.Get().([]byte) + if _, err := io.ReadFull(rand.Reader, c.cn); err != nil { + x.BP12.Put(c.cn) + return nil, err + } + ck := x.BP32.Get().([]byte) + if _, err := io.ReadFull(hkdf.New(sha256.New, password, c.cn, []byte{0x62, 0x72, 0x6f, 0x6f, 0x6b}), ck); err != nil { + x.BP12.Put(c.cn) + x.BP32.Put(ck) + return nil, err + } + if _, err := c.Server.Write(c.cn); err != nil { + x.BP12.Put(c.cn) + x.BP32.Put(ck) + return nil, err + } + cb, err := aes.NewCipher(ck) + if err != nil { + x.BP12.Put(c.cn) + x.BP32.Put(ck) + return nil, err + } + x.BP32.Put(ck) + c.ca, err = cipher.NewGCM(cb) + if err != nil { + x.BP12.Put(c.cn) + return nil, err + } + + c.WB = x.BP2048.Get().([]byte) + i := time.Now().Unix() + if c.network == "tcp" && i%2 != 0 { + i += 1 + } + if c.network == "udp" && i%2 != 1 { + i += 1 + } + binary.BigEndian.PutUint32(c.WB[2+16:2+16+4], uint32(i)) + copy(c.WB[2+16+4:2+16+4+len(dst)], dst) + if err := c.Write(4 + len(dst)); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + return nil, err + } + + c.sn = x.BP12.Get().([]byte) + if _, err := io.ReadFull(c.Server, c.sn); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + return nil, err + } + sk := x.BP32.Get().([]byte) + if _, err := io.ReadFull(hkdf.New(sha256.New, password, c.sn, []byte{0x62, 0x72, 0x6f, 0x6f, 0x6b}), sk); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + x.BP32.Put(sk) + return nil, err + } + sb, err := aes.NewCipher(sk) + if err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + x.BP32.Put(sk) + return nil, err + } + x.BP32.Put(sk) + c.sa, err = cipher.NewGCM(sb) + if err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + return nil, err + } + if c.network == "tcp" { + c.RB = x.BP2048.Get().([]byte) + } + if c.network == "udp" { + x.BP2048.Put(c.WB) + c.WB = x.BP65507.Get().([]byte) + c.RB = x.BP65507.Get().([]byte) + } + return ClientGate(c) +} + +func (c *StreamClient) Exchange(local net.Conn) error { + go func() { + for { + if c.Timeout != 0 { + if err := c.Server.SetDeadline(time.Now().Add(time.Duration(c.Timeout) * time.Second)); err != nil { + return + } + } + l, err := c.Read() + if err != nil { + return + } + if _, err := local.Write(c.RB[2+16 : 2+16+l]); err != nil { + return + } + } + }() + for { + if c.Timeout != 0 { + if err := local.SetDeadline(time.Now().Add(time.Duration(c.Timeout) * time.Second)); err != nil { + return nil + } + } + l, err := local.Read(c.WB[2+16 : len(c.WB)-16]) + if err != nil { + return nil + } + if err := c.Write(l); err != nil { + return nil + } + } + return nil +} + +func (c *StreamClient) Write(l int) error { + binary.BigEndian.PutUint16(c.WB[:2], uint16(l)) + c.ca.Seal(c.WB[:0], c.cn, c.WB[:2], nil) + NextNonce(c.cn) + c.ca.Seal(c.WB[:2+16], c.cn, c.WB[2+16:2+16+l], nil) + if _, err := c.Server.Write(c.WB[:2+16+l+16]); err != nil { + return err + } + NextNonce(c.cn) + return nil +} + +func (c *StreamClient) Read() (int, error) { + if _, err := io.ReadFull(c.Server, c.RB[:2+16]); err != nil { + return 0, err + } + if _, err := c.sa.Open(c.RB[:0], c.sn, c.RB[:2+16], nil); err != nil { + return 0, err + } + l := int(binary.BigEndian.Uint16(c.RB[:2])) + if _, err := io.ReadFull(c.Server, c.RB[2+16:2+16+l+16]); err != nil { + return 0, err + } + NextNonce(c.sn) + if _, err := c.sa.Open(c.RB[:2+16], c.sn, c.RB[2+16:2+16+l+16], nil); err != nil { + return 0, err + } + NextNonce(c.sn) + return l, nil +} + +func (c *StreamClient) Clean() { + x.BP12.Put(c.cn) + x.BP12.Put(c.sn) + if c.network == "tcp" { + x.BP2048.Put(c.WB) + x.BP2048.Put(c.RB) + } + if c.network == "udp" { + x.BP65507.Put(c.WB) + x.BP65507.Put(c.RB) + } +} + +func (s *StreamClient) Network() string { + return s.network +} + +func (s *StreamClient) Src() string { + return s.src +} + +func (s *StreamClient) Dst() string { + return s.dst +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..63cb41bbb98718af1b562878f6649e388abc4643 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/pre_context.md @@ -0,0 +1,3063 @@ +# Patch-overlapping Go context before the fix + +## `cli/brook/main.go` (changed lines (978, 979, 1440, 1441, 1517, 1518, 1526, 1555, 1568)) + +```go +// Copyright (c) 2016-present Cloud +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 3 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package main + +import ( + "context" + "crypto/x509" + "errors" + "fmt" + "io/fs" + "io/ioutil" + "log" + "net" + "os" + "os/exec" + "os/signal" + "path/filepath" + "runtime" + "strings" + "sync" + "syscall" + "time" + + "net/http" + "net/url" + + "github.com/txthinking/brook" + "github.com/txthinking/brook/plugins/block" + "github.com/txthinking/brook/plugins/pprof" + "github.com/txthinking/brook/plugins/socks5dial" + "github.com/txthinking/brook/plugins/thedns" + "github.com/txthinking/brook/plugins/tproxy" + "github.com/txthinking/runnergroup" + "github.com/txthinking/socks5" + "github.com/urfave/cli/v2" +) + +func main() { + g := runnergroup.New() + app := cli.NewApp() + app.Name = "Brook" + app.Version = "20230122.Beta.20230214" + app.Usage = "A cross-platform network tool designed for developers" + app.Authors = []*cli.Author{ + { + Name: "Cloud", + Email: "cloud@txthinking.com", + }, + } + app.Copyright = "https://github.com/txthinking/brook" + app.EnableBashCompletion = true + app.Flags = []cli.Flag{ + &cli.StringFlag{ + Name: "pprof", + Usage: "go http pprof listen addr, such as :6060", + }, + } + app.Before = func(c *cli.Context) error { + if c.String("pprof") != "" { + p, err := pprof.NewPprof(c.String("pprof")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return p.ListenAndServe() + }, + Stop: func() error { + return p.Shutdown() + }, + }) + } + return nil + } + app.Commands = []*cli.Command{ + &cli.Command{ + Name: "server", + Usage: "Run as brook server, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: ':9999'", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + &cli.StringFlag{ + Name: "toSocks5", + Usage: "Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "toSocks5Username", + Usage: "Forward to socks5 server, username", + }, + &cli.StringFlag{ + Name: "toSocks5Password", + Usage: "Forward to socks5 server, password", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + s, err := brook.NewServer(c.String("listen"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + if c.String("toSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("toSocks5"), c.String("toSocks5Username"), c.String("toSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "client", + Usage: "Run as brook client, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook client <-> $ brook server <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "Brook server address, like: 1.2.3.4:9999", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook server password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "UDP over TCP", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("server") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewClient(c.String("socks5"), ip, c.String("server"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.UDPOverTCP = c.Bool("udpovertcp") + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + go func() { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + <-sigs + g.Done() + }() + return g.Wait() + }, + }, + &cli.Command{ + Name: "wsserver", + Usage: "Run as brook wsserver, both TCP and UDP, it will start a standard http server and websocket server", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: ':80'", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.StringFlag{ + Name: "path", + Usage: "URL path", + Value: "/ws", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + &cli.StringFlag{ + Name: "toSocks5", + Usage: "Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "toSocks5Username", + Usage: "Forward to socks5 server, username", + }, + &cli.StringFlag{ + Name: "toSocks5Password", + Usage: "Forward to socks5 server, password", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + if c.String("toSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("toSocks5"), c.String("toSocks5Username"), c.String("toSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + s, err := brook.NewWSServer(c.String("listen"), c.String("password"), "", c.String("path"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "wsclient", + Usage: "Run as brook wsclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wsclient <-> $ brook wsserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "wsserver", + Aliases: []string{"s"}, + Usage: "Brook wsserver address, like: ws://1.2.3.4:80, if no path then /ws will be used. Do not omit the port under any circumstances", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook wsserver password", + }, + &cli.StringFlag{ + Name: "address", + Usage: "Specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("wsserver") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewWSClient(c.String("socks5"), ip, c.String("wsserver"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("address") != "" { + s.ServerAddress = c.String("address") + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "wssserver", + Usage: "Run as brook wssserver, both TCP and UDP, it will start a standard https server and websocket server", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "domainaddress", + Usage: "Such as: domain.com:443. If you choose to automatically issue certificates, the domain must have been resolved to the server IP and 80 port also will be used", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.StringFlag{ + Name: "cert", + Usage: "The cert file absolute path for the domain, such as /path/to/cert.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.StringFlag{ + Name: "certkey", + Usage: "The cert key file absolute path for the domain, such as /path/to/certkey.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.StringFlag{ + Name: "path", + Usage: "URL path", + Value: "/ws", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + &cli.StringFlag{ + Name: "toSocks5", + Usage: "Forward to socks5 server, requires your socks5 supports standard socks5 TCP and UDP, such as 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "toSocks5Username", + Usage: "Forward to socks5 server, username", + }, + &cli.StringFlag{ + Name: "toSocks5Password", + Usage: "Forward to socks5 server, password", + }, + }, + Action: func(c *cli.Context) error { + if c.String("domainaddress") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("cert") != "" && !filepath.IsAbs(c.String("cert")) { + return errors.New("--cert must be with absolute path") + } + if c.String("certkey") != "" && !filepath.IsAbs(c.String("certkey")) { + return errors.New("--certkey must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + if c.String("toSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("toSocks5"), c.String("toSocks5Username"), c.String("toSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + h, p, err := net.SplitHostPort(c.String("domainaddress")) + if err != nil { + return err + } + s, err := brook.NewWSServer(":"+p, c.String("password"), h, c.String("path"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("cert") != "" { + b, err := ioutil.ReadFile(c.String("cert")) + if err != nil { + return err + } + s.Cert = b + } + if c.String("certkey") != "" { + b, err := ioutil.ReadFile(c.String("certkey")) + if err != nil { + return err + } + s.CertKey = b + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "wssclient", + Usage: "Run as brook wssclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook wssclient <-> $ brook wssserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "wssserver", + Aliases: []string{"s"}, + Usage: "Brook wssserver address, like: wss://google.com:443, if no path then /ws will be used. Do not omit the port under any circumstances", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook wssserver password", + }, + &cli.StringFlag{ + Name: "address", + Usage: "Specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "Client do not verify the server's certificate chain and host name", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("wssserver") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewWSClient(c.String("socks5"), ip, c.String("wssserver"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("address") != "" { + s.ServerAddress = c.String("address") + } + if c.Bool("insecure") { + s.TLSConfig.InsecureSkipVerify = true + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM(b) + if !ok { + return errors.New("failed to parse root certificate") + } + s.TLSConfig.RootCAs = roots + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "quicserver", + Usage: "Run as brook quicserver, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "domainaddress", + Usage: "Such as: domain.com:443. If you choose to automatically issue certificates, the domain must have been resolved to the server IP and 80 port also will be used", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Server password", + }, + &cli.StringFlag{ + Name: "cert", + Usage: "The cert file absolute path for the domain, such as /path/to/cert.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.StringFlag{ + Name: "certkey", + Usage: "The cert key file absolute path for the domain, such as /path/to/certkey.pem. If cert or certkey is empty, a certificate will be issued automatically", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "blockCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "blockGeoIP", + Usage: "Block IP by Geo country code, such as US", + }, + &cli.Int64Flag{ + Name: "updateListInterval", + Usage: "Update list interval, second. default 0, only read one time on start", + }, + }, + Action: func(c *cli.Context) error { + if c.String("domainaddress") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockCIDR4List") != "" && !strings.HasPrefix(c.String("blockCIDR4List"), "http://") && !strings.HasPrefix(c.String("blockCIDR4List"), "https://") && !filepath.IsAbs(c.String("blockCIDR4List")) { + return errors.New("--blockCIDR4List must be with absolute path") + } + if c.String("blockCIDR6List") != "" && !strings.HasPrefix(c.String("blockCIDR6List"), "http://") && !strings.HasPrefix(c.String("blockCIDR6List"), "https://") && !filepath.IsAbs(c.String("blockCIDR6List")) { + return errors.New("--blockCIDR6List must be with absolute path") + } + if c.String("cert") != "" && !filepath.IsAbs(c.String("cert")) { + return errors.New("--cert must be with absolute path") + } + if c.String("certkey") != "" && !filepath.IsAbs(c.String("certkey")) { + return errors.New("--certkey must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("blockCIDR4List") != "" || c.String("blockCIDR6List") != "" || len(c.StringSlice("blockGeoIP")) != 0 { + p, err := block.NewBlock(c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.StringSlice("blockGeoIP"), c.Int("updateListInterval")) + if err != nil { + return err + } + p.TouchBrook() + if c.Int("updateListInterval") != 0 { + g.Add(&runnergroup.Runner{ + Start: func() error { + p.Update() + return nil + }, + Stop: func() error { + p.Stop() + return nil + }, + }) + } + } + h, p, err := net.SplitHostPort(c.String("domainaddress")) + if err != nil { + return err + } + s, err := brook.NewQUICServer(":"+p, c.String("password"), h, c.Int("tcpTimeout"), c.Int("udpTimeout"), c.String("blockDomainList"), c.String("blockCIDR4List"), c.String("blockCIDR6List"), c.Int64("updateListInterval"), c.StringSlice("blockGeoIP"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("cert") != "" { + b, err := ioutil.ReadFile(c.String("cert")) + if err != nil { + return err + } + s.Cert = b + } + if c.String("certkey") != "" { + b, err := ioutil.ReadFile(c.String("certkey")) + if err != nil { + return err + } + s.CertKey = b + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "quicclient", + Usage: "Run as brook quicclient, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook quicclient <-> $ brook quicserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "quicserver", + Aliases: []string{"s"}, + Usage: "Brook quicserver address, like: quic://google.com:443. Do not omit the port under any circumstances", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Brook quicserver password", + }, + &cli.StringFlag{ + Name: "address", + Usage: "Specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "The data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" || c.String("quicserver") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewQUICClient(c.String("socks5"), ip, c.String("quicserver"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout"), c.Bool("withoutBrookProtocol")) + if err != nil { + return err + } + if c.String("address") != "" { + s.ServerAddress = c.String("address") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM(b) + if !ok { + return errors.New("failed to parse root certificate") + } + s.TLSConfig.RootCAs = roots + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(ip, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "relayoverbrook", + Usage: "Run as relay over brook, both TCP and UDP, this means access [from address] is equal to [to address], [src <-> from address <-> $ brook server/wsserver/wssserver/quicserver <-> to address]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "from", + Aliases: []string{"f", "l"}, + Usage: "Listen address: like ':9999'", + }, + &cli.StringFlag{ + Name: "to", + Aliases: []string{"t"}, + Usage: "Address which relay to, like: 1.2.3.4:9999", + }, + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain:443/ws, quic://domain.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("from") == "" || c.String("to") == "" || c.String("server") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + kind := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + kind = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + kind = "wssserver" + } + if strings.HasPrefix(c.String("server"), "quic://") { + kind = "quicserver" + } + v := url.Values{} + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + s, err := brook.NewRelayOverBrook(c.String("from"), brook.LinkExtra(kind, c.String("server"), "", c.String("password"), v), c.String("to"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "dnsserveroverbrook", + Usage: "Run as dns server over brook, both TCP and UDP, [src <-> $ brook dnserversoverbrook <-> $ brook server/wsserver/wssserver/quicserver <-> dns] or [src <-> $ brook dnsserveroverbrook <-> dnsForBypass]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: 127.0.0.1:53", + }, + &cli.StringFlag{ + Name: "dns", + Usage: "DNS server for resolving domains NOT in list", + Value: "8.8.8.8:53", + }, + &cli.StringFlag{ + Name: "dnsForBypass", + Usage: "DNS server for resolving domains in bypass list", + Value: "223.5.5.5:53", + }, + &cli.StringFlag{ + Name: "bypassDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.BoolFlag{ + Name: "disableA", + Usage: "Disable A query", + }, + &cli.BoolFlag{ + Name: "disableAAAA", + Usage: "Disable AAAA query", + }, + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("server") == "" || c.String("password") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("bypassDomainList") != "" && !strings.HasPrefix(c.String("bypassDomainList"), "http://") && !strings.HasPrefix(c.String("bypassDomainList"), "https://") && !filepath.IsAbs(c.String("bypassDomainList")) { + return errors.New("--bypassDomainList must be with absolute path") + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("bypassDomainList") != "" || c.Bool("disableA") || c.Bool("disableAAAA") { + p, err := thedns.NewTheDNS(c.String("blockDomainList"), c.String("bypassDomainList"), c.String("dnsForBypass"), c.Bool("disableA"), c.Bool("disableAAAA")) + if err != nil { + return err + } + p.TouchBrook() + } + kind := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + kind = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + kind = "wssserver" + } + if strings.HasPrefix(c.String("server"), "quic://") { + kind = "quicserver" + } + v := url.Values{} + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + s, err := brook.NewRelayOverBrook(c.String("listen"), brook.LinkExtra(kind, c.String("server"), "", c.String("password"), v), c.String("dns"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.IsDNS = true + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "tproxy", + Usage: "Run as transparent proxy, both TCP and UDP, only works on Linux, [src <-> $ brook tproxy <-> $ brook server/wsserver/wssserver/quicserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, DO NOT contain IP, just like: ':1080'. No need to operate iptables by default!", + Value: ":1080", + }, + &cli.StringFlag{ + Name: "dnsListen", + Usage: "Start a smart DNS server, like: ':53'", + }, + &cli.StringFlag{ + Name: "dnsForDefault", + Usage: "DNS server for resolving domains NOT in list", + Value: "8.8.8.8:53", + }, + &cli.StringFlag{ + Name: "dnsForBypass", + Usage: "DNS server for resolving domains in bypass list", + Value: "223.5.5.5:53", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, Suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "bypassDomainList", + Usage: "One domain per line, Suffix match mode. https://, http:// or local file absolute path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.BoolFlag{ + Name: "disableA", + Usage: "Disable A query", + }, + &cli.BoolFlag{ + Name: "disableAAAA", + Usage: "Disable AAAA query", + }, + &cli.StringFlag{ + Name: "bypassCIDR4List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr4.txt", + }, + &cli.StringFlag{ + Name: "bypassCIDR6List", + Usage: "One CIDR per line, https://, http:// or local file absolute path, like: https://txthinking.github.io/bypass/example_cidr6.txt", + }, + &cli.StringSliceFlag{ + Name: "bypassGeoIP", + Usage: "Bypass IP by Geo country code, such as US", + }, + &cli.BoolFlag{ + Name: "enableIPv6", + Usage: "Your local and server must support IPv6 both", + }, + &cli.BoolFlag{ + Name: "doNotRunScripts", + Usage: "This will not change iptables and others if you want to do by yourself", + }, + &cli.StringFlag{ + Name: "webListen", + Usage: "Ignore all other parameters, run web UI, like: ':9999'", + }, + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "brook server or brook wsserver or brook wssserver, like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://domain.com:443/ws, quic://domain.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca instead of insecure, such as /path/to/ca.pem", + }, + &cli.StringFlag{ + Name: "link", + Usage: "brook link. This will ignore server, password, udpovertcp, address, insecure, withoutBrookProtocol, ca", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "Dial with your socks5 proxy, such as 127.0.0.1:1081", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("webListen") != "" { + web, err := fs.Sub(static, "static") + if err != nil { + return err + } + var cmd *exec.Cmd + lock := &sync.Mutex{} + m := http.NewServeMux() + m.Handle("/", http.FileServer(http.FS(web))) + m.HandleFunc("/start", func(w http.ResponseWriter, r *http.Request) { + s, err := os.Executable() + if err != nil { + http.Error(w, err.Error(), 500) + return + } + lock.Lock() + defer lock.Unlock() + cmd = exec.Command("/bin/sh", "-c", s+" tproxy "+r.FormValue("args")) + log.Println(s + " tproxy " + r.FormValue("args")) + done := make(chan byte) + defer close(done) + errch := make(chan error) + go func() { + out, _ := cmd.CombinedOutput() + select { + case <-done: + log.Println(string(out)) + default: + select { + case <-done: + log.Println(string(out)) + case errch <- errors.New(string(out)): + } + } + lock.Lock() + cmd = nil + lock.Unlock() + }() + select { + case err := <-errch: + http.Error(w, err.Error(), 500) + return + case <-time.After(6 * time.Second): + w.Write([]byte("connected")) + } + }) + m.HandleFunc("/stop", func(w http.ResponseWriter, r *http.Request) { + lock.Lock() + defer lock.Unlock() + if cmd == nil { + w.Write([]byte("disconnected")) + return + } + if err := cmd.Process.Signal(syscall.SIGTERM); err != nil { + http.Error(w, err.Error(), 500) + return + } + w.Write([]byte("disconnected")) + }) + m.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) { + lock.Lock() + defer lock.Unlock() + if cmd == nil { + w.Write([]byte("disconnected")) + return + } + w.Write([]byte("connected")) + }) + s := &http.Server{ + Addr: c.String("webListen"), + Handler: m, + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + if cmd != nil { + cmd.Process.Signal(syscall.SIGTERM) + } + return s.Shutdown(context.Background()) + }, + }) + return nil + } + if c.String("listen") == "" || (c.String("link") == "" && (c.String("server") == "" || c.String("password") == "")) { + _ = cli.ShowSubcommandHelp(c) + return errors.New("") + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("bypassDomainList") != "" && !strings.HasPrefix(c.String("bypassDomainList"), "http://") && !strings.HasPrefix(c.String("bypassDomainList"), "https://") && !filepath.IsAbs(c.String("bypassDomainList")) { + return errors.New("--bypassDomainList must be with absolute path") + } + if c.String("bypassCIDR4List") != "" && !strings.HasPrefix(c.String("bypassCIDR4List"), "http://") && !strings.HasPrefix(c.String("bypassCIDR4List"), "https://") && !filepath.IsAbs(c.String("bypassCIDR4List")) { + return errors.New("--bypassCIDR4List must be with absolute path") + } + if c.String("bypassCIDR6List") != "" && !strings.HasPrefix(c.String("bypassCIDR6List"), "http://") && !strings.HasPrefix(c.String("bypassCIDR6List"), "https://") && !filepath.IsAbs(c.String("bypassCIDR6List")) { + return errors.New("--bypassCIDR6List must be with absolute path") + } + if c.String("blockDomainList") != "" || c.String("bypassDomainList") != "" || c.Bool("disableA") || c.Bool("disableAAAA") { + p, err := thedns.NewTheDNS(c.String("blockDomainList"), c.String("bypassDomainList"), c.String("dnsForBypass"), c.Bool("disableA"), c.Bool("disableAAAA")) + if err != nil { + return err + } + p.TouchBrook() + } + if c.String("bypassCIDR4List") != "" || c.String("bypassCIDR6List") != "" || len(c.StringSlice("bypassGeoIP")) != 0 { + p, err := tproxy.NewTproxy(c.String("bypassCIDR4List"), c.String("bypassCIDR6List"), c.StringSlice("bypassGeoIP"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + kind := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + kind = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + kind = "wssserver" + } + if strings.HasPrefix(c.String("server"), "quic://") { + kind = "quicserver" + } + v := url.Values{} + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + link := brook.LinkExtra(kind, c.String("server"), "", c.String("password"), v) + if c.String("link") != "" { + link = c.String("link") + } + s, err := brook.NewTproxy(c.String("listen"), link, c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + if !c.Bool("doNotRunScripts") { + s.ClearAutoScripts() + if err := s.RunAutoScripts(); err != nil { + return err + } + } + return s.ListenAndServe() + }, + Stop: func() error { + if !c.Bool("doNotRunScripts") { + if err := s.ClearAutoScripts(); err != nil { + log.Println(err) + } + } + return s.Shutdown() + }, + }) + if c.String("dnsListen") != "" { + s, err := brook.NewRelayOverBrook(c.String("dnsListen"), link, c.String("dnsForDefault"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.IsDNS = true + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "link", + Usage: "Generate brook link", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "Support brook server, brook wsserver, brook wssserver, socks5 server, brook quicserver. Like: 1.2.3.4:9999, ws://1.2.3.4:9999, wss://google.com:443/ws, socks5://1.2.3.4:1080, quic://google.com:443", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Password", + }, + &cli.StringFlag{ + Name: "username", + Aliases: []string{"u"}, + Usage: "Username, when server is socks5 server", + }, + &cli.StringFlag{ + Name: "name", + Usage: "Give this server a name", + }, + &cli.BoolFlag{ + Name: "udpovertcp", + Usage: "When server is brook server, UDP over TCP", + }, + &cli.StringFlag{ + Name: "address", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, specify address instead of resolving addresses from host, such as 1.2.3.4:443", + }, + &cli.BoolFlag{ + Name: "insecure", + Usage: "When server is brook wssserver or brook quicserver, client do not verify the server's certificate chain and host name", + }, + &cli.BoolFlag{ + Name: "withoutBrookProtocol", + Usage: "When server is brook wsserver or brook wssserver or brook quicserver, the data will not be encrypted with brook protocol", + }, + &cli.StringFlag{ + Name: "ca", + Usage: "When server is brook wssserver or brook quicserver, specify ca for untrusted cert, such as /path/to/ca.pem", + }, + }, + Action: func(c *cli.Context) error { + if c.String("server") == "" { + return cli.ShowSubcommandHelp(c) + } + s := "server" + if strings.HasPrefix(c.String("server"), "ws://") { + s = "wsserver" + } + if strings.HasPrefix(c.String("server"), "wss://") { + s = "wssserver" + } + if strings.HasPrefix(c.String("server"), "socks5://") { + s = "socks5" + } + if strings.HasPrefix(c.String("server"), "quic://") { + s = "quicserver" + } + v := url.Values{} + if c.String("name") != "" { + v.Set("name", c.String("name")) + } + if c.String("address") != "" { + v.Set("address", c.String("address")) + } + if c.Bool("insecure") { + v.Set("insecure", "true") + } + if c.Bool("withoutBrookProtocol") { + v.Set("withoutBrookProtocol", "true") + } + if c.Bool("udpovertcp") { + v.Set("udpovertcp", "true") + } + if c.String("ca") != "" { + b, err := ioutil.ReadFile(c.String("ca")) + if err != nil { + return err + } + v.Set("ca", string(b)) + } + fmt.Println(brook.LinkExtra(s, c.String("server"), c.String("username"), c.String("password"), v)) + return nil + }, + }, + &cli.Command{ + Name: "connect", + Usage: "Run as client and connect to brook link, both TCP and UDP, to start a socks5 proxy, [src <-> socks5 <-> $ brook connect <-> $ brook server/wsserver/wssserver/quicserver <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "link", + Aliases: []string{"l"}, + Usage: "brook link, you can get it via $ brook link", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:1080", + Usage: "Where to listen for SOCKS5 connections", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "http", + Usage: "Where to listen for HTTP proxy connections", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + &cli.StringFlag{ + Name: "dialWithSocks5", + Usage: "If you already have a socks5, such as 127.0.0.1:1081, and want [src <-> listen socks5 <-> $ brook connect <-> dialWithSocks5 <-> $ brook server/wsserver/wssserver <-> dst]", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Username", + Usage: "Optional", + }, + &cli.StringFlag{ + Name: "dialWithSocks5Password", + Usage: "Optional", + }, + }, + Action: func(c *cli.Context) error { + if c.String("link") == "" { + return cli.ShowSubcommandHelp(c) + } + h, p, err := net.SplitHostPort(c.String("socks5")) + if err != nil { + return err + } + if c.String("socks5ServerIP") != "" { + h = c.String("socks5ServerIP") + } + if h == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use loopback IP or lan IP or other, we can not decide for you") + } + kind, _, _, _, _, err := brook.ParseLinkExtra(c.String("link")) + if err != nil { + return err + } + if kind == "socks5" { + return errors.New("Looks like you want create socks5 from a socks5, you may want $ brook socks5tohttp?") + } + if c.String("dialWithSocks5") != "" { + p, err := socks5dial.NewSocks5Dial(c.String("dialWithSocks5"), c.String("dialWithSocks5Username"), c.String("dialWithSocks5Password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + p.TouchBrook() + } + s, err := brook.NewBrookLink(c.String("link")) + if err != nil { + return err + } + err = s.PrepareSocks5Server(c.String("socks5"), h, c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + if c.String("http") != "" { + h, err := brook.NewSocks5ToHTTP(c.String("http"), net.JoinHostPort(h, p), "", "", c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return h.ListenAndServe() + }, + Stop: func() error { + return h.Shutdown() + }, + }) + } + return nil + }, + }, + &cli.Command{ + Name: "relay", + Usage: "Run as standalone relay, both TCP and UDP, this means access [from address] is equal to access [to address], [src <-> from address <-> to address]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "from", + Aliases: []string{"f", "l"}, + Usage: "Listen address: like ':9999'", + }, + &cli.StringFlag{ + Name: "to", + Aliases: []string{"t"}, + Usage: "Address which relay to, like: 1.2.3.4:9999", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("from") == "" || c.String("to") == "" { + return cli.ShowSubcommandHelp(c) + } + s, err := brook.NewRelay(c.String("from"), c.String("to"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "dnsserver", + Usage: "Run as standalone dns server, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: 127.0.0.1:53", + }, + &cli.StringFlag{ + Name: "dns", + Usage: "DNS server which forward to", + Value: "8.8.8.8:53", + }, + &cli.StringFlag{ + Name: "blockDomainList", + Usage: "One domain per line, suffix match mode. https://, http:// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.BoolFlag{ + Name: "disableA", + Usage: "Disable A query", + }, + &cli.BoolFlag{ + Name: "disableAAAA", + Usage: "Disable AAAA query", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("blockDomainList") != "" && !strings.HasPrefix(c.String("blockDomainList"), "http://") && !strings.HasPrefix(c.String("blockDomainList"), "https://") && !filepath.IsAbs(c.String("blockDomainList")) { + return errors.New("--blockDomainList must be with absolute path") + } + if c.String("blockDomainList") != "" || c.Bool("disableA") || c.Bool("disableAAAA") { + p, err := thedns.NewTheDNS(c.String("blockDomainList"), "", "", c.Bool("disableA"), c.Bool("disableAAAA")) + if err != nil { + return err + } + p.TouchBrook() + } + s, err := brook.NewRelay(c.String("listen"), c.String("dns"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.IsDNS = true + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "socks5", + Usage: "Run as standalone standard socks5 server, both TCP and UDP", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Socks5 server listen address, like: :1080 or 1.2.3.4:1080", + }, + &cli.StringFlag{ + Name: "socks5ServerIP", + Usage: "Only if your socks5 server IP is different from listen IP", + }, + &cli.StringFlag{ + Name: "username", + Usage: "User name, optional", + }, + &cli.StringFlag{ + Name: "password", + Usage: "Password, optional", + }, + &cli.BoolFlag{ + Name: "limitUDP", + Usage: "The server MAY use this information to limit access to the UDP association", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "Connection deadline time (s)", + }, + &cli.IntFlag{ + Name: "udpTimeout", + Value: 60, + Usage: "Connection deadline time (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" { + return cli.ShowSubcommandHelp(c) + } + h, _, err := net.SplitHostPort(c.String("listen")) + if err != nil { + return err + } + if h == "" && c.String("socks5ServerIP") == "" { + return errors.New("socks5 server requires a clear IP for UDP, only port is not enough. You may use public IP or lan IP or other, we can not decide for you") + } + var ip string + if h != "" { + ip = h + } + if c.String("socks5ServerIP") != "" { + ip = c.String("socks5ServerIP") + } + s, err := brook.NewSocks5Server(c.String("listen"), ip, c.String("username"), c.String("password"), c.Int("tcpTimeout"), c.Int("udpTimeout")) + if err != nil { + return err + } + s.Server.LimitUDP = c.Bool("limitUDP") + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "socks5tohttp", + Usage: "Convert socks5 to http proxy, [src <-> listen address(http proxy) <-> socks5 address <-> dst]", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "socks5", + Aliases: []string{"s"}, + Usage: "Socks5 server address, like: 127.0.0.1:1080", + }, + &cli.StringFlag{ + Name: "socks5username", + Usage: "Socks5 username, optional", + }, + &cli.StringFlag{ + Name: "socks5password", + Usage: "Socks5 password, optional", + }, + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "HTTP proxy which will be create: like: 127.0.0.1:8010", + }, + &cli.IntFlag{ + Name: "tcpTimeout", + Value: 0, + Usage: "Connection tcp timeout (s)", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" || c.String("socks5") == "" { + return cli.ShowSubcommandHelp(c) + } + s, err := brook.NewSocks5ToHTTP(c.String("listen"), c.String("socks5"), c.String("socks5username"), c.String("socks5password"), c.Int("tcpTimeout")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "pac", + Usage: "Run as PAC server or save PAC to file", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: 127.0.0.1:1980", + }, + &cli.StringFlag{ + Name: "proxy", + Aliases: []string{"p"}, + Value: "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT", + Usage: "Proxy, like: 'SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT'", + }, + &cli.StringFlag{ + Name: "bypassDomainList", + Aliases: []string{"b"}, + Usage: "One domain per line, suffix match mode. http(s):// or local absolute file path. Like: https://txthinking.github.io/bypass/example_domain.txt", + }, + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Save PAC to file, this will ignore listen address", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" && c.String("file") == "" { + return cli.ShowSubcommandHelp(c) + } + if c.String("bypassDomainList") != "" && !strings.HasPrefix(c.String("bypassDomainList"), "http://") && !strings.HasPrefix(c.String("bypassDomainList"), "https://") && !filepath.IsAbs(c.String("bypassDomainList")) { + return errors.New("--bypassDomainList must be with absolute path") + } + s := brook.NewPAC(c.String("listen"), c.String("file"), c.String("proxy"), c.String("bypassDomainList")) + if c.String("file") != "" { + return s.WriteToFile() + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "testsocks5", + Usage: "Test UDP and TCP of socks5 server", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "socks5", + Aliases: []string{"s"}, + Usage: "Like: 127.0.0.1:1080", + }, + &cli.StringFlag{ + Name: "username", + Aliases: []string{"u"}, + Usage: "Socks5 username", + }, + &cli.StringFlag{ + Name: "password", + Aliases: []string{"p"}, + Usage: "Socks5 password", + }, + &cli.StringFlag{ + Name: "dns", + Value: "8.8.8.8:53", + Usage: "DNS server for connecting", + }, + &cli.StringFlag{ + Name: "domain", + Value: "http3.ooo", + Usage: "Domain for query", + }, + &cli.StringFlag{ + Name: "a", + Value: "137.184.237.95", + Usage: "The A record of domain", + }, + }, + Action: func(c *cli.Context) error { + if c.String("socks5") == "" { + return cli.ShowSubcommandHelp(c) + } + socks5.Debug = true + return brook.Socks5Test(c.String("socks5"), c.String("username"), c.String("password"), c.String("domain"), c.String("a"), c.String("dns")) + }, + }, + &cli.Command{ + Name: "testbrook", + Usage: "Test UDP and TCP of brook server/wsserver/wssserver", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "link", + Aliases: []string{"l"}, + Usage: "brook link. Get it via $ brook link", + }, + &cli.StringFlag{ + Name: "socks5", + Value: "127.0.0.1:11080", + Usage: "Temporarily listening socks5", + }, + &cli.StringFlag{ + Name: "dns", + Value: "8.8.8.8:53", + Usage: "DNS server for connecting", + }, + &cli.StringFlag{ + Name: "domain", + Value: "http3.ooo", + Usage: "Domain for query", + }, + &cli.StringFlag{ + Name: "a", + Value: "137.184.237.95", + Usage: "The A record of domain", + }, + }, + Action: func(c *cli.Context) error { + if c.String("link") == "" { + return cli.ShowSubcommandHelp(c) + } + socks5.Debug = true + fmt.Println("Run brook connect to listen", c.String("socks5")) + var cmd *exec.Cmd + var err error + go func() { + var s string + s, err = os.Executable() + if err != nil { + return + } + cmd = exec.Command(s, "connect", "--link", c.String("link"), "--socks5", c.String("socks5")) + b, _ := cmd.CombinedOutput() + err = errors.New(string(b)) + }() + time.Sleep(3 * time.Second) + if err != nil { + return err + } + err1 := brook.Socks5Test(c.String("socks5"), "", "", c.String("domain"), c.String("a"), c.String("dns")) + _ = cmd.Process.Signal(syscall.SIGTERM) + return err1 + }, + }, + &cli.Command{ + Name: "echoserver", + Usage: "Echo server, echo UDP and TCP address of routes", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "listen", + Aliases: []string{"l"}, + Usage: "Listen address, like: ':7777'", + }, + }, + Action: func(c *cli.Context) error { + if c.String("listen") == "" { + return cli.ShowSubcommandHelp(c) + } + s, err := brook.NewEchoServer(c.String("listen")) + if err != nil { + return err + } + g.Add(&runnergroup.Runner{ + Start: func() error { + return s.ListenAndServe() + }, + Stop: func() error { + return s.Shutdown() + }, + }) + return nil + }, + }, + &cli.Command{ + Name: "echoclient", + Usage: "Connect to echoserver, echo UDP and TCP address of routes", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "server", + Aliases: []string{"s"}, + Usage: "Echo server address, such as 1.2.3.4:7777", + }, + &cli.IntFlag{ + Name: "times", + Value: 1, + Usage: "Times of interactions", + }, + }, + Action: func(c *cli.Context) error { + if c.String("server") == "" { + return cli.ShowSubcommandHelp(c) + } + return brook.EchoClient(c.String("server"), c.Int("times")) + }, + }, + &cli.Command{ + Name: "completion", + Usage: "Generate shell completions", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Write to file", + Value: "brook_autocomplete", + }, + }, + Action: func(c *cli.Context) error { + l := c.App.VisibleCommands() + if strings.Contains(os.Getenv("SHELL"), "zsh") { + s := ` +_cli_zsh_autocomplete() { + local -a opts + local cur + cur=${words[-1]} + if [[ "$cur" == "-"* ]]; then + opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}") + else + opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}") + fi + + if [[ "${opts[1]}" != "" ]]; then + _describe 'values' opts + else + _files + fi +} +compdef _cli_zsh_autocomplete brook +` + for _, v := range l { + s += "compdef _cli_zsh_autocomplete brook " + v.Name + "\n" + } + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + fmt.Println("Generated") + fmt.Println("\t" + c.String("file")) + fmt.Println("To enable auto-completion for the current shell session") + fmt.Println("\t$ source " + c.String("file")) + fmt.Println("To enable persistent auto-completion, add this line to your .zsh") + fmt.Println("\t$ source /path/to/" + c.String("file")) + return nil + } + s := `#! /bin/bash +_cli_bash_autocomplete() { + if [[ "${COMP_WORDS[0]}" != "source" ]]; then + local cur opts base + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ "$cur" == "-"* ]]; then + opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion ) + else + opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) + fi + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi +} +complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete brook +` + for _, v := range l { + s += "complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete brook " + v.Name + "\n" + } + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + fmt.Println("Generated:") + fmt.Println("\t" + c.String("file")) + fmt.Println("To enable auto-completion for the current shell session") + fmt.Println("\t$ source " + c.String("file")) + if runtime.GOOS == "darwin" { + fmt.Println("To enable persistent auto-completion, add this line to your .bash_profile") + } + if runtime.GOOS != "darwin" { + fmt.Println("To enable persistent auto-completion, add this line to your .bashrc") + } + fmt.Println("\t$ source /path/to/" + c.String("file")) + return nil + }, + }, + &cli.Command{ + Name: "mdpage", + Usage: "Generate markdown page", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Write to file, default print to stdout", + }, + }, + Action: func(c *cli.Context) error { + s, err := c.App.ToMarkdown() + if err != nil { + return err + } + if c.String("file") != "" { + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + return nil + } + fmt.Println(s) + return nil + }, + }, + &cli.Command{ + Name: "manpage", + Usage: "Generate man.1 page", + BashComplete: func(c *cli.Context) { + l := c.Command.VisibleFlags() + for _, v := range l { + fmt.Println("--" + v.Names()[0]) + } + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "file", + Aliases: []string{"f"}, + Usage: "Write to file, default print to stdout. You should put to /path/to/man/man1/brook.1 on linux or /usr/local/share/man/man1/brook.1 on macos", + }, + }, + Action: func(c *cli.Context) error { + s, err := c.App.ToManWithSection(1) + if err != nil { + return err + } + if c.String("file") != "" { + if err := os.WriteFile(c.String("file"), []byte(s), 0644); err != nil { + return err + } + return nil + } + fmt.Println(s) + return nil + }, + }, + } + if os.Getenv("SOCKS5_DEBUG") != "" { + socks5.Debug = true + } + if err := app.Run(os.Args); err != nil { + log.Println(err) + return + } + if len(g.Runners) == 0 { + return + } + go func() { + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + <-sigs + g.Done() + }() + log.Println(g.Wait()) +} +``` + +## `quicserver.go` (changed lines (48, 49)) + +```go +// Copyright (c) 2016-present Cloud +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 3 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package brook + +import ( + "context" + "crypto/tls" + "errors" + "net" + "net/http" + "os/exec" + "runtime" + "time" + + "github.com/quic-go/quic-go" + "github.com/txthinking/brook/limits" + crypto1 "github.com/txthinking/crypto" + "github.com/txthinking/runnergroup" + "github.com/txthinking/socks5" + "golang.org/x/crypto/acme/autocert" +) + +type QUICServer struct { + Password []byte + Domain string + Addr string + TCPTimeout int + UDPTimeout int + Cert []byte + CertKey []byte + RunnerGroup *runnergroup.RunnerGroup + WithoutBrook bool + UDPServerConnFactory UDPServerConnFactory +} + +func NewQUICServer(addr, password, domain string, tcpTimeout, udpTimeout int, blockDomainList, blockCIDR4List, blockCIDR6List string, updateListInterval int64, blockGeoIP []string, withoutbrook bool) (*QUICServer, error) { + if err := limits.Raise(); err != nil { + Log(&Error{"when": "try to raise system limits", "warning": err.Error()}) + } + if runtime.GOOS == "linux" { + c := exec.Command("sysctl", "-w", "net.core.rmem_max=2500000") + b, err := c.CombinedOutput() + if err != nil { + Log(&Error{"when": "try to raise UDP Receive Buffer Size", "warning": string(b)}) + } + } + if runtime.GOOS == "darwin" { + c := exec.Command("sysctl", "-w", "kern.ipc.maxsockbuf=3014656") + b, err := c.CombinedOutput() + if err != nil { + Log(&Error{"when": "try to raise UDP Receive Buffer Size", "warning": string(b)}) + } + } + var p []byte + var f UDPServerConnFactory + if !withoutbrook { + p = []byte(password) + f = NewPacketServerConnFactory() + } + if withoutbrook { + var err error + p, err = crypto1.SHA256Bytes([]byte(password)) + if err != nil { + return nil, err + } + f = NewSimplePacketServerConnFactory() + } + s := &QUICServer{ + Password: p, + Domain: domain, + Addr: addr, + TCPTimeout: tcpTimeout, + UDPTimeout: udpTimeout, + UDPServerConnFactory: f, + RunnerGroup: runnergroup.New(), + WithoutBrook: withoutbrook, + } + return s, nil +} + +func (s *QUICServer) ListenAndServe() error { + var t *tls.Config + if s.Cert == nil || s.CertKey == nil { + m := autocert.Manager{ + Cache: autocert.DirCache(".letsencrypt"), + Prompt: autocert.AcceptTOS, + HostPolicy: autocert.HostWhitelist(s.Domain), + Email: "cloud@txthinking.com", + } + server := &http.Server{Addr: ":80", Handler: m.HTTPHandler(nil)} + s.RunnerGroup.Add(&runnergroup.Runner{ + Start: func() error { + return server.ListenAndServe() + }, + Stop: func() error { + return server.Shutdown(context.Background()) + }, + }) + t = &tls.Config{GetCertificate: m.GetCertificate, ServerName: s.Domain, NextProtos: []string{"h3"}} + } + if s.Cert != nil && s.CertKey != nil { + ct, err := tls.X509KeyPair(s.Cert, s.CertKey) + if err != nil { + return err + } + t = &tls.Config{Certificates: []tls.Certificate{ct}, ServerName: s.Domain, NextProtos: []string{"h3"}} + } + l, err := quic.ListenAddr(s.Addr, t, &quic.Config{MaxIdleTimeout: time.Duration(s.UDPTimeout) * time.Second, EnableDatagrams: true}) + if err != nil { + return err + } + s.RunnerGroup.Add(&runnergroup.Runner{ + Start: func() error { + for { + c, err := l.Accept(context.Background()) + if err != nil { + return err + } + go func(c quic.Connection) { + defer c.CloseWithError(0, "defer") + for { + st, err := c.AcceptStream(context.Background()) + if err != nil { + return + } + go func(c net.Conn) { + defer c.Close() + var ss Exchanger + if !s.WithoutBrook { + ss, err = NewStreamServer(s.Password, c.RemoteAddr().String(), c, s.TCPTimeout, s.UDPTimeout) + } + if s.WithoutBrook { + ss, err = NewSimpleStreamServer(s.Password, c.RemoteAddr().String(), c, s.TCPTimeout, s.UDPTimeout) + } + if err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "error": err.Error()}) + return + } + defer ss.Clean() + if err := s.TCPHandle(ss); err != nil { + Log(&Error{"from": ss.Src(), "dst": ss.Dst(), "error": err.Error()}) + } + }(&QUICConn{ + Conn: c, + Stream: st, + LAddr: &net.TCPAddr{ + IP: c.LocalAddr().(*net.UDPAddr).IP, + Port: c.LocalAddr().(*net.UDPAddr).Port, + Zone: c.LocalAddr().(*net.UDPAddr).Zone, + }, + RAddr: &net.TCPAddr{ + IP: c.RemoteAddr().(*net.UDPAddr).IP, + Port: c.RemoteAddr().(*net.UDPAddr).Port, + Zone: c.RemoteAddr().(*net.UDPAddr).Zone, + }, + }) + } + }(c) + if c.ConnectionState().SupportsDatagrams { + go func(c quic.Connection) { + defer c.CloseWithError(0, "defer") + for { + b, err := c.ReceiveMessage() + if err != nil { + return + } + conn, dstb, err := s.UDPServerConnFactory.Handle(c.RemoteAddr().(*net.UDPAddr), b, s.Password, func(b []byte) (int, error) { + if len(b) > 1197 { + err := errors.New("when write to client, quic max datagram size is 1197") + Log(&Error{"from": c.RemoteAddr().String(), "error": err.Error()}) + return 0, err + } + if err := c.SendMessage(b); err != nil { + return 0, err + } + return len(b), nil + }, s.UDPTimeout) + if err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "error": err.Error()}) + continue + } + if conn == nil { + continue + } + go func() { + defer conn.Close() + var ss Exchanger + if !s.WithoutBrook { + ss, err = NewPacketServer(s.Password, c.RemoteAddr().String(), conn, s.UDPTimeout, dstb) + } + if s.WithoutBrook { + ss, err = NewSimplePacketServer(s.Password, c.RemoteAddr().String(), conn, s.UDPTimeout, dstb) + } + if err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "dst": socks5.ToAddress(dstb[0], dstb[1:len(dstb)-2], dstb[len(dstb)-2:]), "error": err.Error()}) + return + } + defer ss.Clean() + if err := s.UDPHandle(ss); err != nil { + Log(&Error{"from": c.RemoteAddr().String(), "dst": socks5.ToAddress(dstb[0], dstb[1:len(dstb)-2], dstb[len(dstb)-2:]), "error": err.Error()}) + } + }() + } + }(c) + } + } + return nil + }, + Stop: func() error { + return l.Close() + }, + }) + go func() { + time.Sleep(1 * time.Second) + _, _ = quic.DialAddr(net.JoinHostPort(s.Domain, s.Addr[1:]), &tls.Config{NextProtos: []string{"h3"}}, nil) + }() + return s.RunnerGroup.Wait() +} + +func (s *QUICServer) TCPHandle(ss Exchanger) error { + rc, err := DialTCP("tcp", "", ss.Dst()) + if err != nil { + return err + } + defer rc.Close() + if err := ss.Exchange(rc); err != nil { + return nil + } + return nil +} + +func (s *QUICServer) UDPHandle(ss Exchanger) error { + rc, err := NATDial("udp", ss.Src(), ss.Dst(), ss.Dst()) + if err != nil { + return err + } + defer rc.Close() + if err := ss.Exchange(rc); err != nil { + return nil + } + return nil +} + +func (s *QUICServer) Shutdown() error { + return s.RunnerGroup.Done() +} +``` + +## `streamclient.go` (changed lines (97, 98, 153, 154, 172, 173, 179, 180, 191, 192)) + +```go +// Copyright (c) 2016-present Cloud +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 3 of the GNU General Public +// License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package brook + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "crypto/sha256" + "encoding/binary" + "errors" + "io" + "net" + "time" + + "github.com/txthinking/socks5" + "github.com/txthinking/x" + "golang.org/x/crypto/hkdf" +) + +type StreamClient struct { + Server net.Conn + cn []byte + ca cipher.AEAD + sn []byte + sa cipher.AEAD + RB []byte + WB []byte + Timeout int + network string + src string + dst string +} + +func NewStreamClient(network string, password []byte, src string, server net.Conn, timeout int, dst []byte) (Exchanger, error) { + if timeout != 0 { + if err := server.SetDeadline(time.Now().Add(time.Duration(timeout) * time.Second)); err != nil { + return nil, err + } + } + if len(dst) > 2048-2-16-4-16 { + return nil, errors.New("dst too long") + } + c := &StreamClient{network: network, Server: server, Timeout: timeout, src: src, dst: socks5.ToAddress(dst[0], dst[1:len(dst)-2], dst[len(dst)-2:])} + + c.cn = x.BP12.Get().([]byte) + if _, err := io.ReadFull(rand.Reader, c.cn); err != nil { + x.BP12.Put(c.cn) + return nil, err + } + ck := x.BP32.Get().([]byte) + if _, err := io.ReadFull(hkdf.New(sha256.New, password, c.cn, []byte{0x62, 0x72, 0x6f, 0x6f, 0x6b}), ck); err != nil { + x.BP12.Put(c.cn) + x.BP32.Put(ck) + return nil, err + } + if _, err := c.Server.Write(c.cn); err != nil { + x.BP12.Put(c.cn) + x.BP32.Put(ck) + return nil, err + } + cb, err := aes.NewCipher(ck) + if err != nil { + x.BP12.Put(c.cn) + x.BP32.Put(ck) + return nil, err + } + x.BP32.Put(ck) + c.ca, err = cipher.NewGCM(cb) + if err != nil { + x.BP12.Put(c.cn) + return nil, err + } + + c.WB = x.BP2048.Get().([]byte) + i := time.Now().Unix() + if c.network == "tcp" && i%2 != 0 { + i += 1 + } + if c.network == "udp" && i%2 != 1 { + i += 1 + } + binary.BigEndian.PutUint32(c.WB[2+16:2+16+4], uint32(i)) + copy(c.WB[2+16+4:2+16+4+len(dst)], dst) + if err := c.WriteL(4 + len(dst)); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + return nil, err + } + + c.sn = x.BP12.Get().([]byte) + if _, err := io.ReadFull(c.Server, c.sn); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + return nil, err + } + sk := x.BP32.Get().([]byte) + if _, err := io.ReadFull(hkdf.New(sha256.New, password, c.sn, []byte{0x62, 0x72, 0x6f, 0x6f, 0x6b}), sk); err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + x.BP32.Put(sk) + return nil, err + } + sb, err := aes.NewCipher(sk) + if err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + x.BP32.Put(sk) + return nil, err + } + x.BP32.Put(sk) + c.sa, err = cipher.NewGCM(sb) + if err != nil { + x.BP12.Put(c.cn) + x.BP2048.Put(c.WB) + x.BP12.Put(c.sn) + return nil, err + } + if c.network == "tcp" { + c.RB = x.BP2048.Get().([]byte) + } + if c.network == "udp" { + x.BP2048.Put(c.WB) + c.WB = x.BP65507.Get().([]byte) + c.RB = x.BP65507.Get().([]byte) + } + return ClientGate(c) +} + +func (c *StreamClient) Exchange(local net.Conn) error { + go func() { + for { + if c.Timeout != 0 { + if err := c.Server.SetDeadline(time.Now().Add(time.Duration(c.Timeout) * time.Second)); err != nil { + return + } + } + l, err := c.ReadL() + if err != nil { + return + } + if _, err := local.Write(c.RB[2+16 : 2+16+l]); err != nil { + return + } + } + }() + for { + if c.Timeout != 0 { + if err := local.SetDeadline(time.Now().Add(time.Duration(c.Timeout) * time.Second)); err != nil { + return nil + } + } + l, err := local.Read(c.WB[2+16 : len(c.WB)-16]) + if err != nil { + return nil + } + if err := c.WriteL(l); err != nil { + return nil + } + } + return nil +} + +func (c *StreamClient) WriteL(l int) error { + binary.BigEndian.PutUint16(c.WB[:2], uint16(l)) + c.ca.Seal(c.WB[:0], c.cn, c.WB[:2], nil) + NextNonce(c.cn) + c.ca.Seal(c.WB[:2+16], c.cn, c.WB[2+16:2+16+l], nil) + if _, err := c.Server.Write(c.WB[:2+16+l+16]); err != nil { + return err + } + NextNonce(c.cn) + return nil +} + +func (c *StreamClient) ReadL() (int, error) { + if _, err := io.ReadFull(c.Server, c.RB[:2+16]); err != nil { + return 0, err + } + if _, err := c.sa.Open(c.RB[:0], c.sn, c.RB[:2+16], nil); err != nil { + return 0, err + } + l := int(binary.BigEndian.Uint16(c.RB[:2])) + if _, err := io.ReadFull(c.Server, c.RB[2+16:2+16+l+16]); err != nil { + return 0, err + } + NextNonce(c.sn) + if _, err := c.sa.Open(c.RB[:2+16], c.sn, c.RB[2+16:2+16+l+16], nil); err != nil { + return 0, err + } + NextNonce(c.sn) + return l, nil +} + +func (c *StreamClient) Clean() { + x.BP12.Put(c.cn) + x.BP12.Put(c.sn) + if c.network == "tcp" { + x.BP2048.Put(c.WB) + x.BP2048.Put(c.RB) + } + if c.network == "udp" { + x.BP65507.Put(c.WB) + x.BP65507.Put(c.RB) + } +} + +func (s *StreamClient) Network() string { + return s.network +} + +func (s *StreamClient) Src() string { + return s.src +} + +func (s *StreamClient) Dst() string { + return s.dst +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/task.json new file mode 100644 index 0000000000000000000000000000000000000000..55b572bd0e63a4d9839e8c2cb0cb61c056278cf4 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/task.json @@ -0,0 +1,50 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-7c57d35438d22210ced2", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-7c57d35438d22210ced2", + "project_id": "morefixes__txthinking__brook", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "cli/brook/main.go", + "quicserver.go", + "streamclient.go" + ], + "patch_units": { + "before": [ + "cli/brook/main.go", + "quicserver.go", + "streamclient.go" + ], + "after": [ + "cli/brook/main.go", + "quicserver.go", + "streamclient.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/408e338aeafeed853eb07f2de1999b081c2e3220b702d75ba68e0798e7649ed2/database", + "cache_key": "408e338aeafeed853eb07f2de1999b081c2e3220b702d75ba68e0798e7649ed2", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/af6ef389151a7debea15f88c5c720e732cdbc38ba9458380cf9f37f275ad6ff7/database", + "cache_key": "af6ef389151a7debea15f88c5c720e732cdbc38ba9458380cf9f37f275ad6ff7", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/c86e15674ed1c9949d4ea2b7d8490713f03ba80f06ac7eb0ae975af3dff8656f/database", + "cache_key": "c86e15674ed1c9949d4ea2b7d8490713f03ba80f06ac7eb0ae975af3dff8656f", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-7c57d35438d22210ced2/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-7c57d35438d22210ced2/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7c57d35438d22210ced2/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..f4dda3b9169f3ddf059c15fa9934a3f2be4f7771 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/patch.diff @@ -0,0 +1,60 @@ +diff --git a/modules/zerogod/zerogod_acceptor.go b/modules/zerogod/zerogod_acceptor.go +index ccb956ef..ccae002d 100644 +--- a/modules/zerogod/zerogod_acceptor.go ++++ b/modules/zerogod/zerogod_acceptor.go +@@ -117,16 +117,24 @@ func (a *Acceptor) startTCP() (err error) { + } + } else { + a.mod.Debug("accepted %s connection for service %s (port %d): %v", a.proto, tui.Green(a.service), a.port, conn.RemoteAddr()) +- go a.handler.Handle(&HandlerContext{ +- service: a.service, +- mod: a.mod, +- client: conn, +- srvHost: a.srvHost, +- srvPort: int(a.port), +- srvTLS: a.tlsConfig != nil, +- ippAttributes: a.ippAttributes, +- httpPaths: a.httpPaths, +- }) ++ go func() { ++ ctx := &HandlerContext{ ++ service: a.service, ++ mod: a.mod, ++ client: conn, ++ srvHost: a.srvHost, ++ srvPort: int(a.port), ++ srvTLS: a.tlsConfig != nil, ++ ippAttributes: a.ippAttributes, ++ httpPaths: a.httpPaths, ++ } ++ defer func() { ++ if r := recover(); r != nil { ++ a.mod.Error("panic in %s handler for %s: %v", a.service, conn.RemoteAddr(), r) ++ } ++ }() ++ a.handler.Handle(ctx) ++ }() + } + } + a.mod.Debug("%s listener for port %d (%s) stopped", a.proto, a.port, tui.Green(a.service)) +diff --git a/modules/zerogod/zerogod_ipp_primitives.go b/modules/zerogod/zerogod_ipp_primitives.go +index a87a1fe7..abba691b 100644 +--- a/modules/zerogod/zerogod_ipp_primitives.go ++++ b/modules/zerogod/zerogod_ipp_primitives.go +@@ -13,6 +13,7 @@ import ( + ) + + const IPP_CHUNK_MAX_LINE_SIZE = 1024 ++const IPP_CHUNK_MAX_SIZE = 10 * 1024 * 1024 // 10 MB + + var IPP_REQUEST_NAMES = map[int16]string{ + // https://tools.ietf.org/html/rfc2911#section-4.4.15 +@@ -136,6 +137,8 @@ func ippReadChunkedBody(ctx *HandlerContext) ([]byte, error) { + return nil, fmt.Errorf("error reading next chunk size: %v", err) + } else if chunkSize == 0 { + break ++ } else if chunkSize > IPP_CHUNK_MAX_SIZE { ++ return nil, fmt.Errorf("chunk size %d exceeds maximum allowed size of %d bytes", chunkSize, IPP_CHUNK_MAX_SIZE) + } else { + chunk := make([]byte, chunkSize) + if n, err := ctx.client.Read(chunk); err != nil { diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..69710f4a6f54fafa40148d946ed719999a47fa5e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/post_context.md @@ -0,0 +1,430 @@ +# Patch-overlapping Go context after the fix + +## `modules/zerogod/zerogod_acceptor.go` (changed lines (120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137)) + +```go +package zerogod + +import ( + "context" + "crypto/tls" + "fmt" + "net" + "strings" + + "github.com/evilsocket/islazy/ops" + "github.com/evilsocket/islazy/tui" +) + +type Handler struct { + TLS bool + Handle func(ctx *HandlerContext) +} + +// TODO: possibly autodetect from peeking at the first bytes sent by the client +var TCP_HANDLERS = map[string]Handler{ + "_ipp": { + Handle: ippClientHandler, + }, + "_ipps": { + TLS: true, + Handle: ippClientHandler, + }, + "_http": { + Handle: httpClientHandler, + }, + "_https": { + TLS: true, + Handle: httpClientHandler, + }, +} + +type Acceptor struct { + mod *ZeroGod + srvHost string + proto string + port uint16 + service string + tlsConfig *tls.Config + tcpListener net.Listener + udpListener *net.UDPConn + running bool + context context.Context + ctxCancel context.CancelFunc + handler Handler + ippAttributes map[string]string + httpPaths map[string]string +} + +type HandlerContext struct { + service string + mod *ZeroGod + client net.Conn + srvHost string + srvPort int + srvTLS bool + ippAttributes map[string]string + httpPaths map[string]string +} + +func NewAcceptor(mod *ZeroGod, service string, srvHost string, port uint16, tlsConfig *tls.Config, ippAttributes map[string]string, httpPaths map[string]string) *Acceptor { + context, ctcCancel := context.WithCancel(context.Background()) + proto := ops.Ternary(strings.Contains(service, "_tcp"), "tcp", "udp").(string) + + acceptor := Acceptor{ + mod: mod, + port: port, + proto: proto, + service: service, + context: context, + ctxCancel: ctcCancel, + srvHost: srvHost, + ippAttributes: ippAttributes, + httpPaths: httpPaths, + } + + for svcName, svcHandler := range TCP_HANDLERS { + if strings.Contains(service, svcName) { + if svcHandler.TLS { + acceptor.tlsConfig = tlsConfig + } + acceptor.handler = svcHandler + break + } + } + + if acceptor.handler.Handle == nil { + mod.Warning("no protocol handler found for service %s, using generic %s dump handler", tui.Yellow(service), proto) + acceptor.handler.Handle = handleGenericTCP + } else { + mod.Info("found %s %s protocol handler (tls=%v)", proto, tui.Green(service), acceptor.tlsConfig != nil) + } + + return &acceptor +} + +func (a *Acceptor) startTCP() (err error) { + var lc net.ListenConfig + if a.tcpListener, err = lc.Listen(a.context, "tcp", fmt.Sprintf("0.0.0.0:%d", a.port)); err != nil { + return err + } + if a.tlsConfig != nil { + a.tcpListener = tls.NewListener(a.tcpListener, a.tlsConfig) + } + + a.running = true + go func() { + a.mod.Debug("%s listener for port %d (%s) started", a.proto, a.port, tui.Green(a.service)) + for a.running { + if conn, err := a.tcpListener.Accept(); err != nil { + if a.running { + a.mod.Error("%v", err) + } + } else { + a.mod.Debug("accepted %s connection for service %s (port %d): %v", a.proto, tui.Green(a.service), a.port, conn.RemoteAddr()) + go func() { + ctx := &HandlerContext{ + service: a.service, + mod: a.mod, + client: conn, + srvHost: a.srvHost, + srvPort: int(a.port), + srvTLS: a.tlsConfig != nil, + ippAttributes: a.ippAttributes, + httpPaths: a.httpPaths, + } + defer func() { + if r := recover(); r != nil { + a.mod.Error("panic in %s handler for %s: %v", a.service, conn.RemoteAddr(), r) + } + }() + a.handler.Handle(ctx) + }() + } + } + a.mod.Debug("%s listener for port %d (%s) stopped", a.proto, a.port, tui.Green(a.service)) + }() + + return nil +} + +func (a *Acceptor) startUDP() (err error) { + if udpAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("0.0.0.0:%d", a.port)); err != nil { + return err + } else if a.udpListener, err = net.ListenUDP("udp", udpAddr); err != nil { + return err + } else { + a.running = true + go func() { + var buffer [4096]byte + + a.mod.Info("%s listener for port %d (%s) started", a.proto, a.port, tui.Green(a.service)) + + for a.running { + if n, addr, err := a.udpListener.ReadFromUDP(buffer[0:]); err != nil { + a.mod.Warning("error reading udp packet: %v", err) + } else if n <= 0 { + a.mod.Info("empty read") + } else { + a.mod.Info("%v:\n%s", addr, Dump(buffer[0:n])) + } + } + + a.mod.Info("%s listener for port %d (%s) stopped", a.proto, a.port, tui.Green(a.service)) + }() + } + + return nil +} + +func (a *Acceptor) Start() (err error) { + if a.proto == "tcp" { + return a.startTCP() + } else { + return a.startUDP() + } +} + +func (a *Acceptor) Stop() { + a.mod.Debug("stopping %s listener for port %d", a.proto, a.port) + a.running = false + + if a.proto == "tcp" { + a.ctxCancel() + <-a.context.Done() + a.tcpListener.Close() + } else { + a.udpListener.Close() + } + + a.mod.Debug("%s listener for port %d stopped", a.proto, a.port) +} +``` + +## `modules/zerogod/zerogod_ipp_primitives.go` (changed lines (16, 140, 141)) + +```go +package zerogod + +import ( + "bytes" + "fmt" + "io" + "net/http" + "slices" + "strconv" + + "github.com/evilsocket/islazy/str" + "github.com/phin1x/go-ipp" +) + +const IPP_CHUNK_MAX_LINE_SIZE = 1024 +const IPP_CHUNK_MAX_SIZE = 10 * 1024 * 1024 // 10 MB + +var IPP_REQUEST_NAMES = map[int16]string{ + // https://tools.ietf.org/html/rfc2911#section-4.4.15 + 0x0002: "Print-Job", + 0x0003: "Print-URI", + 0x0004: "Validate-Job", + 0x0005: "Create-Job", + 0x0006: "Send-Document", + 0x0007: "Send-URI", + 0x0008: "Cancel-Job", + 0x0009: "Get-Job-Attributes", + 0x000A: "Get-Jobs", + 0x000B: "Get-Printer-Attributes", + 0x000C: "Hold-Job", + 0x000D: "Release-Job", + 0x000E: "Restart-Job", + 0x0010: "Pause-Printer", + 0x0011: "Resume-Printer", + 0x0012: "Purge-Jobs", + // https://web.archive.org/web/20061024184939/http://uw714doc.sco.com/en/cups/ipp.html + 0x4001: "CUPS-Get-Default", + 0x4002: "CUPS-Get-Printers", + 0x4003: "CUPS-Add-Modify-Printer", + 0x4004: "CUPS-Delete-Printer", + 0x4005: "CUPS-Get-Classes", + 0x4006: "CUPS-Add-Modify-Class", + 0x4007: "CUPS-Delete-Class", + 0x4008: "CUPS-Accept-Jobs", + 0x4009: "CUPS-Reject-Jobs", + 0x400A: "CUPS-Set-Default", + 0x400B: "CUPS-Get-Devices", + 0x400C: "CUPS-Get-PPDs", + 0x400D: "CUPS-Move-Job", +} + +var IPP_USER_ATTRIBUTES = map[string]string{ + "printer-name": "PRINTER_NAME", + "printer-info": "PRINTER_INFO", + "printer-make-and-model": "PRINTER_MAKE PRINTER_MODEL", + "printer-location": "PRINTER_LOCATION", + "printer-privacy-policy-uri": "https://www.bettercap.org/", + "ppd-name": "everywhere", +} + +func init() { + ipp.AttributeTagMapping["printer-uri-supported"] = ipp.TagUri + ipp.AttributeTagMapping["uri-authentication-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["uri-security-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["printer-name"] = ipp.TagName + ipp.AttributeTagMapping["printer-info"] = ipp.TagText + ipp.AttributeTagMapping["printer-make-and-model"] = ipp.TagText + ipp.AttributeTagMapping["printer-state"] = ipp.TagEnum + ipp.AttributeTagMapping["printer-state-reasons"] = ipp.TagKeyword + ipp.AttributeTagMapping["ipp-versions-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["operations-supported"] = ipp.TagEnum + ipp.AttributeTagMapping["multiple-document-jobs-supported"] = ipp.TagBoolean + ipp.AttributeTagMapping["charset-configured"] = ipp.TagCharset + ipp.AttributeTagMapping["charset-supported"] = ipp.TagCharset + ipp.AttributeTagMapping["natural-language-configured"] = ipp.TagLanguage + ipp.AttributeTagMapping["generated-natural-language-supported"] = ipp.TagLanguage + ipp.AttributeTagMapping["document-format-default"] = ipp.TagMimeType + ipp.AttributeTagMapping["document-format-supported"] = ipp.TagMimeType + ipp.AttributeTagMapping["printer-is-accepting-jobs"] = ipp.TagBoolean + ipp.AttributeTagMapping["queued-job-count"] = ipp.TagInteger + ipp.AttributeTagMapping["pdl-override-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["printer-up-time"] = ipp.TagInteger + ipp.AttributeTagMapping["compression-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["printer-privacy-policy-uri"] = ipp.TagUri + ipp.AttributeTagMapping["printer-location"] = ipp.TagText + ipp.AttributeTagMapping["ppd-name"] = ipp.TagName + ipp.AttributeTagMapping["job-state-reasons"] = ipp.TagKeyword + ipp.AttributeTagMapping["job-state"] = ipp.TagEnum + ipp.AttributeTagMapping["job-uri"] = ipp.TagUri + ipp.AttributeTagMapping["job-id"] = ipp.TagInteger + ipp.AttributeTagMapping["job-printer-uri"] = ipp.TagUri + ipp.AttributeTagMapping["job-name"] = ipp.TagName + ipp.AttributeTagMapping["job-originating-user-name"] = ipp.TagName + ipp.AttributeTagMapping["time-at-creation"] = ipp.TagInteger + ipp.AttributeTagMapping["time-at-completed"] = ipp.TagInteger + ipp.AttributeTagMapping["job-printer-up-time"] = ipp.TagInteger +} + +func ippReadChunkSizeHex(ctx *HandlerContext) string { + var buf []byte + + for b := make([]byte, 1); ; { + if n, err := ctx.client.Read(b); err != nil { + ctx.mod.Error("could not read chunked byte: %v", err) + } else if n == 0 { + break + } else if b[0] == '\n' { + break + } else { + // ctx.mod.Info("buf += 0x%x (%c)", b[0], b[0]) + buf = append(buf, b[0]) + } + + if len(buf) >= IPP_CHUNK_MAX_LINE_SIZE { + ctx.mod.Warning("buffer size exceeded %d bytes when reading chunk size", IPP_CHUNK_MAX_LINE_SIZE) + break + } + } + + return str.Trim(string(buf)) +} + +func ippReadChunkSize(ctx *HandlerContext) (uint64, error) { + if chunkSizeHex := ippReadChunkSizeHex(ctx); chunkSizeHex != "" { + ctx.mod.Debug("got chunk size: 0x%s", chunkSizeHex) + return strconv.ParseUint(chunkSizeHex, 16, 64) + } + return 0, nil +} + +func ippReadChunkedBody(ctx *HandlerContext) ([]byte, error) { + var chunkedBody []byte + // read chunked loop + for { + // read the next chunk size + if chunkSize, err := ippReadChunkSize(ctx); err != nil { + return nil, fmt.Errorf("error reading next chunk size: %v", err) + } else if chunkSize == 0 { + break + } else if chunkSize > IPP_CHUNK_MAX_SIZE { + return nil, fmt.Errorf("chunk size %d exceeds maximum allowed size of %d bytes", chunkSize, IPP_CHUNK_MAX_SIZE) + } else { + chunk := make([]byte, chunkSize) + if n, err := ctx.client.Read(chunk); err != nil { + return nil, fmt.Errorf("error while reading chunk of %d bytes: %v", chunkSize, err) + } else if n != int(chunkSize) { + return nil, fmt.Errorf("expected chunk of size %d, got %d bytes", chunkSize, n) + } else { + chunkedBody = append(chunkedBody, chunk...) + } + } + } + + return chunkedBody, nil +} + +func ippReadRequestBody(ctx *HandlerContext, http_req *http.Request) (io.ReadCloser, error) { + ipp_body := http_req.Body + + // check for an Expect 100-continue + if http_req.Header.Get("Expect") == "100-continue" { + buf := make([]byte, 4096) + + // inform the client we're ready to read the request body + ctx.client.Write([]byte("HTTP/1.1 100 Continue\r\n\r\n")) + + if slices.Contains(http_req.TransferEncoding, "chunked") { + ctx.mod.Debug("detected chunked encoding") + if body, err := ippReadChunkedBody(ctx); err != nil { + return nil, err + } else { + ipp_body = io.NopCloser(bytes.NewReader(body)) + } + } else { + // read the body in a single step + read, err := ctx.client.Read(buf) + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, fmt.Errorf("error while reading ipp body from %v: %v", ctx.client.RemoteAddr(), err) + } else if read == 0 { + return nil, fmt.Errorf("error while reading ipp body from %v: no data", ctx.client.RemoteAddr()) + } + + ipp_body = io.NopCloser(bytes.NewReader(buf[0:read])) + } + } + + return ipp_body, nil +} + +func ippSendResponse(ctx *HandlerContext, response *ipp.Response) { + ctx.mod.Debug("SENDING %++v", *response) + + resp_data, err := response.Encode() + if err != nil { + ctx.mod.Error("error while encoding ipp response: %v", err) + return + } + + headers := [][]byte{ + []byte("HTTP/1.1 200 OK\r\n"), + []byte("Content-Type: application/ipp\r\n"), + []byte(fmt.Sprintf("Content-Length: %d\r\n", len(resp_data))), + []byte("Connection: close\r\n"), + []byte("\r\n"), + } + + for _, header := range headers { + if _, err := ctx.client.Write(header); err != nil { + ctx.mod.Error("error while writing header: %v", err) + return + } + } + + if _, err = ctx.client.Write(resp_data); err != nil { + ctx.mod.Error("error while writing ipp response data: %v", err) + return + } + + ctx.mod.Debug("sent %d of ipp response to %v", len(resp_data), ctx.client.RemoteAddr()) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..54c3c8c55a01ea391a8e1e0c8457b6bef4309b90 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/pre_context.md @@ -0,0 +1,419 @@ +# Patch-overlapping Go context before the fix + +## `modules/zerogod/zerogod_acceptor.go` (changed lines (120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130)) + +```go +package zerogod + +import ( + "context" + "crypto/tls" + "fmt" + "net" + "strings" + + "github.com/evilsocket/islazy/ops" + "github.com/evilsocket/islazy/tui" +) + +type Handler struct { + TLS bool + Handle func(ctx *HandlerContext) +} + +// TODO: possibly autodetect from peeking at the first bytes sent by the client +var TCP_HANDLERS = map[string]Handler{ + "_ipp": { + Handle: ippClientHandler, + }, + "_ipps": { + TLS: true, + Handle: ippClientHandler, + }, + "_http": { + Handle: httpClientHandler, + }, + "_https": { + TLS: true, + Handle: httpClientHandler, + }, +} + +type Acceptor struct { + mod *ZeroGod + srvHost string + proto string + port uint16 + service string + tlsConfig *tls.Config + tcpListener net.Listener + udpListener *net.UDPConn + running bool + context context.Context + ctxCancel context.CancelFunc + handler Handler + ippAttributes map[string]string + httpPaths map[string]string +} + +type HandlerContext struct { + service string + mod *ZeroGod + client net.Conn + srvHost string + srvPort int + srvTLS bool + ippAttributes map[string]string + httpPaths map[string]string +} + +func NewAcceptor(mod *ZeroGod, service string, srvHost string, port uint16, tlsConfig *tls.Config, ippAttributes map[string]string, httpPaths map[string]string) *Acceptor { + context, ctcCancel := context.WithCancel(context.Background()) + proto := ops.Ternary(strings.Contains(service, "_tcp"), "tcp", "udp").(string) + + acceptor := Acceptor{ + mod: mod, + port: port, + proto: proto, + service: service, + context: context, + ctxCancel: ctcCancel, + srvHost: srvHost, + ippAttributes: ippAttributes, + httpPaths: httpPaths, + } + + for svcName, svcHandler := range TCP_HANDLERS { + if strings.Contains(service, svcName) { + if svcHandler.TLS { + acceptor.tlsConfig = tlsConfig + } + acceptor.handler = svcHandler + break + } + } + + if acceptor.handler.Handle == nil { + mod.Warning("no protocol handler found for service %s, using generic %s dump handler", tui.Yellow(service), proto) + acceptor.handler.Handle = handleGenericTCP + } else { + mod.Info("found %s %s protocol handler (tls=%v)", proto, tui.Green(service), acceptor.tlsConfig != nil) + } + + return &acceptor +} + +func (a *Acceptor) startTCP() (err error) { + var lc net.ListenConfig + if a.tcpListener, err = lc.Listen(a.context, "tcp", fmt.Sprintf("0.0.0.0:%d", a.port)); err != nil { + return err + } + if a.tlsConfig != nil { + a.tcpListener = tls.NewListener(a.tcpListener, a.tlsConfig) + } + + a.running = true + go func() { + a.mod.Debug("%s listener for port %d (%s) started", a.proto, a.port, tui.Green(a.service)) + for a.running { + if conn, err := a.tcpListener.Accept(); err != nil { + if a.running { + a.mod.Error("%v", err) + } + } else { + a.mod.Debug("accepted %s connection for service %s (port %d): %v", a.proto, tui.Green(a.service), a.port, conn.RemoteAddr()) + go a.handler.Handle(&HandlerContext{ + service: a.service, + mod: a.mod, + client: conn, + srvHost: a.srvHost, + srvPort: int(a.port), + srvTLS: a.tlsConfig != nil, + ippAttributes: a.ippAttributes, + httpPaths: a.httpPaths, + }) + } + } + a.mod.Debug("%s listener for port %d (%s) stopped", a.proto, a.port, tui.Green(a.service)) + }() + + return nil +} + +func (a *Acceptor) startUDP() (err error) { + if udpAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("0.0.0.0:%d", a.port)); err != nil { + return err + } else if a.udpListener, err = net.ListenUDP("udp", udpAddr); err != nil { + return err + } else { + a.running = true + go func() { + var buffer [4096]byte + + a.mod.Info("%s listener for port %d (%s) started", a.proto, a.port, tui.Green(a.service)) + + for a.running { + if n, addr, err := a.udpListener.ReadFromUDP(buffer[0:]); err != nil { + a.mod.Warning("error reading udp packet: %v", err) + } else if n <= 0 { + a.mod.Info("empty read") + } else { + a.mod.Info("%v:\n%s", addr, Dump(buffer[0:n])) + } + } + + a.mod.Info("%s listener for port %d (%s) stopped", a.proto, a.port, tui.Green(a.service)) + }() + } + + return nil +} + +func (a *Acceptor) Start() (err error) { + if a.proto == "tcp" { + return a.startTCP() + } else { + return a.startUDP() + } +} + +func (a *Acceptor) Stop() { + a.mod.Debug("stopping %s listener for port %d", a.proto, a.port) + a.running = false + + if a.proto == "tcp" { + a.ctxCancel() + <-a.context.Done() + a.tcpListener.Close() + } else { + a.udpListener.Close() + } + + a.mod.Debug("%s listener for port %d stopped", a.proto, a.port) +} +``` + +## `modules/zerogod/zerogod_ipp_primitives.go` (changed lines (16, 139)) + +```go +package zerogod + +import ( + "bytes" + "fmt" + "io" + "net/http" + "slices" + "strconv" + + "github.com/evilsocket/islazy/str" + "github.com/phin1x/go-ipp" +) + +const IPP_CHUNK_MAX_LINE_SIZE = 1024 + +var IPP_REQUEST_NAMES = map[int16]string{ + // https://tools.ietf.org/html/rfc2911#section-4.4.15 + 0x0002: "Print-Job", + 0x0003: "Print-URI", + 0x0004: "Validate-Job", + 0x0005: "Create-Job", + 0x0006: "Send-Document", + 0x0007: "Send-URI", + 0x0008: "Cancel-Job", + 0x0009: "Get-Job-Attributes", + 0x000A: "Get-Jobs", + 0x000B: "Get-Printer-Attributes", + 0x000C: "Hold-Job", + 0x000D: "Release-Job", + 0x000E: "Restart-Job", + 0x0010: "Pause-Printer", + 0x0011: "Resume-Printer", + 0x0012: "Purge-Jobs", + // https://web.archive.org/web/20061024184939/http://uw714doc.sco.com/en/cups/ipp.html + 0x4001: "CUPS-Get-Default", + 0x4002: "CUPS-Get-Printers", + 0x4003: "CUPS-Add-Modify-Printer", + 0x4004: "CUPS-Delete-Printer", + 0x4005: "CUPS-Get-Classes", + 0x4006: "CUPS-Add-Modify-Class", + 0x4007: "CUPS-Delete-Class", + 0x4008: "CUPS-Accept-Jobs", + 0x4009: "CUPS-Reject-Jobs", + 0x400A: "CUPS-Set-Default", + 0x400B: "CUPS-Get-Devices", + 0x400C: "CUPS-Get-PPDs", + 0x400D: "CUPS-Move-Job", +} + +var IPP_USER_ATTRIBUTES = map[string]string{ + "printer-name": "PRINTER_NAME", + "printer-info": "PRINTER_INFO", + "printer-make-and-model": "PRINTER_MAKE PRINTER_MODEL", + "printer-location": "PRINTER_LOCATION", + "printer-privacy-policy-uri": "https://www.bettercap.org/", + "ppd-name": "everywhere", +} + +func init() { + ipp.AttributeTagMapping["printer-uri-supported"] = ipp.TagUri + ipp.AttributeTagMapping["uri-authentication-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["uri-security-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["printer-name"] = ipp.TagName + ipp.AttributeTagMapping["printer-info"] = ipp.TagText + ipp.AttributeTagMapping["printer-make-and-model"] = ipp.TagText + ipp.AttributeTagMapping["printer-state"] = ipp.TagEnum + ipp.AttributeTagMapping["printer-state-reasons"] = ipp.TagKeyword + ipp.AttributeTagMapping["ipp-versions-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["operations-supported"] = ipp.TagEnum + ipp.AttributeTagMapping["multiple-document-jobs-supported"] = ipp.TagBoolean + ipp.AttributeTagMapping["charset-configured"] = ipp.TagCharset + ipp.AttributeTagMapping["charset-supported"] = ipp.TagCharset + ipp.AttributeTagMapping["natural-language-configured"] = ipp.TagLanguage + ipp.AttributeTagMapping["generated-natural-language-supported"] = ipp.TagLanguage + ipp.AttributeTagMapping["document-format-default"] = ipp.TagMimeType + ipp.AttributeTagMapping["document-format-supported"] = ipp.TagMimeType + ipp.AttributeTagMapping["printer-is-accepting-jobs"] = ipp.TagBoolean + ipp.AttributeTagMapping["queued-job-count"] = ipp.TagInteger + ipp.AttributeTagMapping["pdl-override-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["printer-up-time"] = ipp.TagInteger + ipp.AttributeTagMapping["compression-supported"] = ipp.TagKeyword + ipp.AttributeTagMapping["printer-privacy-policy-uri"] = ipp.TagUri + ipp.AttributeTagMapping["printer-location"] = ipp.TagText + ipp.AttributeTagMapping["ppd-name"] = ipp.TagName + ipp.AttributeTagMapping["job-state-reasons"] = ipp.TagKeyword + ipp.AttributeTagMapping["job-state"] = ipp.TagEnum + ipp.AttributeTagMapping["job-uri"] = ipp.TagUri + ipp.AttributeTagMapping["job-id"] = ipp.TagInteger + ipp.AttributeTagMapping["job-printer-uri"] = ipp.TagUri + ipp.AttributeTagMapping["job-name"] = ipp.TagName + ipp.AttributeTagMapping["job-originating-user-name"] = ipp.TagName + ipp.AttributeTagMapping["time-at-creation"] = ipp.TagInteger + ipp.AttributeTagMapping["time-at-completed"] = ipp.TagInteger + ipp.AttributeTagMapping["job-printer-up-time"] = ipp.TagInteger +} + +func ippReadChunkSizeHex(ctx *HandlerContext) string { + var buf []byte + + for b := make([]byte, 1); ; { + if n, err := ctx.client.Read(b); err != nil { + ctx.mod.Error("could not read chunked byte: %v", err) + } else if n == 0 { + break + } else if b[0] == '\n' { + break + } else { + // ctx.mod.Info("buf += 0x%x (%c)", b[0], b[0]) + buf = append(buf, b[0]) + } + + if len(buf) >= IPP_CHUNK_MAX_LINE_SIZE { + ctx.mod.Warning("buffer size exceeded %d bytes when reading chunk size", IPP_CHUNK_MAX_LINE_SIZE) + break + } + } + + return str.Trim(string(buf)) +} + +func ippReadChunkSize(ctx *HandlerContext) (uint64, error) { + if chunkSizeHex := ippReadChunkSizeHex(ctx); chunkSizeHex != "" { + ctx.mod.Debug("got chunk size: 0x%s", chunkSizeHex) + return strconv.ParseUint(chunkSizeHex, 16, 64) + } + return 0, nil +} + +func ippReadChunkedBody(ctx *HandlerContext) ([]byte, error) { + var chunkedBody []byte + // read chunked loop + for { + // read the next chunk size + if chunkSize, err := ippReadChunkSize(ctx); err != nil { + return nil, fmt.Errorf("error reading next chunk size: %v", err) + } else if chunkSize == 0 { + break + } else { + chunk := make([]byte, chunkSize) + if n, err := ctx.client.Read(chunk); err != nil { + return nil, fmt.Errorf("error while reading chunk of %d bytes: %v", chunkSize, err) + } else if n != int(chunkSize) { + return nil, fmt.Errorf("expected chunk of size %d, got %d bytes", chunkSize, n) + } else { + chunkedBody = append(chunkedBody, chunk...) + } + } + } + + return chunkedBody, nil +} + +func ippReadRequestBody(ctx *HandlerContext, http_req *http.Request) (io.ReadCloser, error) { + ipp_body := http_req.Body + + // check for an Expect 100-continue + if http_req.Header.Get("Expect") == "100-continue" { + buf := make([]byte, 4096) + + // inform the client we're ready to read the request body + ctx.client.Write([]byte("HTTP/1.1 100 Continue\r\n\r\n")) + + if slices.Contains(http_req.TransferEncoding, "chunked") { + ctx.mod.Debug("detected chunked encoding") + if body, err := ippReadChunkedBody(ctx); err != nil { + return nil, err + } else { + ipp_body = io.NopCloser(bytes.NewReader(body)) + } + } else { + // read the body in a single step + read, err := ctx.client.Read(buf) + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, fmt.Errorf("error while reading ipp body from %v: %v", ctx.client.RemoteAddr(), err) + } else if read == 0 { + return nil, fmt.Errorf("error while reading ipp body from %v: no data", ctx.client.RemoteAddr()) + } + + ipp_body = io.NopCloser(bytes.NewReader(buf[0:read])) + } + } + + return ipp_body, nil +} + +func ippSendResponse(ctx *HandlerContext, response *ipp.Response) { + ctx.mod.Debug("SENDING %++v", *response) + + resp_data, err := response.Encode() + if err != nil { + ctx.mod.Error("error while encoding ipp response: %v", err) + return + } + + headers := [][]byte{ + []byte("HTTP/1.1 200 OK\r\n"), + []byte("Content-Type: application/ipp\r\n"), + []byte(fmt.Sprintf("Content-Length: %d\r\n", len(resp_data))), + []byte("Connection: close\r\n"), + []byte("\r\n"), + } + + for _, header := range headers { + if _, err := ctx.client.Write(header); err != nil { + ctx.mod.Error("error while writing header: %v", err) + return + } + } + + if _, err = ctx.client.Write(resp_data); err != nil { + ctx.mod.Error("error while writing ipp response data: %v", err) + return + } + + ctx.mod.Debug("sent %d of ipp response to %v", len(resp_data), ctx.client.RemoteAddr()) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/task.json new file mode 100644 index 0000000000000000000000000000000000000000..ed1ef628a7376c0f86e73d0521df4ba639112dbb --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-7e2af82757795db7f69a", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-7e2af82757795db7f69a", + "project_id": "morefixes__bettercap__bettercap", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "modules/zerogod/zerogod_acceptor.go", + "modules/zerogod/zerogod_ipp_primitives.go" + ], + "patch_units": { + "before": [ + "modules/zerogod/zerogod_acceptor.go", + "modules/zerogod/zerogod_ipp_primitives.go" + ], + "after": [ + "modules/zerogod/zerogod_acceptor.go", + "modules/zerogod/zerogod_ipp_primitives.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/886843741cf153a04b17994f7df48ba584be43cefb43037fa3f8f61a03586d2a/database", + "cache_key": "886843741cf153a04b17994f7df48ba584be43cefb43037fa3f8f61a03586d2a", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/f23f0e5cc82ca5dd3d6bc23be359b0ffb59a9384c3e320c05b0353915eb3cfaa/database", + "cache_key": "f23f0e5cc82ca5dd3d6bc23be359b0ffb59a9384c3e320c05b0353915eb3cfaa", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/275b9356630ae27e1528cfe5999c3ee3caac16b680057e64e2dd863d1c250bcb/database", + "cache_key": "275b9356630ae27e1528cfe5999c3ee3caac16b680057e64e2dd863d1c250bcb", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-7e2af82757795db7f69a/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-7e2af82757795db7f69a/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-7e2af82757795db7f69a/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..4736b25209fce21f13fb6ec5b811bb11361c3eae --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/patch.diff @@ -0,0 +1,15 @@ +diff --git a/router/server_normal.go b/router/server_normal.go +index b63c542..e882110 100644 +--- a/router/server_normal.go ++++ b/router/server_normal.go +@@ -41,9 +41,8 @@ func RunHTTPServer(ctx context.Context, cfg *config.ConfYaml, q *queue.Queue, s + if cfg.Core.AutoTLS.Enabled { + return startServer(ctx, autoTLSServer(cfg, q), cfg) + } else if cfg.Core.SSL { +- //nolint + config := &tls.Config{ +- MinVersion: tls.VersionTLS10, ++ MinVersion: tls.VersionTLS12, + } + + if config.NextProtos == nil { diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..ae2fb3a260eef0564fb8eff623563b9f9f048c69 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/post_context.md @@ -0,0 +1,133 @@ +# Patch-overlapping Go context after the fix + +## `router/server_normal.go` (changed lines (44, 45)) + +```go +//go:build !lambda +// +build !lambda + +package router + +import ( + "context" + "crypto/tls" + "encoding/base64" + "errors" + "net/http" + "time" + + "github.com/appleboy/gorush/config" + "github.com/appleboy/gorush/logx" + + "github.com/golang-queue/queue" + "golang.org/x/sync/errgroup" +) + +// RunHTTPServer provide run http or https protocol. +func RunHTTPServer(ctx context.Context, cfg *config.ConfYaml, q *queue.Queue, s ...*http.Server) (err error) { + var server *http.Server + + if !cfg.Core.Enabled { + logx.LogAccess.Info("httpd server is disabled.") + return nil + } + + if len(s) == 0 { + //nolint:gosec + server = &http.Server{ + Addr: cfg.Core.Address + ":" + cfg.Core.Port, + Handler: routerEngine(cfg, q), + } + } else { + server = s[0] + } + + logx.LogAccess.Info("HTTPD server is running on " + cfg.Core.Port + " port.") + if cfg.Core.AutoTLS.Enabled { + return startServer(ctx, autoTLSServer(cfg, q), cfg) + } else if cfg.Core.SSL { + config := &tls.Config{ + MinVersion: tls.VersionTLS12, + } + + if config.NextProtos == nil { + config.NextProtos = []string{"http/1.1"} + } + + config.Certificates = make([]tls.Certificate, 1) + //nolint:gocritic + if cfg.Core.CertPath != "" && cfg.Core.KeyPath != "" { + config.Certificates[0], err = tls.LoadX509KeyPair(cfg.Core.CertPath, cfg.Core.KeyPath) + if err != nil { + logx.LogError.Error("Failed to load https cert file: ", err) + return err + } + } else if cfg.Core.CertBase64 != "" && cfg.Core.KeyBase64 != "" { + cert, err := base64.StdEncoding.DecodeString(cfg.Core.CertBase64) + if err != nil { + logx.LogError.Error("base64 decode error:", err.Error()) + return err + } + key, err := base64.StdEncoding.DecodeString(cfg.Core.KeyBase64) + if err != nil { + logx.LogError.Error("base64 decode error:", err.Error()) + return err + } + if config.Certificates[0], err = tls.X509KeyPair(cert, key); err != nil { + logx.LogError.Error("tls key pair error:", err.Error()) + return err + } + } else { + return errors.New("missing https cert config") + } + + server.TLSConfig = config + } + + return startServer(ctx, server, cfg) +} + +func listenAndServe(ctx context.Context, s *http.Server, cfg *config.ConfYaml) error { + var g errgroup.Group + g.Go(func() error { + <-ctx.Done() + timeout := time.Duration(cfg.Core.ShutdownTimeout) * time.Second + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return s.Shutdown(ctx) + }) + g.Go(func() error { + if err := s.ListenAndServe(); err != nil && err != http.ErrServerClosed { + return err + } + return nil + }) + return g.Wait() +} + +func listenAndServeTLS(ctx context.Context, s *http.Server, cfg *config.ConfYaml) error { + var g errgroup.Group + g.Go(func() error { + <-ctx.Done() + timeout := time.Duration(cfg.Core.ShutdownTimeout) * time.Second + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return s.Shutdown(ctx) + }) + g.Go(func() error { + if err := s.ListenAndServeTLS("", ""); err != nil && err != http.ErrServerClosed { + return err + } + return nil + }) + return g.Wait() +} + +func startServer(ctx context.Context, s *http.Server, cfg *config.ConfYaml) error { + if s.TLSConfig == nil { + return listenAndServe(ctx, s, cfg) + } + + return listenAndServeTLS(ctx, s, cfg) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..69588de95de76c7325a3b9b893ebbc47a5232c2b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/pre_context.md @@ -0,0 +1,134 @@ +# Patch-overlapping Go context before the fix + +## `router/server_normal.go` (changed lines (44, 46, 47)) + +```go +//go:build !lambda +// +build !lambda + +package router + +import ( + "context" + "crypto/tls" + "encoding/base64" + "errors" + "net/http" + "time" + + "github.com/appleboy/gorush/config" + "github.com/appleboy/gorush/logx" + + "github.com/golang-queue/queue" + "golang.org/x/sync/errgroup" +) + +// RunHTTPServer provide run http or https protocol. +func RunHTTPServer(ctx context.Context, cfg *config.ConfYaml, q *queue.Queue, s ...*http.Server) (err error) { + var server *http.Server + + if !cfg.Core.Enabled { + logx.LogAccess.Info("httpd server is disabled.") + return nil + } + + if len(s) == 0 { + //nolint:gosec + server = &http.Server{ + Addr: cfg.Core.Address + ":" + cfg.Core.Port, + Handler: routerEngine(cfg, q), + } + } else { + server = s[0] + } + + logx.LogAccess.Info("HTTPD server is running on " + cfg.Core.Port + " port.") + if cfg.Core.AutoTLS.Enabled { + return startServer(ctx, autoTLSServer(cfg, q), cfg) + } else if cfg.Core.SSL { + //nolint + config := &tls.Config{ + MinVersion: tls.VersionTLS10, + } + + if config.NextProtos == nil { + config.NextProtos = []string{"http/1.1"} + } + + config.Certificates = make([]tls.Certificate, 1) + //nolint:gocritic + if cfg.Core.CertPath != "" && cfg.Core.KeyPath != "" { + config.Certificates[0], err = tls.LoadX509KeyPair(cfg.Core.CertPath, cfg.Core.KeyPath) + if err != nil { + logx.LogError.Error("Failed to load https cert file: ", err) + return err + } + } else if cfg.Core.CertBase64 != "" && cfg.Core.KeyBase64 != "" { + cert, err := base64.StdEncoding.DecodeString(cfg.Core.CertBase64) + if err != nil { + logx.LogError.Error("base64 decode error:", err.Error()) + return err + } + key, err := base64.StdEncoding.DecodeString(cfg.Core.KeyBase64) + if err != nil { + logx.LogError.Error("base64 decode error:", err.Error()) + return err + } + if config.Certificates[0], err = tls.X509KeyPair(cert, key); err != nil { + logx.LogError.Error("tls key pair error:", err.Error()) + return err + } + } else { + return errors.New("missing https cert config") + } + + server.TLSConfig = config + } + + return startServer(ctx, server, cfg) +} + +func listenAndServe(ctx context.Context, s *http.Server, cfg *config.ConfYaml) error { + var g errgroup.Group + g.Go(func() error { + <-ctx.Done() + timeout := time.Duration(cfg.Core.ShutdownTimeout) * time.Second + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return s.Shutdown(ctx) + }) + g.Go(func() error { + if err := s.ListenAndServe(); err != nil && err != http.ErrServerClosed { + return err + } + return nil + }) + return g.Wait() +} + +func listenAndServeTLS(ctx context.Context, s *http.Server, cfg *config.ConfYaml) error { + var g errgroup.Group + g.Go(func() error { + <-ctx.Done() + timeout := time.Duration(cfg.Core.ShutdownTimeout) * time.Second + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return s.Shutdown(ctx) + }) + g.Go(func() error { + if err := s.ListenAndServeTLS("", ""); err != nil && err != http.ErrServerClosed { + return err + } + return nil + }) + return g.Wait() +} + +func startServer(ctx context.Context, s *http.Server, cfg *config.ConfYaml) error { + if s.TLSConfig == nil { + return listenAndServe(ctx, s, cfg) + } + + return listenAndServeTLS(ctx, s, cfg) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/task.json new file mode 100644 index 0000000000000000000000000000000000000000..d9d04e1124eff0eeaa120df2c3de70a48aa0e09c --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-9fbea0e4da10bfc882d4", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-9fbea0e4da10bfc882d4", + "project_id": "morefixes__appleboy__gorush", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "router/server_normal.go" + ], + "patch_units": { + "before": [ + "router/server_normal.go" + ], + "after": [ + "router/server_normal.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/ff550f568f23cd739d08a4407f920ee51c729475c058ee55a9b06d7b908c8d10/database", + "cache_key": "ff550f568f23cd739d08a4407f920ee51c729475c058ee55a9b06d7b908c8d10", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/2a4606ae9b99fab6912432f4eae6bb435cca6267f9170e1c84986687e16b62a1/database", + "cache_key": "2a4606ae9b99fab6912432f4eae6bb435cca6267f9170e1c84986687e16b62a1", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/77173a0571bfeaccad8b4cdeb087350522aa30584154a30cf10a0715db672a55/database", + "cache_key": "77173a0571bfeaccad8b4cdeb087350522aa30584154a30cf10a0715db672a55", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-9fbea0e4da10bfc882d4/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-9fbea0e4da10bfc882d4/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-9fbea0e4da10bfc882d4/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..71da239eaa4d7330ba30ac35d980bf5e43ea6078 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/patch.diff @@ -0,0 +1,399 @@ +diff --git a/internal/peer/gossip/mcs.go b/internal/peer/gossip/mcs.go +index 626da4c86..3bcb3f0ba 100644 +--- a/internal/peer/gossip/mcs.go ++++ b/internal/peer/gossip/mcs.go +@@ -151,6 +151,10 @@ func (s *MSPMessageCryptoService) VerifyBlock(chainID common.ChannelID, seqNum u + return fmt.Errorf("Failed unmarshalling medatata for signatures [%s]", err) + } + ++ if err := protoutil.VerifyTransactionsAreWellFormed(block); err != nil { ++ return fmt.Errorf("block has malformed transactions: %v", err) ++ } ++ + // - Verify that Header.DataHash is equal to the hash of block.Data + // This is to ensure that the header is consistent with the data carried by this block + if !bytes.Equal(protoutil.BlockDataHash(block.Data), block.Header.DataHash) { +@@ -259,7 +263,6 @@ func (s *MSPMessageCryptoService) Expiration(peerIdentity api.PeerIdentityType) + return time.Time{}, errors.Wrap(err, "Unable to extract msp.Identity from peer Identity") + } + return id.ExpiresAt(), nil +- + } + + func (s *MSPMessageCryptoService) getValidatedIdentity(peerIdentity api.PeerIdentityType) (msp.Identity, common.ChannelID, error) { +diff --git a/orderer/common/cluster/replication_test.go b/orderer/common/cluster/replication_test.go +index ac8861a00..734eddd26 100644 +--- a/orderer/common/cluster/replication_test.go ++++ b/orderer/common/cluster/replication_test.go +@@ -130,7 +130,7 @@ func TestReplicateChainsFailures(t *testing.T) { + name: "hash chain mismatch", + expectedPanic: "Failed pulling system channel: " + + "block header mismatch on sequence 11, " + +- "expected 9cd61b7e9a5ea2d128cc877e5304e7205888175a8032d40b97db7412dca41d9e, got 010203", ++ "expected 229de8d87db1ddf7278093bc65ba9245cd3acd8ccfc687e0edc68adf9b181488, got 010203", + latestBlockSeqInOrderer: 21, + mutateBlocks: func(systemChannelBlocks []*common.Block) { + systemChannelBlocks[len(systemChannelBlocks)/2].Header.PreviousHash = []byte{1, 2, 3} +@@ -139,8 +139,8 @@ func TestReplicateChainsFailures(t *testing.T) { + { + name: "last pulled block doesn't match the boot block", + expectedPanic: "Block header mismatch on last system channel block," + +- " expected 8ec93b2ef5ffdc302f0c0e24611be04ad2b17b099a1aeafd7cfb76a95923f146," + +- " got e428decfc78f8e4c97b26da9c16f9d0b73f886dafa80477a0dd9bac7eb14fe7a", ++ " expected 0bea18bff7feeaa0bc08f528e1f563c818fc0633e291786c96eedffd8c7e6cff," + ++ " got 924c568c4a4e8f16e3cbd123ea0ae38d0bbb01d60bafb74f4bb55f108c0eb194", + latestBlockSeqInOrderer: 21, + mutateBlocks: func(systemChannelBlocks []*common.Block) { + systemChannelBlocks[21].Header.DataHash = nil +@@ -321,7 +321,6 @@ func TestPullChannelFailure(t *testing.T) { + assert.Equal(t, cluster.ErrRetryCountExhausted, err) + }) + } +- + } + + func TestPullerConfigFromTopLevelConfig(t *testing.T) { +@@ -443,8 +442,10 @@ func TestReplicateChainsGreenPath(t *testing.T) { + channelLister := &mocks.ChannelLister{} + channelLister.On("Channels").Return([]cluster.ChannelGenesisBlock{ + {ChannelName: "E", GenesisBlock: fakeGB}, +- {ChannelName: "D", GenesisBlock: fakeGB}, {ChannelName: "C", GenesisBlock: fakeGB}, +- {ChannelName: "A", GenesisBlock: fakeGB}, {ChannelName: "B", GenesisBlock: fakeGB}, ++ {ChannelName: "D", GenesisBlock: fakeGB}, ++ {ChannelName: "C", GenesisBlock: fakeGB}, ++ {ChannelName: "A", GenesisBlock: fakeGB}, ++ {ChannelName: "B", GenesisBlock: fakeGB}, + }) + channelLister.On("Close") + +diff --git a/orderer/common/cluster/util.go b/orderer/common/cluster/util.go +index a8f2c865d..ef34cead7 100644 +--- a/orderer/common/cluster/util.go ++++ b/orderer/common/cluster/util.go +@@ -318,6 +318,11 @@ func VerifyBlockHash(indexInBuffer int, blockBuff []*common.Block) error { + return errors.New("missing block header") + } + seq := block.Header.Number ++ ++ if err := protoutil.VerifyTransactionsAreWellFormed(block); err != nil && block.Header.Number > 0 { ++ return fmt.Errorf("block has malformed transactions: %v", err) ++ } ++ + dataHash := protoutil.BlockDataHash(block.Data) + // Verify data hash matches the hash in the header + if !bytes.Equal(dataHash, block.Header.DataHash) { +diff --git a/orderer/common/cluster/util_test.go b/orderer/common/cluster/util_test.go +index 059e0f95e..7bf346024 100644 +--- a/orderer/common/cluster/util_test.go ++++ b/orderer/common/cluster/util_test.go +@@ -289,7 +289,7 @@ func TestVerifyBlockHash(t *testing.T) { + }, + { + name: "data hash mismatch", +- errorContains: "computed hash of block (13) (dcb2ec1c5e482e4914cb953ff8eedd12774b244b12912afbe6001ba5de9ff800)" + ++ errorContains: "computed hash of block (13) (6de668ac99645e179a4921b477d50df9295fa56cd44f8e5c94756b60ce32ce1c)" + + " doesn't match claimed hash (07)", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.DataHash = []byte{7} +@@ -299,7 +299,7 @@ func TestVerifyBlockHash(t *testing.T) { + { + name: "prev hash mismatch", + errorContains: "block [12]'s hash " + +- "(866351705f1c2f13e10d52ead9d0ca3b80689ede8cc8bf70a6d60c67578323f4) " + ++ "(72cc7ddf4d8465da95115c0a906416d23d8c74bfcb731a5ab057c213d8db62e1) " + + "mismatches block [13]'s prev block hash (07)", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.PreviousHash = []byte{7} +@@ -373,7 +373,7 @@ func TestVerifyBlocks(t *testing.T) { + return blockSequence + }, + expectedError: "block [74]'s hash " + +- "(5cb4bd1b6a73f81afafd96387bb7ff4473c2425929d0862586f5fbfa12d762dd) " + ++ "(6daec1924ac6db2b23e3f49c190115dfc096603bcd0ec916baf111c68633c969) " + + "mismatches block [75]'s prev block hash (07)", + }, + { +@@ -398,7 +398,7 @@ func TestVerifyBlocks(t *testing.T) { + assignHashes(blockSequence) + return blockSequence + }, +- expectedError: "nil header in payload", ++ expectedError: "block has malformed transactions: transaction 0 has no payload", + }, + { + name: "config blocks in the sequence need to be verified and one of them is improperly signed", +@@ -550,6 +550,7 @@ func createBlockChain(start, end uint64) []*common.Block { + }) + + txn := protoutil.MarshalOrPanic(&common.Envelope{ ++ Signature: []byte{1, 2, 3}, + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{}, + }), +@@ -558,9 +559,8 @@ func createBlockChain(start, end uint64) []*common.Block { + return block + } + var blockchain []*common.Block +- for seq := uint64(start); seq <= uint64(end); seq++ { ++ for seq := start; seq <= end; seq++ { + block := newBlock(seq) +- block.Data.Data = append(block.Data.Data, make([]byte, 100)) + block.Header.DataHash = protoutil.BlockDataHash(block.Data) + blockchain = append(blockchain, block) + } +@@ -706,7 +706,8 @@ func TestConfigFromBlockBadInput(t *testing.T) { + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: []byte{1, 2, 3}, + }), +- })}}}, ++ })}}, ++ }, + }, + { + name: "invalid envelope in block", +@@ -731,7 +732,8 @@ func TestConfigFromBlockBadInput(t *testing.T) { + ChannelHeader: []byte{1, 2, 3}, + }, + }), +- })}}}, ++ })}}, ++ }, + }, + { + name: "invalid config block", +@@ -747,7 +749,8 @@ func TestConfigFromBlockBadInput(t *testing.T) { + }), + }, + }), +- })}}}, ++ })}}, ++ }, + }, + } { + t.Run(testCase.name, func(t *testing.T) { +diff --git a/protoutil/blockutils.go b/protoutil/blockutils.go +index eec72e8ec..46518e994 100644 +--- a/protoutil/blockutils.go ++++ b/protoutil/blockutils.go +@@ -10,6 +10,8 @@ import ( + "bytes" + "crypto/sha256" + "encoding/asn1" ++ "encoding/base64" ++ "fmt" + "math/big" + + "github.com/golang/protobuf/proto" +@@ -218,3 +220,45 @@ func InitBlockMetadata(block *cb.Block) { + } + } + } ++ ++func VerifyTransactionsAreWellFormed(block *cb.Block) error { ++ if block == nil || block.Data == nil || len(block.Data.Data) == 0 { ++ return fmt.Errorf("empty block") ++ } ++ ++ // If we have a single transaction, and the block is a config block, then no need to check ++ // well formed-ness, because there cannot be another transaction in the original block. ++ if IsConfigBlock(block) { ++ return nil ++ } ++ ++ for i, rawTx := range block.Data.Data { ++ env := &cb.Envelope{} ++ if err := proto.Unmarshal(rawTx, env); err != nil { ++ return fmt.Errorf("transaction %d is invalid: %v", i, err) ++ } ++ ++ if len(env.Payload) == 0 { ++ return fmt.Errorf("transaction %d has no payload", i) ++ } ++ ++ if len(env.Signature) == 0 { ++ return fmt.Errorf("transaction %d has no signature", i) ++ } ++ ++ expected, err := proto.Marshal(env) ++ if err != nil { ++ return fmt.Errorf("failed re-marshaling envelope: %v", err) ++ } ++ ++ if len(expected) < len(rawTx) { ++ return fmt.Errorf("transaction %d has %d trailing bytes", i, len(rawTx)-len(expected)) ++ } ++ if !bytes.Equal(expected, rawTx) { ++ return fmt.Errorf("transaction %d (%s) does not match its raw form (%s)", i, ++ base64.StdEncoding.EncodeToString(expected), base64.StdEncoding.EncodeToString(rawTx)) ++ } ++ } ++ ++ return nil ++} +diff --git a/protoutil/blockutils_test.go b/protoutil/blockutils_test.go +index e798749a1..9b3e56e1d 100644 +--- a/protoutil/blockutils_test.go ++++ b/protoutil/blockutils_test.go +@@ -210,7 +210,7 @@ func TestGetMetadataFromBlock(t *testing.T) { + } + + func TestGetConsenterMetadataFromBlock(t *testing.T) { +- var cases = []struct { ++ cases := []struct { + name string + value []byte + signatures []byte +@@ -376,3 +376,131 @@ func TestGetLastConfigIndexFromBlock(t *testing.T) { + }, "Expected panic with malformed last config metadata") + }) + } ++ ++func TestVerifyTransactionsAreWellFormed(t *testing.T) { ++ originalBlock := &cb.Block{ ++ Data: &cb.BlockData{ ++ Data: [][]byte{ ++ marshalOrPanic(&cb.Envelope{ ++ Payload: []byte{1, 2, 3}, ++ Signature: []byte{4, 5, 6}, ++ }), ++ marshalOrPanic(&cb.Envelope{ ++ Payload: []byte{7, 8, 9}, ++ Signature: []byte{10, 11, 12}, ++ }), ++ }, ++ }, ++ } ++ ++ forgedBlock := proto.Clone(originalBlock).(*cb.Block) ++ tmp := make([]byte, len(forgedBlock.Data.Data[0])+len(forgedBlock.Data.Data[1])) ++ copy(tmp, forgedBlock.Data.Data[0]) ++ copy(tmp[len(forgedBlock.Data.Data[0]):], forgedBlock.Data.Data[1]) ++ forgedBlock.Data.Data = [][]byte{tmp} // Replace transactions {0,1} with transaction {0 || 1} ++ ++ for _, tst := range []struct { ++ name string ++ expectedError string ++ block *cb.Block ++ }{ ++ { ++ name: "config block", ++ block: &cb.Block{Data: &cb.BlockData{ ++ Data: [][]byte{ ++ protoutil.MarshalOrPanic( ++ &cb.Envelope{ ++ Payload: protoutil.MarshalOrPanic(&cb.Payload{ ++ Header: &cb.Header{ ++ ChannelHeader: protoutil.MarshalOrPanic(&cb.ChannelHeader{ ++ Type: int32(cb.HeaderType_CONFIG), ++ }), ++ }, ++ }), ++ }), ++ }, ++ }}, ++ }, ++ { ++ name: "empty block", ++ expectedError: "empty block", ++ }, ++ { ++ name: "no block data", ++ block: &cb.Block{}, ++ expectedError: "empty block", ++ }, ++ { ++ name: "no transactions", ++ block: &cb.Block{Data: &cb.BlockData{}}, ++ expectedError: "empty block", ++ }, ++ { ++ name: "single transaction", ++ block: &cb.Block{Data: &cb.BlockData{Data: [][]byte{marshalOrPanic(&cb.Envelope{ ++ Payload: []byte{1, 2, 3}, ++ Signature: []byte{4, 5, 6}, ++ })}}}, ++ }, ++ ++ { ++ name: "good block", ++ block: originalBlock, ++ }, ++ { ++ name: "forged block", ++ block: forgedBlock, ++ expectedError: "transaction 0 has 10 trailing bytes", ++ }, ++ { ++ name: "no signature", ++ expectedError: "transaction 0 has no signature", ++ block: &cb.Block{ ++ Data: &cb.BlockData{ ++ Data: [][]byte{ ++ marshalOrPanic(&cb.Envelope{ ++ Payload: []byte{1, 2, 3}, ++ }), ++ }, ++ }, ++ }, ++ }, ++ { ++ name: "no payload", ++ expectedError: "transaction 0 has no payload", ++ block: &cb.Block{ ++ Data: &cb.BlockData{ ++ Data: [][]byte{ ++ marshalOrPanic(&cb.Envelope{ ++ Signature: []byte{4, 5, 6}, ++ }), ++ }, ++ }, ++ }, ++ }, ++ { ++ name: "transaction invalid", ++ expectedError: "transaction 0 is invalid: proto: common.Envelope: illegal tag 0 (wire type 6)", ++ block: &cb.Block{ ++ Data: &cb.BlockData{ ++ Data: [][]byte{ ++ marshalOrPanic(&cb.Envelope{ ++ Payload: []byte{1, 2, 3}, ++ Signature: []byte{4, 5, 6}, ++ })[9:], ++ }, ++ }, ++ }, ++ }, ++ } { ++ tst := tst ++ t.Run(tst.name, func(t *testing.T) { ++ err := protoutil.VerifyTransactionsAreWellFormed(tst.block) ++ if tst.expectedError == "" { ++ require.NoError(t, err) ++ } else { ++ require.Contains(t, err.Error(), tst.expectedError) ++ } ++ }) ++ } ++} +diff --git a/protoutil/commonutils.go b/protoutil/commonutils.go +index 76c903cdb..97dd17389 100644 +--- a/protoutil/commonutils.go ++++ b/protoutil/commonutils.go +@@ -188,7 +188,16 @@ func SignOrPanic(signer identity.Signer, msg []byte) []byte { + // IsConfigBlock validates whenever given block contains configuration + // update transaction + func IsConfigBlock(block *cb.Block) bool { +- envelope, err := ExtractEnvelope(block, 0) ++ if block.Data == nil { ++ return false ++ } ++ ++ if len(block.Data.Data) != 1 { ++ return false ++ } ++ ++ marshaledEnvelope := block.Data.Data[0] ++ envelope, err := GetEnvelopeFromBlock(marshaledEnvelope) + if err != nil { + return false + } diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..8ce374584c423a9740271ab38451cca8073ba239 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/post_context.md @@ -0,0 +1,5100 @@ +# Patch-overlapping Go context after the fix + +## `internal/peer/gossip/mcs.go` (changed lines (154, 155, 156, 157, 266)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package gossip + +import ( + "bytes" + "fmt" + "time" + + pcommon "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric/bccsp" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/common/util" + "github.com/hyperledger/fabric/gossip/api" + "github.com/hyperledger/fabric/gossip/common" + "github.com/hyperledger/fabric/internal/pkg/identity" + "github.com/hyperledger/fabric/msp" + "github.com/hyperledger/fabric/msp/mgmt" + "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" +) + +var mcsLogger = flogging.MustGetLogger("peer.gossip.mcs") + +// Hasher is the interface provides the hash function should be used for all gossip components. +type Hasher interface { + Hash(msg []byte, opts bccsp.HashOpts) (hash []byte, err error) +} + +// MSPMessageCryptoService implements the MessageCryptoService interface +// using the peer MSPs (local and channel-related) +// +// In order for the system to be secure it is vital to have the +// MSPs to be up-to-date. Channels' MSPs are updated via +// configuration transactions distributed by the ordering service. +// +// A similar mechanism needs to be in place to update the local MSP, as well. +// This implementation assumes that these mechanisms are all in place and working. +type MSPMessageCryptoService struct { + channelPolicyManagerGetter policies.ChannelPolicyManagerGetter + localSigner identity.SignerSerializer + deserializer mgmt.DeserializersManager + hasher Hasher +} + +// NewMCS creates a new instance of MSPMessageCryptoService +// that implements MessageCryptoService. +// The method takes in input: +// 1. a policies.ChannelPolicyManagerGetter that gives access to the policy manager of a given channel via the Manager method. +// 2. an instance of identity.SignerSerializer +// 3. an identity deserializer manager +func NewMCS( + channelPolicyManagerGetter policies.ChannelPolicyManagerGetter, + localSigner identity.SignerSerializer, + deserializer mgmt.DeserializersManager, + hasher Hasher, +) *MSPMessageCryptoService { + return &MSPMessageCryptoService{ + channelPolicyManagerGetter: channelPolicyManagerGetter, + localSigner: localSigner, + deserializer: deserializer, + hasher: hasher, + } +} + +// ValidateIdentity validates the identity of a remote peer. +// If the identity is invalid, revoked, expired it returns an error. +// Else, returns nil +func (s *MSPMessageCryptoService) ValidateIdentity(peerIdentity api.PeerIdentityType) error { + // As prescribed by the contract of method, + // below we check only that peerIdentity is not + // invalid, revoked or expired. + + _, _, err := s.getValidatedIdentity(peerIdentity) + return err +} + +// GetPKIidOfCert returns the PKI-ID of a peer's identity +// If any error occurs, the method return nil +// The PKid of a peer is computed as the SHA2-256 of peerIdentity which +// is supposed to be the serialized version of MSP identity. +// This method does not validate peerIdentity. +// This validation is supposed to be done appropriately during the execution flow. +func (s *MSPMessageCryptoService) GetPKIidOfCert(peerIdentity api.PeerIdentityType) common.PKIidType { + // Validate arguments + if len(peerIdentity) == 0 { + mcsLogger.Error("Invalid Peer Identity. It must be different from nil.") + + return nil + } + + sid, err := s.deserializer.Deserialize(peerIdentity) + if err != nil { + mcsLogger.Errorf("Failed getting validated identity from peer identity %s: [%s]", peerIdentity, err) + + return nil + } + + // concatenate msp-id and idbytes + // idbytes is the low-level representation of an identity. + // it is supposed to be already in its minimal representation + + mspIDRaw := []byte(sid.Mspid) + raw := append(mspIDRaw, sid.IdBytes...) + + // Hash + digest, err := s.hasher.Hash(raw, &bccsp.SHA256Opts{}) + if err != nil { + mcsLogger.Errorf("Failed computing digest of serialized identity %s: [%s]", peerIdentity, err) + return nil + } + + return digest +} + +// VerifyBlock returns nil if the block is properly signed, and the claimed seqNum is the +// sequence number that the block's header contains. +// else returns error +func (s *MSPMessageCryptoService) VerifyBlock(chainID common.ChannelID, seqNum uint64, block *pcommon.Block) error { + if block.Header == nil { + return fmt.Errorf("Invalid Block on channel [%s]. Header must be different from nil.", chainID) + } + + blockSeqNum := block.Header.Number + if seqNum != blockSeqNum { + return fmt.Errorf("Claimed seqNum is [%d] but actual seqNum inside block is [%d]", seqNum, blockSeqNum) + } + + // - Extract channelID and compare with chainID + channelID, err := protoutil.GetChannelIDFromBlock(block) + if err != nil { + return fmt.Errorf("Failed getting channel id from block with id [%d] on channel [%s]: [%s]", block.Header.Number, chainID, err) + } + + if channelID != string(chainID) { + return fmt.Errorf("Invalid block's channel id. Expected [%s]. Given [%s]", chainID, channelID) + } + + // - Unmarshal medatada + if block.Metadata == nil || len(block.Metadata.Metadata) == 0 { + return fmt.Errorf("Block with id [%d] on channel [%s] does not have metadata. Block not valid.", block.Header.Number, chainID) + } + + metadata, err := protoutil.GetMetadataFromBlock(block, pcommon.BlockMetadataIndex_SIGNATURES) + if err != nil { + return fmt.Errorf("Failed unmarshalling medatata for signatures [%s]", err) + } + + if err := protoutil.VerifyTransactionsAreWellFormed(block); err != nil { + return fmt.Errorf("block has malformed transactions: %v", err) + } + + // - Verify that Header.DataHash is equal to the hash of block.Data + // This is to ensure that the header is consistent with the data carried by this block + if !bytes.Equal(protoutil.BlockDataHash(block.Data), block.Header.DataHash) { + return fmt.Errorf("Header.DataHash is different from Hash(block.Data) for block with id [%d] on channel [%s]", block.Header.Number, chainID) + } + + // - Get Policy for block validation + + // Get the policy manager for channelID + cpm := s.channelPolicyManagerGetter.Manager(channelID) + if cpm == nil { + return fmt.Errorf("Could not acquire policy manager for channel %s", channelID) + } + mcsLogger.Debugf("Got policy manager for channel [%s]", channelID) + + // Get block validation policy + policy, ok := cpm.GetPolicy(policies.BlockValidation) + // ok is true if it was the policy requested, or false if it is the default policy + mcsLogger.Debugf("Got block validation policy for channel [%s] with flag [%t]", channelID, ok) + + // - Prepare SignedData + signatureSet := []*protoutil.SignedData{} + for _, metadataSignature := range metadata.Signatures { + shdr, err := protoutil.UnmarshalSignatureHeader(metadataSignature.SignatureHeader) + if err != nil { + return fmt.Errorf("Failed unmarshalling signature header for block with id [%d] on channel [%s]: [%s]", block.Header.Number, chainID, err) + } + signatureSet = append( + signatureSet, + &protoutil.SignedData{ + Identity: shdr.Creator, + Data: util.ConcatenateBytes(metadata.Value, metadataSignature.SignatureHeader, protoutil.BlockHeaderBytes(block.Header)), + Signature: metadataSignature.Signature, + }, + ) + } + + // - Evaluate policy + return policy.EvaluateSignedData(signatureSet) +} + +// Sign signs msg with this peer's signing key and outputs +// the signature if no error occurred. +func (s *MSPMessageCryptoService) Sign(msg []byte) ([]byte, error) { + return s.localSigner.Sign(msg) +} + +// Verify checks that signature is a valid signature of message under a peer's verification key. +// If the verification succeeded, Verify returns nil meaning no error occurred. +// If peerIdentity is nil, then the verification fails. +func (s *MSPMessageCryptoService) Verify(peerIdentity api.PeerIdentityType, signature, message []byte) error { + identity, chainID, err := s.getValidatedIdentity(peerIdentity) + if err != nil { + mcsLogger.Errorf("Failed getting validated identity from peer identity [%s]", err) + + return err + } + + if len(chainID) == 0 { + // At this stage, this means that peerIdentity + // belongs to this peer's LocalMSP. + // The signature is validated directly + return identity.Verify(message, signature) + } + + // At this stage, the signature must be validated + // against the reader policy of the channel + // identified by chainID + + return s.VerifyByChannel(chainID, peerIdentity, signature, message) +} + +// VerifyByChannel checks that signature is a valid signature of message +// under a peer's verification key, but also in the context of a specific channel. +// If the verification succeeded, Verify returns nil meaning no error occurred. +// If peerIdentity is nil, then the verification fails. +func (s *MSPMessageCryptoService) VerifyByChannel(chainID common.ChannelID, peerIdentity api.PeerIdentityType, signature, message []byte) error { + // Validate arguments + if len(peerIdentity) == 0 { + return errors.New("Invalid Peer Identity. It must be different from nil.") + } + + // Get the policy manager for channel chainID + cpm := s.channelPolicyManagerGetter.Manager(string(chainID)) + if cpm == nil { + return fmt.Errorf("Could not acquire policy manager for channel %s", string(chainID)) + } + mcsLogger.Debugf("Got policy manager for channel [%s]", string(chainID)) + + // Get channel reader policy + policy, flag := cpm.GetPolicy(policies.ChannelApplicationReaders) + mcsLogger.Debugf("Got reader policy for channel [%s] with flag [%t]", string(chainID), flag) + + return policy.EvaluateSignedData( + []*protoutil.SignedData{{ + Data: message, + Identity: []byte(peerIdentity), + Signature: signature, + }}, + ) +} + +func (s *MSPMessageCryptoService) Expiration(peerIdentity api.PeerIdentityType) (time.Time, error) { + id, _, err := s.getValidatedIdentity(peerIdentity) + if err != nil { + return time.Time{}, errors.Wrap(err, "Unable to extract msp.Identity from peer Identity") + } + return id.ExpiresAt(), nil +} + +func (s *MSPMessageCryptoService) getValidatedIdentity(peerIdentity api.PeerIdentityType) (msp.Identity, common.ChannelID, error) { + // Validate arguments + if len(peerIdentity) == 0 { + return nil, nil, errors.New("Invalid Peer Identity. It must be different from nil.") + } + + sId, err := s.deserializer.Deserialize(peerIdentity) + if err != nil { + mcsLogger.Error("failed deserializing identity", err) + return nil, nil, err + } + + // Notice that peerIdentity is assumed to be the serialization of an identity. + // So, first step is the identity deserialization and then verify it. + + // First check against the local MSP. + // If the peerIdentity is in the same organization of this node then + // the local MSP is required to take the final decision on the validity + // of the signature. + lDes := s.deserializer.GetLocalDeserializer() + identity, err := lDes.DeserializeIdentity([]byte(peerIdentity)) + if err == nil { + // No error means that the local MSP successfully deserialized the identity. + // We now check additional properties. + if err := lDes.IsWellFormed(sId); err != nil { + return nil, nil, errors.Wrap(err, "identity is not well formed") + } + // TODO: The following check will be replaced by a check on the organizational units + // when we allow the gossip network to have organization unit (MSP subdivisions) + // scoped messages. + // The following check is consistent with the SecurityAdvisor#OrgByPeerIdentity + // implementation. + // TODO: Notice that the following check saves us from the fact + // that DeserializeIdentity does not yet enforce MSP-IDs consistency. + // This check can be removed once DeserializeIdentity will be fixed. + if identity.GetMSPIdentifier() == s.deserializer.GetLocalMSPIdentifier() { + // Check identity validity + + // Notice that at this stage we don't have to check the identity + // against any channel's policies. + // This will be done by the caller function, if needed. + return identity, nil, identity.Validate() + } + } + + // Check against managers + for chainID, mspManager := range s.deserializer.GetChannelDeserializers() { + // Deserialize identity + identity, err := mspManager.DeserializeIdentity([]byte(peerIdentity)) + if err != nil { + mcsLogger.Debugf("Failed deserialization identity %s on [%s]: [%s]", peerIdentity, chainID, err) + continue + } + + // We managed deserializing the identity with this MSP manager. Now we check if it's well formed. + if err := mspManager.IsWellFormed(sId); err != nil { + return nil, nil, errors.Wrap(err, "identity is not well formed") + } + + // Check identity validity + // Notice that at this stage we don't have to check the identity + // against any channel's policies. + // This will be done by the caller function, if needed. + + if err := identity.Validate(); err != nil { + mcsLogger.Debugf("Failed validating identity %s on [%s]: [%s]", peerIdentity, chainID, err) + continue + } + + mcsLogger.Debugf("Validation succeeded %s on [%s]", peerIdentity, chainID) + + return identity, common.ChannelID(chainID), nil + } + + return nil, nil, fmt.Errorf("Peer Identity %s cannot be validated. No MSP found able to do that.", peerIdentity) +} +``` + +## `orderer/common/cluster/replication_test.go` (changed lines (133, 142, 143, 324, 445, 446, 447, 448)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package cluster_test + +import ( + "io/ioutil" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric/bccsp/sw" + "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/internal/pkg/comm" + "github.com/hyperledger/fabric/orderer/common/cluster" + "github.com/hyperledger/fabric/orderer/common/cluster/mocks" + "github.com/hyperledger/fabric/orderer/common/localconfig" + "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +func TestIsReplicationNeeded(t *testing.T) { + for _, testCase := range []struct { + name string + bootBlock *common.Block + systemChannelHeight uint64 + systemChannelError error + expectedError string + replicationNeeded bool + }{ + { + name: "no replication needed", + systemChannelHeight: 100, + bootBlock: &common.Block{Header: &common.BlockHeader{Number: 99}}, + }, + { + name: "replication is needed - bootstrap block's index equal to height", + systemChannelHeight: 99, + bootBlock: &common.Block{Header: &common.BlockHeader{Number: 99}}, + replicationNeeded: true, + }, + { + name: "replication is needed - no ledger", + systemChannelHeight: 0, + bootBlock: &common.Block{Header: &common.BlockHeader{Number: 99}}, + replicationNeeded: true, + }, + { + name: "IO error", + systemChannelError: errors.New("IO error"), + expectedError: "IO error", + }, + } { + t.Run(testCase.name, func(t *testing.T) { + ledgerWriter := &mocks.LedgerWriter{} + ledgerWriter.On("Height").Return(testCase.systemChannelHeight) + + ledgerFactory := &mocks.LedgerFactory{} + ledgerFactory.On("GetOrCreate", "system").Return(ledgerWriter, testCase.systemChannelError) + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + Logger: flogging.MustGetLogger("test"), + BootBlock: testCase.bootBlock, + SystemChannel: "system", + LedgerFactory: ledgerFactory, + } + + ok, err := r.IsReplicationNeeded() + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + } else { + assert.NoError(t, err) + assert.Equal(t, testCase.replicationNeeded, ok) + } + }) + } +} + +func TestReplicateChainsFailures(t *testing.T) { + for _, testCase := range []struct { + name string + isProbeResponseDelayed bool + latestBlockSeqInOrderer uint64 + ledgerFactoryError error + appendBlockError error + expectedPanic string + mutateBlocks func([]*common.Block) + channelsReturns []cluster.ChannelGenesisBlock + badResponse *orderer.DeliverResponse + }{ + { + name: "no block received", + expectedPanic: "Failed pulling system channel: " + + "failed obtaining the latest block for channel system", + isProbeResponseDelayed: true, + }, + { + name: "received service unavailable", + expectedPanic: "Failed pulling system channel: " + + "failed obtaining the latest block for channel system", + badResponse: &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Status{ + Status: common.Status_SERVICE_UNAVAILABLE, + }, + }, + }, + { + name: "latest block seq is less than boot block seq", + expectedPanic: "Failed pulling system channel: " + + "latest height found among system channel(system) orderers is 19," + + " but the boot block's sequence is 21", + latestBlockSeqInOrderer: 18, + }, + { + name: "hash chain mismatch", + expectedPanic: "Failed pulling system channel: " + + "block header mismatch on sequence 11, " + + "expected 229de8d87db1ddf7278093bc65ba9245cd3acd8ccfc687e0edc68adf9b181488, got 010203", + latestBlockSeqInOrderer: 21, + mutateBlocks: func(systemChannelBlocks []*common.Block) { + systemChannelBlocks[len(systemChannelBlocks)/2].Header.PreviousHash = []byte{1, 2, 3} + }, + }, + { + name: "last pulled block doesn't match the boot block", + expectedPanic: "Block header mismatch on last system channel block," + + " expected 0bea18bff7feeaa0bc08f528e1f563c818fc0633e291786c96eedffd8c7e6cff," + + " got 924c568c4a4e8f16e3cbd123ea0ae38d0bbb01d60bafb74f4bb55f108c0eb194", + latestBlockSeqInOrderer: 21, + mutateBlocks: func(systemChannelBlocks []*common.Block) { + systemChannelBlocks[21].Header.DataHash = nil + }, + }, + { + name: "failure in creating ledger", + latestBlockSeqInOrderer: 21, + ledgerFactoryError: errors.New("IO error"), + expectedPanic: "Failed to create a ledger for channel system: IO error", + }, + { + name: "failure in appending a block to the ledger", + latestBlockSeqInOrderer: 21, + appendBlockError: errors.New("IO error"), + expectedPanic: "Failed to write block [0]: IO error", + }, + { + name: "failure pulling the system chain", + latestBlockSeqInOrderer: 21, + expectedPanic: "Failed pulling system channel: " + + "failed obtaining the latest block for channel system", + isProbeResponseDelayed: true, + }, + { + name: "failure obtaining a ledger for a non participating channel", + latestBlockSeqInOrderer: 21, + channelsReturns: []cluster.ChannelGenesisBlock{ + {ChannelName: "channelWeAreNotPartOf"}, + }, + ledgerFactoryError: errors.New("IO error"), + expectedPanic: "Failed to create a ledger for channel channelWeAreNotPartOf: IO error", + }, + } { + t.Run(testCase.name, func(t *testing.T) { + systemChannelBlocks := createBlockChain(0, 21) + if testCase.mutateBlocks != nil { + testCase.mutateBlocks(systemChannelBlocks) + } + + lw := &mocks.LedgerWriter{} + lw.On("Append", mock.Anything).Return(testCase.appendBlockError) + lw.On("Height").Return(uint64(0)) + + lf := &mocks.LedgerFactory{} + lf.On("GetOrCreate", "system").Return(lw, testCase.ledgerFactoryError) + lf.On("GetOrCreate", "channelWeAreNotPartOf").Return(lw, testCase.ledgerFactoryError) + + osn := newClusterNode(t) + defer osn.stop() + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + // Put a big timeout, to reduce chance of flakes when the server gets stuck + // and we get an un-called for timeout. + bp.FetchTimeout = time.Hour + + cl := &mocks.ChannelLister{} + cl.On("Channels").Return(testCase.channelsReturns) + cl.On("Close") + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return cluster.ErrNotInChannel + }, + Logger: flogging.MustGetLogger("test"), + BootBlock: systemChannelBlocks[21], + SystemChannel: "system", + LedgerFactory: lf, + Puller: bp, + ChannelLister: cl, + } + + if len(testCase.channelsReturns) > 0 { + simulateNonParticipantChannelPull(osn) + } + + if testCase.badResponse != nil { + osn.blockResponses <- testCase.badResponse + } + + if !testCase.isProbeResponseDelayed { + osn.enqueueResponse(testCase.latestBlockSeqInOrderer) + osn.enqueueResponse(testCase.latestBlockSeqInOrderer) + } else { + // Send a nil to force an EOF to the client + osn.blockResponses <- nil + } + osn.addExpectProbeAssert() + osn.addExpectProbeAssert() + osn.addExpectPullAssert(0) + + if !testCase.isProbeResponseDelayed { + for _, block := range systemChannelBlocks { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block}, + } + } + } else { + // Send a nil to force an EOF to the client + osn.blockResponses <- nil + } + + assert.PanicsWithValue(t, testCase.expectedPanic, func() { r.ReplicateChains() }) + bp.Close() + dialer.assertAllConnectionsClosed(t) + }) + } +} + +func TestPullChannelFailure(t *testing.T) { + blockchain := createBlockChain(0, 5) + for _, testcase := range []struct { + name string + genesisBlockSequence int + thirdBlockSequence int + }{ + { + name: "Failed to pull genesis block", + genesisBlockSequence: 1, + }, + { + name: "Failed to pull some non genesis block", + genesisBlockSequence: 0, + thirdBlockSequence: 0, + }, + } { + t.Run(testcase.name, func(t *testing.T) { + lw := &mocks.LedgerWriter{} + lw.On("Append", mock.Anything).Return(nil) + lw.On("Height").Return(uint64(0)) + + lf := &mocks.LedgerFactory{} + lf.On("GetOrCreate", "mychannel").Return(lw, nil) + + osn := newClusterNode(t) + defer osn.stop() + + enqueueBlock := func(seq int) { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{ + Block: blockchain[seq], + }, + } + } + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + // Put a big timeout, to reduce chance of flakes when the server gets stuck + // and we get an un-called for timeout. + bp.FetchTimeout = time.Hour + bp.MaxPullBlockRetries = 1 + // Do not buffer blocks in memory + bp.MaxTotalBufferBytes = 1 + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return nil + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + LedgerFactory: lf, + Puller: bp, + } + + osn.addExpectProbeAssert() + enqueueBlock(5) + osn.addExpectProbeAssert() + enqueueBlock(5) + osn.addExpectPullAssert(0) + enqueueBlock(testcase.genesisBlockSequence) + enqueueBlock(1) + enqueueBlock(testcase.thirdBlockSequence) + + err := r.PullChannel("mychannel") + assert.Equal(t, cluster.ErrRetryCountExhausted, err) + }) + } +} + +func TestPullerConfigFromTopLevelConfig(t *testing.T) { + signer := &mocks.SignerSerializer{} + expected := cluster.PullerConfig{ + Channel: "system", + MaxTotalBufferBytes: 100, + Signer: signer, + TLSCert: []byte{3, 2, 1}, + TLSKey: []byte{1, 2, 3}, + Timeout: time.Hour, + } + + topLevelConfig := &localconfig.TopLevel{ + General: localconfig.General{ + Cluster: localconfig.Cluster{ + ReplicationBufferSize: 100, + RPCTimeout: time.Hour, + }, + }, + } + + config := cluster.PullerConfigFromTopLevelConfig("system", topLevelConfig, []byte{1, 2, 3}, []byte{3, 2, 1}, signer) + assert.Equal(t, expected, config) +} + +func TestReplicateChainsChannelClassificationFailure(t *testing.T) { + // Scenario: We are unable to classify whether we are part of the channel, + // so we crash, because this is a programming error. + + block30WithConfigBlockOf21 := protoutil.NewBlock(30, nil) + block30WithConfigBlockOf21.Metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 21}), + }) + + osn := newClusterNode(t) + defer osn.stop() + osn.blockResponses = make(chan *orderer.DeliverResponse, 1000) + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + bp.FetchTimeout = time.Hour + + channelLister := &mocks.ChannelLister{} + channelLister.On("Channels").Return([]cluster.ChannelGenesisBlock{{ChannelName: "A"}}) + channelLister.On("Close") + + // We probe for the latest block of the orderer + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + + // And now pull it again (first poll and then pull it for real). + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + osn.addExpectPullAssert(30) + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block30WithConfigBlockOf21}, + } + // Now we pull the latest config block extracted from the previous block pulled. + // Beforehand we reconnect to the orderer, so we put an artificial signal to close the stream on the server side, + // in order to expect for a new stream to be established. + osn.blockResponses <- nil + // The orderer's last block's sequence is 30, + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + // And the Replicator now asks for block 21. + osn.enqueueResponse(21) + osn.addExpectPullAssert(21) + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return errors.New("oops") + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + ChannelLister: channelLister, + Puller: bp, + } + + assert.PanicsWithValue(t, "Failed classifying whether I belong to channel A: oops, skipping chain retrieval", func() { + r.ReplicateChains() + }) + + bp.Close() + dialer.assertAllConnectionsClosed(t) +} + +func TestReplicateChainsGreenPath(t *testing.T) { + // Scenario: There are 5 channels in the system: A-E. + // We are in channel A but not in channel B, therefore + // we should pull channel A and then the system channel. + // However, this is not the first attempt of replication for + // our node, but the second. + // In the past, the node pulled 10 blocks of channel A and crashed. + // Therefore, it should pull blocks, but commit for channel A + // only blocks starting from block number 10. + // For channel C - we are forbidden from pulling any blocks. + // Channel D is a deserted channel - all OSNs have left it, + // therefore we should not pull it at all. + // Channel E cannot be pulled at all, due to the OSN being unavailable + // at that time. + + systemChannelBlocks := createBlockChain(0, 21) + block30WithConfigBlockOf21 := protoutil.NewBlock(30, nil) + block30WithConfigBlockOf21.Metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 21}), + }) + + osn := newClusterNode(t) + defer osn.stop() + osn.blockResponses = make(chan *orderer.DeliverResponse, 1000) + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + bp.FetchTimeout = time.Hour + bp.MaxPullBlockRetries = 1 + + channelLister := &mocks.ChannelLister{} + channelLister.On("Channels").Return([]cluster.ChannelGenesisBlock{ + {ChannelName: "E", GenesisBlock: fakeGB}, + {ChannelName: "D", GenesisBlock: fakeGB}, + {ChannelName: "C", GenesisBlock: fakeGB}, + {ChannelName: "A", GenesisBlock: fakeGB}, + {ChannelName: "B", GenesisBlock: fakeGB}, + }) + channelLister.On("Close") + + amIPartOfChannelMock := &mock.Mock{} + // For channel A + amIPartOfChannelMock.On("func13").Return(nil).Once() + // For channel B + amIPartOfChannelMock.On("func13").Return(cluster.ErrNotInChannel).Once() + + // 22 is for the system channel, and 31 is for channel A, and for channel B we only need 1 block (the GB). + blocksCommittedToLedgerA := make(chan *common.Block, 31) + blocksCommittedToLedgerB := make(chan *common.Block, 1) + blocksCommittedToLedgerC := make(chan *common.Block, 1) + blocksCommittedToLedgerD := make(chan *common.Block, 1) + blocksCommittedToLedgerE := make(chan *common.Block, 1) + blocksCommittedToSystemLedger := make(chan *common.Block, 22) + // Put 10 blocks in the ledger of channel A, to simulate + // that the ledger had blocks when the node started. + for seq := 0; seq < 10; seq++ { + blocksCommittedToLedgerA <- &common.Block{ + Header: &common.BlockHeader{Number: uint64(seq)}, + } + } + + lwA := &mocks.LedgerWriter{} + lwA.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerA <- arg.Get(0).(*common.Block) + }) + lwA.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerA)) + }) + + lwB := &mocks.LedgerWriter{} + lwB.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerB)) + }) + lwB.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerB <- arg.Get(0).(*common.Block) + }) + + lwC := &mocks.LedgerWriter{} + lwC.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerC)) + }) + lwC.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerC <- arg.Get(0).(*common.Block) + }) + + lwD := &mocks.LedgerWriter{} + lwD.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerD)) + }) + lwD.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerD <- arg.Get(0).(*common.Block) + }) + + lwE := &mocks.LedgerWriter{} + lwE.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerE)) + }) + lwE.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerE <- arg.Get(0).(*common.Block) + }) + + lwSystem := &mocks.LedgerWriter{} + lwSystem.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToSystemLedger <- arg.Get(0).(*common.Block) + }) + lwSystem.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToSystemLedger)) + }) + + lf := &mocks.LedgerFactory{} + lf.On("Close") + lf.On("GetOrCreate", "A").Return(lwA, nil) + lf.On("GetOrCreate", "B").Return(lwB, nil) + lf.On("GetOrCreate", "C").Return(lwC, nil) + lf.On("GetOrCreate", "D").Return(lwD, nil) + lf.On("GetOrCreate", "E").Return(lwE, nil) + lf.On("GetOrCreate", "system").Return(lwSystem, nil) + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + LedgerFactory: lf, + AmIPartOfChannel: func(configBlock *common.Block) error { + return amIPartOfChannelMock.Called().Error(0) + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + ChannelLister: channelLister, + Puller: bp, + BootBlock: systemChannelBlocks[21], + } + + // The first thing the orderer gets is a seek to channel E. + // Unfortunately, it's not available! + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "E", actualChannel) + } + // Send an EOF down the stream. + osn.blockResponses <- nil + + // The second thing the orderer gets is a seek to channel D, + // which is followed by a response of service unavailable + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "D", actualChannel) + } + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Status{ + Status: common.Status_SERVICE_UNAVAILABLE, + }, + } + + // The third thing the orderer gets is a seek to channel C, + // which is followed by a response of forbidden + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "C", actualChannel) + } + + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Status{ + Status: common.Status_FORBIDDEN, + }, + } + + for _, channel := range []string{"A", "B"} { + channel := channel + // First, the orderer needs to figure out whether it is in the channel, + // so it reaches to find the latest block from all orderers to get + // the latest config block and see whether it is among the consenters. + + // Orderer is expecting a poll for last block of the current channel + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, channel, actualChannel) + } + + // Orderer returns its last block is 30. + // This is needed to get the latest height by comparing among all orderers. + osn.enqueueResponse(30) + + // First we poll for the block sequence we got previously again, from some orderer. + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + + // And afterwards pull the block from the first orderer. + osn.addExpectPullAssert(30) + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block30WithConfigBlockOf21}, + } + // And the last config block is pulled via reconnecting to the orderer. + osn.blockResponses <- nil + // The orderer's last block's sequence is 30, + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + // And the Replicator now asks for block 21. + osn.enqueueResponse(21) + osn.addExpectPullAssert(21) + // We always close the connection before attempting to pull the next block + osn.blockResponses <- nil + } + + // Next, the Replicator figures out the latest block sequence for that chain + // to know until when to pull + + // We expect a probe for channel A only, because channel B isn't in the channel + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "A", actualChannel) + } + osn.enqueueResponse(30) + // From this point onwards, we pull the blocks for the chain. + osn.enqueueResponse(30) + osn.addExpectProbeAssert() + osn.addExpectPullAssert(10) + // Enqueue 31 blocks in its belly + for _, block := range createBlockChain(10, 30) { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block}, + } + } + // Signal the orderer to stop sending us blocks since we're going to reconnect + // to it to ask for the next channel + osn.blockResponses <- nil + + // Now we define assertions for the system channel + // Pull assertions for the system channel + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the system channel. + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "system", actualChannel) + } + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: systemChannelBlocks[21]}, + } + osn.addExpectProbeAssert() + osn.enqueueResponse(21) + osn.addExpectPullAssert(0) + for _, block := range systemChannelBlocks { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block}, + } + } + + // This is where all the work is done. + // The above lines were all assertions and preparations + // for the expected flow of the test. + r.ReplicateChains() + + // We replicated the chains, so all that left is to ensure + // the blocks were committed in order, and all blocks we expected + // to be committed (for channel A and the system channel) were committed. + close(blocksCommittedToLedgerA) + close(blocksCommittedToSystemLedger) + assert.Len(t, blocksCommittedToLedgerA, cap(blocksCommittedToLedgerA)) + assert.Len(t, blocksCommittedToSystemLedger, cap(blocksCommittedToSystemLedger)) + assert.Len(t, blocksCommittedToLedgerB, 1) + assert.Len(t, blocksCommittedToLedgerC, 1) + assert.Len(t, blocksCommittedToLedgerD, 1) + assert.Len(t, blocksCommittedToLedgerE, 1) + // Count the blocks for channel A + var expectedSequence uint64 + for block := range blocksCommittedToLedgerA { + assert.Equal(t, expectedSequence, block.Header.Number) + expectedSequence++ + } + + // Count the blocks for the system channel + expectedSequence = uint64(0) + for block := range blocksCommittedToSystemLedger { + assert.Equal(t, expectedSequence, block.Header.Number) + expectedSequence++ + } + + bp.Close() + dialer.assertAllConnectionsClosed(t) +} + +func TestParticipant(t *testing.T) { + for _, testCase := range []struct { + name string + heightsByEndpoints map[string]uint64 + heightsByEndpointsErr error + latestBlockSeq uint64 + latestBlock *common.Block + latestConfigBlockSeq uint64 + latestConfigBlock *common.Block + expectedError string + predicateReturns error + }{ + { + name: "No available orderer", + expectedError: cluster.ErrRetryCountExhausted.Error(), + }, + { + name: "Unauthorized for the channel", + expectedError: cluster.ErrForbidden.Error(), + heightsByEndpointsErr: cluster.ErrForbidden, + }, + { + name: "No OSN services the channel", + expectedError: cluster.ErrServiceUnavailable.Error(), + heightsByEndpointsErr: cluster.ErrServiceUnavailable, + }, + { + name: "Pulled block has no metadata", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{}, + expectedError: "failed to retrieve metadata: no metadata in block", + }, + { + name: "Pulled block has no last config sequence in metadata", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: nil, + }, + }, + expectedError: "failed to retrieve metadata: no metadata at index [SIGNATURES]", + }, + { + name: "Pulled block's SIGNATURES metadata is malformed", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{1, 2, 3}}, + }, + }, + expectedError: "failed to retrieve metadata: error unmarshaling metadata" + + " at index [SIGNATURES]: proto: common.Metadata: illegal tag 0 (wire type 1)", + }, + { + name: "Pulled block's LAST_CONFIG metadata is malformed", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, {1, 2, 3}}, + }, + }, + expectedError: "failed to retrieve metadata: error unmarshaling metadata" + + " at index [LAST_CONFIG]: proto: common.Metadata: illegal tag 0 (wire type 1)", + }, + { + name: "Pulled block's metadata is valid and has a last config", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.OrdererBlockMetadata{ + LastConfig: &common.LastConfig{Index: 42}, + }), + })}, + }, + }, + latestConfigBlockSeq: 42, + latestConfigBlock: &common.Block{Header: &common.BlockHeader{Number: 42}}, + predicateReturns: cluster.ErrNotInChannel, + }, + { + name: "Failed pulling last block", + expectedError: cluster.ErrRetryCountExhausted.Error(), + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: nil, + }, + { + name: "Failed pulling last config block", + expectedError: cluster.ErrRetryCountExhausted.Error(), + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.OrdererBlockMetadata{ + LastConfig: &common.LastConfig{Index: 42}, + }), + })}, + }, + }, + latestConfigBlockSeq: 42, + latestConfigBlock: nil, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + configBlocks := make(chan *common.Block, 1) + predicate := func(configBlock *common.Block) error { + configBlocks <- configBlock + return testCase.predicateReturns + } + puller := &mocks.ChainPuller{} + puller.On("HeightsByEndpoints").Return(testCase.heightsByEndpoints, testCase.heightsByEndpointsErr) + puller.On("PullBlock", testCase.latestBlockSeq).Return(testCase.latestBlock) + puller.On("PullBlock", testCase.latestConfigBlockSeq).Return(testCase.latestConfigBlock) + puller.On("Close") + + err := cluster.Participant(puller, predicate) + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + assert.Len(t, configBlocks, 0) + } else { + assert.Len(t, configBlocks, 1) + assert.Equal(t, testCase.predicateReturns, err) + } + }) + } +} + +func TestBlockPullerFromConfigBlockFailures(t *testing.T) { + blockBytes, err := ioutil.ReadFile("testdata/mychannel.block") + assert.NoError(t, err) + + validBlock := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, validBlock)) + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + for _, testCase := range []struct { + name string + expectedErr string + pullerConfig cluster.PullerConfig + block *common.Block + }{ + { + name: "nil block", + expectedErr: "nil block", + }, + { + name: "invalid block", + expectedErr: "block data is nil", + block: &common.Block{}, + }, + { + name: "bad envelope inside block", + expectedErr: "failed extracting bundle from envelope: " + + "failed to unmarshal payload from envelope: " + + "error unmarshaling Payload: " + + "proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + })}, + }, + }, + }, + { + name: "invalid TLS certificate", + expectedErr: "unable to decode TLS certificate PEM: ////", + block: validBlock, + pullerConfig: cluster.PullerConfig{ + TLSCert: []byte{255, 255, 255}, + }, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + verifierRetriever := &mocks.VerifierRetriever{} + verifierRetriever.On("RetrieveVerifier", mock.Anything).Return(&cluster.NoopBlockVerifier{}) + bp, err := cluster.BlockPullerFromConfigBlock(testCase.pullerConfig, testCase.block, verifierRetriever, cryptoProvider) + assert.EqualError(t, err, testCase.expectedErr) + assert.Nil(t, bp) + }) + } +} + +func testBlockPullerFromConfig(t *testing.T, blockVerifiers []cluster.BlockVerifier, expectedLogMsg string, iterations int) { + verifierRetriever := &mocks.VerifierRetriever{} + for _, blockVerifier := range blockVerifiers { + verifierRetriever.On("RetrieveVerifier", mock.Anything).Return(blockVerifier).Once() + } + + caCert, err := ioutil.ReadFile(filepath.Join("testdata", "ca.crt")) + assert.NoError(t, err) + + tlsCert, err := ioutil.ReadFile(filepath.Join("testdata", "server.crt")) + assert.NoError(t, err) + + tlsKey, err := ioutil.ReadFile(filepath.Join("testdata", "server.key")) + assert.NoError(t, err) + + osn := newClusterNode(t) + osn.srv.Stop() + // Replace the gRPC server with a TLS one + osn.srv, err = comm.NewGRPCServer("127.0.0.1:0", comm.ServerConfig{ + SecOpts: comm.SecureOptions{ + Key: tlsKey, + RequireClientCert: true, + Certificate: tlsCert, + ClientRootCAs: [][]byte{caCert}, + UseTLS: true, + }, + }) + assert.NoError(t, err) + orderer.RegisterAtomicBroadcastServer(osn.srv.Server(), osn) + // And start it + go osn.srv.Start() + defer osn.stop() + + // Start from a valid configuration block + blockBytes, err := ioutil.ReadFile(filepath.Join("testdata", "mychannel.block")) + assert.NoError(t, err) + + validBlock := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, validBlock)) + + // And inject into it a 127.0.0.1 orderer endpoint endpoint and a new TLS CA certificate. + injectTLSCACert(t, validBlock, caCert) + injectGlobalOrdererEndpoint(t, validBlock, osn.srv.Address()) + validBlock.Header.DataHash = protoutil.BlockDataHash(validBlock.Data) + + for attempt := 0; attempt < iterations; attempt++ { + blockMsg := &orderer.DeliverResponse_Block{ + Block: validBlock, + } + + osn.blockResponses <- &orderer.DeliverResponse{ + Type: blockMsg, + } + + osn.blockResponses <- &orderer.DeliverResponse{ + Type: blockMsg, + } + + osn.blockResponses <- nil + + osn.addExpectProbeAssert() + osn.addExpectPullAssert(0) + } + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + bp, err := cluster.BlockPullerFromConfigBlock(cluster.PullerConfig{ + TLSCert: tlsCert, + TLSKey: tlsKey, + MaxTotalBufferBytes: 1, + Channel: "mychannel", + Signer: &mocks.SignerSerializer{}, + Timeout: time.Hour, + }, validBlock, verifierRetriever, cryptoProvider) + bp.RetryTimeout = time.Millisecond * 10 + assert.NoError(t, err) + defer bp.Close() + + var seenExpectedLogMsg bool + + bp.Logger = bp.Logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + if strings.Contains(entry.Message, expectedLogMsg) { + seenExpectedLogMsg = true + } + return nil + })) + + block := bp.PullBlock(0) + assert.Equal(t, uint64(0), block.Header.Number) + assert.True(t, seenExpectedLogMsg) +} + +func TestSkipPullingPulledChannels(t *testing.T) { + blockchain := createBlockChain(0, 5) + lw := &mocks.LedgerWriter{} + lw.On("Height").Return(uint64(6)) + + lf := &mocks.LedgerFactory{} + lf.On("GetOrCreate", "mychannel").Return(lw, nil) + + osn := newClusterNode(t) + defer osn.stop() + + enqueueBlock := func(seq int) { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{ + Block: blockchain[seq], + }, + } + } + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + bp.FetchTimeout = time.Hour + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return nil + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + LedgerFactory: lf, + Puller: bp, + } + + var detectedChannelPulled bool + r.Logger = r.Logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + if strings.Contains(entry.Message, "Latest height found (6) is equal to our height, skipping pulling channel mychannel") { + detectedChannelPulled = true + } + return nil + })) + + osn.addExpectProbeAssert() + enqueueBlock(5) + osn.addExpectProbeAssert() + enqueueBlock(5) + + err := r.PullChannel("mychannel") + assert.NoError(t, err) + assert.True(t, detectedChannelPulled) +} + +func TestBlockPullerFromConfigBlockGreenPath(t *testing.T) { + for _, testCase := range []struct { + description string + blockVerifiers []cluster.BlockVerifier + expectedLogMessage string + iterations int + }{ + { + description: "Success", + blockVerifiers: []cluster.BlockVerifier{&cluster.NoopBlockVerifier{}}, + expectedLogMessage: "Got block [0] of size", + iterations: 1, + }, + { + description: "Failure", + iterations: 2, + // First time it returns nil, second time returns like the success case + blockVerifiers: []cluster.BlockVerifier{nil, &cluster.NoopBlockVerifier{}}, + expectedLogMessage: "Failed verifying received blocks: " + + "couldn't acquire verifier for channel mychannel", + }, + } { + t.Run(testCase.description, func(t *testing.T) { + testBlockPullerFromConfig(t, testCase.blockVerifiers, + testCase.expectedLogMessage, testCase.iterations) + }) + } +} + +func TestNoopBlockVerifier(t *testing.T) { + v := &cluster.NoopBlockVerifier{} + assert.Nil(t, v.VerifyBlockSignature(nil, nil)) +} + +func injectGlobalOrdererEndpoint(t *testing.T, block *common.Block, endpoint string) { + ordererAddresses := channelconfig.OrdererAddressesValue([]string{endpoint}) + // Unwrap the layers until we reach the orderer addresses + env, err := protoutil.ExtractEnvelope(block, 0) + assert.NoError(t, err) + payload, err := protoutil.UnmarshalPayload(env.Payload) + assert.NoError(t, err) + confEnv, err := configtx.UnmarshalConfigEnvelope(payload.Data) + assert.NoError(t, err) + // Replace the orderer addresses + confEnv.Config.ChannelGroup.Values[ordererAddresses.Key()] = &common.ConfigValue{ + Value: protoutil.MarshalOrPanic(ordererAddresses.Value()), + ModPolicy: "/Channel/Orderer/Admins", + } + // Remove the per org addresses, if applicable + ordererGrps := confEnv.Config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups + for _, grp := range ordererGrps { + if grp.Values[channelconfig.EndpointsKey] == nil { + continue + } + grp.Values[channelconfig.EndpointsKey].Value = nil + } + // And put it back into the block + payload.Data = protoutil.MarshalOrPanic(confEnv) + env.Payload = protoutil.MarshalOrPanic(payload) + block.Data.Data[0] = protoutil.MarshalOrPanic(env) +} + +func injectTLSCACert(t *testing.T, block *common.Block, tlsCA []byte) { + // Unwrap the layers until we reach the TLS CA certificates + env, err := protoutil.ExtractEnvelope(block, 0) + assert.NoError(t, err) + payload, err := protoutil.UnmarshalPayload(env.Payload) + assert.NoError(t, err) + confEnv, err := configtx.UnmarshalConfigEnvelope(payload.Data) + assert.NoError(t, err) + mspKey := confEnv.Config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups["OrdererOrg"].Values[channelconfig.MSPKey] + rawMSPConfig := mspKey.Value + mspConf := &msp.MSPConfig{} + proto.Unmarshal(rawMSPConfig, mspConf) + fabricMSPConf := &msp.FabricMSPConfig{} + proto.Unmarshal(mspConf.Config, fabricMSPConf) + // Replace the TLS root certs with the given ones + fabricMSPConf.TlsRootCerts = [][]byte{tlsCA} + // And put it back into the block + mspConf.Config = protoutil.MarshalOrPanic(fabricMSPConf) + mspKey.Value = protoutil.MarshalOrPanic(mspConf) + payload.Data = protoutil.MarshalOrPanic(confEnv) + env.Payload = protoutil.MarshalOrPanic(payload) + block.Data.Data[0] = protoutil.MarshalOrPanic(env) +} + +func TestExtractGenesisBlock(t *testing.T) { + for _, testCase := range []struct { + name string + expectedErr string + returnedName string + block *common.Block + returnGenesisBlock bool + }{ + { + name: "nil block", + expectedErr: "nil block", + }, + { + name: "no data section in block", + expectedErr: "block data is nil", + block: &common.Block{}, + }, + { + name: "corrupt envelope in block", + expectedErr: "block data does not carry an" + + " envelope at index 0: error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{{1, 2, 3}}, + }, + }, + }, + { + name: "corrupt payload in envelope", + expectedErr: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + })}, + }, + }, + }, + { + name: "no header in block", + expectedErr: "nil header in payload", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{}), + })}, + }, + }, + }, + { + name: "corrupt channel header", + expectedErr: "error unmarshaling ChannelHeader:" + + " proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: []byte{1, 2, 3}, + }, + }), + })}, + }, + }, + }, + { + name: "not an orderer transaction", + expectedErr: "", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG_UPDATE), + }), + }, + }), + })}, + }, + }, + }, + { + name: "orderer transaction with corrupt inner envelope", + expectedErr: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: []byte{1, 2, 3}, + }), + })}, + }, + }, + }, + { + name: "orderer transaction with corrupt inner payload", + expectedErr: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction with nil inner header", + expectedErr: "inner payload's header is nil", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{}), + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction with corrupt inner channel header", + expectedErr: "error unmarshaling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: []byte{1, 2, 3}, + }, + }), + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction that is not a config, but a config update", + expectedErr: "", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG_UPDATE), + }), + }, + }), + }), + }), + })}, + }, + }, + }, + { + expectedErr: "", + name: "orderer transaction that is a system channel config block", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + ChannelId: "systemChannel", + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + ChannelId: "systemChannel", + }), + }, + }), + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction that creates a new application channel", + expectedErr: "", + returnedName: "notSystemChannel", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + ChannelId: "systemChannel", + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + ChannelId: "notSystemChannel", + }), + }, + }), + }), + }), + })}, + }, + }, + returnGenesisBlock: true, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + channelName, gb, err := cluster.ExtractGenesisBlock(flogging.MustGetLogger("test"), testCase.block) + if testCase.expectedErr != "" { + assert.EqualError(t, err, testCase.expectedErr) + } else { + assert.NoError(t, err) + } + assert.Equal(t, testCase.returnedName, channelName) + if testCase.returnGenesisBlock { + assert.NotNil(t, gb) + } else { + assert.Nil(t, gb) + } + }) + } +} + +func TestChannels(t *testing.T) { + makeBlock := func(outerChannelName, innerChannelName string) *common.Block { + return &common.Block{ + Header: &common.BlockHeader{}, + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + ChannelId: outerChannelName, + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + ChannelId: innerChannelName, + }), + }, + }), + }), + }), + })}, + }, + } + } + + for _, testCase := range []struct { + name string + prepareSystemChain func(systemChain []*common.Block) + assertion func(t *testing.T, ci *cluster.ChainInspector) + }{ + { + name: "happy path - artificial blocks", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + actual := cluster.GenesisBlocks(ci.Channels()) + // Assert that the returned channels are returned in any order + assert.Contains(t, [][]string{{"mychannel", "mychannel2"}, {"mychannel2", "mychannel"}}, actual.Names()) + }, + }, + { + name: "happy path - one block is not artificial but real", + prepareSystemChain: func(systemChain []*common.Block) { + blockbytes, err := ioutil.ReadFile(filepath.Join("testdata", "block3.pb")) + assert.NoError(t, err) + block := &common.Block{} + err = proto.Unmarshal(blockbytes, block) + assert.NoError(t, err) + + systemChain[len(systemChain)/2-1] = block + assignHashes(systemChain) + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + actual := cluster.GenesisBlocks(ci.Channels()) + // Assert that the returned channels are returned in any order + assert.Contains(t, [][]string{{"mychannel2", "bar"}, {"bar", "mychannel2"}}, actual.Names()) + }, + }, + { + name: "bad path - pulled chain's last block hash doesn't match the last config block", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + systemChain[len(systemChain)-1].Header.PreviousHash = nil + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "System channel pulled doesn't match the boot last config block:" + + " block [2]'s hash (bc4ef5cc8a61ac0747cc82df58bac9ad3278622c1cfc7a119b9b1068e422c9f1)" + + " mismatches block [3]'s prev block hash ()" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + { + name: "bad path - hash chain mismatch", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + systemChain[len(systemChain)-2].Header.PreviousHash = nil + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "Claimed previous hash of block [2] is but actual previous " + + "hash is 920faeb0bd8a02b3f2553247359fb3b684819c75c6e5487bc7eed632841ddc5f" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + { + name: "bad path - a block cannot be classified", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + systemChain[len(systemChain)-2].Data.Data = [][]byte{{1, 2, 3}} + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "Failed extracting channel genesis block from config block: " + + "block data does not carry an envelope at index 0: error unmarshaling " + + "Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + { + name: "bad path - failed pulling blocks", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + // Setting a block to nil makes the block puller return nil, + // which signals failure of pulling a block. + systemChain[len(systemChain)/2] = nil + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "Failed pulling block [2] from the system channel" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + systemChain := []*common.Block{ + makeBlock("systemChannel", "systemChannel"), + makeBlock("systemChannel", "mychannel"), + makeBlock("systemChannel", "mychannel2"), + makeBlock("systemChannel", "systemChannel"), + } + + for i := 0; i < len(systemChain); i++ { + systemChain[i].Header.DataHash = protoutil.BlockDataHash(systemChain[i].Data) + systemChain[i].Header.Number = uint64(i) + } + testCase.prepareSystemChain(systemChain) + puller := &mocks.ChainPuller{} + puller.On("Close") + for seq := uint64(0); int(seq) < len(systemChain)-1; seq++ { + puller.On("PullBlock", seq).Return(systemChain[int(seq)]) + } + + ci := &cluster.ChainInspector{ + Logger: flogging.MustGetLogger("test"), + Puller: puller, + LastConfigBlock: systemChain[len(systemChain)-1], + } + defer puller.AssertNumberOfCalls(t, "Close", 1) + defer ci.Close() + testCase.assertion(t, ci) + }) + } +} + +var fakeGB = &common.Block{ + Header: &common.BlockHeader{}, + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, {}, {}, {}}, + }, + Data: &common.BlockData{ + Data: [][]byte{ + protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Config{ + Sequence: 1, + }), + }), + }), + }, + }, +} + +func simulateNonParticipantChannelPull(osn *deliverServer) { + lastBlock := protoutil.NewBlock(1, nil) + lastBlock.Metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 0}), + }) + // We first present a channel with a last block of 'lastBlock', that points to + // the genesis block + osn.addExpectProbeAssert() + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: lastBlock}, + } + osn.addExpectProbeAssert() + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: lastBlock}, + } + osn.addExpectPullAssert(1) + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: lastBlock}, + } + osn.blockResponses <- nil + + // and make it send back the genesis block. + // First send is for probing, + osn.addExpectProbeAssert() + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: fakeGB}, + } + osn.addExpectPullAssert(0) + // and the second one sends the actual block itself downstream + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: fakeGB}, + } + + osn.blockResponses <- nil +} + +func TestFilter(t *testing.T) { + logger := flogging.MustGetLogger("test") + logger = logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + assert.Equal(t, "Channel foo shouldn't be pulled. Skipping it", entry.Message) + return nil + })) + + r := &cluster.Replicator{ + Filter: func(_ string) bool { + return false + }, + Logger: logger, + } + assert.Equal(t, cluster.ErrSkipped, r.PullChannel("foo")) +} +``` + +## `orderer/common/cluster/util.go` (changed lines (321, 322, 323, 324, 325)) + +```go +/* +Copyright IBM Corp. 2017 All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package cluster + +import ( + "bytes" + "crypto/tls" + "crypto/x509" + "encoding/hex" + "encoding/json" + "encoding/pem" + "fmt" + "math/rand" + "sync" + "sync/atomic" + "time" + + "github.com/hyperledger/fabric-config/protolator" + "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric/bccsp" + "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/common/util" + "github.com/hyperledger/fabric/internal/pkg/comm" + "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" + "google.golang.org/grpc" +) + +// ConnByCertMap maps certificates represented as strings +// to gRPC connections +type ConnByCertMap map[string]*grpc.ClientConn + +// Lookup looks up a certificate and returns the connection that was mapped +// to the certificate, and whether it was found or not +func (cbc ConnByCertMap) Lookup(cert []byte) (*grpc.ClientConn, bool) { + conn, ok := cbc[string(cert)] + return conn, ok +} + +// Put associates the given connection to the certificate +func (cbc ConnByCertMap) Put(cert []byte, conn *grpc.ClientConn) { + cbc[string(cert)] = conn +} + +// Remove removes the connection that is associated to the given certificate +func (cbc ConnByCertMap) Remove(cert []byte) { + delete(cbc, string(cert)) +} + +// Size returns the size of the connections by certificate mapping +func (cbc ConnByCertMap) Size() int { + return len(cbc) +} + +// CertificateComparator returns whether some relation holds for two given certificates +type CertificateComparator func([]byte, []byte) bool + +// MemberMapping defines NetworkMembers by their ID +// and enables to lookup stubs by a certificate +type MemberMapping struct { + id2stub map[uint64]*Stub + SamePublicKey CertificateComparator +} + +// Foreach applies the given function on all stubs in the mapping +func (mp *MemberMapping) Foreach(f func(id uint64, stub *Stub)) { + for id, stub := range mp.id2stub { + f(id, stub) + } +} + +// Put inserts the given stub to the MemberMapping +func (mp *MemberMapping) Put(stub *Stub) { + mp.id2stub[stub.ID] = stub +} + +// Remove removes the stub with the given ID from the MemberMapping +func (mp *MemberMapping) Remove(ID uint64) { + delete(mp.id2stub, ID) +} + +// ByID retrieves the Stub with the given ID from the MemberMapping +func (mp MemberMapping) ByID(ID uint64) *Stub { + return mp.id2stub[ID] +} + +// LookupByClientCert retrieves a Stub with the given client certificate +func (mp MemberMapping) LookupByClientCert(cert []byte) *Stub { + for _, stub := range mp.id2stub { + if mp.SamePublicKey(stub.ClientTLSCert, cert) { + return stub + } + } + return nil +} + +// ServerCertificates returns a set of the server certificates +// represented as strings +func (mp MemberMapping) ServerCertificates() StringSet { + res := make(StringSet) + for _, member := range mp.id2stub { + res[string(member.ServerTLSCert)] = struct{}{} + } + return res +} + +// StringSet is a set of strings +type StringSet map[string]struct{} + +// union adds the elements of the given set to the StringSet +func (ss StringSet) union(set StringSet) { + for k := range set { + ss[k] = struct{}{} + } +} + +// subtract removes all elements in the given set from the StringSet +func (ss StringSet) subtract(set StringSet) { + for k := range set { + delete(ss, k) + } +} + +// PredicateDialer creates gRPC connections +// that are only established if the given predicate +// is fulfilled +type PredicateDialer struct { + lock sync.RWMutex + Config comm.ClientConfig +} + +func (dialer *PredicateDialer) UpdateRootCAs(serverRootCAs [][]byte) { + dialer.lock.Lock() + defer dialer.lock.Unlock() + dialer.Config.SecOpts.ServerRootCAs = serverRootCAs +} + +// Dial creates a new gRPC connection that can only be established, if the remote node's +// certificate chain satisfy verifyFunc +func (dialer *PredicateDialer) Dial(address string, verifyFunc RemoteVerifier) (*grpc.ClientConn, error) { + dialer.lock.RLock() + cfg := dialer.Config.Clone() + dialer.lock.RUnlock() + + cfg.SecOpts.VerifyCertificate = verifyFunc + client, err := comm.NewGRPCClient(cfg) + if err != nil { + return nil, errors.WithStack(err) + } + return client.NewConnection(address, func(tlsConfig *tls.Config) { + // We need to dynamically overwrite the TLS root CAs, + // as they may be updated. + dialer.lock.RLock() + serverRootCAs := dialer.Config.Clone().SecOpts.ServerRootCAs + dialer.lock.RUnlock() + + tlsConfig.RootCAs = x509.NewCertPool() + for _, pem := range serverRootCAs { + tlsConfig.RootCAs.AppendCertsFromPEM(pem) + } + }) +} + +// DERtoPEM returns a PEM representation of the DER +// encoded certificate +func DERtoPEM(der []byte) string { + return string(pem.EncodeToMemory(&pem.Block{ + Type: "CERTIFICATE", + Bytes: der, + })) +} + +// StandardDialer wraps an ClientConfig, and provides +// a means to connect according to given EndpointCriteria. +type StandardDialer struct { + Config comm.ClientConfig +} + +// Dial dials an address according to the given EndpointCriteria +func (dialer *StandardDialer) Dial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error) { + cfg := dialer.Config.Clone() + cfg.SecOpts.ServerRootCAs = endpointCriteria.TLSRootCAs + + client, err := comm.NewGRPCClient(cfg) + if err != nil { + return nil, errors.Wrap(err, "failed creating gRPC client") + } + + return client.NewConnection(endpointCriteria.Endpoint) +} + +//go:generate mockery -dir . -name BlockVerifier -case underscore -output ./mocks/ + +// BlockVerifier verifies block signatures. +type BlockVerifier interface { + // VerifyBlockSignature verifies a signature of a block. + // It has an optional argument of a configuration envelope + // which would make the block verification to use validation rules + // based on the given configuration in the ConfigEnvelope. + // If the config envelope passed is nil, then the validation rules used + // are the ones that were applied at commit of previous blocks. + VerifyBlockSignature(sd []*protoutil.SignedData, config *common.ConfigEnvelope) error +} + +// BlockSequenceVerifier verifies that the given consecutive sequence +// of blocks is valid. +type BlockSequenceVerifier func(blocks []*common.Block, channel string) error + +// Dialer creates a gRPC connection to a remote address +type Dialer interface { + Dial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error) +} + +// VerifyBlocks verifies the given consecutive sequence of blocks is valid, +// and returns nil if it's valid, else an error. +func VerifyBlocks(blockBuff []*common.Block, signatureVerifier BlockVerifier) error { + if len(blockBuff) == 0 { + return errors.New("buffer is empty") + } + // First, we verify that the block hash in every block is: + // Equal to the hash in the header + // Equal to the previous hash in the succeeding block + for i := range blockBuff { + if err := VerifyBlockHash(i, blockBuff); err != nil { + return err + } + } + + var config *common.ConfigEnvelope + var isLastBlockConfigBlock bool + // Verify all configuration blocks that are found inside the block batch, + // with the configuration that was committed (nil) or with one that is picked up + // during iteration over the block batch. + for _, block := range blockBuff { + configFromBlock, err := ConfigFromBlock(block) + if err == errNotAConfig { + isLastBlockConfigBlock = false + continue + } + if err != nil { + return err + } + // The block is a configuration block, so verify it + if err := VerifyBlockSignature(block, signatureVerifier, config); err != nil { + return err + } + config = configFromBlock + isLastBlockConfigBlock = true + } + + // Verify the last block's signature + lastBlock := blockBuff[len(blockBuff)-1] + + // If last block is a config block, we verified it using the policy of the previous block, so it's valid. + if isLastBlockConfigBlock { + return nil + } + + return VerifyBlockSignature(lastBlock, signatureVerifier, config) +} + +var errNotAConfig = errors.New("not a config block") + +// ConfigFromBlock returns a ConfigEnvelope if exists, or a *NotAConfigBlock error. +// It may also return some other error in case parsing failed. +func ConfigFromBlock(block *common.Block) (*common.ConfigEnvelope, error) { + if block == nil || block.Data == nil || len(block.Data.Data) == 0 { + return nil, errors.New("empty block") + } + txn := block.Data.Data[0] + env, err := protoutil.GetEnvelopeFromBlock(txn) + if err != nil { + return nil, errors.WithStack(err) + } + payload, err := protoutil.UnmarshalPayload(env.Payload) + if err != nil { + return nil, errors.WithStack(err) + } + if block.Header.Number == 0 { + configEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data) + if err != nil { + return nil, errors.Wrap(err, "invalid config envelope") + } + return configEnvelope, nil + } + if payload.Header == nil { + return nil, errors.New("nil header in payload") + } + chdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return nil, errors.WithStack(err) + } + if common.HeaderType(chdr.Type) != common.HeaderType_CONFIG { + return nil, errNotAConfig + } + configEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data) + if err != nil { + return nil, errors.Wrap(err, "invalid config envelope") + } + return configEnvelope, nil +} + +// VerifyBlockHash verifies the hash chain of the block with the given index +// among the blocks of the given block buffer. +func VerifyBlockHash(indexInBuffer int, blockBuff []*common.Block) error { + if len(blockBuff) <= indexInBuffer { + return errors.Errorf("index %d out of bounds (total %d blocks)", indexInBuffer, len(blockBuff)) + } + block := blockBuff[indexInBuffer] + if block.Header == nil { + return errors.New("missing block header") + } + seq := block.Header.Number + + if err := protoutil.VerifyTransactionsAreWellFormed(block); err != nil && block.Header.Number > 0 { + return fmt.Errorf("block has malformed transactions: %v", err) + } + + dataHash := protoutil.BlockDataHash(block.Data) + // Verify data hash matches the hash in the header + if !bytes.Equal(dataHash, block.Header.DataHash) { + computedHash := hex.EncodeToString(dataHash) + claimedHash := hex.EncodeToString(block.Header.DataHash) + return errors.Errorf("computed hash of block (%d) (%s) doesn't match claimed hash (%s)", + seq, computedHash, claimedHash) + } + // We have a previous block in the buffer, ensure current block's previous hash matches the previous one. + if indexInBuffer > 0 { + prevBlock := blockBuff[indexInBuffer-1] + currSeq := block.Header.Number + if prevBlock.Header == nil { + return errors.New("previous block header is nil") + } + prevSeq := prevBlock.Header.Number + if prevSeq+1 != currSeq { + return errors.Errorf("sequences %d and %d were received consecutively", prevSeq, currSeq) + } + if !bytes.Equal(block.Header.PreviousHash, protoutil.BlockHeaderHash(prevBlock.Header)) { + claimedPrevHash := hex.EncodeToString(block.Header.PreviousHash) + actualPrevHash := hex.EncodeToString(protoutil.BlockHeaderHash(prevBlock.Header)) + return errors.Errorf("block [%d]'s hash (%s) mismatches block [%d]'s prev block hash (%s)", + prevSeq, actualPrevHash, currSeq, claimedPrevHash) + } + } + return nil +} + +// SignatureSetFromBlock creates a signature set out of a block. +func SignatureSetFromBlock(block *common.Block) ([]*protoutil.SignedData, error) { + if block.Metadata == nil || len(block.Metadata.Metadata) <= int(common.BlockMetadataIndex_SIGNATURES) { + return nil, errors.New("no metadata in block") + } + metadata, err := protoutil.GetMetadataFromBlock(block, common.BlockMetadataIndex_SIGNATURES) + if err != nil { + return nil, errors.Errorf("failed unmarshaling medatata for signatures: %v", err) + } + + var signatureSet []*protoutil.SignedData + for _, metadataSignature := range metadata.Signatures { + sigHdr, err := protoutil.UnmarshalSignatureHeader(metadataSignature.SignatureHeader) + if err != nil { + return nil, errors.Errorf("failed unmarshaling signature header for block with id %d: %v", + block.Header.Number, err) + } + signatureSet = append(signatureSet, + &protoutil.SignedData{ + Identity: sigHdr.Creator, + Data: util.ConcatenateBytes(metadata.Value, + metadataSignature.SignatureHeader, protoutil.BlockHeaderBytes(block.Header)), + Signature: metadataSignature.Signature, + }, + ) + } + return signatureSet, nil +} + +// VerifyBlockSignature verifies the signature on the block with the given BlockVerifier and the given config. +func VerifyBlockSignature(block *common.Block, verifier BlockVerifier, config *common.ConfigEnvelope) error { + signatureSet, err := SignatureSetFromBlock(block) + if err != nil { + return err + } + return verifier.VerifyBlockSignature(signatureSet, config) +} + +// EndpointCriteria defines criteria of how to connect to a remote orderer node. +type EndpointCriteria struct { + Endpoint string // Endpoint of the form host:port + TLSRootCAs [][]byte // PEM encoded TLS root CA certificates +} + +// String returns a string representation of this EndpointCriteria +func (ep EndpointCriteria) String() string { + var formattedCAs []interface{} + for _, rawCAFile := range ep.TLSRootCAs { + var bl *pem.Block + pemContent := rawCAFile + for { + bl, pemContent = pem.Decode(pemContent) + if bl == nil { + break + } + cert, err := x509.ParseCertificate(bl.Bytes) + if err != nil { + break + } + + issuedBy := cert.Issuer.String() + if cert.Issuer.String() == cert.Subject.String() { + issuedBy = "self" + } + + info := make(map[string]interface{}) + info["Expired"] = time.Now().After(cert.NotAfter) + info["Subject"] = cert.Subject.String() + info["Issuer"] = issuedBy + formattedCAs = append(formattedCAs, info) + } + } + + formattedEndpointCriteria := make(map[string]interface{}) + formattedEndpointCriteria["Endpoint"] = ep.Endpoint + formattedEndpointCriteria["CAs"] = formattedCAs + + rawJSON, err := json.Marshal(formattedEndpointCriteria) + if err != nil { + return fmt.Sprintf("{\"Endpoint\": \"%s\"}", ep.Endpoint) + } + + return string(rawJSON) +} + +// EndpointconfigFromConfigBlock retrieves TLS CA certificates and endpoints +// from a config block. +func EndpointconfigFromConfigBlock(block *common.Block, bccsp bccsp.BCCSP) ([]EndpointCriteria, error) { + if block == nil { + return nil, errors.New("nil block") + } + envelopeConfig, err := protoutil.ExtractEnvelope(block, 0) + if err != nil { + return nil, err + } + + bundle, err := channelconfig.NewBundleFromEnvelope(envelopeConfig, bccsp) + if err != nil { + return nil, errors.Wrap(err, "failed extracting bundle from envelope") + } + msps, err := bundle.MSPManager().GetMSPs() + if err != nil { + return nil, errors.Wrap(err, "failed obtaining MSPs from MSPManager") + } + ordererConfig, ok := bundle.OrdererConfig() + if !ok { + return nil, errors.New("failed obtaining orderer config from bundle") + } + + mspIDsToCACerts := make(map[string][][]byte) + var aggregatedTLSCerts [][]byte + for _, org := range ordererConfig.Organizations() { + // Validate that every orderer org has a corresponding MSP instance in the MSP Manager. + msp, exists := msps[org.MSPID()] + if !exists { + return nil, errors.Errorf("no MSP found for MSP with ID of %s", org.MSPID()) + } + + // Build a per org mapping of the TLS CA certs for this org, + // and aggregate all TLS CA certs into aggregatedTLSCerts to be used later on. + var caCerts [][]byte + caCerts = append(caCerts, msp.GetTLSIntermediateCerts()...) + caCerts = append(caCerts, msp.GetTLSRootCerts()...) + mspIDsToCACerts[org.MSPID()] = caCerts + aggregatedTLSCerts = append(aggregatedTLSCerts, caCerts...) + } + + endpointsPerOrg := perOrgEndpoints(ordererConfig, mspIDsToCACerts) + if len(endpointsPerOrg) > 0 { + return endpointsPerOrg, nil + } + + return globalEndpointsFromConfig(aggregatedTLSCerts, bundle), nil +} + +func perOrgEndpoints(ordererConfig channelconfig.Orderer, mspIDsToCerts map[string][][]byte) []EndpointCriteria { + var endpointsPerOrg []EndpointCriteria + + for _, org := range ordererConfig.Organizations() { + for _, endpoint := range org.Endpoints() { + endpointsPerOrg = append(endpointsPerOrg, EndpointCriteria{ + TLSRootCAs: mspIDsToCerts[org.MSPID()], + Endpoint: endpoint, + }) + } + } + + return endpointsPerOrg +} + +func globalEndpointsFromConfig(aggregatedTLSCerts [][]byte, bundle *channelconfig.Bundle) []EndpointCriteria { + var globalEndpoints []EndpointCriteria + for _, endpoint := range bundle.ChannelConfig().OrdererAddresses() { + globalEndpoints = append(globalEndpoints, EndpointCriteria{ + Endpoint: endpoint, + TLSRootCAs: aggregatedTLSCerts, + }) + } + return globalEndpoints +} + +//go:generate mockery -dir . -name VerifierFactory -case underscore -output ./mocks/ + +// VerifierFactory creates BlockVerifiers. +type VerifierFactory interface { + // VerifierFromConfig creates a BlockVerifier from the given configuration. + VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error) +} + +// VerificationRegistry registers verifiers and retrieves them. +type VerificationRegistry struct { + LoadVerifier func(chain string) BlockVerifier + Logger *flogging.FabricLogger + VerifierFactory VerifierFactory + VerifiersByChannel map[string]BlockVerifier +} + +// RegisterVerifier adds a verifier into the registry if applicable. +func (vr *VerificationRegistry) RegisterVerifier(chain string) { + if _, exists := vr.VerifiersByChannel[chain]; exists { + vr.Logger.Debugf("No need to register verifier for chain %s", chain) + return + } + + v := vr.LoadVerifier(chain) + if v == nil { + vr.Logger.Errorf("Failed loading verifier for chain %s", chain) + return + } + + vr.VerifiersByChannel[chain] = v + vr.Logger.Infof("Registered verifier for chain %s", chain) +} + +// RetrieveVerifier returns a BlockVerifier for the given channel, or nil if not found. +func (vr *VerificationRegistry) RetrieveVerifier(channel string) BlockVerifier { + verifier, exists := vr.VerifiersByChannel[channel] + if exists { + return verifier + } + vr.Logger.Errorf("No verifier for channel %s exists", channel) + return nil +} + +// BlockCommitted notifies the VerificationRegistry upon a block commit, which may +// trigger a registration of a verifier out of the block in case the block is a config block. +func (vr *VerificationRegistry) BlockCommitted(block *common.Block, channel string) { + conf, err := ConfigFromBlock(block) + // The block doesn't contain a config block, but is a valid block + if err == errNotAConfig { + vr.Logger.Debugf("Committed block [%d] for channel %s that is not a config block", + block.Header.Number, channel) + return + } + // The block isn't a valid block + if err != nil { + vr.Logger.Errorf("Failed parsing block of channel %s: %v, content: %s", + channel, err, BlockToString(block)) + return + } + + // The block contains a config block + verifier, err := vr.VerifierFactory.VerifierFromConfig(conf, channel) + if err != nil { + vr.Logger.Errorf("Failed creating a verifier from a config block for channel %s: %v, content: %s", + channel, err, BlockToString(block)) + return + } + + vr.VerifiersByChannel[channel] = verifier + + vr.Logger.Debugf("Committed config block [%d] for channel %s", block.Header.Number, channel) +} + +// BlockToString returns a string representation of this block. +func BlockToString(block *common.Block) string { + buff := &bytes.Buffer{} + protolator.DeepMarshalJSON(buff, block) + return buff.String() +} + +// BlockCommitFunc signals a block commit. +type BlockCommitFunc func(block *common.Block, channel string) + +// LedgerInterceptor intercepts block commits. +type LedgerInterceptor struct { + Channel string + InterceptBlockCommit BlockCommitFunc + LedgerWriter +} + +// Append commits a block into the ledger, and also fires the configured callback. +func (interceptor *LedgerInterceptor) Append(block *common.Block) error { + defer interceptor.InterceptBlockCommit(block, interceptor.Channel) + return interceptor.LedgerWriter.Append(block) +} + +// BlockVerifierAssembler creates a BlockVerifier out of a config envelope +type BlockVerifierAssembler struct { + Logger *flogging.FabricLogger + BCCSP bccsp.BCCSP +} + +// VerifierFromConfig creates a BlockVerifier from the given configuration. +func (bva *BlockVerifierAssembler) VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error) { + bundle, err := channelconfig.NewBundle(channel, configuration.Config, bva.BCCSP) + if err != nil { + return nil, errors.Wrap(err, "failed extracting bundle from envelope") + } + policyMgr := bundle.PolicyManager() + + return &BlockValidationPolicyVerifier{ + Logger: bva.Logger, + PolicyMgr: policyMgr, + Channel: channel, + BCCSP: bva.BCCSP, + }, nil +} + +// BlockValidationPolicyVerifier verifies signatures based on the block validation policy. +type BlockValidationPolicyVerifier struct { + Logger *flogging.FabricLogger + Channel string + PolicyMgr policies.Manager + BCCSP bccsp.BCCSP +} + +// VerifyBlockSignature verifies the signed data associated to a block, optionally with the given config envelope. +func (bv *BlockValidationPolicyVerifier) VerifyBlockSignature(sd []*protoutil.SignedData, envelope *common.ConfigEnvelope) error { + policyMgr := bv.PolicyMgr + // If the envelope passed isn't nil, we should use a different policy manager. + if envelope != nil { + bundle, err := channelconfig.NewBundle(bv.Channel, envelope.Config, bv.BCCSP) + if err != nil { + buff := &bytes.Buffer{} + protolator.DeepMarshalJSON(buff, envelope.Config) + bv.Logger.Errorf("Failed creating a new bundle for channel %s, Config content is: %s", bv.Channel, buff.String()) + return err + } + bv.Logger.Infof("Initializing new PolicyManager for channel %s", bv.Channel) + policyMgr = bundle.PolicyManager() + } + policy, exists := policyMgr.GetPolicy(policies.BlockValidation) + if !exists { + return errors.Errorf("policy %s wasn't found", policies.BlockValidation) + } + return policy.EvaluateSignedData(sd) +} + +//go:generate mockery -dir . -name BlockRetriever -case underscore -output ./mocks/ + +// BlockRetriever retrieves blocks +type BlockRetriever interface { + // Block returns a block with the given number, + // or nil if such a block doesn't exist. + Block(number uint64) *common.Block +} + +// LastConfigBlock returns the last config block relative to the given block. +func LastConfigBlock(block *common.Block, blockRetriever BlockRetriever) (*common.Block, error) { + if block == nil { + return nil, errors.New("nil block") + } + if blockRetriever == nil { + return nil, errors.New("nil blockRetriever") + } + lastConfigBlockNum, err := protoutil.GetLastConfigIndexFromBlock(block) + if err != nil { + return nil, err + } + lastConfigBlock := blockRetriever.Block(lastConfigBlockNum) + if lastConfigBlock == nil { + return nil, errors.Errorf("unable to retrieve last config block [%d]", lastConfigBlockNum) + } + return lastConfigBlock, nil +} + +// StreamCountReporter reports the number of streams currently connected to this node +type StreamCountReporter struct { + Metrics *Metrics + count uint32 +} + +func (scr *StreamCountReporter) Increment() { + count := atomic.AddUint32(&scr.count, 1) + scr.Metrics.reportStreamCount(count) +} + +func (scr *StreamCountReporter) Decrement() { + count := atomic.AddUint32(&scr.count, ^uint32(0)) + scr.Metrics.reportStreamCount(count) +} + +type certificateExpirationCheck struct { + minimumExpirationWarningInterval time.Duration + expiresAt time.Time + expirationWarningThreshold time.Duration + lastWarning time.Time + nodeName string + endpoint string + alert func(string, ...interface{}) +} + +func (exp *certificateExpirationCheck) checkExpiration(currentTime time.Time, channel string) { + timeLeft := exp.expiresAt.Sub(currentTime) + if timeLeft > exp.expirationWarningThreshold { + return + } + + timeSinceLastWarning := currentTime.Sub(exp.lastWarning) + if timeSinceLastWarning < exp.minimumExpirationWarningInterval { + return + } + + exp.alert("Certificate of %s from %s for channel %s expires in less than %v", + exp.nodeName, exp.endpoint, channel, timeLeft) + exp.lastWarning = currentTime +} + +// CachePublicKeyComparisons creates CertificateComparator that caches invocations based on input arguments. +// The given CertificateComparator must be a stateless function. +func CachePublicKeyComparisons(f CertificateComparator) CertificateComparator { + m := &ComparisonMemoizer{ + MaxEntries: 4096, + F: f, + } + return m.Compare +} + +// ComparisonMemoizer speeds up comparison computations by caching past invocations of a stateless function +type ComparisonMemoizer struct { + // Configuration + F func(a, b []byte) bool + MaxEntries uint16 + // Internal state + cache map[arguments]bool + lock sync.RWMutex + once sync.Once + rand *rand.Rand +} + +type arguments struct { + a, b string +} + +// Size returns the number of computations the ComparisonMemoizer currently caches. +func (cm *ComparisonMemoizer) Size() int { + cm.lock.RLock() + defer cm.lock.RUnlock() + return len(cm.cache) +} + +// Compare compares the given two byte slices. +// It may return previous computations for the given two arguments, +// otherwise it will compute the function F and cache the result. +func (cm *ComparisonMemoizer) Compare(a, b []byte) bool { + cm.once.Do(cm.setup) + key := arguments{ + a: string(a), + b: string(b), + } + + cm.lock.RLock() + result, exists := cm.cache[key] + cm.lock.RUnlock() + + if exists { + return result + } + + result = cm.F(a, b) + + cm.lock.Lock() + defer cm.lock.Unlock() + + cm.shrinkIfNeeded() + cm.cache[key] = result + + return result +} + +func (cm *ComparisonMemoizer) shrinkIfNeeded() { + for { + currentSize := uint16(len(cm.cache)) + if currentSize < cm.MaxEntries { + return + } + cm.shrink() + } +} + +func (cm *ComparisonMemoizer) shrink() { + // Shrink the cache by 25% by removing every fourth element (on average) + for key := range cm.cache { + if cm.rand.Int()%4 != 0 { + continue + } + delete(cm.cache, key) + } +} + +func (cm *ComparisonMemoizer) setup() { + cm.lock.Lock() + defer cm.lock.Unlock() + cm.rand = rand.New(rand.NewSource(time.Now().UnixNano())) + cm.cache = make(map[arguments]bool) +} +``` + +## `orderer/common/cluster/util_test.go` (changed lines (292, 302, 376, 401, 553, 562, 564, 709, 710, 735, 736, 752, 753)) + +```go +/* +Copyright IBM Corp. 2017 All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package cluster_test + +import ( + "bytes" + "crypto/x509" + "encoding/pem" + "errors" + "fmt" + "io/ioutil" + "strings" + "sync" + "testing" + "time" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric/bccsp/sw" + "github.com/hyperledger/fabric/common/capabilities" + "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/common/configtx/test" + "github.com/hyperledger/fabric/common/crypto/tlsgen" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/core/config/configtest" + "github.com/hyperledger/fabric/internal/configtxgen/encoder" + "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" + "github.com/hyperledger/fabric/internal/pkg/comm" + "github.com/hyperledger/fabric/orderer/common/cluster" + "github.com/hyperledger/fabric/orderer/common/cluster/mocks" + "github.com/hyperledger/fabric/protoutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +//go:generate counterfeiter -o mocks/policy.go --fake-name Policy . policy + +type policy interface { + policies.Policy +} + +//go:generate counterfeiter -o mocks/policy_manager.go --fake-name PolicyManager . policyManager + +type policyManager interface { + policies.Manager +} + +func TestParallelStubActivation(t *testing.T) { + // Scenario: Activate the stub from different goroutines in parallel. + stub := &cluster.Stub{} + var wg sync.WaitGroup + n := 100 + wg.Add(n) + instance := &cluster.RemoteContext{} + var activationCount int + maybeCreateInstance := func() (*cluster.RemoteContext, error) { + activationCount++ + return instance, nil + } + + for i := 0; i < n; i++ { + go func() { + defer wg.Done() + stub.Activate(maybeCreateInstance) + }() + } + wg.Wait() + activatedStub := stub.RemoteContext + // Ensure the instance is the reference we stored + // and not any other reference, i.e - it wasn't + // copied by value. + assert.True(t, activatedStub == instance) + // Ensure the method was invoked only once. + assert.Equal(t, activationCount, 1) +} + +func TestDialerCustomKeepAliveOptions(t *testing.T) { + ca, err := tlsgen.NewCA() + assert.NoError(t, err) + + clientKeyPair, err := ca.NewClientCertKeyPair() + assert.NoError(t, err) + clientConfig := comm.ClientConfig{ + KaOpts: comm.KeepaliveOptions{ + ClientTimeout: time.Second * 12345, + }, + Timeout: time.Millisecond * 100, + SecOpts: comm.SecureOptions{ + RequireClientCert: true, + Key: clientKeyPair.Key, + Certificate: clientKeyPair.Cert, + ServerRootCAs: [][]byte{ca.CertBytes()}, + UseTLS: true, + ClientRootCAs: [][]byte{ca.CertBytes()}, + }, + } + + dialer := &cluster.PredicateDialer{Config: clientConfig} + timeout := dialer.Config.KaOpts.ClientTimeout + assert.Equal(t, time.Second*12345, timeout) +} + +func TestPredicateDialerUpdateRootCAs(t *testing.T) { + node1 := newTestNode(t) + defer node1.stop() + + anotherTLSCA, err := tlsgen.NewCA() + assert.NoError(t, err) + + dialer := &cluster.PredicateDialer{ + Config: node1.clientConfig.Clone(), + } + dialer.Config.SecOpts.ServerRootCAs = [][]byte{anotherTLSCA.CertBytes()} + dialer.Config.Timeout = time.Second + dialer.Config.AsyncConnect = false + + _, err = dialer.Dial(node1.srv.Address(), nil) + assert.Error(t, err) + + // Update root TLS CAs asynchronously to make sure we don't have a data race. + go func() { + dialer.UpdateRootCAs(node1.clientConfig.SecOpts.ServerRootCAs) + }() + + // Eventually we should succeed connecting. + for i := 0; i < 10; i++ { + conn, err := dialer.Dial(node1.srv.Address(), nil) + if err == nil { + conn.Close() + return + } + } + + assert.Fail(t, "could not connect after 10 attempts despite changing TLS CAs") +} + +func TestDialerBadConfig(t *testing.T) { + emptyCertificate := []byte("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----") + dialer := &cluster.PredicateDialer{ + Config: comm.ClientConfig{ + SecOpts: comm.SecureOptions{ + UseTLS: true, + ServerRootCAs: [][]byte{emptyCertificate}, + }, + }, + } + _, err := dialer.Dial("127.0.0.1:8080", func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { + return nil + }) + assert.EqualError(t, err, "error adding root certificate: x509: malformed certificate") +} + +func TestDERtoPEM(t *testing.T) { + ca, err := tlsgen.NewCA() + assert.NoError(t, err) + keyPair, err := ca.NewServerCertKeyPair("localhost") + assert.NoError(t, err) + assert.Equal(t, cluster.DERtoPEM(keyPair.TLSCert.Raw), string(keyPair.Cert)) +} + +func TestStandardDialer(t *testing.T) { + emptyCertificate := []byte("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----") + certPool := [][]byte{emptyCertificate} + config := comm.ClientConfig{SecOpts: comm.SecureOptions{UseTLS: true, ServerRootCAs: certPool}} + standardDialer := &cluster.StandardDialer{ + Config: config, + } + _, err := standardDialer.Dial(cluster.EndpointCriteria{Endpoint: "127.0.0.1:8080", TLSRootCAs: certPool}) + assert.EqualError(t, + err, + "failed creating gRPC client: error adding root certificate: x509: malformed certificate", + ) +} + +func TestVerifyBlockSignature(t *testing.T) { + verifier := &mocks.BlockVerifier{} + var nilConfigEnvelope *common.ConfigEnvelope + verifier.On("VerifyBlockSignature", mock.Anything, nilConfigEnvelope).Return(nil) + + block := createBlockChain(3, 3)[0] + + // The block should have a valid structure + err := cluster.VerifyBlockSignature(block, verifier, nil) + assert.NoError(t, err) + + for _, testCase := range []struct { + name string + mutateBlock func(*common.Block) *common.Block + errorContains string + }{ + { + name: "nil metadata", + errorContains: "no metadata in block", + mutateBlock: func(block *common.Block) *common.Block { + block.Metadata = nil + return block + }, + }, + { + name: "zero metadata slice", + errorContains: "no metadata in block", + mutateBlock: func(block *common.Block) *common.Block { + block.Metadata.Metadata = nil + return block + }, + }, + { + name: "nil metadata", + errorContains: "failed unmarshaling medatata for signatures", + mutateBlock: func(block *common.Block) *common.Block { + block.Metadata.Metadata[0] = []byte{1, 2, 3} + return block + }, + }, + { + name: "bad signature header", + errorContains: "failed unmarshaling signature header", + mutateBlock: func(block *common.Block) *common.Block { + metadata := protoutil.GetMetadataFromBlockOrPanic(block, common.BlockMetadataIndex_SIGNATURES) + metadata.Signatures[0].SignatureHeader = []byte{1, 2, 3} + block.Metadata.Metadata[common.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(metadata) + return block + }, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + // Create a copy of the block + blockCopy := &common.Block{} + err := proto.Unmarshal(protoutil.MarshalOrPanic(block), blockCopy) + assert.NoError(t, err) + // Mutate the block to sabotage it + blockCopy = testCase.mutateBlock(blockCopy) + err = cluster.VerifyBlockSignature(blockCopy, verifier, nil) + assert.Contains(t, err.Error(), testCase.errorContains) + }) + } +} + +func TestVerifyBlockHash(t *testing.T) { + var start uint64 = 3 + var end uint64 = 23 + + verify := func(blockchain []*common.Block) error { + for i := 0; i < len(blockchain); i++ { + err := cluster.VerifyBlockHash(i, blockchain) + if err != nil { + return err + } + } + return nil + } + + // Verify that createBlockChain() creates a valid blockchain + assert.NoError(t, verify(createBlockChain(start, end))) + + twoBlocks := createBlockChain(2, 3) + twoBlocks[0].Header = nil + assert.EqualError(t, cluster.VerifyBlockHash(1, twoBlocks), "previous block header is nil") + + // Index out of bounds + blockchain := createBlockChain(start, end) + err := cluster.VerifyBlockHash(100, blockchain) + assert.EqualError(t, err, "index 100 out of bounds (total 21 blocks)") + + for _, testCase := range []struct { + name string + mutateBlockSequence func([]*common.Block) []*common.Block + errorContains string + }{ + { + name: "non consecutive sequences", + errorContains: "sequences 12 and 666 were received consecutively", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.Number = 666 + assignHashes(blockSequence) + return blockSequence + }, + }, + { + name: "data hash mismatch", + errorContains: "computed hash of block (13) (6de668ac99645e179a4921b477d50df9295fa56cd44f8e5c94756b60ce32ce1c)" + + " doesn't match claimed hash (07)", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.DataHash = []byte{7} + return blockSequence + }, + }, + { + name: "prev hash mismatch", + errorContains: "block [12]'s hash " + + "(72cc7ddf4d8465da95115c0a906416d23d8c74bfcb731a5ab057c213d8db62e1) " + + "mismatches block [13]'s prev block hash (07)", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.PreviousHash = []byte{7} + return blockSequence + }, + }, + { + name: "nil block header", + errorContains: "missing block header", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[0].Header = nil + return blockSequence + }, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + blockchain := createBlockChain(start, end) + blockchain = testCase.mutateBlockSequence(blockchain) + err := verify(blockchain) + assert.EqualError(t, err, testCase.errorContains) + }) + } +} + +func TestVerifyBlocks(t *testing.T) { + var sigSet1 []*protoutil.SignedData + var sigSet2 []*protoutil.SignedData + + configEnvelope1 := &common.ConfigEnvelope{ + Config: &common.Config{ + Sequence: 1, + }, + } + configEnvelope2 := &common.ConfigEnvelope{ + Config: &common.Config{ + Sequence: 2, + }, + } + configTransaction := func(envelope *common.ConfigEnvelope) *common.Envelope { + return &common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: protoutil.MarshalOrPanic(envelope), + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + }), + }, + }), + } + } + + for _, testCase := range []struct { + name string + configureVerifier func(*mocks.BlockVerifier) + mutateBlockSequence func([]*common.Block) []*common.Block + expectedError string + verifierExpectedCalls int + }{ + { + name: "empty sequence", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + return nil + }, + expectedError: "buffer is empty", + }, + { + name: "prev hash mismatch", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.PreviousHash = []byte{7} + return blockSequence + }, + expectedError: "block [74]'s hash " + + "(6daec1924ac6db2b23e3f49c190115dfc096603bcd0ec916baf111c68633c969) " + + "mismatches block [75]'s prev block hash (07)", + }, + { + name: "bad signature", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + verifier.On("VerifyBlockSignature", mock.Anything, nilEnvelope).Return(errors.New("bad signature")) + }, + expectedError: "bad signature", + verifierExpectedCalls: 1, + }, + { + name: "block that its type cannot be classified", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{})}, + } + blockSequence[len(blockSequence)/2].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/2].Data) + assignHashes(blockSequence) + return blockSequence + }, + expectedError: "block has malformed transactions: transaction 0 has no payload", + }, + { + name: "config blocks in the sequence need to be verified and one of them is improperly signed", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + var err error + // Put a config transaction in block n / 4 + blockSequence[len(blockSequence)/4].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope1))}, + } + blockSequence[len(blockSequence)/4].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/4].Data) + + // Put a config transaction in block n / 2 + blockSequence[len(blockSequence)/2].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope2))}, + } + blockSequence[len(blockSequence)/2].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/2].Data) + + assignHashes(blockSequence) + + sigSet1, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)/4]) + assert.NoError(t, err) + sigSet2, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)/2]) + assert.NoError(t, err) + + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + // The first config block, validates correctly. + verifier.On("VerifyBlockSignature", sigSet1, nilEnvelope).Return(nil).Once() + // However, the second config block - validates incorrectly. + confEnv1 := &common.ConfigEnvelope{} + proto.Unmarshal(protoutil.MarshalOrPanic(configEnvelope1), confEnv1) + verifier.On("VerifyBlockSignature", sigSet2, confEnv1).Return(errors.New("bad signature")).Once() + }, + expectedError: "bad signature", + verifierExpectedCalls: 2, + }, + { + name: "config block in the sequence needs to be verified, and it is properly signed", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + var err error + // Put a config transaction in block n / 4 + blockSequence[len(blockSequence)/4].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope1))}, + } + blockSequence[len(blockSequence)/4].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/4].Data) + + assignHashes(blockSequence) + + sigSet1, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)/4]) + assert.NoError(t, err) + + sigSet2, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)-1]) + assert.NoError(t, err) + + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + confEnv1 := &common.ConfigEnvelope{} + proto.Unmarshal(protoutil.MarshalOrPanic(configEnvelope1), confEnv1) + verifier.On("VerifyBlockSignature", sigSet1, nilEnvelope).Return(nil).Once() + verifier.On("VerifyBlockSignature", sigSet2, confEnv1).Return(nil).Once() + }, + // We have a single config block in the 'middle' of the chain, so we have 2 verifications total: + // The last block, and the config block. + verifierExpectedCalls: 2, + }, + { + name: "last two blocks are config blocks, last block only verified once", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + var err error + // Put a config transaction in block n-2 and in n-1 + blockSequence[len(blockSequence)-2].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope1))}, + } + blockSequence[len(blockSequence)-2].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)-2].Data) + + blockSequence[len(blockSequence)-1].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope2))}, + } + blockSequence[len(blockSequence)-1].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)-1].Data) + + assignHashes(blockSequence) + + sigSet1, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)-2]) + assert.NoError(t, err) + + sigSet2, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)-1]) + assert.NoError(t, err) + + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + confEnv1 := &common.ConfigEnvelope{} + proto.Unmarshal(protoutil.MarshalOrPanic(configEnvelope1), confEnv1) + verifier.On("VerifyBlockSignature", sigSet1, nilEnvelope).Return(nil).Once() + // We ensure that the signature set of the last block is verified using the config envelope of the block + // before it. + verifier.On("VerifyBlockSignature", sigSet2, confEnv1).Return(nil).Once() + // Note that we do not record a call to verify the last block, with the config envelope extracted from the block itself. + }, + // We have 2 config blocks, yet we only verify twice- the first config block, and the next config block, but no more, + // since the last block is a config block. + verifierExpectedCalls: 2, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + blockchain := createBlockChain(50, 100) + blockchain = testCase.mutateBlockSequence(blockchain) + verifier := &mocks.BlockVerifier{} + if testCase.configureVerifier != nil { + testCase.configureVerifier(verifier) + } + err := cluster.VerifyBlocks(blockchain, verifier) + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + } else { + assert.NoError(t, err) + } + }) + } +} + +func assignHashes(blockchain []*common.Block) { + for i := 1; i < len(blockchain); i++ { + blockchain[i].Header.PreviousHash = protoutil.BlockHeaderHash(blockchain[i-1].Header) + } +} + +func createBlockChain(start, end uint64) []*common.Block { + newBlock := func(seq uint64) *common.Block { + sHdr := &common.SignatureHeader{ + Creator: []byte{1, 2, 3}, + Nonce: []byte{9, 5, 42, 66}, + } + block := protoutil.NewBlock(seq, nil) + blockSignature := &common.MetadataSignature{ + SignatureHeader: protoutil.MarshalOrPanic(sHdr), + } + block.Metadata.Metadata[common.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: nil, + Signatures: []*common.MetadataSignature{ + blockSignature, + }, + }) + + txn := protoutil.MarshalOrPanic(&common.Envelope{ + Signature: []byte{1, 2, 3}, + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{}, + }), + }) + block.Data.Data = append(block.Data.Data, txn) + return block + } + var blockchain []*common.Block + for seq := start; seq <= end; seq++ { + block := newBlock(seq) + block.Header.DataHash = protoutil.BlockDataHash(block.Data) + blockchain = append(blockchain, block) + } + assignHashes(blockchain) + return blockchain +} + +func TestEndpointconfigFromConfigBlockGreenPath(t *testing.T) { + t.Run("global endpoints", func(t *testing.T) { + block, err := test.MakeGenesisBlock("mychannel") + assert.NoError(t, err) + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + // For a block that doesn't have per org endpoints, + // we take the global endpoints + injectGlobalOrdererEndpoint(t, block, "globalEndpoint") + endpointConfig, err := cluster.EndpointconfigFromConfigBlock(block, cryptoProvider) + assert.NoError(t, err) + assert.Len(t, endpointConfig, 1) + assert.Equal(t, "globalEndpoint", endpointConfig[0].Endpoint) + + bl, _ := pem.Decode(endpointConfig[0].TLSRootCAs[0]) + cert, err := x509.ParseCertificate(bl.Bytes) + assert.NoError(t, err) + + assert.True(t, cert.IsCA) + }) + + t.Run("per org endpoints", func(t *testing.T) { + block, err := test.MakeGenesisBlock("mychannel") + assert.NoError(t, err) + + // Make a second config. + gConf := genesisconfig.Load(genesisconfig.SampleSingleMSPSoloProfile, configtest.GetDevConfigDir()) + gConf.Orderer.Capabilities = map[string]bool{ + capabilities.OrdererV2_0: true, + } + channelGroup, err := encoder.NewChannelGroup(gConf) + assert.NoError(t, err) + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + bundle, err := channelconfig.NewBundle("mychannel", &common.Config{ChannelGroup: channelGroup}, cryptoProvider) + assert.NoError(t, err) + + msps, err := bundle.MSPManager().GetMSPs() + assert.NoError(t, err) + caBytes := msps["SampleOrg"].GetTLSRootCerts()[0] + + assert.NoError(t, err) + injectAdditionalTLSCAEndpointPair(t, block, "anotherEndpoint", caBytes, "fooOrg") + endpointConfig, err := cluster.EndpointconfigFromConfigBlock(block, cryptoProvider) + assert.NoError(t, err) + // And ensure that the endpoints that are taken, are the per org ones. + assert.Len(t, endpointConfig, 2) + for _, endpoint := range endpointConfig { + // If this is the original organization (and not the clone), + // the TLS CA is 'caBytes' read from the second block. + if endpoint.Endpoint == "anotherEndpoint" { + assert.Len(t, endpoint.TLSRootCAs, 1) + assert.Equal(t, caBytes, endpoint.TLSRootCAs[0]) + continue + } + // Else, our endpoints are from the original org, and the TLS CA is something else. + assert.NotEqual(t, caBytes, endpoint.TLSRootCAs[0]) + // The endpoints we expect to see are something else. + assert.Equal(t, 0, strings.Index(endpoint.Endpoint, "127.0.0.1:")) + bl, _ := pem.Decode(endpoint.TLSRootCAs[0]) + cert, err := x509.ParseCertificate(bl.Bytes) + assert.NoError(t, err) + assert.True(t, cert.IsCA) + } + }) +} + +func TestEndpointconfigFromConfigBlockFailures(t *testing.T) { + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + t.Run("nil block", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(nil, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "nil block") + }) + + t.Run("nil block data", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(&common.Block{}, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "block data is nil") + }) + + t.Run("no envelope", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(&common.Block{ + Data: &common.BlockData{}, + }, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "envelope index out of bounds") + }) + + t.Run("bad envelope", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(&common.Block{ + Data: &common.BlockData{ + Data: [][]byte{{}}, + }, + }, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "failed extracting bundle from envelope: envelope header cannot be nil") + }) +} + +func TestConfigFromBlockBadInput(t *testing.T) { + for _, testCase := range []struct { + name string + block *common.Block + expectedError string + }{ + { + name: "nil block", + expectedError: "empty block", + block: nil, + }, + { + name: "nil block data", + expectedError: "empty block", + block: &common.Block{}, + }, + { + name: "no data in block", + expectedError: "empty block", + block: &common.Block{Data: &common.BlockData{}}, + }, + { + name: "invalid payload", + expectedError: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{Data: &common.BlockData{Data: [][]byte{{1, 2, 3}}}}, + }, + { + name: "bad genesis block", + expectedError: "invalid config envelope: proto: common.ConfigEnvelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Header: &common.BlockHeader{}, Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: []byte{1, 2, 3}, + }), + })}}, + }, + }, + { + name: "invalid envelope in block", + expectedError: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{Data: &common.BlockData{Data: [][]byte{{1, 2, 3}}}}, + }, + { + name: "invalid payload in block envelope", + expectedError: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + })}}}, + }, + { + name: "invalid channel header", + expectedError: "error unmarshaling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + block: &common.Block{ + Header: &common.BlockHeader{Number: 1}, + Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: []byte{1, 2, 3}, + }, + }), + })}}, + }, + }, + { + name: "invalid config block", + expectedError: "invalid config envelope: proto: common.ConfigEnvelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Header: &common.BlockHeader{}, + Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: []byte{1, 2, 3}, + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + }), + }, + }), + })}}, + }, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + conf, err := cluster.ConfigFromBlock(testCase.block) + assert.Nil(t, conf) + assert.EqualError(t, err, testCase.expectedError) + }) + } +} + +func TestBlockValidationPolicyVerifier(t *testing.T) { + config := genesisconfig.Load(genesisconfig.SampleInsecureSoloProfile, configtest.GetDevConfigDir()) + group, err := encoder.NewChannelGroup(config) + assert.NoError(t, err) + assert.NotNil(t, group) + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + validConfigEnvelope := &common.ConfigEnvelope{ + Config: &common.Config{ + ChannelGroup: group, + }, + } + + for _, testCase := range []struct { + description string + expectedError string + envelope *common.ConfigEnvelope + policyMap map[string]policies.Policy + policy policies.Policy + }{ + /** + { + description: "policy not found", + expectedError: "policy /Channel/Orderer/BlockValidation wasn't found", + }, + */ + { + description: "policy evaluation fails", + expectedError: "invalid signature", + policy: &mocks.Policy{ + EvaluateSignedDataStub: func([]*protoutil.SignedData) error { + return errors.New("invalid signature") + }, + }, + }, + { + description: "bad config envelope", + expectedError: "config must contain a channel group", + policy: &mocks.Policy{}, + envelope: &common.ConfigEnvelope{Config: &common.Config{}}, + }, + { + description: "good config envelope overrides custom policy manager", + policy: &mocks.Policy{ + EvaluateSignedDataStub: func([]*protoutil.SignedData) error { + return errors.New("invalid signature") + }, + }, + envelope: validConfigEnvelope, + }, + } { + t.Run(testCase.description, func(t *testing.T) { + mockPolicyManager := &mocks.PolicyManager{} + if testCase.policy != nil { + mockPolicyManager.GetPolicyReturns(testCase.policy, true) + } else { + mockPolicyManager.GetPolicyReturns(nil, false) + } + mockPolicyManager.GetPolicyReturns(testCase.policy, true) + verifier := &cluster.BlockValidationPolicyVerifier{ + Logger: flogging.MustGetLogger("test"), + Channel: "mychannel", + PolicyMgr: mockPolicyManager, + BCCSP: cryptoProvider, + } + + err := verifier.VerifyBlockSignature(nil, testCase.envelope) + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + } else { + assert.NoError(t, err) + } + }) + } +} + +func TestBlockVerifierAssembler(t *testing.T) { + config := genesisconfig.Load(genesisconfig.SampleInsecureSoloProfile, configtest.GetDevConfigDir()) + group, err := encoder.NewChannelGroup(config) + assert.NoError(t, err) + assert.NotNil(t, group) + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + t.Run("Good config envelope", func(t *testing.T) { + bva := &cluster.BlockVerifierAssembler{BCCSP: cryptoProvider} + verifier, err := bva.VerifierFromConfig(&common.ConfigEnvelope{ + Config: &common.Config{ + ChannelGroup: group, + }, + }, "mychannel") + assert.NoError(t, err) + + assert.NoError(t, verifier.VerifyBlockSignature(nil, nil)) + }) + + t.Run("Bad config envelope", func(t *testing.T) { + bva := &cluster.BlockVerifierAssembler{BCCSP: cryptoProvider} + _, err := bva.VerifierFromConfig(&common.ConfigEnvelope{}, "mychannel") + assert.EqualError(t, err, "failed extracting bundle from envelope: channelconfig Config cannot be nil") + }) +} + +func TestLastConfigBlock(t *testing.T) { + blockRetriever := &mocks.BlockRetriever{} + blockRetriever.On("Block", uint64(42)).Return(&common.Block{}) + blockRetriever.On("Block", uint64(666)).Return(nil) + + for _, testCase := range []struct { + name string + block *common.Block + blockRetriever cluster.BlockRetriever + expectedError string + }{ + { + name: "nil block", + expectedError: "nil block", + blockRetriever: blockRetriever, + }, + { + name: "nil support", + expectedError: "nil blockRetriever", + block: &common.Block{}, + }, + { + name: "nil metadata", + expectedError: "failed to retrieve metadata: no metadata in block", + blockRetriever: blockRetriever, + block: &common.Block{}, + }, + { + name: "no block with index", + block: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 666}), + })}, + }, + }, + expectedError: "unable to retrieve last config block [666]", + blockRetriever: blockRetriever, + }, + { + name: "valid last config block", + block: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 42}), + })}, + }, + }, + blockRetriever: blockRetriever, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + block, err := cluster.LastConfigBlock(testCase.block, testCase.blockRetriever) + if testCase.expectedError == "" { + assert.NoError(t, err) + assert.NotNil(t, block) + return + } + assert.EqualError(t, err, testCase.expectedError) + assert.Nil(t, block) + }) + } +} + +func TestVerificationRegistryRegisterVerifier(t *testing.T) { + blockBytes, err := ioutil.ReadFile("testdata/mychannel.block") + assert.NoError(t, err) + + block := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, block)) + + verifier := &mocks.BlockVerifier{} + + verifierFactory := &mocks.VerifierFactory{} + verifierFactory.On("VerifierFromConfig", + mock.Anything, "mychannel").Return(verifier, nil) + + registry := &cluster.VerificationRegistry{ + Logger: flogging.MustGetLogger("test"), + VerifiersByChannel: make(map[string]cluster.BlockVerifier), + VerifierFactory: verifierFactory, + } + + var loadCount int + registry.LoadVerifier = func(chain string) cluster.BlockVerifier { + assert.Equal(t, "mychannel", chain) + loadCount++ + return verifier + } + + v := registry.RetrieveVerifier("mychannel") + assert.Nil(t, v) + + registry.RegisterVerifier("mychannel") + v = registry.RetrieveVerifier("mychannel") + assert.Equal(t, verifier, v) + assert.Equal(t, 1, loadCount) + + // If the verifier exists, this is a no-op + registry.RegisterVerifier("mychannel") + assert.Equal(t, 1, loadCount) +} + +func TestVerificationRegistry(t *testing.T) { + blockBytes, err := ioutil.ReadFile("testdata/mychannel.block") + assert.NoError(t, err) + + block := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, block)) + + flogging.ActivateSpec("test=DEBUG") + defer flogging.Reset() + + verifier := &mocks.BlockVerifier{} + + for _, testCase := range []struct { + description string + verifiersByChannel map[string]cluster.BlockVerifier + blockCommitted *common.Block + channelCommitted string + channelRetrieved string + expectedVerifier cluster.BlockVerifier + verifierFromConfig cluster.BlockVerifier + verifierFromConfigErr error + loggedMessages map[string]struct{} + }{ + { + description: "bad block", + blockCommitted: &common.Block{}, + channelRetrieved: "foo", + channelCommitted: "foo", + loggedMessages: map[string]struct{}{ + "Failed parsing block of channel foo: empty block, content: " + + "{\n\t\"data\": null,\n\t\"header\": null,\n\t\"metadata\": null\n}\n": {}, + "No verifier for channel foo exists": {}, + }, + expectedVerifier: nil, + }, + { + description: "not a config block", + blockCommitted: createBlockChain(5, 5)[0], + channelRetrieved: "foo", + channelCommitted: "foo", + loggedMessages: map[string]struct{}{ + "No verifier for channel foo exists": {}, + "Committed block [5] for channel foo that is not a config block": {}, + }, + expectedVerifier: nil, + }, + { + description: "valid block but verifier from config fails", + blockCommitted: block, + verifierFromConfigErr: errors.New("invalid MSP config"), + channelRetrieved: "bar", + channelCommitted: "bar", + loggedMessages: map[string]struct{}{ + "Failed creating a verifier from a " + + "config block for channel bar: invalid MSP config, " + + "content: " + cluster.BlockToString(block): {}, + "No verifier for channel bar exists": {}, + }, + expectedVerifier: nil, + }, + { + description: "valid block and verifier from config succeeds but wrong channel retrieved", + blockCommitted: block, + verifierFromConfig: verifier, + channelRetrieved: "foo", + channelCommitted: "bar", + loggedMessages: map[string]struct{}{ + "No verifier for channel foo exists": {}, + "Committed config block [0] for channel bar": {}, + }, + expectedVerifier: nil, + verifiersByChannel: make(map[string]cluster.BlockVerifier), + }, + { + description: "valid block and verifier from config succeeds", + blockCommitted: block, + verifierFromConfig: verifier, + channelRetrieved: "bar", + channelCommitted: "bar", + loggedMessages: map[string]struct{}{ + "Committed config block [0] for channel bar": {}, + }, + expectedVerifier: verifier, + verifiersByChannel: make(map[string]cluster.BlockVerifier), + }, + } { + t.Run(testCase.description, func(t *testing.T) { + verifierFactory := &mocks.VerifierFactory{} + verifierFactory.On("VerifierFromConfig", + mock.Anything, testCase.channelCommitted).Return(testCase.verifierFromConfig, testCase.verifierFromConfigErr) + + registry := &cluster.VerificationRegistry{ + Logger: flogging.MustGetLogger("test"), + VerifiersByChannel: testCase.verifiersByChannel, + VerifierFactory: verifierFactory, + } + + loggedEntriesByMethods := make(map[string]struct{}) + // Configure the logger to collect the message logged + registry.Logger = registry.Logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + loggedEntriesByMethods[entry.Message] = struct{}{} + return nil + })) + + registry.BlockCommitted(testCase.blockCommitted, testCase.channelCommitted) + verifier := registry.RetrieveVerifier(testCase.channelRetrieved) + + assert.Equal(t, testCase.loggedMessages, loggedEntriesByMethods) + assert.Equal(t, testCase.expectedVerifier, verifier) + }) + } +} + +func TestLedgerInterceptor(t *testing.T) { + block := &common.Block{} + + ledger := &mocks.LedgerWriter{} + ledger.On("Append", block).Return(nil).Once() + + var intercepted bool + + var interceptedLedger cluster.LedgerWriter = &cluster.LedgerInterceptor{ + Channel: "mychannel", + LedgerWriter: ledger, + InterceptBlockCommit: func(b *common.Block, channel string) { + assert.Equal(t, block, b) + assert.Equal(t, "mychannel", channel) + intercepted = true + }, + } + + err := interceptedLedger.Append(block) + assert.NoError(t, err) + assert.True(t, intercepted) + ledger.AssertCalled(t, "Append", block) +} + +func injectAdditionalTLSCAEndpointPair(t *testing.T, block *common.Block, endpoint string, tlsCA []byte, orgName string) { + // Unwrap the layers until we reach the orderer addresses + env, err := protoutil.ExtractEnvelope(block, 0) + assert.NoError(t, err) + payload, err := protoutil.UnmarshalPayload(env.Payload) + assert.NoError(t, err) + confEnv, err := configtx.UnmarshalConfigEnvelope(payload.Data) + assert.NoError(t, err) + ordererGrp := confEnv.Config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups + // Get the first orderer org config + var firstOrdererConfig *common.ConfigGroup + for _, grp := range ordererGrp { + firstOrdererConfig = grp + break + } + // Duplicate it. + secondOrdererConfig := proto.Clone(firstOrdererConfig).(*common.ConfigGroup) + ordererGrp[orgName] = secondOrdererConfig + // Reach the FabricMSPConfig buried in it. + mspConfig := &msp.MSPConfig{} + err = proto.Unmarshal(secondOrdererConfig.Values[channelconfig.MSPKey].Value, mspConfig) + assert.NoError(t, err) + + fabricConfig := &msp.FabricMSPConfig{} + err = proto.Unmarshal(mspConfig.Config, fabricConfig) + assert.NoError(t, err) + + // Plant the given TLS CA in it. + fabricConfig.TlsRootCerts = [][]byte{tlsCA} + // No intermediate root CAs, to make the test simpler. + fabricConfig.TlsIntermediateCerts = nil + // Rename it. + fabricConfig.Name = orgName + + // Pack the MSP config back into the config + secondOrdererConfig.Values[channelconfig.MSPKey].Value = protoutil.MarshalOrPanic(&msp.MSPConfig{ + Config: protoutil.MarshalOrPanic(fabricConfig), + Type: mspConfig.Type, + }) + + // Inject the endpoint + ordererOrgProtos := &common.OrdererAddresses{ + Addresses: []string{endpoint}, + } + secondOrdererConfig.Values[channelconfig.EndpointsKey].Value = protoutil.MarshalOrPanic(ordererOrgProtos) + + // Fold everything back into the block + payload.Data = protoutil.MarshalOrPanic(confEnv) + env.Payload = protoutil.MarshalOrPanic(payload) + block.Data.Data[0] = protoutil.MarshalOrPanic(env) +} + +func TestEndpointCriteriaString(t *testing.T) { + // The top cert is the issuer of the bottom cert + certs := `-----BEGIN CERTIFICATE----- +MIIBozCCAUigAwIBAgIQMXmzUnikiAZDr4VsrBL+rzAKBggqhkjOPQQDAjAxMS8w +LQYDVQQFEyY2NTc2NDA3Njc5ODcwOTA3OTEwNDM5NzkxMTAwNzA0Mzk3Njg3OTAe +Fw0xOTExMTEyMDM5MDRaFw0yOTExMDkyMDM5MDRaMDExLzAtBgNVBAUTJjY1NzY0 +MDc2Nzk4NzA5MDc5MTA0Mzk3OTExMDA3MDQzOTc2ODc5MFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEzBBkRvWgasCKf1pejwpOu+1Fv9FffOZMHnna/7lfMrAqOs8d +HMDVU7mSexu7YNTpAwm4vkdHXi35H8zlVABTxaNCMEAwDgYDVR0PAQH/BAQDAgGm +MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/ +MAoGCCqGSM49BAMCA0kAMEYCIQCXqXoYLAJN9diIdGxPlRQJgJLju4brWXZfyt3s +E9TjFwIhAOuUJjcOchdP6UA9WLnVWciEo1Omf59NgfHL1gUPb/t6 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIBpDCCAUqgAwIBAgIRAIyvtL0z1xQ+NecXeH1HmmAwCgYIKoZIzj0EAwIwMTEv +MC0GA1UEBRMmNjU3NjQwNzY3OTg3MDkwNzkxMDQzOTc5MTEwMDcwNDM5NzY4Nzkw +HhcNMTkxMTExMjAzOTA0WhcNMTkxMTEyMjAzOTA0WjAyMTAwLgYDVQQFEycxODcw +MDQyMzcxODQwMjY5Mzk2ODUxNzk1NzM3MzIyMTc2OTA3MjAwWTATBgcqhkjOPQIB +BggqhkjOPQMBBwNCAARZBFDBOfC7T9RbsX+PgyE6sM7ocuwn6krIGjc00ICivFgQ +qdHMU7hiswiYwSvwh9MDHlprCRW3ycSgEYQgKU5to0IwQDAOBgNVHQ8BAf8EBAMC +BaAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMA8GA1UdEQQIMAaHBH8A +AAEwCgYIKoZIzj0EAwIDSAAwRQIhAK6G7qr/ClszCFP25gsflA31+7eoss5vi3o4 +qz8bY+s6AiBvO0aOfE8M4ibjmRE4vSXo0+gkOIJKqZcmiRdnJSr8Xw== +-----END CERTIFICATE-----` + + epc := cluster.EndpointCriteria{ + Endpoint: "orderer.example.com:7050", + TLSRootCAs: [][]byte{[]byte(certs)}, + } + + actual := fmt.Sprint(epc) + expected := `{"CAs":[{"Expired":false,"Issuer":"self","Subject":"SERIALNUMBER=65764076798709079104397911007043976879"},{"Expired":true,"Issuer":"SERIALNUMBER=65764076798709079104397911007043976879","Subject":"SERIALNUMBER=187004237184026939685179573732217690720"}],"Endpoint":"orderer.example.com:7050"}` + assert.Equal(t, expected, actual) +} + +func TestComparisonMemoizer(t *testing.T) { + var invocations int + + m := &cluster.ComparisonMemoizer{ + MaxEntries: 5, + F: func(a, b []byte) bool { + invocations++ + return bytes.Equal(a, b) + }, + } + + // Warm-up cache + for i := 0; i < 5; i++ { + notSame := m.Compare([]byte{byte(i)}, []byte{1, 2, 3}) + require.False(t, notSame) + require.Equal(t, i+1, invocations) + } + + // Ensure lookups are cached + for i := 0; i < 5; i++ { + notSame := m.Compare([]byte{byte(i)}, []byte{1, 2, 3}) + require.False(t, notSame) + require.Equal(t, 5, invocations) + } + + // Put a new entry which will cause a cache miss + same := m.Compare([]byte{5}, []byte{5}) + require.True(t, same) + require.Equal(t, 6, invocations) + + // Keep adding more and more elements to the cache and ensure it stays smaller than its size + for i := 0; i < 20; i++ { + odd := m.Compare([]byte{byte(1)}, []byte{byte(i % 2)}) + require.Equal(t, i%2 != 0, odd) + require.LessOrEqual(t, m.Size(), int(m.MaxEntries)) + } +} +``` + +## `protoutil/blockutils.go` (changed lines (13, 14, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package protoutil + +import ( + "bytes" + "crypto/sha256" + "encoding/asn1" + "encoding/base64" + "fmt" + "math/big" + + "github.com/golang/protobuf/proto" + cb "github.com/hyperledger/fabric-protos-go/common" + "github.com/pkg/errors" +) + +// NewBlock constructs a block with no data and no metadata. +func NewBlock(seqNum uint64, previousHash []byte) *cb.Block { + block := &cb.Block{} + block.Header = &cb.BlockHeader{} + block.Header.Number = seqNum + block.Header.PreviousHash = previousHash + block.Header.DataHash = []byte{} + block.Data = &cb.BlockData{} + + var metadataContents [][]byte + for i := 0; i < len(cb.BlockMetadataIndex_name); i++ { + metadataContents = append(metadataContents, []byte{}) + } + block.Metadata = &cb.BlockMetadata{Metadata: metadataContents} + + return block +} + +type asn1Header struct { + Number *big.Int + PreviousHash []byte + DataHash []byte +} + +func BlockHeaderBytes(b *cb.BlockHeader) []byte { + asn1Header := asn1Header{ + PreviousHash: b.PreviousHash, + DataHash: b.DataHash, + Number: new(big.Int).SetUint64(b.Number), + } + result, err := asn1.Marshal(asn1Header) + if err != nil { + // Errors should only arise for types which cannot be encoded, since the + // BlockHeader type is known a-priori to contain only encodable types, an + // error here is fatal and should not be propagated + panic(err) + } + return result +} + +func BlockHeaderHash(b *cb.BlockHeader) []byte { + sum := sha256.Sum256(BlockHeaderBytes(b)) + return sum[:] +} + +func BlockDataHash(b *cb.BlockData) []byte { + sum := sha256.Sum256(bytes.Join(b.Data, nil)) + return sum[:] +} + +// GetChannelIDFromBlockBytes returns channel ID given byte array which represents +// the block +func GetChannelIDFromBlockBytes(bytes []byte) (string, error) { + block, err := UnmarshalBlock(bytes) + if err != nil { + return "", err + } + + return GetChannelIDFromBlock(block) +} + +// GetChannelIDFromBlock returns channel ID in the block +func GetChannelIDFromBlock(block *cb.Block) (string, error) { + if block == nil || block.Data == nil || block.Data.Data == nil || len(block.Data.Data) == 0 { + return "", errors.New("failed to retrieve channel id - block is empty") + } + var err error + envelope, err := GetEnvelopeFromBlock(block.Data.Data[0]) + if err != nil { + return "", err + } + payload, err := UnmarshalPayload(envelope.Payload) + if err != nil { + return "", err + } + + if payload.Header == nil { + return "", errors.New("failed to retrieve channel id - payload header is empty") + } + chdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return "", err + } + + return chdr.ChannelId, nil +} + +// GetMetadataFromBlock retrieves metadata at the specified index. +func GetMetadataFromBlock(block *cb.Block, index cb.BlockMetadataIndex) (*cb.Metadata, error) { + if block.Metadata == nil { + return nil, errors.New("no metadata in block") + } + + if len(block.Metadata.Metadata) <= int(index) { + return nil, errors.Errorf("no metadata at index [%s]", index) + } + + md := &cb.Metadata{} + err := proto.Unmarshal(block.Metadata.Metadata[index], md) + if err != nil { + return nil, errors.Wrapf(err, "error unmarshaling metadata at index [%s]", index) + } + return md, nil +} + +// GetMetadataFromBlockOrPanic retrieves metadata at the specified index, or +// panics on error +func GetMetadataFromBlockOrPanic(block *cb.Block, index cb.BlockMetadataIndex) *cb.Metadata { + md, err := GetMetadataFromBlock(block, index) + if err != nil { + panic(err) + } + return md +} + +// GetConsenterMetadataFromBlock attempts to retrieve consenter metadata from the value +// stored in block metadata at index SIGNATURES (first field). If no consenter metadata +// is found there, it falls back to index ORDERER (third field). +func GetConsenterMetadataFromBlock(block *cb.Block) (*cb.Metadata, error) { + m, err := GetMetadataFromBlock(block, cb.BlockMetadataIndex_SIGNATURES) + if err != nil { + return nil, errors.WithMessage(err, "failed to retrieve metadata") + } + + // TODO FAB-15864 Remove this fallback when we can stop supporting upgrade from pre-1.4.1 orderer + if len(m.Value) == 0 { + return GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + } + + obm := &cb.OrdererBlockMetadata{} + err = proto.Unmarshal(m.Value, obm) + if err != nil { + return nil, errors.Wrap(err, "failed to unmarshal orderer block metadata") + } + + res := &cb.Metadata{} + err = proto.Unmarshal(obm.ConsenterMetadata, res) + if err != nil { + return nil, errors.Wrap(err, "failed to unmarshal consenter metadata") + } + + return res, nil +} + +// GetLastConfigIndexFromBlock retrieves the index of the last config block as +// encoded in the block metadata +func GetLastConfigIndexFromBlock(block *cb.Block) (uint64, error) { + m, err := GetMetadataFromBlock(block, cb.BlockMetadataIndex_SIGNATURES) + if err != nil { + return 0, errors.WithMessage(err, "failed to retrieve metadata") + } + // TODO FAB-15864 Remove this fallback when we can stop supporting upgrade from pre-1.4.1 orderer + if len(m.Value) == 0 { + m, err := GetMetadataFromBlock(block, cb.BlockMetadataIndex_LAST_CONFIG) + if err != nil { + return 0, errors.WithMessage(err, "failed to retrieve metadata") + } + lc := &cb.LastConfig{} + err = proto.Unmarshal(m.Value, lc) + if err != nil { + return 0, errors.Wrap(err, "error unmarshaling LastConfig") + } + return lc.Index, nil + } + + obm := &cb.OrdererBlockMetadata{} + err = proto.Unmarshal(m.Value, obm) + if err != nil { + return 0, errors.Wrap(err, "failed to unmarshal orderer block metadata") + } + return obm.LastConfig.Index, nil +} + +// GetLastConfigIndexFromBlockOrPanic retrieves the index of the last config +// block as encoded in the block metadata, or panics on error +func GetLastConfigIndexFromBlockOrPanic(block *cb.Block) uint64 { + index, err := GetLastConfigIndexFromBlock(block) + if err != nil { + panic(err) + } + return index +} + +// CopyBlockMetadata copies metadata from one block into another +func CopyBlockMetadata(src *cb.Block, dst *cb.Block) { + dst.Metadata = src.Metadata + // Once copied initialize with rest of the + // required metadata positions. + InitBlockMetadata(dst) +} + +// InitBlockMetadata initializes metadata structure +func InitBlockMetadata(block *cb.Block) { + if block.Metadata == nil { + block.Metadata = &cb.BlockMetadata{Metadata: [][]byte{{}, {}, {}, {}, {}}} + } else if len(block.Metadata.Metadata) < int(cb.BlockMetadataIndex_COMMIT_HASH+1) { + for i := int(len(block.Metadata.Metadata)); i <= int(cb.BlockMetadataIndex_COMMIT_HASH); i++ { + block.Metadata.Metadata = append(block.Metadata.Metadata, []byte{}) + } + } +} + +func VerifyTransactionsAreWellFormed(block *cb.Block) error { + if block == nil || block.Data == nil || len(block.Data.Data) == 0 { + return fmt.Errorf("empty block") + } + + // If we have a single transaction, and the block is a config block, then no need to check + // well formed-ness, because there cannot be another transaction in the original block. + if IsConfigBlock(block) { + return nil + } + + for i, rawTx := range block.Data.Data { + env := &cb.Envelope{} + if err := proto.Unmarshal(rawTx, env); err != nil { + return fmt.Errorf("transaction %d is invalid: %v", i, err) + } + + if len(env.Payload) == 0 { + return fmt.Errorf("transaction %d has no payload", i) + } + + if len(env.Signature) == 0 { + return fmt.Errorf("transaction %d has no signature", i) + } + + expected, err := proto.Marshal(env) + if err != nil { + return fmt.Errorf("failed re-marshaling envelope: %v", err) + } + + if len(expected) < len(rawTx) { + return fmt.Errorf("transaction %d has %d trailing bytes", i, len(rawTx)-len(expected)) + } + if !bytes.Equal(expected, rawTx) { + return fmt.Errorf("transaction %d (%s) does not match its raw form (%s)", i, + base64.StdEncoding.EncodeToString(expected), base64.StdEncoding.EncodeToString(rawTx)) + } + } + + return nil +} +``` + +## `protoutil/blockutils_test.go` (changed lines (213, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package protoutil_test + +import ( + "crypto/sha256" + "encoding/asn1" + "math" + "testing" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go/common" + configtxtest "github.com/hyperledger/fabric/common/configtx/test" + "github.com/hyperledger/fabric/protoutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var testChannelID = "myuniquetestchainid" + +func TestNewBlock(t *testing.T) { + var block *cb.Block + assert.Nil(t, block.GetHeader()) + assert.Nil(t, block.GetData()) + assert.Nil(t, block.GetMetadata()) + + data := &cb.BlockData{ + Data: [][]byte{{0, 1, 2}}, + } + block = protoutil.NewBlock(uint64(0), []byte("datahash")) + assert.Equal(t, []byte("datahash"), block.Header.PreviousHash, "Incorrect previous hash") + assert.NotNil(t, block.GetData()) + assert.NotNil(t, block.GetMetadata()) + block.GetHeader().DataHash = protoutil.BlockDataHash(data) + + asn1Bytes, err := asn1.Marshal(struct { + Number int64 + PreviousHash []byte + DataHash []byte + }{ + Number: 0, + DataHash: protoutil.BlockDataHash(data), + PreviousHash: []byte("datahash"), + }) + headerHash := sha256.Sum256(asn1Bytes) + assert.NoError(t, err) + assert.Equal(t, asn1Bytes, protoutil.BlockHeaderBytes(block.Header), "Incorrect marshaled blockheader bytes") + assert.Equal(t, headerHash[:], protoutil.BlockHeaderHash(block.Header), "Incorrect blockheader hash") +} + +func TestGoodBlockHeaderBytes(t *testing.T) { + goodBlockHeader := &common.BlockHeader{ + Number: 1, + PreviousHash: []byte("foo"), + DataHash: []byte("bar"), + } + + _ = protoutil.BlockHeaderBytes(goodBlockHeader) // Should not panic + + goodBlockHeaderMaxNumber := &common.BlockHeader{ + Number: math.MaxUint64, + PreviousHash: []byte("foo"), + DataHash: []byte("bar"), + } + + _ = protoutil.BlockHeaderBytes(goodBlockHeaderMaxNumber) // Should not panic +} + +func TestGetChannelIDFromBlockBytes(t *testing.T) { + gb, err := configtxtest.MakeGenesisBlock(testChannelID) + assert.NoError(t, err, "Failed to create test configuration block") + bytes, err := proto.Marshal(gb) + assert.NoError(t, err) + cid, err := protoutil.GetChannelIDFromBlockBytes(bytes) + assert.NoError(t, err) + assert.Equal(t, testChannelID, cid, "Failed to return expected chain ID") + + // bad block bytes + _, err = protoutil.GetChannelIDFromBlockBytes([]byte("bad block")) + assert.Error(t, err, "Expected error with malformed block bytes") +} + +func TestGetChannelIDFromBlock(t *testing.T) { + var err error + var gb *common.Block + var cid string + + // nil block + _, err = protoutil.GetChannelIDFromBlock(gb) + assert.Error(t, err, "Expected error getting channel id from nil block") + + gb, err = configtxtest.MakeGenesisBlock(testChannelID) + assert.NoError(t, err, "Failed to create test configuration block") + + cid, err = protoutil.GetChannelIDFromBlock(gb) + assert.NoError(t, err, "Failed to get chain ID from block") + assert.Equal(t, testChannelID, cid, "Failed to return expected chain ID") + + // missing data + badBlock := gb + badBlock.Data = nil + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error with missing block data") + + // no envelope + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{[]byte("bad envelope")}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error with no envelope in data") + + // bad payload + env, _ := proto.Marshal(&cb.Envelope{ + Payload: []byte("bad payload"), + }) + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{env}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error - malformed payload") + + // bad channel header + payload, _ := proto.Marshal(&cb.Payload{ + Header: &cb.Header{ + ChannelHeader: []byte("bad header"), + }, + }) + env, _ = proto.Marshal(&cb.Envelope{ + Payload: payload, + }) + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{env}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error with malformed channel header") + + // nil payload header + payload, _ = proto.Marshal(&cb.Payload{}) + env, _ = proto.Marshal(&cb.Envelope{ + Payload: payload, + }) + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{env}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error when payload header is nil") +} + +func TestGetBlockFromBlockBytes(t *testing.T) { + testChainID := "myuniquetestchainid" + gb, err := configtxtest.MakeGenesisBlock(testChainID) + assert.NoError(t, err, "Failed to create test configuration block") + blockBytes, err := protoutil.Marshal(gb) + assert.NoError(t, err, "Failed to marshal block") + _, err = protoutil.UnmarshalBlock(blockBytes) + assert.NoError(t, err, "to get block from block bytes") + + // bad block bytes + _, err = protoutil.UnmarshalBlock([]byte("bad block")) + assert.Error(t, err, "Expected error for malformed block bytes") +} + +func TestGetMetadataFromBlock(t *testing.T) { + t.Run("new block", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + md, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + assert.NoError(t, err, "Unexpected error extracting metadata from new block") + assert.Nil(t, md.Value, "Expected metadata field value to be nil") + assert.Equal(t, 0, len(md.Value), "Expected length of metadata field value to be 0") + md = protoutil.GetMetadataFromBlockOrPanic(block, cb.BlockMetadataIndex_ORDERER) + assert.NotNil(t, md, "Expected to get metadata from block") + }) + t.Run("no metadata", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + block.Metadata = nil + _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + assert.Error(t, err, "Expected error with nil metadata") + assert.Contains(t, err.Error(), "no metadata in block") + }) + t.Run("no metadata at index", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + block.Metadata.Metadata = [][]byte{{1, 2, 3}} + _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_LAST_CONFIG) + assert.Error(t, err, "Expected error with nil metadata") + assert.Contains(t, err.Error(), "no metadata at index") + }) + t.Run("malformed metadata", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + block.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = []byte("bad metadata") + _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + assert.Error(t, err, "Expected error with malformed metadata") + assert.Contains(t, err.Error(), "error unmarshaling metadata at index [ORDERER]") + assert.Panics(t, func() { + _ = protoutil.GetMetadataFromBlockOrPanic(block, cb.BlockMetadataIndex_ORDERER) + }, "Expected panic with malformed metadata") + }) +} + +func TestGetConsenterMetadataFromBlock(t *testing.T) { + cases := []struct { + name string + value []byte + signatures []byte + orderer []byte + pass bool + }{ + { + name: "empty", + value: nil, + signatures: nil, + orderer: nil, + pass: true, + }, + { + name: "signature only", + value: []byte("hello"), + signatures: protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{ + ConsenterMetadata: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + }), + }), + orderer: nil, + pass: true, + }, + { + name: "orderer only", + value: []byte("hello"), + signatures: nil, + orderer: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + pass: true, + }, + { + name: "both signatures and orderer", + value: []byte("hello"), + signatures: protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{ + ConsenterMetadata: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + }), + }), + orderer: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + pass: true, + }, + { + name: "malformed OrdererBlockMetadata", + signatures: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("malformed")}), + orderer: nil, + pass: false, + }, + } + + for _, test := range cases { + block := protoutil.NewBlock(0, nil) + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = test.signatures + block.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = test.orderer + result, err := protoutil.GetConsenterMetadataFromBlock(block) + + if test.pass { + require.NoError(t, err) + require.Equal(t, result.Value, test.value) + } else { + require.Error(t, err) + } + } +} + +func TestInitBlockMeta(t *testing.T) { + // block with no metadata + block := &cb.Block{} + protoutil.InitBlockMetadata(block) + // should have 3 entries + assert.Equal(t, 5, len(block.Metadata.Metadata), "Expected block to have 5 metadata entries") + + // block with a single entry + block = &cb.Block{ + Metadata: &cb.BlockMetadata{}, + } + block.Metadata.Metadata = append(block.Metadata.Metadata, []byte{}) + protoutil.InitBlockMetadata(block) + // should have 3 entries + assert.Equal(t, 5, len(block.Metadata.Metadata), "Expected block to have 5 metadata entries") +} + +func TestCopyBlockMetadata(t *testing.T) { + srcBlock := protoutil.NewBlock(0, nil) + dstBlock := &cb.Block{} + + metadata, _ := proto.Marshal(&cb.Metadata{ + Value: []byte("orderer metadata"), + }) + srcBlock.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = metadata + protoutil.CopyBlockMetadata(srcBlock, dstBlock) + + // check that the copy worked + assert.Equal(t, len(srcBlock.Metadata.Metadata), len(dstBlock.Metadata.Metadata), + "Expected target block to have same number of metadata entries after copy") + assert.Equal(t, metadata, dstBlock.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER], + "Unexpected metadata from target block") +} + +func TestGetLastConfigIndexFromBlock(t *testing.T) { + index := uint64(2) + block := protoutil.NewBlock(0, nil) + + t.Run("block with last config metadata in signatures field", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{ + LastConfig: &cb.LastConfig{Index: 2}, + }), + }) + result, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.NoError(t, err, "Unexpected error returning last config index") + assert.Equal(t, index, result, "Unexpected last config index returned from block") + result = protoutil.GetLastConfigIndexFromBlockOrPanic(block) + assert.Equal(t, index, result, "Unexpected last config index returned from block") + }) + + t.Run("block with malformed signatures", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = []byte("apple") + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshaling metadata at index [SIGNATURES]") + }) + + t.Run("block with malformed orderer block metadata", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("banana")}) + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to unmarshal orderer block metadata") + }) + + // TODO: FAB-15864 remove the tests below when we stop supporting upgrade from + // pre-1.4.1 orderer + t.Run("block with deprecated (pre-1.4.1) last config", func(t *testing.T) { + block = protoutil.NewBlock(0, nil) + block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.LastConfig{ + Index: index, + }), + }) + result, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.NoError(t, err, "Unexpected error returning last config index") + assert.Equal(t, index, result, "Unexpected last config index returned from block") + result = protoutil.GetLastConfigIndexFromBlockOrPanic(block) + assert.Equal(t, index, result, "Unexpected last config index returned from block") + }) + + t.Run("malformed metadata", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = []byte("bad metadata") + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshaling metadata at index [LAST_CONFIG]") + }) + + t.Run("malformed last config", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&cb.Metadata{ + Value: []byte("bad last config"), + }) + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err, "Expected error with malformed last config metadata") + assert.Contains(t, err.Error(), "error unmarshaling LastConfig") + assert.Panics(t, func() { + _ = protoutil.GetLastConfigIndexFromBlockOrPanic(block) + }, "Expected panic with malformed last config metadata") + }) +} + +func TestVerifyTransactionsAreWellFormed(t *testing.T) { + originalBlock := &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{ + marshalOrPanic(&cb.Envelope{ + Payload: []byte{1, 2, 3}, + Signature: []byte{4, 5, 6}, + }), + marshalOrPanic(&cb.Envelope{ + Payload: []byte{7, 8, 9}, + Signature: []byte{10, 11, 12}, + }), + }, + }, + } + + forgedBlock := proto.Clone(originalBlock).(*cb.Block) + tmp := make([]byte, len(forgedBlock.Data.Data[0])+len(forgedBlock.Data.Data[1])) + copy(tmp, forgedBlock.Data.Data[0]) + copy(tmp[len(forgedBlock.Data.Data[0]):], forgedBlock.Data.Data[1]) + forgedBlock.Data.Data = [][]byte{tmp} // Replace transactions {0,1} with transaction {0 || 1} + + for _, tst := range []struct { + name string + expectedError string + block *cb.Block + }{ + { + name: "config block", + block: &cb.Block{Data: &cb.BlockData{ + Data: [][]byte{ + protoutil.MarshalOrPanic( + &cb.Envelope{ + Payload: protoutil.MarshalOrPanic(&cb.Payload{ + Header: &cb.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&cb.ChannelHeader{ + Type: int32(cb.HeaderType_CONFIG), + }), + }, + }), + }), + }, + }}, + }, + { + name: "empty block", + expectedError: "empty block", + }, + { + name: "no block data", + block: &cb.Block{}, + expectedError: "empty block", + }, + { + name: "no transactions", + block: &cb.Block{Data: &cb.BlockData{}}, + expectedError: "empty block", + }, + { + name: "single transaction", + block: &cb.Block{Data: &cb.BlockData{Data: [][]byte{marshalOrPanic(&cb.Envelope{ + Payload: []byte{1, 2, 3}, + Signature: []byte{4, 5, 6}, + })}}}, + }, + + { + name: "good block", + block: originalBlock, + }, + { + name: "forged block", + block: forgedBlock, + expectedError: "transaction 0 has 10 trailing bytes", + }, + { + name: "no signature", + expectedError: "transaction 0 has no signature", + block: &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{ + marshalOrPanic(&cb.Envelope{ + Payload: []byte{1, 2, 3}, + }), + }, + }, + }, + }, + { + name: "no payload", + expectedError: "transaction 0 has no payload", + block: &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{ + marshalOrPanic(&cb.Envelope{ + Signature: []byte{4, 5, 6}, + }), + }, + }, + }, + }, + { + name: "transaction invalid", + expectedError: "transaction 0 is invalid: proto: common.Envelope: illegal tag 0 (wire type 6)", + block: &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{ + marshalOrPanic(&cb.Envelope{ + Payload: []byte{1, 2, 3}, + Signature: []byte{4, 5, 6}, + })[9:], + }, + }, + }, + }, + } { + tst := tst + t.Run(tst.name, func(t *testing.T) { + err := protoutil.VerifyTransactionsAreWellFormed(tst.block) + if tst.expectedError == "" { + require.NoError(t, err) + } else { + require.Contains(t, err.Error(), tst.expectedError) + } + }) + } +} +``` + +## `protoutil/commonutils.go` (changed lines (191, 192, 193, 194, 195, 196, 197, 198, 199, 200)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package protoutil + +import ( + "crypto/rand" + "fmt" + "time" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/timestamp" + cb "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric/internal/pkg/identity" + "github.com/pkg/errors" +) + +// MarshalOrPanic serializes a protobuf message and panics if this +// operation fails +func MarshalOrPanic(pb proto.Message) []byte { + data, err := proto.Marshal(pb) + if err != nil { + panic(err) + } + return data +} + +// Marshal serializes a protobuf message. +func Marshal(pb proto.Message) ([]byte, error) { + return proto.Marshal(pb) +} + +// CreateNonceOrPanic generates a nonce using the common/crypto package +// and panics if this operation fails. +func CreateNonceOrPanic() []byte { + nonce, err := CreateNonce() + if err != nil { + panic(err) + } + return nonce +} + +// CreateNonce generates a nonce using the common/crypto package. +func CreateNonce() ([]byte, error) { + nonce, err := getRandomNonce() + return nonce, errors.WithMessage(err, "error generating random nonce") +} + +// UnmarshalEnvelopeOfType unmarshals an envelope of the specified type, +// including unmarshaling the payload data +func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, message proto.Message) (*cb.ChannelHeader, error) { + payload, err := UnmarshalPayload(envelope.Payload) + if err != nil { + return nil, err + } + + if payload.Header == nil { + return nil, errors.New("envelope must have a Header") + } + + chdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return nil, err + } + + if chdr.Type != int32(headerType) { + return nil, errors.Errorf("invalid type %s, expected %s", cb.HeaderType(chdr.Type), headerType) + } + + err = proto.Unmarshal(payload.Data, message) + err = errors.Wrapf(err, "error unmarshaling message for type %s", headerType) + return chdr, err +} + +// ExtractEnvelopeOrPanic retrieves the requested envelope from a given block +// and unmarshals it -- it panics if either of these operations fail +func ExtractEnvelopeOrPanic(block *cb.Block, index int) *cb.Envelope { + envelope, err := ExtractEnvelope(block, index) + if err != nil { + panic(err) + } + return envelope +} + +// ExtractEnvelope retrieves the requested envelope from a given block and +// unmarshals it +func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error) { + if block.Data == nil { + return nil, errors.New("block data is nil") + } + + envelopeCount := len(block.Data.Data) + if index < 0 || index >= envelopeCount { + return nil, errors.New("envelope index out of bounds") + } + marshaledEnvelope := block.Data.Data[index] + envelope, err := GetEnvelopeFromBlock(marshaledEnvelope) + err = errors.WithMessagef(err, "block data does not carry an envelope at index %d", index) + return envelope, err +} + +// MakeChannelHeader creates a ChannelHeader. +func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader { + return &cb.ChannelHeader{ + Type: int32(headerType), + Version: version, + Timestamp: ×tamp.Timestamp{ + Seconds: time.Now().Unix(), + Nanos: 0, + }, + ChannelId: chainID, + Epoch: epoch, + } +} + +// MakeSignatureHeader creates a SignatureHeader. +func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *cb.SignatureHeader { + return &cb.SignatureHeader{ + Creator: serializedCreatorCertChain, + Nonce: nonce, + } +} + +// SetTxID generates a transaction id based on the provided signature header +// and sets the TxId field in the channel header +func SetTxID(channelHeader *cb.ChannelHeader, signatureHeader *cb.SignatureHeader) { + channelHeader.TxId = ComputeTxID( + signatureHeader.Nonce, + signatureHeader.Creator, + ) +} + +// MakePayloadHeader creates a Payload Header. +func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header { + return &cb.Header{ + ChannelHeader: MarshalOrPanic(ch), + SignatureHeader: MarshalOrPanic(sh), + } +} + +// NewSignatureHeader returns a SignatureHeader with a valid nonce. +func NewSignatureHeader(id identity.Serializer) (*cb.SignatureHeader, error) { + creator, err := id.Serialize() + if err != nil { + return nil, err + } + nonce, err := CreateNonce() + if err != nil { + return nil, err + } + + return &cb.SignatureHeader{ + Creator: creator, + Nonce: nonce, + }, nil +} + +// NewSignatureHeaderOrPanic returns a signature header and panics on error. +func NewSignatureHeaderOrPanic(id identity.Serializer) *cb.SignatureHeader { + if id == nil { + panic(errors.New("invalid signer. cannot be nil")) + } + + signatureHeader, err := NewSignatureHeader(id) + if err != nil { + panic(fmt.Errorf("failed generating a new SignatureHeader: %s", err)) + } + + return signatureHeader +} + +// SignOrPanic signs a message and panics on error. +func SignOrPanic(signer identity.Signer, msg []byte) []byte { + if signer == nil { + panic(errors.New("invalid signer. cannot be nil")) + } + + sigma, err := signer.Sign(msg) + if err != nil { + panic(fmt.Errorf("failed generating signature: %s", err)) + } + return sigma +} + +// IsConfigBlock validates whenever given block contains configuration +// update transaction +func IsConfigBlock(block *cb.Block) bool { + if block.Data == nil { + return false + } + + if len(block.Data.Data) != 1 { + return false + } + + marshaledEnvelope := block.Data.Data[0] + envelope, err := GetEnvelopeFromBlock(marshaledEnvelope) + if err != nil { + return false + } + + payload, err := UnmarshalPayload(envelope.Payload) + if err != nil { + return false + } + + if payload.Header == nil { + return false + } + + hdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return false + } + + return cb.HeaderType(hdr.Type) == cb.HeaderType_CONFIG || cb.HeaderType(hdr.Type) == cb.HeaderType_ORDERER_TRANSACTION +} + +// ChannelHeader returns the *cb.ChannelHeader for a given *cb.Envelope. +func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error) { + if env == nil { + return nil, errors.New("Invalid envelope payload. can't be nil") + } + + envPayload, err := UnmarshalPayload(env.Payload) + if err != nil { + return nil, err + } + + if envPayload.Header == nil { + return nil, errors.New("header not set") + } + + if envPayload.Header.ChannelHeader == nil { + return nil, errors.New("channel header not set") + } + + chdr, err := UnmarshalChannelHeader(envPayload.Header.ChannelHeader) + if err != nil { + return nil, errors.WithMessage(err, "error unmarshaling channel header") + } + + return chdr, nil +} + +// ChannelID returns the Channel ID for a given *cb.Envelope. +func ChannelID(env *cb.Envelope) (string, error) { + chdr, err := ChannelHeader(env) + if err != nil { + return "", errors.WithMessage(err, "error retrieving channel header") + } + + return chdr.ChannelId, nil +} + +// EnvelopeToConfigUpdate is used to extract a ConfigUpdateEnvelope from an envelope of +// type CONFIG_UPDATE +func EnvelopeToConfigUpdate(configtx *cb.Envelope) (*cb.ConfigUpdateEnvelope, error) { + configUpdateEnv := &cb.ConfigUpdateEnvelope{} + _, err := UnmarshalEnvelopeOfType(configtx, cb.HeaderType_CONFIG_UPDATE, configUpdateEnv) + if err != nil { + return nil, err + } + return configUpdateEnv, nil +} + +func getRandomNonce() ([]byte, error) { + key := make([]byte, 24) + + _, err := rand.Read(key) + if err != nil { + return nil, errors.Wrap(err, "error getting random bytes") + } + return key, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..db86511d6319d227c398441c594b36c543546ad6 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/pre_context.md @@ -0,0 +1,4907 @@ +# Patch-overlapping Go context before the fix + +## `internal/peer/gossip/mcs.go` (changed lines (154, 262)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package gossip + +import ( + "bytes" + "fmt" + "time" + + pcommon "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric/bccsp" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/common/util" + "github.com/hyperledger/fabric/gossip/api" + "github.com/hyperledger/fabric/gossip/common" + "github.com/hyperledger/fabric/internal/pkg/identity" + "github.com/hyperledger/fabric/msp" + "github.com/hyperledger/fabric/msp/mgmt" + "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" +) + +var mcsLogger = flogging.MustGetLogger("peer.gossip.mcs") + +// Hasher is the interface provides the hash function should be used for all gossip components. +type Hasher interface { + Hash(msg []byte, opts bccsp.HashOpts) (hash []byte, err error) +} + +// MSPMessageCryptoService implements the MessageCryptoService interface +// using the peer MSPs (local and channel-related) +// +// In order for the system to be secure it is vital to have the +// MSPs to be up-to-date. Channels' MSPs are updated via +// configuration transactions distributed by the ordering service. +// +// A similar mechanism needs to be in place to update the local MSP, as well. +// This implementation assumes that these mechanisms are all in place and working. +type MSPMessageCryptoService struct { + channelPolicyManagerGetter policies.ChannelPolicyManagerGetter + localSigner identity.SignerSerializer + deserializer mgmt.DeserializersManager + hasher Hasher +} + +// NewMCS creates a new instance of MSPMessageCryptoService +// that implements MessageCryptoService. +// The method takes in input: +// 1. a policies.ChannelPolicyManagerGetter that gives access to the policy manager of a given channel via the Manager method. +// 2. an instance of identity.SignerSerializer +// 3. an identity deserializer manager +func NewMCS( + channelPolicyManagerGetter policies.ChannelPolicyManagerGetter, + localSigner identity.SignerSerializer, + deserializer mgmt.DeserializersManager, + hasher Hasher, +) *MSPMessageCryptoService { + return &MSPMessageCryptoService{ + channelPolicyManagerGetter: channelPolicyManagerGetter, + localSigner: localSigner, + deserializer: deserializer, + hasher: hasher, + } +} + +// ValidateIdentity validates the identity of a remote peer. +// If the identity is invalid, revoked, expired it returns an error. +// Else, returns nil +func (s *MSPMessageCryptoService) ValidateIdentity(peerIdentity api.PeerIdentityType) error { + // As prescribed by the contract of method, + // below we check only that peerIdentity is not + // invalid, revoked or expired. + + _, _, err := s.getValidatedIdentity(peerIdentity) + return err +} + +// GetPKIidOfCert returns the PKI-ID of a peer's identity +// If any error occurs, the method return nil +// The PKid of a peer is computed as the SHA2-256 of peerIdentity which +// is supposed to be the serialized version of MSP identity. +// This method does not validate peerIdentity. +// This validation is supposed to be done appropriately during the execution flow. +func (s *MSPMessageCryptoService) GetPKIidOfCert(peerIdentity api.PeerIdentityType) common.PKIidType { + // Validate arguments + if len(peerIdentity) == 0 { + mcsLogger.Error("Invalid Peer Identity. It must be different from nil.") + + return nil + } + + sid, err := s.deserializer.Deserialize(peerIdentity) + if err != nil { + mcsLogger.Errorf("Failed getting validated identity from peer identity %s: [%s]", peerIdentity, err) + + return nil + } + + // concatenate msp-id and idbytes + // idbytes is the low-level representation of an identity. + // it is supposed to be already in its minimal representation + + mspIDRaw := []byte(sid.Mspid) + raw := append(mspIDRaw, sid.IdBytes...) + + // Hash + digest, err := s.hasher.Hash(raw, &bccsp.SHA256Opts{}) + if err != nil { + mcsLogger.Errorf("Failed computing digest of serialized identity %s: [%s]", peerIdentity, err) + return nil + } + + return digest +} + +// VerifyBlock returns nil if the block is properly signed, and the claimed seqNum is the +// sequence number that the block's header contains. +// else returns error +func (s *MSPMessageCryptoService) VerifyBlock(chainID common.ChannelID, seqNum uint64, block *pcommon.Block) error { + if block.Header == nil { + return fmt.Errorf("Invalid Block on channel [%s]. Header must be different from nil.", chainID) + } + + blockSeqNum := block.Header.Number + if seqNum != blockSeqNum { + return fmt.Errorf("Claimed seqNum is [%d] but actual seqNum inside block is [%d]", seqNum, blockSeqNum) + } + + // - Extract channelID and compare with chainID + channelID, err := protoutil.GetChannelIDFromBlock(block) + if err != nil { + return fmt.Errorf("Failed getting channel id from block with id [%d] on channel [%s]: [%s]", block.Header.Number, chainID, err) + } + + if channelID != string(chainID) { + return fmt.Errorf("Invalid block's channel id. Expected [%s]. Given [%s]", chainID, channelID) + } + + // - Unmarshal medatada + if block.Metadata == nil || len(block.Metadata.Metadata) == 0 { + return fmt.Errorf("Block with id [%d] on channel [%s] does not have metadata. Block not valid.", block.Header.Number, chainID) + } + + metadata, err := protoutil.GetMetadataFromBlock(block, pcommon.BlockMetadataIndex_SIGNATURES) + if err != nil { + return fmt.Errorf("Failed unmarshalling medatata for signatures [%s]", err) + } + + // - Verify that Header.DataHash is equal to the hash of block.Data + // This is to ensure that the header is consistent with the data carried by this block + if !bytes.Equal(protoutil.BlockDataHash(block.Data), block.Header.DataHash) { + return fmt.Errorf("Header.DataHash is different from Hash(block.Data) for block with id [%d] on channel [%s]", block.Header.Number, chainID) + } + + // - Get Policy for block validation + + // Get the policy manager for channelID + cpm := s.channelPolicyManagerGetter.Manager(channelID) + if cpm == nil { + return fmt.Errorf("Could not acquire policy manager for channel %s", channelID) + } + mcsLogger.Debugf("Got policy manager for channel [%s]", channelID) + + // Get block validation policy + policy, ok := cpm.GetPolicy(policies.BlockValidation) + // ok is true if it was the policy requested, or false if it is the default policy + mcsLogger.Debugf("Got block validation policy for channel [%s] with flag [%t]", channelID, ok) + + // - Prepare SignedData + signatureSet := []*protoutil.SignedData{} + for _, metadataSignature := range metadata.Signatures { + shdr, err := protoutil.UnmarshalSignatureHeader(metadataSignature.SignatureHeader) + if err != nil { + return fmt.Errorf("Failed unmarshalling signature header for block with id [%d] on channel [%s]: [%s]", block.Header.Number, chainID, err) + } + signatureSet = append( + signatureSet, + &protoutil.SignedData{ + Identity: shdr.Creator, + Data: util.ConcatenateBytes(metadata.Value, metadataSignature.SignatureHeader, protoutil.BlockHeaderBytes(block.Header)), + Signature: metadataSignature.Signature, + }, + ) + } + + // - Evaluate policy + return policy.EvaluateSignedData(signatureSet) +} + +// Sign signs msg with this peer's signing key and outputs +// the signature if no error occurred. +func (s *MSPMessageCryptoService) Sign(msg []byte) ([]byte, error) { + return s.localSigner.Sign(msg) +} + +// Verify checks that signature is a valid signature of message under a peer's verification key. +// If the verification succeeded, Verify returns nil meaning no error occurred. +// If peerIdentity is nil, then the verification fails. +func (s *MSPMessageCryptoService) Verify(peerIdentity api.PeerIdentityType, signature, message []byte) error { + identity, chainID, err := s.getValidatedIdentity(peerIdentity) + if err != nil { + mcsLogger.Errorf("Failed getting validated identity from peer identity [%s]", err) + + return err + } + + if len(chainID) == 0 { + // At this stage, this means that peerIdentity + // belongs to this peer's LocalMSP. + // The signature is validated directly + return identity.Verify(message, signature) + } + + // At this stage, the signature must be validated + // against the reader policy of the channel + // identified by chainID + + return s.VerifyByChannel(chainID, peerIdentity, signature, message) +} + +// VerifyByChannel checks that signature is a valid signature of message +// under a peer's verification key, but also in the context of a specific channel. +// If the verification succeeded, Verify returns nil meaning no error occurred. +// If peerIdentity is nil, then the verification fails. +func (s *MSPMessageCryptoService) VerifyByChannel(chainID common.ChannelID, peerIdentity api.PeerIdentityType, signature, message []byte) error { + // Validate arguments + if len(peerIdentity) == 0 { + return errors.New("Invalid Peer Identity. It must be different from nil.") + } + + // Get the policy manager for channel chainID + cpm := s.channelPolicyManagerGetter.Manager(string(chainID)) + if cpm == nil { + return fmt.Errorf("Could not acquire policy manager for channel %s", string(chainID)) + } + mcsLogger.Debugf("Got policy manager for channel [%s]", string(chainID)) + + // Get channel reader policy + policy, flag := cpm.GetPolicy(policies.ChannelApplicationReaders) + mcsLogger.Debugf("Got reader policy for channel [%s] with flag [%t]", string(chainID), flag) + + return policy.EvaluateSignedData( + []*protoutil.SignedData{{ + Data: message, + Identity: []byte(peerIdentity), + Signature: signature, + }}, + ) +} + +func (s *MSPMessageCryptoService) Expiration(peerIdentity api.PeerIdentityType) (time.Time, error) { + id, _, err := s.getValidatedIdentity(peerIdentity) + if err != nil { + return time.Time{}, errors.Wrap(err, "Unable to extract msp.Identity from peer Identity") + } + return id.ExpiresAt(), nil + +} + +func (s *MSPMessageCryptoService) getValidatedIdentity(peerIdentity api.PeerIdentityType) (msp.Identity, common.ChannelID, error) { + // Validate arguments + if len(peerIdentity) == 0 { + return nil, nil, errors.New("Invalid Peer Identity. It must be different from nil.") + } + + sId, err := s.deserializer.Deserialize(peerIdentity) + if err != nil { + mcsLogger.Error("failed deserializing identity", err) + return nil, nil, err + } + + // Notice that peerIdentity is assumed to be the serialization of an identity. + // So, first step is the identity deserialization and then verify it. + + // First check against the local MSP. + // If the peerIdentity is in the same organization of this node then + // the local MSP is required to take the final decision on the validity + // of the signature. + lDes := s.deserializer.GetLocalDeserializer() + identity, err := lDes.DeserializeIdentity([]byte(peerIdentity)) + if err == nil { + // No error means that the local MSP successfully deserialized the identity. + // We now check additional properties. + if err := lDes.IsWellFormed(sId); err != nil { + return nil, nil, errors.Wrap(err, "identity is not well formed") + } + // TODO: The following check will be replaced by a check on the organizational units + // when we allow the gossip network to have organization unit (MSP subdivisions) + // scoped messages. + // The following check is consistent with the SecurityAdvisor#OrgByPeerIdentity + // implementation. + // TODO: Notice that the following check saves us from the fact + // that DeserializeIdentity does not yet enforce MSP-IDs consistency. + // This check can be removed once DeserializeIdentity will be fixed. + if identity.GetMSPIdentifier() == s.deserializer.GetLocalMSPIdentifier() { + // Check identity validity + + // Notice that at this stage we don't have to check the identity + // against any channel's policies. + // This will be done by the caller function, if needed. + return identity, nil, identity.Validate() + } + } + + // Check against managers + for chainID, mspManager := range s.deserializer.GetChannelDeserializers() { + // Deserialize identity + identity, err := mspManager.DeserializeIdentity([]byte(peerIdentity)) + if err != nil { + mcsLogger.Debugf("Failed deserialization identity %s on [%s]: [%s]", peerIdentity, chainID, err) + continue + } + + // We managed deserializing the identity with this MSP manager. Now we check if it's well formed. + if err := mspManager.IsWellFormed(sId); err != nil { + return nil, nil, errors.Wrap(err, "identity is not well formed") + } + + // Check identity validity + // Notice that at this stage we don't have to check the identity + // against any channel's policies. + // This will be done by the caller function, if needed. + + if err := identity.Validate(); err != nil { + mcsLogger.Debugf("Failed validating identity %s on [%s]: [%s]", peerIdentity, chainID, err) + continue + } + + mcsLogger.Debugf("Validation succeeded %s on [%s]", peerIdentity, chainID) + + return identity, common.ChannelID(chainID), nil + } + + return nil, nil, fmt.Errorf("Peer Identity %s cannot be validated. No MSP found able to do that.", peerIdentity) +} +``` + +## `orderer/common/cluster/replication_test.go` (changed lines (133, 134, 142, 143, 144, 324, 446, 447, 448)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package cluster_test + +import ( + "io/ioutil" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric/bccsp/sw" + "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/internal/pkg/comm" + "github.com/hyperledger/fabric/orderer/common/cluster" + "github.com/hyperledger/fabric/orderer/common/cluster/mocks" + "github.com/hyperledger/fabric/orderer/common/localconfig" + "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +func TestIsReplicationNeeded(t *testing.T) { + for _, testCase := range []struct { + name string + bootBlock *common.Block + systemChannelHeight uint64 + systemChannelError error + expectedError string + replicationNeeded bool + }{ + { + name: "no replication needed", + systemChannelHeight: 100, + bootBlock: &common.Block{Header: &common.BlockHeader{Number: 99}}, + }, + { + name: "replication is needed - bootstrap block's index equal to height", + systemChannelHeight: 99, + bootBlock: &common.Block{Header: &common.BlockHeader{Number: 99}}, + replicationNeeded: true, + }, + { + name: "replication is needed - no ledger", + systemChannelHeight: 0, + bootBlock: &common.Block{Header: &common.BlockHeader{Number: 99}}, + replicationNeeded: true, + }, + { + name: "IO error", + systemChannelError: errors.New("IO error"), + expectedError: "IO error", + }, + } { + t.Run(testCase.name, func(t *testing.T) { + ledgerWriter := &mocks.LedgerWriter{} + ledgerWriter.On("Height").Return(testCase.systemChannelHeight) + + ledgerFactory := &mocks.LedgerFactory{} + ledgerFactory.On("GetOrCreate", "system").Return(ledgerWriter, testCase.systemChannelError) + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + Logger: flogging.MustGetLogger("test"), + BootBlock: testCase.bootBlock, + SystemChannel: "system", + LedgerFactory: ledgerFactory, + } + + ok, err := r.IsReplicationNeeded() + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + } else { + assert.NoError(t, err) + assert.Equal(t, testCase.replicationNeeded, ok) + } + }) + } +} + +func TestReplicateChainsFailures(t *testing.T) { + for _, testCase := range []struct { + name string + isProbeResponseDelayed bool + latestBlockSeqInOrderer uint64 + ledgerFactoryError error + appendBlockError error + expectedPanic string + mutateBlocks func([]*common.Block) + channelsReturns []cluster.ChannelGenesisBlock + badResponse *orderer.DeliverResponse + }{ + { + name: "no block received", + expectedPanic: "Failed pulling system channel: " + + "failed obtaining the latest block for channel system", + isProbeResponseDelayed: true, + }, + { + name: "received service unavailable", + expectedPanic: "Failed pulling system channel: " + + "failed obtaining the latest block for channel system", + badResponse: &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Status{ + Status: common.Status_SERVICE_UNAVAILABLE, + }, + }, + }, + { + name: "latest block seq is less than boot block seq", + expectedPanic: "Failed pulling system channel: " + + "latest height found among system channel(system) orderers is 19," + + " but the boot block's sequence is 21", + latestBlockSeqInOrderer: 18, + }, + { + name: "hash chain mismatch", + expectedPanic: "Failed pulling system channel: " + + "block header mismatch on sequence 11, " + + "expected 9cd61b7e9a5ea2d128cc877e5304e7205888175a8032d40b97db7412dca41d9e, got 010203", + latestBlockSeqInOrderer: 21, + mutateBlocks: func(systemChannelBlocks []*common.Block) { + systemChannelBlocks[len(systemChannelBlocks)/2].Header.PreviousHash = []byte{1, 2, 3} + }, + }, + { + name: "last pulled block doesn't match the boot block", + expectedPanic: "Block header mismatch on last system channel block," + + " expected 8ec93b2ef5ffdc302f0c0e24611be04ad2b17b099a1aeafd7cfb76a95923f146," + + " got e428decfc78f8e4c97b26da9c16f9d0b73f886dafa80477a0dd9bac7eb14fe7a", + latestBlockSeqInOrderer: 21, + mutateBlocks: func(systemChannelBlocks []*common.Block) { + systemChannelBlocks[21].Header.DataHash = nil + }, + }, + { + name: "failure in creating ledger", + latestBlockSeqInOrderer: 21, + ledgerFactoryError: errors.New("IO error"), + expectedPanic: "Failed to create a ledger for channel system: IO error", + }, + { + name: "failure in appending a block to the ledger", + latestBlockSeqInOrderer: 21, + appendBlockError: errors.New("IO error"), + expectedPanic: "Failed to write block [0]: IO error", + }, + { + name: "failure pulling the system chain", + latestBlockSeqInOrderer: 21, + expectedPanic: "Failed pulling system channel: " + + "failed obtaining the latest block for channel system", + isProbeResponseDelayed: true, + }, + { + name: "failure obtaining a ledger for a non participating channel", + latestBlockSeqInOrderer: 21, + channelsReturns: []cluster.ChannelGenesisBlock{ + {ChannelName: "channelWeAreNotPartOf"}, + }, + ledgerFactoryError: errors.New("IO error"), + expectedPanic: "Failed to create a ledger for channel channelWeAreNotPartOf: IO error", + }, + } { + t.Run(testCase.name, func(t *testing.T) { + systemChannelBlocks := createBlockChain(0, 21) + if testCase.mutateBlocks != nil { + testCase.mutateBlocks(systemChannelBlocks) + } + + lw := &mocks.LedgerWriter{} + lw.On("Append", mock.Anything).Return(testCase.appendBlockError) + lw.On("Height").Return(uint64(0)) + + lf := &mocks.LedgerFactory{} + lf.On("GetOrCreate", "system").Return(lw, testCase.ledgerFactoryError) + lf.On("GetOrCreate", "channelWeAreNotPartOf").Return(lw, testCase.ledgerFactoryError) + + osn := newClusterNode(t) + defer osn.stop() + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + // Put a big timeout, to reduce chance of flakes when the server gets stuck + // and we get an un-called for timeout. + bp.FetchTimeout = time.Hour + + cl := &mocks.ChannelLister{} + cl.On("Channels").Return(testCase.channelsReturns) + cl.On("Close") + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return cluster.ErrNotInChannel + }, + Logger: flogging.MustGetLogger("test"), + BootBlock: systemChannelBlocks[21], + SystemChannel: "system", + LedgerFactory: lf, + Puller: bp, + ChannelLister: cl, + } + + if len(testCase.channelsReturns) > 0 { + simulateNonParticipantChannelPull(osn) + } + + if testCase.badResponse != nil { + osn.blockResponses <- testCase.badResponse + } + + if !testCase.isProbeResponseDelayed { + osn.enqueueResponse(testCase.latestBlockSeqInOrderer) + osn.enqueueResponse(testCase.latestBlockSeqInOrderer) + } else { + // Send a nil to force an EOF to the client + osn.blockResponses <- nil + } + osn.addExpectProbeAssert() + osn.addExpectProbeAssert() + osn.addExpectPullAssert(0) + + if !testCase.isProbeResponseDelayed { + for _, block := range systemChannelBlocks { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block}, + } + } + } else { + // Send a nil to force an EOF to the client + osn.blockResponses <- nil + } + + assert.PanicsWithValue(t, testCase.expectedPanic, func() { r.ReplicateChains() }) + bp.Close() + dialer.assertAllConnectionsClosed(t) + }) + } +} + +func TestPullChannelFailure(t *testing.T) { + blockchain := createBlockChain(0, 5) + for _, testcase := range []struct { + name string + genesisBlockSequence int + thirdBlockSequence int + }{ + { + name: "Failed to pull genesis block", + genesisBlockSequence: 1, + }, + { + name: "Failed to pull some non genesis block", + genesisBlockSequence: 0, + thirdBlockSequence: 0, + }, + } { + t.Run(testcase.name, func(t *testing.T) { + lw := &mocks.LedgerWriter{} + lw.On("Append", mock.Anything).Return(nil) + lw.On("Height").Return(uint64(0)) + + lf := &mocks.LedgerFactory{} + lf.On("GetOrCreate", "mychannel").Return(lw, nil) + + osn := newClusterNode(t) + defer osn.stop() + + enqueueBlock := func(seq int) { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{ + Block: blockchain[seq], + }, + } + } + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + // Put a big timeout, to reduce chance of flakes when the server gets stuck + // and we get an un-called for timeout. + bp.FetchTimeout = time.Hour + bp.MaxPullBlockRetries = 1 + // Do not buffer blocks in memory + bp.MaxTotalBufferBytes = 1 + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return nil + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + LedgerFactory: lf, + Puller: bp, + } + + osn.addExpectProbeAssert() + enqueueBlock(5) + osn.addExpectProbeAssert() + enqueueBlock(5) + osn.addExpectPullAssert(0) + enqueueBlock(testcase.genesisBlockSequence) + enqueueBlock(1) + enqueueBlock(testcase.thirdBlockSequence) + + err := r.PullChannel("mychannel") + assert.Equal(t, cluster.ErrRetryCountExhausted, err) + }) + } + +} + +func TestPullerConfigFromTopLevelConfig(t *testing.T) { + signer := &mocks.SignerSerializer{} + expected := cluster.PullerConfig{ + Channel: "system", + MaxTotalBufferBytes: 100, + Signer: signer, + TLSCert: []byte{3, 2, 1}, + TLSKey: []byte{1, 2, 3}, + Timeout: time.Hour, + } + + topLevelConfig := &localconfig.TopLevel{ + General: localconfig.General{ + Cluster: localconfig.Cluster{ + ReplicationBufferSize: 100, + RPCTimeout: time.Hour, + }, + }, + } + + config := cluster.PullerConfigFromTopLevelConfig("system", topLevelConfig, []byte{1, 2, 3}, []byte{3, 2, 1}, signer) + assert.Equal(t, expected, config) +} + +func TestReplicateChainsChannelClassificationFailure(t *testing.T) { + // Scenario: We are unable to classify whether we are part of the channel, + // so we crash, because this is a programming error. + + block30WithConfigBlockOf21 := protoutil.NewBlock(30, nil) + block30WithConfigBlockOf21.Metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 21}), + }) + + osn := newClusterNode(t) + defer osn.stop() + osn.blockResponses = make(chan *orderer.DeliverResponse, 1000) + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + bp.FetchTimeout = time.Hour + + channelLister := &mocks.ChannelLister{} + channelLister.On("Channels").Return([]cluster.ChannelGenesisBlock{{ChannelName: "A"}}) + channelLister.On("Close") + + // We probe for the latest block of the orderer + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + + // And now pull it again (first poll and then pull it for real). + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + osn.addExpectPullAssert(30) + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block30WithConfigBlockOf21}, + } + // Now we pull the latest config block extracted from the previous block pulled. + // Beforehand we reconnect to the orderer, so we put an artificial signal to close the stream on the server side, + // in order to expect for a new stream to be established. + osn.blockResponses <- nil + // The orderer's last block's sequence is 30, + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + // And the Replicator now asks for block 21. + osn.enqueueResponse(21) + osn.addExpectPullAssert(21) + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return errors.New("oops") + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + ChannelLister: channelLister, + Puller: bp, + } + + assert.PanicsWithValue(t, "Failed classifying whether I belong to channel A: oops, skipping chain retrieval", func() { + r.ReplicateChains() + }) + + bp.Close() + dialer.assertAllConnectionsClosed(t) +} + +func TestReplicateChainsGreenPath(t *testing.T) { + // Scenario: There are 5 channels in the system: A-E. + // We are in channel A but not in channel B, therefore + // we should pull channel A and then the system channel. + // However, this is not the first attempt of replication for + // our node, but the second. + // In the past, the node pulled 10 blocks of channel A and crashed. + // Therefore, it should pull blocks, but commit for channel A + // only blocks starting from block number 10. + // For channel C - we are forbidden from pulling any blocks. + // Channel D is a deserted channel - all OSNs have left it, + // therefore we should not pull it at all. + // Channel E cannot be pulled at all, due to the OSN being unavailable + // at that time. + + systemChannelBlocks := createBlockChain(0, 21) + block30WithConfigBlockOf21 := protoutil.NewBlock(30, nil) + block30WithConfigBlockOf21.Metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 21}), + }) + + osn := newClusterNode(t) + defer osn.stop() + osn.blockResponses = make(chan *orderer.DeliverResponse, 1000) + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + bp.FetchTimeout = time.Hour + bp.MaxPullBlockRetries = 1 + + channelLister := &mocks.ChannelLister{} + channelLister.On("Channels").Return([]cluster.ChannelGenesisBlock{ + {ChannelName: "E", GenesisBlock: fakeGB}, + {ChannelName: "D", GenesisBlock: fakeGB}, {ChannelName: "C", GenesisBlock: fakeGB}, + {ChannelName: "A", GenesisBlock: fakeGB}, {ChannelName: "B", GenesisBlock: fakeGB}, + }) + channelLister.On("Close") + + amIPartOfChannelMock := &mock.Mock{} + // For channel A + amIPartOfChannelMock.On("func13").Return(nil).Once() + // For channel B + amIPartOfChannelMock.On("func13").Return(cluster.ErrNotInChannel).Once() + + // 22 is for the system channel, and 31 is for channel A, and for channel B we only need 1 block (the GB). + blocksCommittedToLedgerA := make(chan *common.Block, 31) + blocksCommittedToLedgerB := make(chan *common.Block, 1) + blocksCommittedToLedgerC := make(chan *common.Block, 1) + blocksCommittedToLedgerD := make(chan *common.Block, 1) + blocksCommittedToLedgerE := make(chan *common.Block, 1) + blocksCommittedToSystemLedger := make(chan *common.Block, 22) + // Put 10 blocks in the ledger of channel A, to simulate + // that the ledger had blocks when the node started. + for seq := 0; seq < 10; seq++ { + blocksCommittedToLedgerA <- &common.Block{ + Header: &common.BlockHeader{Number: uint64(seq)}, + } + } + + lwA := &mocks.LedgerWriter{} + lwA.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerA <- arg.Get(0).(*common.Block) + }) + lwA.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerA)) + }) + + lwB := &mocks.LedgerWriter{} + lwB.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerB)) + }) + lwB.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerB <- arg.Get(0).(*common.Block) + }) + + lwC := &mocks.LedgerWriter{} + lwC.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerC)) + }) + lwC.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerC <- arg.Get(0).(*common.Block) + }) + + lwD := &mocks.LedgerWriter{} + lwD.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerD)) + }) + lwD.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerD <- arg.Get(0).(*common.Block) + }) + + lwE := &mocks.LedgerWriter{} + lwE.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToLedgerE)) + }) + lwE.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToLedgerE <- arg.Get(0).(*common.Block) + }) + + lwSystem := &mocks.LedgerWriter{} + lwSystem.On("Append", mock.Anything).Return(nil).Run(func(arg mock.Arguments) { + blocksCommittedToSystemLedger <- arg.Get(0).(*common.Block) + }) + lwSystem.On("Height").Return(func() uint64 { + return uint64(len(blocksCommittedToSystemLedger)) + }) + + lf := &mocks.LedgerFactory{} + lf.On("Close") + lf.On("GetOrCreate", "A").Return(lwA, nil) + lf.On("GetOrCreate", "B").Return(lwB, nil) + lf.On("GetOrCreate", "C").Return(lwC, nil) + lf.On("GetOrCreate", "D").Return(lwD, nil) + lf.On("GetOrCreate", "E").Return(lwE, nil) + lf.On("GetOrCreate", "system").Return(lwSystem, nil) + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + LedgerFactory: lf, + AmIPartOfChannel: func(configBlock *common.Block) error { + return amIPartOfChannelMock.Called().Error(0) + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + ChannelLister: channelLister, + Puller: bp, + BootBlock: systemChannelBlocks[21], + } + + // The first thing the orderer gets is a seek to channel E. + // Unfortunately, it's not available! + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "E", actualChannel) + } + // Send an EOF down the stream. + osn.blockResponses <- nil + + // The second thing the orderer gets is a seek to channel D, + // which is followed by a response of service unavailable + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "D", actualChannel) + } + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Status{ + Status: common.Status_SERVICE_UNAVAILABLE, + }, + } + + // The third thing the orderer gets is a seek to channel C, + // which is followed by a response of forbidden + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "C", actualChannel) + } + + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Status{ + Status: common.Status_FORBIDDEN, + }, + } + + for _, channel := range []string{"A", "B"} { + channel := channel + // First, the orderer needs to figure out whether it is in the channel, + // so it reaches to find the latest block from all orderers to get + // the latest config block and see whether it is among the consenters. + + // Orderer is expecting a poll for last block of the current channel + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, channel, actualChannel) + } + + // Orderer returns its last block is 30. + // This is needed to get the latest height by comparing among all orderers. + osn.enqueueResponse(30) + + // First we poll for the block sequence we got previously again, from some orderer. + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + + // And afterwards pull the block from the first orderer. + osn.addExpectPullAssert(30) + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block30WithConfigBlockOf21}, + } + // And the last config block is pulled via reconnecting to the orderer. + osn.blockResponses <- nil + // The orderer's last block's sequence is 30, + osn.addExpectProbeAssert() + osn.enqueueResponse(30) + // And the Replicator now asks for block 21. + osn.enqueueResponse(21) + osn.addExpectPullAssert(21) + // We always close the connection before attempting to pull the next block + osn.blockResponses <- nil + } + + // Next, the Replicator figures out the latest block sequence for that chain + // to know until when to pull + + // We expect a probe for channel A only, because channel B isn't in the channel + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the right channel + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "A", actualChannel) + } + osn.enqueueResponse(30) + // From this point onwards, we pull the blocks for the chain. + osn.enqueueResponse(30) + osn.addExpectProbeAssert() + osn.addExpectPullAssert(10) + // Enqueue 31 blocks in its belly + for _, block := range createBlockChain(10, 30) { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block}, + } + } + // Signal the orderer to stop sending us blocks since we're going to reconnect + // to it to ask for the next channel + osn.blockResponses <- nil + + // Now we define assertions for the system channel + // Pull assertions for the system channel + osn.seekAssertions <- func(info *orderer.SeekInfo, actualChannel string) { + // Ensure the seek came to the system channel. + assert.NotNil(osn.t, info.GetStart().GetNewest()) + assert.Equal(t, "system", actualChannel) + } + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: systemChannelBlocks[21]}, + } + osn.addExpectProbeAssert() + osn.enqueueResponse(21) + osn.addExpectPullAssert(0) + for _, block := range systemChannelBlocks { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: block}, + } + } + + // This is where all the work is done. + // The above lines were all assertions and preparations + // for the expected flow of the test. + r.ReplicateChains() + + // We replicated the chains, so all that left is to ensure + // the blocks were committed in order, and all blocks we expected + // to be committed (for channel A and the system channel) were committed. + close(blocksCommittedToLedgerA) + close(blocksCommittedToSystemLedger) + assert.Len(t, blocksCommittedToLedgerA, cap(blocksCommittedToLedgerA)) + assert.Len(t, blocksCommittedToSystemLedger, cap(blocksCommittedToSystemLedger)) + assert.Len(t, blocksCommittedToLedgerB, 1) + assert.Len(t, blocksCommittedToLedgerC, 1) + assert.Len(t, blocksCommittedToLedgerD, 1) + assert.Len(t, blocksCommittedToLedgerE, 1) + // Count the blocks for channel A + var expectedSequence uint64 + for block := range blocksCommittedToLedgerA { + assert.Equal(t, expectedSequence, block.Header.Number) + expectedSequence++ + } + + // Count the blocks for the system channel + expectedSequence = uint64(0) + for block := range blocksCommittedToSystemLedger { + assert.Equal(t, expectedSequence, block.Header.Number) + expectedSequence++ + } + + bp.Close() + dialer.assertAllConnectionsClosed(t) +} + +func TestParticipant(t *testing.T) { + for _, testCase := range []struct { + name string + heightsByEndpoints map[string]uint64 + heightsByEndpointsErr error + latestBlockSeq uint64 + latestBlock *common.Block + latestConfigBlockSeq uint64 + latestConfigBlock *common.Block + expectedError string + predicateReturns error + }{ + { + name: "No available orderer", + expectedError: cluster.ErrRetryCountExhausted.Error(), + }, + { + name: "Unauthorized for the channel", + expectedError: cluster.ErrForbidden.Error(), + heightsByEndpointsErr: cluster.ErrForbidden, + }, + { + name: "No OSN services the channel", + expectedError: cluster.ErrServiceUnavailable.Error(), + heightsByEndpointsErr: cluster.ErrServiceUnavailable, + }, + { + name: "Pulled block has no metadata", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{}, + expectedError: "failed to retrieve metadata: no metadata in block", + }, + { + name: "Pulled block has no last config sequence in metadata", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: nil, + }, + }, + expectedError: "failed to retrieve metadata: no metadata at index [SIGNATURES]", + }, + { + name: "Pulled block's SIGNATURES metadata is malformed", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{1, 2, 3}}, + }, + }, + expectedError: "failed to retrieve metadata: error unmarshaling metadata" + + " at index [SIGNATURES]: proto: common.Metadata: illegal tag 0 (wire type 1)", + }, + { + name: "Pulled block's LAST_CONFIG metadata is malformed", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, {1, 2, 3}}, + }, + }, + expectedError: "failed to retrieve metadata: error unmarshaling metadata" + + " at index [LAST_CONFIG]: proto: common.Metadata: illegal tag 0 (wire type 1)", + }, + { + name: "Pulled block's metadata is valid and has a last config", + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.OrdererBlockMetadata{ + LastConfig: &common.LastConfig{Index: 42}, + }), + })}, + }, + }, + latestConfigBlockSeq: 42, + latestConfigBlock: &common.Block{Header: &common.BlockHeader{Number: 42}}, + predicateReturns: cluster.ErrNotInChannel, + }, + { + name: "Failed pulling last block", + expectedError: cluster.ErrRetryCountExhausted.Error(), + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: nil, + }, + { + name: "Failed pulling last config block", + expectedError: cluster.ErrRetryCountExhausted.Error(), + heightsByEndpoints: map[string]uint64{ + "orderer.example.com:7050": 100, + }, + latestBlockSeq: uint64(99), + latestBlock: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.OrdererBlockMetadata{ + LastConfig: &common.LastConfig{Index: 42}, + }), + })}, + }, + }, + latestConfigBlockSeq: 42, + latestConfigBlock: nil, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + configBlocks := make(chan *common.Block, 1) + predicate := func(configBlock *common.Block) error { + configBlocks <- configBlock + return testCase.predicateReturns + } + puller := &mocks.ChainPuller{} + puller.On("HeightsByEndpoints").Return(testCase.heightsByEndpoints, testCase.heightsByEndpointsErr) + puller.On("PullBlock", testCase.latestBlockSeq).Return(testCase.latestBlock) + puller.On("PullBlock", testCase.latestConfigBlockSeq).Return(testCase.latestConfigBlock) + puller.On("Close") + + err := cluster.Participant(puller, predicate) + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + assert.Len(t, configBlocks, 0) + } else { + assert.Len(t, configBlocks, 1) + assert.Equal(t, testCase.predicateReturns, err) + } + }) + } +} + +func TestBlockPullerFromConfigBlockFailures(t *testing.T) { + blockBytes, err := ioutil.ReadFile("testdata/mychannel.block") + assert.NoError(t, err) + + validBlock := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, validBlock)) + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + for _, testCase := range []struct { + name string + expectedErr string + pullerConfig cluster.PullerConfig + block *common.Block + }{ + { + name: "nil block", + expectedErr: "nil block", + }, + { + name: "invalid block", + expectedErr: "block data is nil", + block: &common.Block{}, + }, + { + name: "bad envelope inside block", + expectedErr: "failed extracting bundle from envelope: " + + "failed to unmarshal payload from envelope: " + + "error unmarshaling Payload: " + + "proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + })}, + }, + }, + }, + { + name: "invalid TLS certificate", + expectedErr: "unable to decode TLS certificate PEM: ////", + block: validBlock, + pullerConfig: cluster.PullerConfig{ + TLSCert: []byte{255, 255, 255}, + }, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + verifierRetriever := &mocks.VerifierRetriever{} + verifierRetriever.On("RetrieveVerifier", mock.Anything).Return(&cluster.NoopBlockVerifier{}) + bp, err := cluster.BlockPullerFromConfigBlock(testCase.pullerConfig, testCase.block, verifierRetriever, cryptoProvider) + assert.EqualError(t, err, testCase.expectedErr) + assert.Nil(t, bp) + }) + } +} + +func testBlockPullerFromConfig(t *testing.T, blockVerifiers []cluster.BlockVerifier, expectedLogMsg string, iterations int) { + verifierRetriever := &mocks.VerifierRetriever{} + for _, blockVerifier := range blockVerifiers { + verifierRetriever.On("RetrieveVerifier", mock.Anything).Return(blockVerifier).Once() + } + + caCert, err := ioutil.ReadFile(filepath.Join("testdata", "ca.crt")) + assert.NoError(t, err) + + tlsCert, err := ioutil.ReadFile(filepath.Join("testdata", "server.crt")) + assert.NoError(t, err) + + tlsKey, err := ioutil.ReadFile(filepath.Join("testdata", "server.key")) + assert.NoError(t, err) + + osn := newClusterNode(t) + osn.srv.Stop() + // Replace the gRPC server with a TLS one + osn.srv, err = comm.NewGRPCServer("127.0.0.1:0", comm.ServerConfig{ + SecOpts: comm.SecureOptions{ + Key: tlsKey, + RequireClientCert: true, + Certificate: tlsCert, + ClientRootCAs: [][]byte{caCert}, + UseTLS: true, + }, + }) + assert.NoError(t, err) + orderer.RegisterAtomicBroadcastServer(osn.srv.Server(), osn) + // And start it + go osn.srv.Start() + defer osn.stop() + + // Start from a valid configuration block + blockBytes, err := ioutil.ReadFile(filepath.Join("testdata", "mychannel.block")) + assert.NoError(t, err) + + validBlock := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, validBlock)) + + // And inject into it a 127.0.0.1 orderer endpoint endpoint and a new TLS CA certificate. + injectTLSCACert(t, validBlock, caCert) + injectGlobalOrdererEndpoint(t, validBlock, osn.srv.Address()) + validBlock.Header.DataHash = protoutil.BlockDataHash(validBlock.Data) + + for attempt := 0; attempt < iterations; attempt++ { + blockMsg := &orderer.DeliverResponse_Block{ + Block: validBlock, + } + + osn.blockResponses <- &orderer.DeliverResponse{ + Type: blockMsg, + } + + osn.blockResponses <- &orderer.DeliverResponse{ + Type: blockMsg, + } + + osn.blockResponses <- nil + + osn.addExpectProbeAssert() + osn.addExpectPullAssert(0) + } + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + bp, err := cluster.BlockPullerFromConfigBlock(cluster.PullerConfig{ + TLSCert: tlsCert, + TLSKey: tlsKey, + MaxTotalBufferBytes: 1, + Channel: "mychannel", + Signer: &mocks.SignerSerializer{}, + Timeout: time.Hour, + }, validBlock, verifierRetriever, cryptoProvider) + bp.RetryTimeout = time.Millisecond * 10 + assert.NoError(t, err) + defer bp.Close() + + var seenExpectedLogMsg bool + + bp.Logger = bp.Logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + if strings.Contains(entry.Message, expectedLogMsg) { + seenExpectedLogMsg = true + } + return nil + })) + + block := bp.PullBlock(0) + assert.Equal(t, uint64(0), block.Header.Number) + assert.True(t, seenExpectedLogMsg) +} + +func TestSkipPullingPulledChannels(t *testing.T) { + blockchain := createBlockChain(0, 5) + lw := &mocks.LedgerWriter{} + lw.On("Height").Return(uint64(6)) + + lf := &mocks.LedgerFactory{} + lf.On("GetOrCreate", "mychannel").Return(lw, nil) + + osn := newClusterNode(t) + defer osn.stop() + + enqueueBlock := func(seq int) { + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{ + Block: blockchain[seq], + }, + } + } + + dialer := newCountingDialer() + bp := newBlockPuller(dialer, osn.srv.Address()) + bp.FetchTimeout = time.Hour + + r := cluster.Replicator{ + Filter: cluster.AnyChannel, + AmIPartOfChannel: func(configBlock *common.Block) error { + return nil + }, + Logger: flogging.MustGetLogger("test"), + SystemChannel: "system", + LedgerFactory: lf, + Puller: bp, + } + + var detectedChannelPulled bool + r.Logger = r.Logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + if strings.Contains(entry.Message, "Latest height found (6) is equal to our height, skipping pulling channel mychannel") { + detectedChannelPulled = true + } + return nil + })) + + osn.addExpectProbeAssert() + enqueueBlock(5) + osn.addExpectProbeAssert() + enqueueBlock(5) + + err := r.PullChannel("mychannel") + assert.NoError(t, err) + assert.True(t, detectedChannelPulled) +} + +func TestBlockPullerFromConfigBlockGreenPath(t *testing.T) { + for _, testCase := range []struct { + description string + blockVerifiers []cluster.BlockVerifier + expectedLogMessage string + iterations int + }{ + { + description: "Success", + blockVerifiers: []cluster.BlockVerifier{&cluster.NoopBlockVerifier{}}, + expectedLogMessage: "Got block [0] of size", + iterations: 1, + }, + { + description: "Failure", + iterations: 2, + // First time it returns nil, second time returns like the success case + blockVerifiers: []cluster.BlockVerifier{nil, &cluster.NoopBlockVerifier{}}, + expectedLogMessage: "Failed verifying received blocks: " + + "couldn't acquire verifier for channel mychannel", + }, + } { + t.Run(testCase.description, func(t *testing.T) { + testBlockPullerFromConfig(t, testCase.blockVerifiers, + testCase.expectedLogMessage, testCase.iterations) + }) + } +} + +func TestNoopBlockVerifier(t *testing.T) { + v := &cluster.NoopBlockVerifier{} + assert.Nil(t, v.VerifyBlockSignature(nil, nil)) +} + +func injectGlobalOrdererEndpoint(t *testing.T, block *common.Block, endpoint string) { + ordererAddresses := channelconfig.OrdererAddressesValue([]string{endpoint}) + // Unwrap the layers until we reach the orderer addresses + env, err := protoutil.ExtractEnvelope(block, 0) + assert.NoError(t, err) + payload, err := protoutil.UnmarshalPayload(env.Payload) + assert.NoError(t, err) + confEnv, err := configtx.UnmarshalConfigEnvelope(payload.Data) + assert.NoError(t, err) + // Replace the orderer addresses + confEnv.Config.ChannelGroup.Values[ordererAddresses.Key()] = &common.ConfigValue{ + Value: protoutil.MarshalOrPanic(ordererAddresses.Value()), + ModPolicy: "/Channel/Orderer/Admins", + } + // Remove the per org addresses, if applicable + ordererGrps := confEnv.Config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups + for _, grp := range ordererGrps { + if grp.Values[channelconfig.EndpointsKey] == nil { + continue + } + grp.Values[channelconfig.EndpointsKey].Value = nil + } + // And put it back into the block + payload.Data = protoutil.MarshalOrPanic(confEnv) + env.Payload = protoutil.MarshalOrPanic(payload) + block.Data.Data[0] = protoutil.MarshalOrPanic(env) +} + +func injectTLSCACert(t *testing.T, block *common.Block, tlsCA []byte) { + // Unwrap the layers until we reach the TLS CA certificates + env, err := protoutil.ExtractEnvelope(block, 0) + assert.NoError(t, err) + payload, err := protoutil.UnmarshalPayload(env.Payload) + assert.NoError(t, err) + confEnv, err := configtx.UnmarshalConfigEnvelope(payload.Data) + assert.NoError(t, err) + mspKey := confEnv.Config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups["OrdererOrg"].Values[channelconfig.MSPKey] + rawMSPConfig := mspKey.Value + mspConf := &msp.MSPConfig{} + proto.Unmarshal(rawMSPConfig, mspConf) + fabricMSPConf := &msp.FabricMSPConfig{} + proto.Unmarshal(mspConf.Config, fabricMSPConf) + // Replace the TLS root certs with the given ones + fabricMSPConf.TlsRootCerts = [][]byte{tlsCA} + // And put it back into the block + mspConf.Config = protoutil.MarshalOrPanic(fabricMSPConf) + mspKey.Value = protoutil.MarshalOrPanic(mspConf) + payload.Data = protoutil.MarshalOrPanic(confEnv) + env.Payload = protoutil.MarshalOrPanic(payload) + block.Data.Data[0] = protoutil.MarshalOrPanic(env) +} + +func TestExtractGenesisBlock(t *testing.T) { + for _, testCase := range []struct { + name string + expectedErr string + returnedName string + block *common.Block + returnGenesisBlock bool + }{ + { + name: "nil block", + expectedErr: "nil block", + }, + { + name: "no data section in block", + expectedErr: "block data is nil", + block: &common.Block{}, + }, + { + name: "corrupt envelope in block", + expectedErr: "block data does not carry an" + + " envelope at index 0: error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{{1, 2, 3}}, + }, + }, + }, + { + name: "corrupt payload in envelope", + expectedErr: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + })}, + }, + }, + }, + { + name: "no header in block", + expectedErr: "nil header in payload", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{}), + })}, + }, + }, + }, + { + name: "corrupt channel header", + expectedErr: "error unmarshaling ChannelHeader:" + + " proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: []byte{1, 2, 3}, + }, + }), + })}, + }, + }, + }, + { + name: "not an orderer transaction", + expectedErr: "", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG_UPDATE), + }), + }, + }), + })}, + }, + }, + }, + { + name: "orderer transaction with corrupt inner envelope", + expectedErr: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: []byte{1, 2, 3}, + }), + })}, + }, + }, + }, + { + name: "orderer transaction with corrupt inner payload", + expectedErr: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction with nil inner header", + expectedErr: "inner payload's header is nil", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{}), + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction with corrupt inner channel header", + expectedErr: "error unmarshaling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: []byte{1, 2, 3}, + }, + }), + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction that is not a config, but a config update", + expectedErr: "", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG_UPDATE), + }), + }, + }), + }), + }), + })}, + }, + }, + }, + { + expectedErr: "", + name: "orderer transaction that is a system channel config block", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + ChannelId: "systemChannel", + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + ChannelId: "systemChannel", + }), + }, + }), + }), + }), + })}, + }, + }, + }, + { + name: "orderer transaction that creates a new application channel", + expectedErr: "", + returnedName: "notSystemChannel", + block: &common.Block{ + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + ChannelId: "systemChannel", + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + ChannelId: "notSystemChannel", + }), + }, + }), + }), + }), + })}, + }, + }, + returnGenesisBlock: true, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + channelName, gb, err := cluster.ExtractGenesisBlock(flogging.MustGetLogger("test"), testCase.block) + if testCase.expectedErr != "" { + assert.EqualError(t, err, testCase.expectedErr) + } else { + assert.NoError(t, err) + } + assert.Equal(t, testCase.returnedName, channelName) + if testCase.returnGenesisBlock { + assert.NotNil(t, gb) + } else { + assert.Nil(t, gb) + } + }) + } +} + +func TestChannels(t *testing.T) { + makeBlock := func(outerChannelName, innerChannelName string) *common.Block { + return &common.Block{ + Header: &common.BlockHeader{}, + Data: &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + ChannelId: outerChannelName, + Type: int32(common.HeaderType_ORDERER_TRANSACTION), + }), + }, + Data: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + ChannelId: innerChannelName, + }), + }, + }), + }), + }), + })}, + }, + } + } + + for _, testCase := range []struct { + name string + prepareSystemChain func(systemChain []*common.Block) + assertion func(t *testing.T, ci *cluster.ChainInspector) + }{ + { + name: "happy path - artificial blocks", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + actual := cluster.GenesisBlocks(ci.Channels()) + // Assert that the returned channels are returned in any order + assert.Contains(t, [][]string{{"mychannel", "mychannel2"}, {"mychannel2", "mychannel"}}, actual.Names()) + }, + }, + { + name: "happy path - one block is not artificial but real", + prepareSystemChain: func(systemChain []*common.Block) { + blockbytes, err := ioutil.ReadFile(filepath.Join("testdata", "block3.pb")) + assert.NoError(t, err) + block := &common.Block{} + err = proto.Unmarshal(blockbytes, block) + assert.NoError(t, err) + + systemChain[len(systemChain)/2-1] = block + assignHashes(systemChain) + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + actual := cluster.GenesisBlocks(ci.Channels()) + // Assert that the returned channels are returned in any order + assert.Contains(t, [][]string{{"mychannel2", "bar"}, {"bar", "mychannel2"}}, actual.Names()) + }, + }, + { + name: "bad path - pulled chain's last block hash doesn't match the last config block", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + systemChain[len(systemChain)-1].Header.PreviousHash = nil + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "System channel pulled doesn't match the boot last config block:" + + " block [2]'s hash (bc4ef5cc8a61ac0747cc82df58bac9ad3278622c1cfc7a119b9b1068e422c9f1)" + + " mismatches block [3]'s prev block hash ()" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + { + name: "bad path - hash chain mismatch", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + systemChain[len(systemChain)-2].Header.PreviousHash = nil + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "Claimed previous hash of block [2] is but actual previous " + + "hash is 920faeb0bd8a02b3f2553247359fb3b684819c75c6e5487bc7eed632841ddc5f" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + { + name: "bad path - a block cannot be classified", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + systemChain[len(systemChain)-2].Data.Data = [][]byte{{1, 2, 3}} + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "Failed extracting channel genesis block from config block: " + + "block data does not carry an envelope at index 0: error unmarshaling " + + "Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + { + name: "bad path - failed pulling blocks", + prepareSystemChain: func(systemChain []*common.Block) { + assignHashes(systemChain) + // Setting a block to nil makes the block puller return nil, + // which signals failure of pulling a block. + systemChain[len(systemChain)/2] = nil + }, + assertion: func(t *testing.T, ci *cluster.ChainInspector) { + panicValue := "Failed pulling block [2] from the system channel" + assert.PanicsWithValue(t, panicValue, func() { + ci.Channels() + }) + }, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + systemChain := []*common.Block{ + makeBlock("systemChannel", "systemChannel"), + makeBlock("systemChannel", "mychannel"), + makeBlock("systemChannel", "mychannel2"), + makeBlock("systemChannel", "systemChannel"), + } + + for i := 0; i < len(systemChain); i++ { + systemChain[i].Header.DataHash = protoutil.BlockDataHash(systemChain[i].Data) + systemChain[i].Header.Number = uint64(i) + } + testCase.prepareSystemChain(systemChain) + puller := &mocks.ChainPuller{} + puller.On("Close") + for seq := uint64(0); int(seq) < len(systemChain)-1; seq++ { + puller.On("PullBlock", seq).Return(systemChain[int(seq)]) + } + + ci := &cluster.ChainInspector{ + Logger: flogging.MustGetLogger("test"), + Puller: puller, + LastConfigBlock: systemChain[len(systemChain)-1], + } + defer puller.AssertNumberOfCalls(t, "Close", 1) + defer ci.Close() + testCase.assertion(t, ci) + }) + } +} + +var fakeGB = &common.Block{ + Header: &common.BlockHeader{}, + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, {}, {}, {}}, + }, + Data: &common.BlockData{ + Data: [][]byte{ + protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Config{ + Sequence: 1, + }), + }), + }), + }, + }, +} + +func simulateNonParticipantChannelPull(osn *deliverServer) { + lastBlock := protoutil.NewBlock(1, nil) + lastBlock.Metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 0}), + }) + // We first present a channel with a last block of 'lastBlock', that points to + // the genesis block + osn.addExpectProbeAssert() + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: lastBlock}, + } + osn.addExpectProbeAssert() + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: lastBlock}, + } + osn.addExpectPullAssert(1) + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: lastBlock}, + } + osn.blockResponses <- nil + + // and make it send back the genesis block. + // First send is for probing, + osn.addExpectProbeAssert() + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: fakeGB}, + } + osn.addExpectPullAssert(0) + // and the second one sends the actual block itself downstream + osn.blockResponses <- &orderer.DeliverResponse{ + Type: &orderer.DeliverResponse_Block{Block: fakeGB}, + } + + osn.blockResponses <- nil +} + +func TestFilter(t *testing.T) { + logger := flogging.MustGetLogger("test") + logger = logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + assert.Equal(t, "Channel foo shouldn't be pulled. Skipping it", entry.Message) + return nil + })) + + r := &cluster.Replicator{ + Filter: func(_ string) bool { + return false + }, + Logger: logger, + } + assert.Equal(t, cluster.ErrSkipped, r.PullChannel("foo")) +} +``` + +## `orderer/common/cluster/util.go` (changed lines (321,)) + +```go +/* +Copyright IBM Corp. 2017 All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package cluster + +import ( + "bytes" + "crypto/tls" + "crypto/x509" + "encoding/hex" + "encoding/json" + "encoding/pem" + "fmt" + "math/rand" + "sync" + "sync/atomic" + "time" + + "github.com/hyperledger/fabric-config/protolator" + "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric/bccsp" + "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/common/util" + "github.com/hyperledger/fabric/internal/pkg/comm" + "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" + "google.golang.org/grpc" +) + +// ConnByCertMap maps certificates represented as strings +// to gRPC connections +type ConnByCertMap map[string]*grpc.ClientConn + +// Lookup looks up a certificate and returns the connection that was mapped +// to the certificate, and whether it was found or not +func (cbc ConnByCertMap) Lookup(cert []byte) (*grpc.ClientConn, bool) { + conn, ok := cbc[string(cert)] + return conn, ok +} + +// Put associates the given connection to the certificate +func (cbc ConnByCertMap) Put(cert []byte, conn *grpc.ClientConn) { + cbc[string(cert)] = conn +} + +// Remove removes the connection that is associated to the given certificate +func (cbc ConnByCertMap) Remove(cert []byte) { + delete(cbc, string(cert)) +} + +// Size returns the size of the connections by certificate mapping +func (cbc ConnByCertMap) Size() int { + return len(cbc) +} + +// CertificateComparator returns whether some relation holds for two given certificates +type CertificateComparator func([]byte, []byte) bool + +// MemberMapping defines NetworkMembers by their ID +// and enables to lookup stubs by a certificate +type MemberMapping struct { + id2stub map[uint64]*Stub + SamePublicKey CertificateComparator +} + +// Foreach applies the given function on all stubs in the mapping +func (mp *MemberMapping) Foreach(f func(id uint64, stub *Stub)) { + for id, stub := range mp.id2stub { + f(id, stub) + } +} + +// Put inserts the given stub to the MemberMapping +func (mp *MemberMapping) Put(stub *Stub) { + mp.id2stub[stub.ID] = stub +} + +// Remove removes the stub with the given ID from the MemberMapping +func (mp *MemberMapping) Remove(ID uint64) { + delete(mp.id2stub, ID) +} + +// ByID retrieves the Stub with the given ID from the MemberMapping +func (mp MemberMapping) ByID(ID uint64) *Stub { + return mp.id2stub[ID] +} + +// LookupByClientCert retrieves a Stub with the given client certificate +func (mp MemberMapping) LookupByClientCert(cert []byte) *Stub { + for _, stub := range mp.id2stub { + if mp.SamePublicKey(stub.ClientTLSCert, cert) { + return stub + } + } + return nil +} + +// ServerCertificates returns a set of the server certificates +// represented as strings +func (mp MemberMapping) ServerCertificates() StringSet { + res := make(StringSet) + for _, member := range mp.id2stub { + res[string(member.ServerTLSCert)] = struct{}{} + } + return res +} + +// StringSet is a set of strings +type StringSet map[string]struct{} + +// union adds the elements of the given set to the StringSet +func (ss StringSet) union(set StringSet) { + for k := range set { + ss[k] = struct{}{} + } +} + +// subtract removes all elements in the given set from the StringSet +func (ss StringSet) subtract(set StringSet) { + for k := range set { + delete(ss, k) + } +} + +// PredicateDialer creates gRPC connections +// that are only established if the given predicate +// is fulfilled +type PredicateDialer struct { + lock sync.RWMutex + Config comm.ClientConfig +} + +func (dialer *PredicateDialer) UpdateRootCAs(serverRootCAs [][]byte) { + dialer.lock.Lock() + defer dialer.lock.Unlock() + dialer.Config.SecOpts.ServerRootCAs = serverRootCAs +} + +// Dial creates a new gRPC connection that can only be established, if the remote node's +// certificate chain satisfy verifyFunc +func (dialer *PredicateDialer) Dial(address string, verifyFunc RemoteVerifier) (*grpc.ClientConn, error) { + dialer.lock.RLock() + cfg := dialer.Config.Clone() + dialer.lock.RUnlock() + + cfg.SecOpts.VerifyCertificate = verifyFunc + client, err := comm.NewGRPCClient(cfg) + if err != nil { + return nil, errors.WithStack(err) + } + return client.NewConnection(address, func(tlsConfig *tls.Config) { + // We need to dynamically overwrite the TLS root CAs, + // as they may be updated. + dialer.lock.RLock() + serverRootCAs := dialer.Config.Clone().SecOpts.ServerRootCAs + dialer.lock.RUnlock() + + tlsConfig.RootCAs = x509.NewCertPool() + for _, pem := range serverRootCAs { + tlsConfig.RootCAs.AppendCertsFromPEM(pem) + } + }) +} + +// DERtoPEM returns a PEM representation of the DER +// encoded certificate +func DERtoPEM(der []byte) string { + return string(pem.EncodeToMemory(&pem.Block{ + Type: "CERTIFICATE", + Bytes: der, + })) +} + +// StandardDialer wraps an ClientConfig, and provides +// a means to connect according to given EndpointCriteria. +type StandardDialer struct { + Config comm.ClientConfig +} + +// Dial dials an address according to the given EndpointCriteria +func (dialer *StandardDialer) Dial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error) { + cfg := dialer.Config.Clone() + cfg.SecOpts.ServerRootCAs = endpointCriteria.TLSRootCAs + + client, err := comm.NewGRPCClient(cfg) + if err != nil { + return nil, errors.Wrap(err, "failed creating gRPC client") + } + + return client.NewConnection(endpointCriteria.Endpoint) +} + +//go:generate mockery -dir . -name BlockVerifier -case underscore -output ./mocks/ + +// BlockVerifier verifies block signatures. +type BlockVerifier interface { + // VerifyBlockSignature verifies a signature of a block. + // It has an optional argument of a configuration envelope + // which would make the block verification to use validation rules + // based on the given configuration in the ConfigEnvelope. + // If the config envelope passed is nil, then the validation rules used + // are the ones that were applied at commit of previous blocks. + VerifyBlockSignature(sd []*protoutil.SignedData, config *common.ConfigEnvelope) error +} + +// BlockSequenceVerifier verifies that the given consecutive sequence +// of blocks is valid. +type BlockSequenceVerifier func(blocks []*common.Block, channel string) error + +// Dialer creates a gRPC connection to a remote address +type Dialer interface { + Dial(endpointCriteria EndpointCriteria) (*grpc.ClientConn, error) +} + +// VerifyBlocks verifies the given consecutive sequence of blocks is valid, +// and returns nil if it's valid, else an error. +func VerifyBlocks(blockBuff []*common.Block, signatureVerifier BlockVerifier) error { + if len(blockBuff) == 0 { + return errors.New("buffer is empty") + } + // First, we verify that the block hash in every block is: + // Equal to the hash in the header + // Equal to the previous hash in the succeeding block + for i := range blockBuff { + if err := VerifyBlockHash(i, blockBuff); err != nil { + return err + } + } + + var config *common.ConfigEnvelope + var isLastBlockConfigBlock bool + // Verify all configuration blocks that are found inside the block batch, + // with the configuration that was committed (nil) or with one that is picked up + // during iteration over the block batch. + for _, block := range blockBuff { + configFromBlock, err := ConfigFromBlock(block) + if err == errNotAConfig { + isLastBlockConfigBlock = false + continue + } + if err != nil { + return err + } + // The block is a configuration block, so verify it + if err := VerifyBlockSignature(block, signatureVerifier, config); err != nil { + return err + } + config = configFromBlock + isLastBlockConfigBlock = true + } + + // Verify the last block's signature + lastBlock := blockBuff[len(blockBuff)-1] + + // If last block is a config block, we verified it using the policy of the previous block, so it's valid. + if isLastBlockConfigBlock { + return nil + } + + return VerifyBlockSignature(lastBlock, signatureVerifier, config) +} + +var errNotAConfig = errors.New("not a config block") + +// ConfigFromBlock returns a ConfigEnvelope if exists, or a *NotAConfigBlock error. +// It may also return some other error in case parsing failed. +func ConfigFromBlock(block *common.Block) (*common.ConfigEnvelope, error) { + if block == nil || block.Data == nil || len(block.Data.Data) == 0 { + return nil, errors.New("empty block") + } + txn := block.Data.Data[0] + env, err := protoutil.GetEnvelopeFromBlock(txn) + if err != nil { + return nil, errors.WithStack(err) + } + payload, err := protoutil.UnmarshalPayload(env.Payload) + if err != nil { + return nil, errors.WithStack(err) + } + if block.Header.Number == 0 { + configEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data) + if err != nil { + return nil, errors.Wrap(err, "invalid config envelope") + } + return configEnvelope, nil + } + if payload.Header == nil { + return nil, errors.New("nil header in payload") + } + chdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return nil, errors.WithStack(err) + } + if common.HeaderType(chdr.Type) != common.HeaderType_CONFIG { + return nil, errNotAConfig + } + configEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data) + if err != nil { + return nil, errors.Wrap(err, "invalid config envelope") + } + return configEnvelope, nil +} + +// VerifyBlockHash verifies the hash chain of the block with the given index +// among the blocks of the given block buffer. +func VerifyBlockHash(indexInBuffer int, blockBuff []*common.Block) error { + if len(blockBuff) <= indexInBuffer { + return errors.Errorf("index %d out of bounds (total %d blocks)", indexInBuffer, len(blockBuff)) + } + block := blockBuff[indexInBuffer] + if block.Header == nil { + return errors.New("missing block header") + } + seq := block.Header.Number + dataHash := protoutil.BlockDataHash(block.Data) + // Verify data hash matches the hash in the header + if !bytes.Equal(dataHash, block.Header.DataHash) { + computedHash := hex.EncodeToString(dataHash) + claimedHash := hex.EncodeToString(block.Header.DataHash) + return errors.Errorf("computed hash of block (%d) (%s) doesn't match claimed hash (%s)", + seq, computedHash, claimedHash) + } + // We have a previous block in the buffer, ensure current block's previous hash matches the previous one. + if indexInBuffer > 0 { + prevBlock := blockBuff[indexInBuffer-1] + currSeq := block.Header.Number + if prevBlock.Header == nil { + return errors.New("previous block header is nil") + } + prevSeq := prevBlock.Header.Number + if prevSeq+1 != currSeq { + return errors.Errorf("sequences %d and %d were received consecutively", prevSeq, currSeq) + } + if !bytes.Equal(block.Header.PreviousHash, protoutil.BlockHeaderHash(prevBlock.Header)) { + claimedPrevHash := hex.EncodeToString(block.Header.PreviousHash) + actualPrevHash := hex.EncodeToString(protoutil.BlockHeaderHash(prevBlock.Header)) + return errors.Errorf("block [%d]'s hash (%s) mismatches block [%d]'s prev block hash (%s)", + prevSeq, actualPrevHash, currSeq, claimedPrevHash) + } + } + return nil +} + +// SignatureSetFromBlock creates a signature set out of a block. +func SignatureSetFromBlock(block *common.Block) ([]*protoutil.SignedData, error) { + if block.Metadata == nil || len(block.Metadata.Metadata) <= int(common.BlockMetadataIndex_SIGNATURES) { + return nil, errors.New("no metadata in block") + } + metadata, err := protoutil.GetMetadataFromBlock(block, common.BlockMetadataIndex_SIGNATURES) + if err != nil { + return nil, errors.Errorf("failed unmarshaling medatata for signatures: %v", err) + } + + var signatureSet []*protoutil.SignedData + for _, metadataSignature := range metadata.Signatures { + sigHdr, err := protoutil.UnmarshalSignatureHeader(metadataSignature.SignatureHeader) + if err != nil { + return nil, errors.Errorf("failed unmarshaling signature header for block with id %d: %v", + block.Header.Number, err) + } + signatureSet = append(signatureSet, + &protoutil.SignedData{ + Identity: sigHdr.Creator, + Data: util.ConcatenateBytes(metadata.Value, + metadataSignature.SignatureHeader, protoutil.BlockHeaderBytes(block.Header)), + Signature: metadataSignature.Signature, + }, + ) + } + return signatureSet, nil +} + +// VerifyBlockSignature verifies the signature on the block with the given BlockVerifier and the given config. +func VerifyBlockSignature(block *common.Block, verifier BlockVerifier, config *common.ConfigEnvelope) error { + signatureSet, err := SignatureSetFromBlock(block) + if err != nil { + return err + } + return verifier.VerifyBlockSignature(signatureSet, config) +} + +// EndpointCriteria defines criteria of how to connect to a remote orderer node. +type EndpointCriteria struct { + Endpoint string // Endpoint of the form host:port + TLSRootCAs [][]byte // PEM encoded TLS root CA certificates +} + +// String returns a string representation of this EndpointCriteria +func (ep EndpointCriteria) String() string { + var formattedCAs []interface{} + for _, rawCAFile := range ep.TLSRootCAs { + var bl *pem.Block + pemContent := rawCAFile + for { + bl, pemContent = pem.Decode(pemContent) + if bl == nil { + break + } + cert, err := x509.ParseCertificate(bl.Bytes) + if err != nil { + break + } + + issuedBy := cert.Issuer.String() + if cert.Issuer.String() == cert.Subject.String() { + issuedBy = "self" + } + + info := make(map[string]interface{}) + info["Expired"] = time.Now().After(cert.NotAfter) + info["Subject"] = cert.Subject.String() + info["Issuer"] = issuedBy + formattedCAs = append(formattedCAs, info) + } + } + + formattedEndpointCriteria := make(map[string]interface{}) + formattedEndpointCriteria["Endpoint"] = ep.Endpoint + formattedEndpointCriteria["CAs"] = formattedCAs + + rawJSON, err := json.Marshal(formattedEndpointCriteria) + if err != nil { + return fmt.Sprintf("{\"Endpoint\": \"%s\"}", ep.Endpoint) + } + + return string(rawJSON) +} + +// EndpointconfigFromConfigBlock retrieves TLS CA certificates and endpoints +// from a config block. +func EndpointconfigFromConfigBlock(block *common.Block, bccsp bccsp.BCCSP) ([]EndpointCriteria, error) { + if block == nil { + return nil, errors.New("nil block") + } + envelopeConfig, err := protoutil.ExtractEnvelope(block, 0) + if err != nil { + return nil, err + } + + bundle, err := channelconfig.NewBundleFromEnvelope(envelopeConfig, bccsp) + if err != nil { + return nil, errors.Wrap(err, "failed extracting bundle from envelope") + } + msps, err := bundle.MSPManager().GetMSPs() + if err != nil { + return nil, errors.Wrap(err, "failed obtaining MSPs from MSPManager") + } + ordererConfig, ok := bundle.OrdererConfig() + if !ok { + return nil, errors.New("failed obtaining orderer config from bundle") + } + + mspIDsToCACerts := make(map[string][][]byte) + var aggregatedTLSCerts [][]byte + for _, org := range ordererConfig.Organizations() { + // Validate that every orderer org has a corresponding MSP instance in the MSP Manager. + msp, exists := msps[org.MSPID()] + if !exists { + return nil, errors.Errorf("no MSP found for MSP with ID of %s", org.MSPID()) + } + + // Build a per org mapping of the TLS CA certs for this org, + // and aggregate all TLS CA certs into aggregatedTLSCerts to be used later on. + var caCerts [][]byte + caCerts = append(caCerts, msp.GetTLSIntermediateCerts()...) + caCerts = append(caCerts, msp.GetTLSRootCerts()...) + mspIDsToCACerts[org.MSPID()] = caCerts + aggregatedTLSCerts = append(aggregatedTLSCerts, caCerts...) + } + + endpointsPerOrg := perOrgEndpoints(ordererConfig, mspIDsToCACerts) + if len(endpointsPerOrg) > 0 { + return endpointsPerOrg, nil + } + + return globalEndpointsFromConfig(aggregatedTLSCerts, bundle), nil +} + +func perOrgEndpoints(ordererConfig channelconfig.Orderer, mspIDsToCerts map[string][][]byte) []EndpointCriteria { + var endpointsPerOrg []EndpointCriteria + + for _, org := range ordererConfig.Organizations() { + for _, endpoint := range org.Endpoints() { + endpointsPerOrg = append(endpointsPerOrg, EndpointCriteria{ + TLSRootCAs: mspIDsToCerts[org.MSPID()], + Endpoint: endpoint, + }) + } + } + + return endpointsPerOrg +} + +func globalEndpointsFromConfig(aggregatedTLSCerts [][]byte, bundle *channelconfig.Bundle) []EndpointCriteria { + var globalEndpoints []EndpointCriteria + for _, endpoint := range bundle.ChannelConfig().OrdererAddresses() { + globalEndpoints = append(globalEndpoints, EndpointCriteria{ + Endpoint: endpoint, + TLSRootCAs: aggregatedTLSCerts, + }) + } + return globalEndpoints +} + +//go:generate mockery -dir . -name VerifierFactory -case underscore -output ./mocks/ + +// VerifierFactory creates BlockVerifiers. +type VerifierFactory interface { + // VerifierFromConfig creates a BlockVerifier from the given configuration. + VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error) +} + +// VerificationRegistry registers verifiers and retrieves them. +type VerificationRegistry struct { + LoadVerifier func(chain string) BlockVerifier + Logger *flogging.FabricLogger + VerifierFactory VerifierFactory + VerifiersByChannel map[string]BlockVerifier +} + +// RegisterVerifier adds a verifier into the registry if applicable. +func (vr *VerificationRegistry) RegisterVerifier(chain string) { + if _, exists := vr.VerifiersByChannel[chain]; exists { + vr.Logger.Debugf("No need to register verifier for chain %s", chain) + return + } + + v := vr.LoadVerifier(chain) + if v == nil { + vr.Logger.Errorf("Failed loading verifier for chain %s", chain) + return + } + + vr.VerifiersByChannel[chain] = v + vr.Logger.Infof("Registered verifier for chain %s", chain) +} + +// RetrieveVerifier returns a BlockVerifier for the given channel, or nil if not found. +func (vr *VerificationRegistry) RetrieveVerifier(channel string) BlockVerifier { + verifier, exists := vr.VerifiersByChannel[channel] + if exists { + return verifier + } + vr.Logger.Errorf("No verifier for channel %s exists", channel) + return nil +} + +// BlockCommitted notifies the VerificationRegistry upon a block commit, which may +// trigger a registration of a verifier out of the block in case the block is a config block. +func (vr *VerificationRegistry) BlockCommitted(block *common.Block, channel string) { + conf, err := ConfigFromBlock(block) + // The block doesn't contain a config block, but is a valid block + if err == errNotAConfig { + vr.Logger.Debugf("Committed block [%d] for channel %s that is not a config block", + block.Header.Number, channel) + return + } + // The block isn't a valid block + if err != nil { + vr.Logger.Errorf("Failed parsing block of channel %s: %v, content: %s", + channel, err, BlockToString(block)) + return + } + + // The block contains a config block + verifier, err := vr.VerifierFactory.VerifierFromConfig(conf, channel) + if err != nil { + vr.Logger.Errorf("Failed creating a verifier from a config block for channel %s: %v, content: %s", + channel, err, BlockToString(block)) + return + } + + vr.VerifiersByChannel[channel] = verifier + + vr.Logger.Debugf("Committed config block [%d] for channel %s", block.Header.Number, channel) +} + +// BlockToString returns a string representation of this block. +func BlockToString(block *common.Block) string { + buff := &bytes.Buffer{} + protolator.DeepMarshalJSON(buff, block) + return buff.String() +} + +// BlockCommitFunc signals a block commit. +type BlockCommitFunc func(block *common.Block, channel string) + +// LedgerInterceptor intercepts block commits. +type LedgerInterceptor struct { + Channel string + InterceptBlockCommit BlockCommitFunc + LedgerWriter +} + +// Append commits a block into the ledger, and also fires the configured callback. +func (interceptor *LedgerInterceptor) Append(block *common.Block) error { + defer interceptor.InterceptBlockCommit(block, interceptor.Channel) + return interceptor.LedgerWriter.Append(block) +} + +// BlockVerifierAssembler creates a BlockVerifier out of a config envelope +type BlockVerifierAssembler struct { + Logger *flogging.FabricLogger + BCCSP bccsp.BCCSP +} + +// VerifierFromConfig creates a BlockVerifier from the given configuration. +func (bva *BlockVerifierAssembler) VerifierFromConfig(configuration *common.ConfigEnvelope, channel string) (BlockVerifier, error) { + bundle, err := channelconfig.NewBundle(channel, configuration.Config, bva.BCCSP) + if err != nil { + return nil, errors.Wrap(err, "failed extracting bundle from envelope") + } + policyMgr := bundle.PolicyManager() + + return &BlockValidationPolicyVerifier{ + Logger: bva.Logger, + PolicyMgr: policyMgr, + Channel: channel, + BCCSP: bva.BCCSP, + }, nil +} + +// BlockValidationPolicyVerifier verifies signatures based on the block validation policy. +type BlockValidationPolicyVerifier struct { + Logger *flogging.FabricLogger + Channel string + PolicyMgr policies.Manager + BCCSP bccsp.BCCSP +} + +// VerifyBlockSignature verifies the signed data associated to a block, optionally with the given config envelope. +func (bv *BlockValidationPolicyVerifier) VerifyBlockSignature(sd []*protoutil.SignedData, envelope *common.ConfigEnvelope) error { + policyMgr := bv.PolicyMgr + // If the envelope passed isn't nil, we should use a different policy manager. + if envelope != nil { + bundle, err := channelconfig.NewBundle(bv.Channel, envelope.Config, bv.BCCSP) + if err != nil { + buff := &bytes.Buffer{} + protolator.DeepMarshalJSON(buff, envelope.Config) + bv.Logger.Errorf("Failed creating a new bundle for channel %s, Config content is: %s", bv.Channel, buff.String()) + return err + } + bv.Logger.Infof("Initializing new PolicyManager for channel %s", bv.Channel) + policyMgr = bundle.PolicyManager() + } + policy, exists := policyMgr.GetPolicy(policies.BlockValidation) + if !exists { + return errors.Errorf("policy %s wasn't found", policies.BlockValidation) + } + return policy.EvaluateSignedData(sd) +} + +//go:generate mockery -dir . -name BlockRetriever -case underscore -output ./mocks/ + +// BlockRetriever retrieves blocks +type BlockRetriever interface { + // Block returns a block with the given number, + // or nil if such a block doesn't exist. + Block(number uint64) *common.Block +} + +// LastConfigBlock returns the last config block relative to the given block. +func LastConfigBlock(block *common.Block, blockRetriever BlockRetriever) (*common.Block, error) { + if block == nil { + return nil, errors.New("nil block") + } + if blockRetriever == nil { + return nil, errors.New("nil blockRetriever") + } + lastConfigBlockNum, err := protoutil.GetLastConfigIndexFromBlock(block) + if err != nil { + return nil, err + } + lastConfigBlock := blockRetriever.Block(lastConfigBlockNum) + if lastConfigBlock == nil { + return nil, errors.Errorf("unable to retrieve last config block [%d]", lastConfigBlockNum) + } + return lastConfigBlock, nil +} + +// StreamCountReporter reports the number of streams currently connected to this node +type StreamCountReporter struct { + Metrics *Metrics + count uint32 +} + +func (scr *StreamCountReporter) Increment() { + count := atomic.AddUint32(&scr.count, 1) + scr.Metrics.reportStreamCount(count) +} + +func (scr *StreamCountReporter) Decrement() { + count := atomic.AddUint32(&scr.count, ^uint32(0)) + scr.Metrics.reportStreamCount(count) +} + +type certificateExpirationCheck struct { + minimumExpirationWarningInterval time.Duration + expiresAt time.Time + expirationWarningThreshold time.Duration + lastWarning time.Time + nodeName string + endpoint string + alert func(string, ...interface{}) +} + +func (exp *certificateExpirationCheck) checkExpiration(currentTime time.Time, channel string) { + timeLeft := exp.expiresAt.Sub(currentTime) + if timeLeft > exp.expirationWarningThreshold { + return + } + + timeSinceLastWarning := currentTime.Sub(exp.lastWarning) + if timeSinceLastWarning < exp.minimumExpirationWarningInterval { + return + } + + exp.alert("Certificate of %s from %s for channel %s expires in less than %v", + exp.nodeName, exp.endpoint, channel, timeLeft) + exp.lastWarning = currentTime +} + +// CachePublicKeyComparisons creates CertificateComparator that caches invocations based on input arguments. +// The given CertificateComparator must be a stateless function. +func CachePublicKeyComparisons(f CertificateComparator) CertificateComparator { + m := &ComparisonMemoizer{ + MaxEntries: 4096, + F: f, + } + return m.Compare +} + +// ComparisonMemoizer speeds up comparison computations by caching past invocations of a stateless function +type ComparisonMemoizer struct { + // Configuration + F func(a, b []byte) bool + MaxEntries uint16 + // Internal state + cache map[arguments]bool + lock sync.RWMutex + once sync.Once + rand *rand.Rand +} + +type arguments struct { + a, b string +} + +// Size returns the number of computations the ComparisonMemoizer currently caches. +func (cm *ComparisonMemoizer) Size() int { + cm.lock.RLock() + defer cm.lock.RUnlock() + return len(cm.cache) +} + +// Compare compares the given two byte slices. +// It may return previous computations for the given two arguments, +// otherwise it will compute the function F and cache the result. +func (cm *ComparisonMemoizer) Compare(a, b []byte) bool { + cm.once.Do(cm.setup) + key := arguments{ + a: string(a), + b: string(b), + } + + cm.lock.RLock() + result, exists := cm.cache[key] + cm.lock.RUnlock() + + if exists { + return result + } + + result = cm.F(a, b) + + cm.lock.Lock() + defer cm.lock.Unlock() + + cm.shrinkIfNeeded() + cm.cache[key] = result + + return result +} + +func (cm *ComparisonMemoizer) shrinkIfNeeded() { + for { + currentSize := uint16(len(cm.cache)) + if currentSize < cm.MaxEntries { + return + } + cm.shrink() + } +} + +func (cm *ComparisonMemoizer) shrink() { + // Shrink the cache by 25% by removing every fourth element (on average) + for key := range cm.cache { + if cm.rand.Int()%4 != 0 { + continue + } + delete(cm.cache, key) + } +} + +func (cm *ComparisonMemoizer) setup() { + cm.lock.Lock() + defer cm.lock.Unlock() + cm.rand = rand.New(rand.NewSource(time.Now().UnixNano())) + cm.cache = make(map[arguments]bool) +} +``` + +## `orderer/common/cluster/util_test.go` (changed lines (292, 293, 302, 303, 376, 377, 401, 402, 553, 561, 562, 563, 709, 710, 734, 735, 750, 751)) + +```go +/* +Copyright IBM Corp. 2017 All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package cluster_test + +import ( + "bytes" + "crypto/x509" + "encoding/pem" + "errors" + "fmt" + "io/ioutil" + "strings" + "sync" + "testing" + "time" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric/bccsp/sw" + "github.com/hyperledger/fabric/common/capabilities" + "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/common/configtx/test" + "github.com/hyperledger/fabric/common/crypto/tlsgen" + "github.com/hyperledger/fabric/common/flogging" + "github.com/hyperledger/fabric/common/policies" + "github.com/hyperledger/fabric/core/config/configtest" + "github.com/hyperledger/fabric/internal/configtxgen/encoder" + "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" + "github.com/hyperledger/fabric/internal/pkg/comm" + "github.com/hyperledger/fabric/orderer/common/cluster" + "github.com/hyperledger/fabric/orderer/common/cluster/mocks" + "github.com/hyperledger/fabric/protoutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +//go:generate counterfeiter -o mocks/policy.go --fake-name Policy . policy + +type policy interface { + policies.Policy +} + +//go:generate counterfeiter -o mocks/policy_manager.go --fake-name PolicyManager . policyManager + +type policyManager interface { + policies.Manager +} + +func TestParallelStubActivation(t *testing.T) { + // Scenario: Activate the stub from different goroutines in parallel. + stub := &cluster.Stub{} + var wg sync.WaitGroup + n := 100 + wg.Add(n) + instance := &cluster.RemoteContext{} + var activationCount int + maybeCreateInstance := func() (*cluster.RemoteContext, error) { + activationCount++ + return instance, nil + } + + for i := 0; i < n; i++ { + go func() { + defer wg.Done() + stub.Activate(maybeCreateInstance) + }() + } + wg.Wait() + activatedStub := stub.RemoteContext + // Ensure the instance is the reference we stored + // and not any other reference, i.e - it wasn't + // copied by value. + assert.True(t, activatedStub == instance) + // Ensure the method was invoked only once. + assert.Equal(t, activationCount, 1) +} + +func TestDialerCustomKeepAliveOptions(t *testing.T) { + ca, err := tlsgen.NewCA() + assert.NoError(t, err) + + clientKeyPair, err := ca.NewClientCertKeyPair() + assert.NoError(t, err) + clientConfig := comm.ClientConfig{ + KaOpts: comm.KeepaliveOptions{ + ClientTimeout: time.Second * 12345, + }, + Timeout: time.Millisecond * 100, + SecOpts: comm.SecureOptions{ + RequireClientCert: true, + Key: clientKeyPair.Key, + Certificate: clientKeyPair.Cert, + ServerRootCAs: [][]byte{ca.CertBytes()}, + UseTLS: true, + ClientRootCAs: [][]byte{ca.CertBytes()}, + }, + } + + dialer := &cluster.PredicateDialer{Config: clientConfig} + timeout := dialer.Config.KaOpts.ClientTimeout + assert.Equal(t, time.Second*12345, timeout) +} + +func TestPredicateDialerUpdateRootCAs(t *testing.T) { + node1 := newTestNode(t) + defer node1.stop() + + anotherTLSCA, err := tlsgen.NewCA() + assert.NoError(t, err) + + dialer := &cluster.PredicateDialer{ + Config: node1.clientConfig.Clone(), + } + dialer.Config.SecOpts.ServerRootCAs = [][]byte{anotherTLSCA.CertBytes()} + dialer.Config.Timeout = time.Second + dialer.Config.AsyncConnect = false + + _, err = dialer.Dial(node1.srv.Address(), nil) + assert.Error(t, err) + + // Update root TLS CAs asynchronously to make sure we don't have a data race. + go func() { + dialer.UpdateRootCAs(node1.clientConfig.SecOpts.ServerRootCAs) + }() + + // Eventually we should succeed connecting. + for i := 0; i < 10; i++ { + conn, err := dialer.Dial(node1.srv.Address(), nil) + if err == nil { + conn.Close() + return + } + } + + assert.Fail(t, "could not connect after 10 attempts despite changing TLS CAs") +} + +func TestDialerBadConfig(t *testing.T) { + emptyCertificate := []byte("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----") + dialer := &cluster.PredicateDialer{ + Config: comm.ClientConfig{ + SecOpts: comm.SecureOptions{ + UseTLS: true, + ServerRootCAs: [][]byte{emptyCertificate}, + }, + }, + } + _, err := dialer.Dial("127.0.0.1:8080", func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { + return nil + }) + assert.EqualError(t, err, "error adding root certificate: x509: malformed certificate") +} + +func TestDERtoPEM(t *testing.T) { + ca, err := tlsgen.NewCA() + assert.NoError(t, err) + keyPair, err := ca.NewServerCertKeyPair("localhost") + assert.NoError(t, err) + assert.Equal(t, cluster.DERtoPEM(keyPair.TLSCert.Raw), string(keyPair.Cert)) +} + +func TestStandardDialer(t *testing.T) { + emptyCertificate := []byte("-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----") + certPool := [][]byte{emptyCertificate} + config := comm.ClientConfig{SecOpts: comm.SecureOptions{UseTLS: true, ServerRootCAs: certPool}} + standardDialer := &cluster.StandardDialer{ + Config: config, + } + _, err := standardDialer.Dial(cluster.EndpointCriteria{Endpoint: "127.0.0.1:8080", TLSRootCAs: certPool}) + assert.EqualError(t, + err, + "failed creating gRPC client: error adding root certificate: x509: malformed certificate", + ) +} + +func TestVerifyBlockSignature(t *testing.T) { + verifier := &mocks.BlockVerifier{} + var nilConfigEnvelope *common.ConfigEnvelope + verifier.On("VerifyBlockSignature", mock.Anything, nilConfigEnvelope).Return(nil) + + block := createBlockChain(3, 3)[0] + + // The block should have a valid structure + err := cluster.VerifyBlockSignature(block, verifier, nil) + assert.NoError(t, err) + + for _, testCase := range []struct { + name string + mutateBlock func(*common.Block) *common.Block + errorContains string + }{ + { + name: "nil metadata", + errorContains: "no metadata in block", + mutateBlock: func(block *common.Block) *common.Block { + block.Metadata = nil + return block + }, + }, + { + name: "zero metadata slice", + errorContains: "no metadata in block", + mutateBlock: func(block *common.Block) *common.Block { + block.Metadata.Metadata = nil + return block + }, + }, + { + name: "nil metadata", + errorContains: "failed unmarshaling medatata for signatures", + mutateBlock: func(block *common.Block) *common.Block { + block.Metadata.Metadata[0] = []byte{1, 2, 3} + return block + }, + }, + { + name: "bad signature header", + errorContains: "failed unmarshaling signature header", + mutateBlock: func(block *common.Block) *common.Block { + metadata := protoutil.GetMetadataFromBlockOrPanic(block, common.BlockMetadataIndex_SIGNATURES) + metadata.Signatures[0].SignatureHeader = []byte{1, 2, 3} + block.Metadata.Metadata[common.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(metadata) + return block + }, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + // Create a copy of the block + blockCopy := &common.Block{} + err := proto.Unmarshal(protoutil.MarshalOrPanic(block), blockCopy) + assert.NoError(t, err) + // Mutate the block to sabotage it + blockCopy = testCase.mutateBlock(blockCopy) + err = cluster.VerifyBlockSignature(blockCopy, verifier, nil) + assert.Contains(t, err.Error(), testCase.errorContains) + }) + } +} + +func TestVerifyBlockHash(t *testing.T) { + var start uint64 = 3 + var end uint64 = 23 + + verify := func(blockchain []*common.Block) error { + for i := 0; i < len(blockchain); i++ { + err := cluster.VerifyBlockHash(i, blockchain) + if err != nil { + return err + } + } + return nil + } + + // Verify that createBlockChain() creates a valid blockchain + assert.NoError(t, verify(createBlockChain(start, end))) + + twoBlocks := createBlockChain(2, 3) + twoBlocks[0].Header = nil + assert.EqualError(t, cluster.VerifyBlockHash(1, twoBlocks), "previous block header is nil") + + // Index out of bounds + blockchain := createBlockChain(start, end) + err := cluster.VerifyBlockHash(100, blockchain) + assert.EqualError(t, err, "index 100 out of bounds (total 21 blocks)") + + for _, testCase := range []struct { + name string + mutateBlockSequence func([]*common.Block) []*common.Block + errorContains string + }{ + { + name: "non consecutive sequences", + errorContains: "sequences 12 and 666 were received consecutively", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.Number = 666 + assignHashes(blockSequence) + return blockSequence + }, + }, + { + name: "data hash mismatch", + errorContains: "computed hash of block (13) (dcb2ec1c5e482e4914cb953ff8eedd12774b244b12912afbe6001ba5de9ff800)" + + " doesn't match claimed hash (07)", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.DataHash = []byte{7} + return blockSequence + }, + }, + { + name: "prev hash mismatch", + errorContains: "block [12]'s hash " + + "(866351705f1c2f13e10d52ead9d0ca3b80689ede8cc8bf70a6d60c67578323f4) " + + "mismatches block [13]'s prev block hash (07)", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.PreviousHash = []byte{7} + return blockSequence + }, + }, + { + name: "nil block header", + errorContains: "missing block header", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[0].Header = nil + return blockSequence + }, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + blockchain := createBlockChain(start, end) + blockchain = testCase.mutateBlockSequence(blockchain) + err := verify(blockchain) + assert.EqualError(t, err, testCase.errorContains) + }) + } +} + +func TestVerifyBlocks(t *testing.T) { + var sigSet1 []*protoutil.SignedData + var sigSet2 []*protoutil.SignedData + + configEnvelope1 := &common.ConfigEnvelope{ + Config: &common.Config{ + Sequence: 1, + }, + } + configEnvelope2 := &common.ConfigEnvelope{ + Config: &common.Config{ + Sequence: 2, + }, + } + configTransaction := func(envelope *common.ConfigEnvelope) *common.Envelope { + return &common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: protoutil.MarshalOrPanic(envelope), + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + }), + }, + }), + } + } + + for _, testCase := range []struct { + name string + configureVerifier func(*mocks.BlockVerifier) + mutateBlockSequence func([]*common.Block) []*common.Block + expectedError string + verifierExpectedCalls int + }{ + { + name: "empty sequence", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + return nil + }, + expectedError: "buffer is empty", + }, + { + name: "prev hash mismatch", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Header.PreviousHash = []byte{7} + return blockSequence + }, + expectedError: "block [74]'s hash " + + "(5cb4bd1b6a73f81afafd96387bb7ff4473c2425929d0862586f5fbfa12d762dd) " + + "mismatches block [75]'s prev block hash (07)", + }, + { + name: "bad signature", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + verifier.On("VerifyBlockSignature", mock.Anything, nilEnvelope).Return(errors.New("bad signature")) + }, + expectedError: "bad signature", + verifierExpectedCalls: 1, + }, + { + name: "block that its type cannot be classified", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + blockSequence[len(blockSequence)/2].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{})}, + } + blockSequence[len(blockSequence)/2].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/2].Data) + assignHashes(blockSequence) + return blockSequence + }, + expectedError: "nil header in payload", + }, + { + name: "config blocks in the sequence need to be verified and one of them is improperly signed", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + var err error + // Put a config transaction in block n / 4 + blockSequence[len(blockSequence)/4].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope1))}, + } + blockSequence[len(blockSequence)/4].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/4].Data) + + // Put a config transaction in block n / 2 + blockSequence[len(blockSequence)/2].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope2))}, + } + blockSequence[len(blockSequence)/2].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/2].Data) + + assignHashes(blockSequence) + + sigSet1, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)/4]) + assert.NoError(t, err) + sigSet2, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)/2]) + assert.NoError(t, err) + + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + // The first config block, validates correctly. + verifier.On("VerifyBlockSignature", sigSet1, nilEnvelope).Return(nil).Once() + // However, the second config block - validates incorrectly. + confEnv1 := &common.ConfigEnvelope{} + proto.Unmarshal(protoutil.MarshalOrPanic(configEnvelope1), confEnv1) + verifier.On("VerifyBlockSignature", sigSet2, confEnv1).Return(errors.New("bad signature")).Once() + }, + expectedError: "bad signature", + verifierExpectedCalls: 2, + }, + { + name: "config block in the sequence needs to be verified, and it is properly signed", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + var err error + // Put a config transaction in block n / 4 + blockSequence[len(blockSequence)/4].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope1))}, + } + blockSequence[len(blockSequence)/4].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)/4].Data) + + assignHashes(blockSequence) + + sigSet1, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)/4]) + assert.NoError(t, err) + + sigSet2, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)-1]) + assert.NoError(t, err) + + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + confEnv1 := &common.ConfigEnvelope{} + proto.Unmarshal(protoutil.MarshalOrPanic(configEnvelope1), confEnv1) + verifier.On("VerifyBlockSignature", sigSet1, nilEnvelope).Return(nil).Once() + verifier.On("VerifyBlockSignature", sigSet2, confEnv1).Return(nil).Once() + }, + // We have a single config block in the 'middle' of the chain, so we have 2 verifications total: + // The last block, and the config block. + verifierExpectedCalls: 2, + }, + { + name: "last two blocks are config blocks, last block only verified once", + mutateBlockSequence: func(blockSequence []*common.Block) []*common.Block { + var err error + // Put a config transaction in block n-2 and in n-1 + blockSequence[len(blockSequence)-2].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope1))}, + } + blockSequence[len(blockSequence)-2].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)-2].Data) + + blockSequence[len(blockSequence)-1].Data = &common.BlockData{ + Data: [][]byte{protoutil.MarshalOrPanic(configTransaction(configEnvelope2))}, + } + blockSequence[len(blockSequence)-1].Header.DataHash = protoutil.BlockDataHash(blockSequence[len(blockSequence)-1].Data) + + assignHashes(blockSequence) + + sigSet1, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)-2]) + assert.NoError(t, err) + + sigSet2, err = cluster.SignatureSetFromBlock(blockSequence[len(blockSequence)-1]) + assert.NoError(t, err) + + return blockSequence + }, + configureVerifier: func(verifier *mocks.BlockVerifier) { + var nilEnvelope *common.ConfigEnvelope + confEnv1 := &common.ConfigEnvelope{} + proto.Unmarshal(protoutil.MarshalOrPanic(configEnvelope1), confEnv1) + verifier.On("VerifyBlockSignature", sigSet1, nilEnvelope).Return(nil).Once() + // We ensure that the signature set of the last block is verified using the config envelope of the block + // before it. + verifier.On("VerifyBlockSignature", sigSet2, confEnv1).Return(nil).Once() + // Note that we do not record a call to verify the last block, with the config envelope extracted from the block itself. + }, + // We have 2 config blocks, yet we only verify twice- the first config block, and the next config block, but no more, + // since the last block is a config block. + verifierExpectedCalls: 2, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + blockchain := createBlockChain(50, 100) + blockchain = testCase.mutateBlockSequence(blockchain) + verifier := &mocks.BlockVerifier{} + if testCase.configureVerifier != nil { + testCase.configureVerifier(verifier) + } + err := cluster.VerifyBlocks(blockchain, verifier) + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + } else { + assert.NoError(t, err) + } + }) + } +} + +func assignHashes(blockchain []*common.Block) { + for i := 1; i < len(blockchain); i++ { + blockchain[i].Header.PreviousHash = protoutil.BlockHeaderHash(blockchain[i-1].Header) + } +} + +func createBlockChain(start, end uint64) []*common.Block { + newBlock := func(seq uint64) *common.Block { + sHdr := &common.SignatureHeader{ + Creator: []byte{1, 2, 3}, + Nonce: []byte{9, 5, 42, 66}, + } + block := protoutil.NewBlock(seq, nil) + blockSignature := &common.MetadataSignature{ + SignatureHeader: protoutil.MarshalOrPanic(sHdr), + } + block.Metadata.Metadata[common.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&common.Metadata{ + Value: nil, + Signatures: []*common.MetadataSignature{ + blockSignature, + }, + }) + + txn := protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{}, + }), + }) + block.Data.Data = append(block.Data.Data, txn) + return block + } + var blockchain []*common.Block + for seq := uint64(start); seq <= uint64(end); seq++ { + block := newBlock(seq) + block.Data.Data = append(block.Data.Data, make([]byte, 100)) + block.Header.DataHash = protoutil.BlockDataHash(block.Data) + blockchain = append(blockchain, block) + } + assignHashes(blockchain) + return blockchain +} + +func TestEndpointconfigFromConfigBlockGreenPath(t *testing.T) { + t.Run("global endpoints", func(t *testing.T) { + block, err := test.MakeGenesisBlock("mychannel") + assert.NoError(t, err) + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + // For a block that doesn't have per org endpoints, + // we take the global endpoints + injectGlobalOrdererEndpoint(t, block, "globalEndpoint") + endpointConfig, err := cluster.EndpointconfigFromConfigBlock(block, cryptoProvider) + assert.NoError(t, err) + assert.Len(t, endpointConfig, 1) + assert.Equal(t, "globalEndpoint", endpointConfig[0].Endpoint) + + bl, _ := pem.Decode(endpointConfig[0].TLSRootCAs[0]) + cert, err := x509.ParseCertificate(bl.Bytes) + assert.NoError(t, err) + + assert.True(t, cert.IsCA) + }) + + t.Run("per org endpoints", func(t *testing.T) { + block, err := test.MakeGenesisBlock("mychannel") + assert.NoError(t, err) + + // Make a second config. + gConf := genesisconfig.Load(genesisconfig.SampleSingleMSPSoloProfile, configtest.GetDevConfigDir()) + gConf.Orderer.Capabilities = map[string]bool{ + capabilities.OrdererV2_0: true, + } + channelGroup, err := encoder.NewChannelGroup(gConf) + assert.NoError(t, err) + + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + bundle, err := channelconfig.NewBundle("mychannel", &common.Config{ChannelGroup: channelGroup}, cryptoProvider) + assert.NoError(t, err) + + msps, err := bundle.MSPManager().GetMSPs() + assert.NoError(t, err) + caBytes := msps["SampleOrg"].GetTLSRootCerts()[0] + + assert.NoError(t, err) + injectAdditionalTLSCAEndpointPair(t, block, "anotherEndpoint", caBytes, "fooOrg") + endpointConfig, err := cluster.EndpointconfigFromConfigBlock(block, cryptoProvider) + assert.NoError(t, err) + // And ensure that the endpoints that are taken, are the per org ones. + assert.Len(t, endpointConfig, 2) + for _, endpoint := range endpointConfig { + // If this is the original organization (and not the clone), + // the TLS CA is 'caBytes' read from the second block. + if endpoint.Endpoint == "anotherEndpoint" { + assert.Len(t, endpoint.TLSRootCAs, 1) + assert.Equal(t, caBytes, endpoint.TLSRootCAs[0]) + continue + } + // Else, our endpoints are from the original org, and the TLS CA is something else. + assert.NotEqual(t, caBytes, endpoint.TLSRootCAs[0]) + // The endpoints we expect to see are something else. + assert.Equal(t, 0, strings.Index(endpoint.Endpoint, "127.0.0.1:")) + bl, _ := pem.Decode(endpoint.TLSRootCAs[0]) + cert, err := x509.ParseCertificate(bl.Bytes) + assert.NoError(t, err) + assert.True(t, cert.IsCA) + } + }) +} + +func TestEndpointconfigFromConfigBlockFailures(t *testing.T) { + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + t.Run("nil block", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(nil, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "nil block") + }) + + t.Run("nil block data", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(&common.Block{}, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "block data is nil") + }) + + t.Run("no envelope", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(&common.Block{ + Data: &common.BlockData{}, + }, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "envelope index out of bounds") + }) + + t.Run("bad envelope", func(t *testing.T) { + certs, err := cluster.EndpointconfigFromConfigBlock(&common.Block{ + Data: &common.BlockData{ + Data: [][]byte{{}}, + }, + }, cryptoProvider) + assert.Nil(t, certs) + assert.EqualError(t, err, "failed extracting bundle from envelope: envelope header cannot be nil") + }) +} + +func TestConfigFromBlockBadInput(t *testing.T) { + for _, testCase := range []struct { + name string + block *common.Block + expectedError string + }{ + { + name: "nil block", + expectedError: "empty block", + block: nil, + }, + { + name: "nil block data", + expectedError: "empty block", + block: &common.Block{}, + }, + { + name: "no data in block", + expectedError: "empty block", + block: &common.Block{Data: &common.BlockData{}}, + }, + { + name: "invalid payload", + expectedError: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{Data: &common.BlockData{Data: [][]byte{{1, 2, 3}}}}, + }, + { + name: "bad genesis block", + expectedError: "invalid config envelope: proto: common.ConfigEnvelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Header: &common.BlockHeader{}, Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: []byte{1, 2, 3}, + }), + })}}}, + }, + { + name: "invalid envelope in block", + expectedError: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + block: &common.Block{Data: &common.BlockData{Data: [][]byte{{1, 2, 3}}}}, + }, + { + name: "invalid payload in block envelope", + expectedError: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + block: &common.Block{Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: []byte{1, 2, 3}, + })}}}, + }, + { + name: "invalid channel header", + expectedError: "error unmarshaling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + block: &common.Block{ + Header: &common.BlockHeader{Number: 1}, + Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Header: &common.Header{ + ChannelHeader: []byte{1, 2, 3}, + }, + }), + })}}}, + }, + { + name: "invalid config block", + expectedError: "invalid config envelope: proto: common.ConfigEnvelope: illegal tag 0 (wire type 1)", + block: &common.Block{ + Header: &common.BlockHeader{}, + Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ + Payload: protoutil.MarshalOrPanic(&common.Payload{ + Data: []byte{1, 2, 3}, + Header: &common.Header{ + ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ + Type: int32(common.HeaderType_CONFIG), + }), + }, + }), + })}}}, + }, + } { + t.Run(testCase.name, func(t *testing.T) { + conf, err := cluster.ConfigFromBlock(testCase.block) + assert.Nil(t, conf) + assert.EqualError(t, err, testCase.expectedError) + }) + } +} + +func TestBlockValidationPolicyVerifier(t *testing.T) { + config := genesisconfig.Load(genesisconfig.SampleInsecureSoloProfile, configtest.GetDevConfigDir()) + group, err := encoder.NewChannelGroup(config) + assert.NoError(t, err) + assert.NotNil(t, group) + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + validConfigEnvelope := &common.ConfigEnvelope{ + Config: &common.Config{ + ChannelGroup: group, + }, + } + + for _, testCase := range []struct { + description string + expectedError string + envelope *common.ConfigEnvelope + policyMap map[string]policies.Policy + policy policies.Policy + }{ + /** + { + description: "policy not found", + expectedError: "policy /Channel/Orderer/BlockValidation wasn't found", + }, + */ + { + description: "policy evaluation fails", + expectedError: "invalid signature", + policy: &mocks.Policy{ + EvaluateSignedDataStub: func([]*protoutil.SignedData) error { + return errors.New("invalid signature") + }, + }, + }, + { + description: "bad config envelope", + expectedError: "config must contain a channel group", + policy: &mocks.Policy{}, + envelope: &common.ConfigEnvelope{Config: &common.Config{}}, + }, + { + description: "good config envelope overrides custom policy manager", + policy: &mocks.Policy{ + EvaluateSignedDataStub: func([]*protoutil.SignedData) error { + return errors.New("invalid signature") + }, + }, + envelope: validConfigEnvelope, + }, + } { + t.Run(testCase.description, func(t *testing.T) { + mockPolicyManager := &mocks.PolicyManager{} + if testCase.policy != nil { + mockPolicyManager.GetPolicyReturns(testCase.policy, true) + } else { + mockPolicyManager.GetPolicyReturns(nil, false) + } + mockPolicyManager.GetPolicyReturns(testCase.policy, true) + verifier := &cluster.BlockValidationPolicyVerifier{ + Logger: flogging.MustGetLogger("test"), + Channel: "mychannel", + PolicyMgr: mockPolicyManager, + BCCSP: cryptoProvider, + } + + err := verifier.VerifyBlockSignature(nil, testCase.envelope) + if testCase.expectedError != "" { + assert.EqualError(t, err, testCase.expectedError) + } else { + assert.NoError(t, err) + } + }) + } +} + +func TestBlockVerifierAssembler(t *testing.T) { + config := genesisconfig.Load(genesisconfig.SampleInsecureSoloProfile, configtest.GetDevConfigDir()) + group, err := encoder.NewChannelGroup(config) + assert.NoError(t, err) + assert.NotNil(t, group) + cryptoProvider, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + assert.NoError(t, err) + + t.Run("Good config envelope", func(t *testing.T) { + bva := &cluster.BlockVerifierAssembler{BCCSP: cryptoProvider} + verifier, err := bva.VerifierFromConfig(&common.ConfigEnvelope{ + Config: &common.Config{ + ChannelGroup: group, + }, + }, "mychannel") + assert.NoError(t, err) + + assert.NoError(t, verifier.VerifyBlockSignature(nil, nil)) + }) + + t.Run("Bad config envelope", func(t *testing.T) { + bva := &cluster.BlockVerifierAssembler{BCCSP: cryptoProvider} + _, err := bva.VerifierFromConfig(&common.ConfigEnvelope{}, "mychannel") + assert.EqualError(t, err, "failed extracting bundle from envelope: channelconfig Config cannot be nil") + }) +} + +func TestLastConfigBlock(t *testing.T) { + blockRetriever := &mocks.BlockRetriever{} + blockRetriever.On("Block", uint64(42)).Return(&common.Block{}) + blockRetriever.On("Block", uint64(666)).Return(nil) + + for _, testCase := range []struct { + name string + block *common.Block + blockRetriever cluster.BlockRetriever + expectedError string + }{ + { + name: "nil block", + expectedError: "nil block", + blockRetriever: blockRetriever, + }, + { + name: "nil support", + expectedError: "nil blockRetriever", + block: &common.Block{}, + }, + { + name: "nil metadata", + expectedError: "failed to retrieve metadata: no metadata in block", + blockRetriever: blockRetriever, + block: &common.Block{}, + }, + { + name: "no block with index", + block: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 666}), + })}, + }, + }, + expectedError: "unable to retrieve last config block [666]", + blockRetriever: blockRetriever, + }, + { + name: "valid last config block", + block: &common.Block{ + Metadata: &common.BlockMetadata{ + Metadata: [][]byte{{}, protoutil.MarshalOrPanic(&common.Metadata{ + Value: protoutil.MarshalOrPanic(&common.LastConfig{Index: 42}), + })}, + }, + }, + blockRetriever: blockRetriever, + }, + } { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + block, err := cluster.LastConfigBlock(testCase.block, testCase.blockRetriever) + if testCase.expectedError == "" { + assert.NoError(t, err) + assert.NotNil(t, block) + return + } + assert.EqualError(t, err, testCase.expectedError) + assert.Nil(t, block) + }) + } +} + +func TestVerificationRegistryRegisterVerifier(t *testing.T) { + blockBytes, err := ioutil.ReadFile("testdata/mychannel.block") + assert.NoError(t, err) + + block := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, block)) + + verifier := &mocks.BlockVerifier{} + + verifierFactory := &mocks.VerifierFactory{} + verifierFactory.On("VerifierFromConfig", + mock.Anything, "mychannel").Return(verifier, nil) + + registry := &cluster.VerificationRegistry{ + Logger: flogging.MustGetLogger("test"), + VerifiersByChannel: make(map[string]cluster.BlockVerifier), + VerifierFactory: verifierFactory, + } + + var loadCount int + registry.LoadVerifier = func(chain string) cluster.BlockVerifier { + assert.Equal(t, "mychannel", chain) + loadCount++ + return verifier + } + + v := registry.RetrieveVerifier("mychannel") + assert.Nil(t, v) + + registry.RegisterVerifier("mychannel") + v = registry.RetrieveVerifier("mychannel") + assert.Equal(t, verifier, v) + assert.Equal(t, 1, loadCount) + + // If the verifier exists, this is a no-op + registry.RegisterVerifier("mychannel") + assert.Equal(t, 1, loadCount) +} + +func TestVerificationRegistry(t *testing.T) { + blockBytes, err := ioutil.ReadFile("testdata/mychannel.block") + assert.NoError(t, err) + + block := &common.Block{} + assert.NoError(t, proto.Unmarshal(blockBytes, block)) + + flogging.ActivateSpec("test=DEBUG") + defer flogging.Reset() + + verifier := &mocks.BlockVerifier{} + + for _, testCase := range []struct { + description string + verifiersByChannel map[string]cluster.BlockVerifier + blockCommitted *common.Block + channelCommitted string + channelRetrieved string + expectedVerifier cluster.BlockVerifier + verifierFromConfig cluster.BlockVerifier + verifierFromConfigErr error + loggedMessages map[string]struct{} + }{ + { + description: "bad block", + blockCommitted: &common.Block{}, + channelRetrieved: "foo", + channelCommitted: "foo", + loggedMessages: map[string]struct{}{ + "Failed parsing block of channel foo: empty block, content: " + + "{\n\t\"data\": null,\n\t\"header\": null,\n\t\"metadata\": null\n}\n": {}, + "No verifier for channel foo exists": {}, + }, + expectedVerifier: nil, + }, + { + description: "not a config block", + blockCommitted: createBlockChain(5, 5)[0], + channelRetrieved: "foo", + channelCommitted: "foo", + loggedMessages: map[string]struct{}{ + "No verifier for channel foo exists": {}, + "Committed block [5] for channel foo that is not a config block": {}, + }, + expectedVerifier: nil, + }, + { + description: "valid block but verifier from config fails", + blockCommitted: block, + verifierFromConfigErr: errors.New("invalid MSP config"), + channelRetrieved: "bar", + channelCommitted: "bar", + loggedMessages: map[string]struct{}{ + "Failed creating a verifier from a " + + "config block for channel bar: invalid MSP config, " + + "content: " + cluster.BlockToString(block): {}, + "No verifier for channel bar exists": {}, + }, + expectedVerifier: nil, + }, + { + description: "valid block and verifier from config succeeds but wrong channel retrieved", + blockCommitted: block, + verifierFromConfig: verifier, + channelRetrieved: "foo", + channelCommitted: "bar", + loggedMessages: map[string]struct{}{ + "No verifier for channel foo exists": {}, + "Committed config block [0] for channel bar": {}, + }, + expectedVerifier: nil, + verifiersByChannel: make(map[string]cluster.BlockVerifier), + }, + { + description: "valid block and verifier from config succeeds", + blockCommitted: block, + verifierFromConfig: verifier, + channelRetrieved: "bar", + channelCommitted: "bar", + loggedMessages: map[string]struct{}{ + "Committed config block [0] for channel bar": {}, + }, + expectedVerifier: verifier, + verifiersByChannel: make(map[string]cluster.BlockVerifier), + }, + } { + t.Run(testCase.description, func(t *testing.T) { + verifierFactory := &mocks.VerifierFactory{} + verifierFactory.On("VerifierFromConfig", + mock.Anything, testCase.channelCommitted).Return(testCase.verifierFromConfig, testCase.verifierFromConfigErr) + + registry := &cluster.VerificationRegistry{ + Logger: flogging.MustGetLogger("test"), + VerifiersByChannel: testCase.verifiersByChannel, + VerifierFactory: verifierFactory, + } + + loggedEntriesByMethods := make(map[string]struct{}) + // Configure the logger to collect the message logged + registry.Logger = registry.Logger.WithOptions(zap.Hooks(func(entry zapcore.Entry) error { + loggedEntriesByMethods[entry.Message] = struct{}{} + return nil + })) + + registry.BlockCommitted(testCase.blockCommitted, testCase.channelCommitted) + verifier := registry.RetrieveVerifier(testCase.channelRetrieved) + + assert.Equal(t, testCase.loggedMessages, loggedEntriesByMethods) + assert.Equal(t, testCase.expectedVerifier, verifier) + }) + } +} + +func TestLedgerInterceptor(t *testing.T) { + block := &common.Block{} + + ledger := &mocks.LedgerWriter{} + ledger.On("Append", block).Return(nil).Once() + + var intercepted bool + + var interceptedLedger cluster.LedgerWriter = &cluster.LedgerInterceptor{ + Channel: "mychannel", + LedgerWriter: ledger, + InterceptBlockCommit: func(b *common.Block, channel string) { + assert.Equal(t, block, b) + assert.Equal(t, "mychannel", channel) + intercepted = true + }, + } + + err := interceptedLedger.Append(block) + assert.NoError(t, err) + assert.True(t, intercepted) + ledger.AssertCalled(t, "Append", block) +} + +func injectAdditionalTLSCAEndpointPair(t *testing.T, block *common.Block, endpoint string, tlsCA []byte, orgName string) { + // Unwrap the layers until we reach the orderer addresses + env, err := protoutil.ExtractEnvelope(block, 0) + assert.NoError(t, err) + payload, err := protoutil.UnmarshalPayload(env.Payload) + assert.NoError(t, err) + confEnv, err := configtx.UnmarshalConfigEnvelope(payload.Data) + assert.NoError(t, err) + ordererGrp := confEnv.Config.ChannelGroup.Groups[channelconfig.OrdererGroupKey].Groups + // Get the first orderer org config + var firstOrdererConfig *common.ConfigGroup + for _, grp := range ordererGrp { + firstOrdererConfig = grp + break + } + // Duplicate it. + secondOrdererConfig := proto.Clone(firstOrdererConfig).(*common.ConfigGroup) + ordererGrp[orgName] = secondOrdererConfig + // Reach the FabricMSPConfig buried in it. + mspConfig := &msp.MSPConfig{} + err = proto.Unmarshal(secondOrdererConfig.Values[channelconfig.MSPKey].Value, mspConfig) + assert.NoError(t, err) + + fabricConfig := &msp.FabricMSPConfig{} + err = proto.Unmarshal(mspConfig.Config, fabricConfig) + assert.NoError(t, err) + + // Plant the given TLS CA in it. + fabricConfig.TlsRootCerts = [][]byte{tlsCA} + // No intermediate root CAs, to make the test simpler. + fabricConfig.TlsIntermediateCerts = nil + // Rename it. + fabricConfig.Name = orgName + + // Pack the MSP config back into the config + secondOrdererConfig.Values[channelconfig.MSPKey].Value = protoutil.MarshalOrPanic(&msp.MSPConfig{ + Config: protoutil.MarshalOrPanic(fabricConfig), + Type: mspConfig.Type, + }) + + // Inject the endpoint + ordererOrgProtos := &common.OrdererAddresses{ + Addresses: []string{endpoint}, + } + secondOrdererConfig.Values[channelconfig.EndpointsKey].Value = protoutil.MarshalOrPanic(ordererOrgProtos) + + // Fold everything back into the block + payload.Data = protoutil.MarshalOrPanic(confEnv) + env.Payload = protoutil.MarshalOrPanic(payload) + block.Data.Data[0] = protoutil.MarshalOrPanic(env) +} + +func TestEndpointCriteriaString(t *testing.T) { + // The top cert is the issuer of the bottom cert + certs := `-----BEGIN CERTIFICATE----- +MIIBozCCAUigAwIBAgIQMXmzUnikiAZDr4VsrBL+rzAKBggqhkjOPQQDAjAxMS8w +LQYDVQQFEyY2NTc2NDA3Njc5ODcwOTA3OTEwNDM5NzkxMTAwNzA0Mzk3Njg3OTAe +Fw0xOTExMTEyMDM5MDRaFw0yOTExMDkyMDM5MDRaMDExLzAtBgNVBAUTJjY1NzY0 +MDc2Nzk4NzA5MDc5MTA0Mzk3OTExMDA3MDQzOTc2ODc5MFkwEwYHKoZIzj0CAQYI +KoZIzj0DAQcDQgAEzBBkRvWgasCKf1pejwpOu+1Fv9FffOZMHnna/7lfMrAqOs8d +HMDVU7mSexu7YNTpAwm4vkdHXi35H8zlVABTxaNCMEAwDgYDVR0PAQH/BAQDAgGm +MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8EBTADAQH/ +MAoGCCqGSM49BAMCA0kAMEYCIQCXqXoYLAJN9diIdGxPlRQJgJLju4brWXZfyt3s +E9TjFwIhAOuUJjcOchdP6UA9WLnVWciEo1Omf59NgfHL1gUPb/t6 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIBpDCCAUqgAwIBAgIRAIyvtL0z1xQ+NecXeH1HmmAwCgYIKoZIzj0EAwIwMTEv +MC0GA1UEBRMmNjU3NjQwNzY3OTg3MDkwNzkxMDQzOTc5MTEwMDcwNDM5NzY4Nzkw +HhcNMTkxMTExMjAzOTA0WhcNMTkxMTEyMjAzOTA0WjAyMTAwLgYDVQQFEycxODcw +MDQyMzcxODQwMjY5Mzk2ODUxNzk1NzM3MzIyMTc2OTA3MjAwWTATBgcqhkjOPQIB +BggqhkjOPQMBBwNCAARZBFDBOfC7T9RbsX+PgyE6sM7ocuwn6krIGjc00ICivFgQ +qdHMU7hiswiYwSvwh9MDHlprCRW3ycSgEYQgKU5to0IwQDAOBgNVHQ8BAf8EBAMC +BaAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMA8GA1UdEQQIMAaHBH8A +AAEwCgYIKoZIzj0EAwIDSAAwRQIhAK6G7qr/ClszCFP25gsflA31+7eoss5vi3o4 +qz8bY+s6AiBvO0aOfE8M4ibjmRE4vSXo0+gkOIJKqZcmiRdnJSr8Xw== +-----END CERTIFICATE-----` + + epc := cluster.EndpointCriteria{ + Endpoint: "orderer.example.com:7050", + TLSRootCAs: [][]byte{[]byte(certs)}, + } + + actual := fmt.Sprint(epc) + expected := `{"CAs":[{"Expired":false,"Issuer":"self","Subject":"SERIALNUMBER=65764076798709079104397911007043976879"},{"Expired":true,"Issuer":"SERIALNUMBER=65764076798709079104397911007043976879","Subject":"SERIALNUMBER=187004237184026939685179573732217690720"}],"Endpoint":"orderer.example.com:7050"}` + assert.Equal(t, expected, actual) +} + +func TestComparisonMemoizer(t *testing.T) { + var invocations int + + m := &cluster.ComparisonMemoizer{ + MaxEntries: 5, + F: func(a, b []byte) bool { + invocations++ + return bytes.Equal(a, b) + }, + } + + // Warm-up cache + for i := 0; i < 5; i++ { + notSame := m.Compare([]byte{byte(i)}, []byte{1, 2, 3}) + require.False(t, notSame) + require.Equal(t, i+1, invocations) + } + + // Ensure lookups are cached + for i := 0; i < 5; i++ { + notSame := m.Compare([]byte{byte(i)}, []byte{1, 2, 3}) + require.False(t, notSame) + require.Equal(t, 5, invocations) + } + + // Put a new entry which will cause a cache miss + same := m.Compare([]byte{5}, []byte{5}) + require.True(t, same) + require.Equal(t, 6, invocations) + + // Keep adding more and more elements to the cache and ensure it stays smaller than its size + for i := 0; i < 20; i++ { + odd := m.Compare([]byte{byte(1)}, []byte{byte(i % 2)}) + require.Equal(t, i%2 != 0, odd) + require.LessOrEqual(t, m.Size(), int(m.MaxEntries)) + } +} +``` + +## `protoutil/blockutils.go` (changed lines (13, 221)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package protoutil + +import ( + "bytes" + "crypto/sha256" + "encoding/asn1" + "math/big" + + "github.com/golang/protobuf/proto" + cb "github.com/hyperledger/fabric-protos-go/common" + "github.com/pkg/errors" +) + +// NewBlock constructs a block with no data and no metadata. +func NewBlock(seqNum uint64, previousHash []byte) *cb.Block { + block := &cb.Block{} + block.Header = &cb.BlockHeader{} + block.Header.Number = seqNum + block.Header.PreviousHash = previousHash + block.Header.DataHash = []byte{} + block.Data = &cb.BlockData{} + + var metadataContents [][]byte + for i := 0; i < len(cb.BlockMetadataIndex_name); i++ { + metadataContents = append(metadataContents, []byte{}) + } + block.Metadata = &cb.BlockMetadata{Metadata: metadataContents} + + return block +} + +type asn1Header struct { + Number *big.Int + PreviousHash []byte + DataHash []byte +} + +func BlockHeaderBytes(b *cb.BlockHeader) []byte { + asn1Header := asn1Header{ + PreviousHash: b.PreviousHash, + DataHash: b.DataHash, + Number: new(big.Int).SetUint64(b.Number), + } + result, err := asn1.Marshal(asn1Header) + if err != nil { + // Errors should only arise for types which cannot be encoded, since the + // BlockHeader type is known a-priori to contain only encodable types, an + // error here is fatal and should not be propagated + panic(err) + } + return result +} + +func BlockHeaderHash(b *cb.BlockHeader) []byte { + sum := sha256.Sum256(BlockHeaderBytes(b)) + return sum[:] +} + +func BlockDataHash(b *cb.BlockData) []byte { + sum := sha256.Sum256(bytes.Join(b.Data, nil)) + return sum[:] +} + +// GetChannelIDFromBlockBytes returns channel ID given byte array which represents +// the block +func GetChannelIDFromBlockBytes(bytes []byte) (string, error) { + block, err := UnmarshalBlock(bytes) + if err != nil { + return "", err + } + + return GetChannelIDFromBlock(block) +} + +// GetChannelIDFromBlock returns channel ID in the block +func GetChannelIDFromBlock(block *cb.Block) (string, error) { + if block == nil || block.Data == nil || block.Data.Data == nil || len(block.Data.Data) == 0 { + return "", errors.New("failed to retrieve channel id - block is empty") + } + var err error + envelope, err := GetEnvelopeFromBlock(block.Data.Data[0]) + if err != nil { + return "", err + } + payload, err := UnmarshalPayload(envelope.Payload) + if err != nil { + return "", err + } + + if payload.Header == nil { + return "", errors.New("failed to retrieve channel id - payload header is empty") + } + chdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return "", err + } + + return chdr.ChannelId, nil +} + +// GetMetadataFromBlock retrieves metadata at the specified index. +func GetMetadataFromBlock(block *cb.Block, index cb.BlockMetadataIndex) (*cb.Metadata, error) { + if block.Metadata == nil { + return nil, errors.New("no metadata in block") + } + + if len(block.Metadata.Metadata) <= int(index) { + return nil, errors.Errorf("no metadata at index [%s]", index) + } + + md := &cb.Metadata{} + err := proto.Unmarshal(block.Metadata.Metadata[index], md) + if err != nil { + return nil, errors.Wrapf(err, "error unmarshaling metadata at index [%s]", index) + } + return md, nil +} + +// GetMetadataFromBlockOrPanic retrieves metadata at the specified index, or +// panics on error +func GetMetadataFromBlockOrPanic(block *cb.Block, index cb.BlockMetadataIndex) *cb.Metadata { + md, err := GetMetadataFromBlock(block, index) + if err != nil { + panic(err) + } + return md +} + +// GetConsenterMetadataFromBlock attempts to retrieve consenter metadata from the value +// stored in block metadata at index SIGNATURES (first field). If no consenter metadata +// is found there, it falls back to index ORDERER (third field). +func GetConsenterMetadataFromBlock(block *cb.Block) (*cb.Metadata, error) { + m, err := GetMetadataFromBlock(block, cb.BlockMetadataIndex_SIGNATURES) + if err != nil { + return nil, errors.WithMessage(err, "failed to retrieve metadata") + } + + // TODO FAB-15864 Remove this fallback when we can stop supporting upgrade from pre-1.4.1 orderer + if len(m.Value) == 0 { + return GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + } + + obm := &cb.OrdererBlockMetadata{} + err = proto.Unmarshal(m.Value, obm) + if err != nil { + return nil, errors.Wrap(err, "failed to unmarshal orderer block metadata") + } + + res := &cb.Metadata{} + err = proto.Unmarshal(obm.ConsenterMetadata, res) + if err != nil { + return nil, errors.Wrap(err, "failed to unmarshal consenter metadata") + } + + return res, nil +} + +// GetLastConfigIndexFromBlock retrieves the index of the last config block as +// encoded in the block metadata +func GetLastConfigIndexFromBlock(block *cb.Block) (uint64, error) { + m, err := GetMetadataFromBlock(block, cb.BlockMetadataIndex_SIGNATURES) + if err != nil { + return 0, errors.WithMessage(err, "failed to retrieve metadata") + } + // TODO FAB-15864 Remove this fallback when we can stop supporting upgrade from pre-1.4.1 orderer + if len(m.Value) == 0 { + m, err := GetMetadataFromBlock(block, cb.BlockMetadataIndex_LAST_CONFIG) + if err != nil { + return 0, errors.WithMessage(err, "failed to retrieve metadata") + } + lc := &cb.LastConfig{} + err = proto.Unmarshal(m.Value, lc) + if err != nil { + return 0, errors.Wrap(err, "error unmarshaling LastConfig") + } + return lc.Index, nil + } + + obm := &cb.OrdererBlockMetadata{} + err = proto.Unmarshal(m.Value, obm) + if err != nil { + return 0, errors.Wrap(err, "failed to unmarshal orderer block metadata") + } + return obm.LastConfig.Index, nil +} + +// GetLastConfigIndexFromBlockOrPanic retrieves the index of the last config +// block as encoded in the block metadata, or panics on error +func GetLastConfigIndexFromBlockOrPanic(block *cb.Block) uint64 { + index, err := GetLastConfigIndexFromBlock(block) + if err != nil { + panic(err) + } + return index +} + +// CopyBlockMetadata copies metadata from one block into another +func CopyBlockMetadata(src *cb.Block, dst *cb.Block) { + dst.Metadata = src.Metadata + // Once copied initialize with rest of the + // required metadata positions. + InitBlockMetadata(dst) +} + +// InitBlockMetadata initializes metadata structure +func InitBlockMetadata(block *cb.Block) { + if block.Metadata == nil { + block.Metadata = &cb.BlockMetadata{Metadata: [][]byte{{}, {}, {}, {}, {}}} + } else if len(block.Metadata.Metadata) < int(cb.BlockMetadataIndex_COMMIT_HASH+1) { + for i := int(len(block.Metadata.Metadata)); i <= int(cb.BlockMetadataIndex_COMMIT_HASH); i++ { + block.Metadata.Metadata = append(block.Metadata.Metadata, []byte{}) + } + } +} +``` + +## `protoutil/blockutils_test.go` (changed lines (213, 214, 379)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package protoutil_test + +import ( + "crypto/sha256" + "encoding/asn1" + "math" + "testing" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go/common" + configtxtest "github.com/hyperledger/fabric/common/configtx/test" + "github.com/hyperledger/fabric/protoutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var testChannelID = "myuniquetestchainid" + +func TestNewBlock(t *testing.T) { + var block *cb.Block + assert.Nil(t, block.GetHeader()) + assert.Nil(t, block.GetData()) + assert.Nil(t, block.GetMetadata()) + + data := &cb.BlockData{ + Data: [][]byte{{0, 1, 2}}, + } + block = protoutil.NewBlock(uint64(0), []byte("datahash")) + assert.Equal(t, []byte("datahash"), block.Header.PreviousHash, "Incorrect previous hash") + assert.NotNil(t, block.GetData()) + assert.NotNil(t, block.GetMetadata()) + block.GetHeader().DataHash = protoutil.BlockDataHash(data) + + asn1Bytes, err := asn1.Marshal(struct { + Number int64 + PreviousHash []byte + DataHash []byte + }{ + Number: 0, + DataHash: protoutil.BlockDataHash(data), + PreviousHash: []byte("datahash"), + }) + headerHash := sha256.Sum256(asn1Bytes) + assert.NoError(t, err) + assert.Equal(t, asn1Bytes, protoutil.BlockHeaderBytes(block.Header), "Incorrect marshaled blockheader bytes") + assert.Equal(t, headerHash[:], protoutil.BlockHeaderHash(block.Header), "Incorrect blockheader hash") +} + +func TestGoodBlockHeaderBytes(t *testing.T) { + goodBlockHeader := &common.BlockHeader{ + Number: 1, + PreviousHash: []byte("foo"), + DataHash: []byte("bar"), + } + + _ = protoutil.BlockHeaderBytes(goodBlockHeader) // Should not panic + + goodBlockHeaderMaxNumber := &common.BlockHeader{ + Number: math.MaxUint64, + PreviousHash: []byte("foo"), + DataHash: []byte("bar"), + } + + _ = protoutil.BlockHeaderBytes(goodBlockHeaderMaxNumber) // Should not panic +} + +func TestGetChannelIDFromBlockBytes(t *testing.T) { + gb, err := configtxtest.MakeGenesisBlock(testChannelID) + assert.NoError(t, err, "Failed to create test configuration block") + bytes, err := proto.Marshal(gb) + assert.NoError(t, err) + cid, err := protoutil.GetChannelIDFromBlockBytes(bytes) + assert.NoError(t, err) + assert.Equal(t, testChannelID, cid, "Failed to return expected chain ID") + + // bad block bytes + _, err = protoutil.GetChannelIDFromBlockBytes([]byte("bad block")) + assert.Error(t, err, "Expected error with malformed block bytes") +} + +func TestGetChannelIDFromBlock(t *testing.T) { + var err error + var gb *common.Block + var cid string + + // nil block + _, err = protoutil.GetChannelIDFromBlock(gb) + assert.Error(t, err, "Expected error getting channel id from nil block") + + gb, err = configtxtest.MakeGenesisBlock(testChannelID) + assert.NoError(t, err, "Failed to create test configuration block") + + cid, err = protoutil.GetChannelIDFromBlock(gb) + assert.NoError(t, err, "Failed to get chain ID from block") + assert.Equal(t, testChannelID, cid, "Failed to return expected chain ID") + + // missing data + badBlock := gb + badBlock.Data = nil + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error with missing block data") + + // no envelope + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{[]byte("bad envelope")}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error with no envelope in data") + + // bad payload + env, _ := proto.Marshal(&cb.Envelope{ + Payload: []byte("bad payload"), + }) + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{env}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error - malformed payload") + + // bad channel header + payload, _ := proto.Marshal(&cb.Payload{ + Header: &cb.Header{ + ChannelHeader: []byte("bad header"), + }, + }) + env, _ = proto.Marshal(&cb.Envelope{ + Payload: payload, + }) + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{env}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error with malformed channel header") + + // nil payload header + payload, _ = proto.Marshal(&cb.Payload{}) + env, _ = proto.Marshal(&cb.Envelope{ + Payload: payload, + }) + badBlock = &cb.Block{ + Data: &cb.BlockData{ + Data: [][]byte{env}, + }, + } + _, err = protoutil.GetChannelIDFromBlock(badBlock) + assert.Error(t, err, "Expected error when payload header is nil") +} + +func TestGetBlockFromBlockBytes(t *testing.T) { + testChainID := "myuniquetestchainid" + gb, err := configtxtest.MakeGenesisBlock(testChainID) + assert.NoError(t, err, "Failed to create test configuration block") + blockBytes, err := protoutil.Marshal(gb) + assert.NoError(t, err, "Failed to marshal block") + _, err = protoutil.UnmarshalBlock(blockBytes) + assert.NoError(t, err, "to get block from block bytes") + + // bad block bytes + _, err = protoutil.UnmarshalBlock([]byte("bad block")) + assert.Error(t, err, "Expected error for malformed block bytes") +} + +func TestGetMetadataFromBlock(t *testing.T) { + t.Run("new block", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + md, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + assert.NoError(t, err, "Unexpected error extracting metadata from new block") + assert.Nil(t, md.Value, "Expected metadata field value to be nil") + assert.Equal(t, 0, len(md.Value), "Expected length of metadata field value to be 0") + md = protoutil.GetMetadataFromBlockOrPanic(block, cb.BlockMetadataIndex_ORDERER) + assert.NotNil(t, md, "Expected to get metadata from block") + }) + t.Run("no metadata", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + block.Metadata = nil + _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + assert.Error(t, err, "Expected error with nil metadata") + assert.Contains(t, err.Error(), "no metadata in block") + }) + t.Run("no metadata at index", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + block.Metadata.Metadata = [][]byte{{1, 2, 3}} + _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_LAST_CONFIG) + assert.Error(t, err, "Expected error with nil metadata") + assert.Contains(t, err.Error(), "no metadata at index") + }) + t.Run("malformed metadata", func(t *testing.T) { + block := protoutil.NewBlock(0, nil) + block.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = []byte("bad metadata") + _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) + assert.Error(t, err, "Expected error with malformed metadata") + assert.Contains(t, err.Error(), "error unmarshaling metadata at index [ORDERER]") + assert.Panics(t, func() { + _ = protoutil.GetMetadataFromBlockOrPanic(block, cb.BlockMetadataIndex_ORDERER) + }, "Expected panic with malformed metadata") + }) +} + +func TestGetConsenterMetadataFromBlock(t *testing.T) { + var cases = []struct { + name string + value []byte + signatures []byte + orderer []byte + pass bool + }{ + { + name: "empty", + value: nil, + signatures: nil, + orderer: nil, + pass: true, + }, + { + name: "signature only", + value: []byte("hello"), + signatures: protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{ + ConsenterMetadata: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + }), + }), + orderer: nil, + pass: true, + }, + { + name: "orderer only", + value: []byte("hello"), + signatures: nil, + orderer: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + pass: true, + }, + { + name: "both signatures and orderer", + value: []byte("hello"), + signatures: protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{ + ConsenterMetadata: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + }), + }), + orderer: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("hello")}), + pass: true, + }, + { + name: "malformed OrdererBlockMetadata", + signatures: protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("malformed")}), + orderer: nil, + pass: false, + }, + } + + for _, test := range cases { + block := protoutil.NewBlock(0, nil) + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = test.signatures + block.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = test.orderer + result, err := protoutil.GetConsenterMetadataFromBlock(block) + + if test.pass { + require.NoError(t, err) + require.Equal(t, result.Value, test.value) + } else { + require.Error(t, err) + } + } +} + +func TestInitBlockMeta(t *testing.T) { + // block with no metadata + block := &cb.Block{} + protoutil.InitBlockMetadata(block) + // should have 3 entries + assert.Equal(t, 5, len(block.Metadata.Metadata), "Expected block to have 5 metadata entries") + + // block with a single entry + block = &cb.Block{ + Metadata: &cb.BlockMetadata{}, + } + block.Metadata.Metadata = append(block.Metadata.Metadata, []byte{}) + protoutil.InitBlockMetadata(block) + // should have 3 entries + assert.Equal(t, 5, len(block.Metadata.Metadata), "Expected block to have 5 metadata entries") +} + +func TestCopyBlockMetadata(t *testing.T) { + srcBlock := protoutil.NewBlock(0, nil) + dstBlock := &cb.Block{} + + metadata, _ := proto.Marshal(&cb.Metadata{ + Value: []byte("orderer metadata"), + }) + srcBlock.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = metadata + protoutil.CopyBlockMetadata(srcBlock, dstBlock) + + // check that the copy worked + assert.Equal(t, len(srcBlock.Metadata.Metadata), len(dstBlock.Metadata.Metadata), + "Expected target block to have same number of metadata entries after copy") + assert.Equal(t, metadata, dstBlock.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER], + "Unexpected metadata from target block") +} + +func TestGetLastConfigIndexFromBlock(t *testing.T) { + index := uint64(2) + block := protoutil.NewBlock(0, nil) + + t.Run("block with last config metadata in signatures field", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{ + LastConfig: &cb.LastConfig{Index: 2}, + }), + }) + result, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.NoError(t, err, "Unexpected error returning last config index") + assert.Equal(t, index, result, "Unexpected last config index returned from block") + result = protoutil.GetLastConfigIndexFromBlockOrPanic(block) + assert.Equal(t, index, result, "Unexpected last config index returned from block") + }) + + t.Run("block with malformed signatures", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = []byte("apple") + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshaling metadata at index [SIGNATURES]") + }) + + t.Run("block with malformed orderer block metadata", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&cb.Metadata{Value: []byte("banana")}) + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to unmarshal orderer block metadata") + }) + + // TODO: FAB-15864 remove the tests below when we stop supporting upgrade from + // pre-1.4.1 orderer + t.Run("block with deprecated (pre-1.4.1) last config", func(t *testing.T) { + block = protoutil.NewBlock(0, nil) + block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&cb.Metadata{ + Value: protoutil.MarshalOrPanic(&cb.LastConfig{ + Index: index, + }), + }) + result, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.NoError(t, err, "Unexpected error returning last config index") + assert.Equal(t, index, result, "Unexpected last config index returned from block") + result = protoutil.GetLastConfigIndexFromBlockOrPanic(block) + assert.Equal(t, index, result, "Unexpected last config index returned from block") + }) + + t.Run("malformed metadata", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = []byte("bad metadata") + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshaling metadata at index [LAST_CONFIG]") + }) + + t.Run("malformed last config", func(t *testing.T) { + block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = protoutil.MarshalOrPanic(&cb.Metadata{ + Value: []byte("bad last config"), + }) + _, err := protoutil.GetLastConfigIndexFromBlock(block) + assert.Error(t, err, "Expected error with malformed last config metadata") + assert.Contains(t, err.Error(), "error unmarshaling LastConfig") + assert.Panics(t, func() { + _ = protoutil.GetLastConfigIndexFromBlockOrPanic(block) + }, "Expected panic with malformed last config metadata") + }) +} +``` + +## `protoutil/commonutils.go` (changed lines (191, 192)) + +```go +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package protoutil + +import ( + "crypto/rand" + "fmt" + "time" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/timestamp" + cb "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric/internal/pkg/identity" + "github.com/pkg/errors" +) + +// MarshalOrPanic serializes a protobuf message and panics if this +// operation fails +func MarshalOrPanic(pb proto.Message) []byte { + data, err := proto.Marshal(pb) + if err != nil { + panic(err) + } + return data +} + +// Marshal serializes a protobuf message. +func Marshal(pb proto.Message) ([]byte, error) { + return proto.Marshal(pb) +} + +// CreateNonceOrPanic generates a nonce using the common/crypto package +// and panics if this operation fails. +func CreateNonceOrPanic() []byte { + nonce, err := CreateNonce() + if err != nil { + panic(err) + } + return nonce +} + +// CreateNonce generates a nonce using the common/crypto package. +func CreateNonce() ([]byte, error) { + nonce, err := getRandomNonce() + return nonce, errors.WithMessage(err, "error generating random nonce") +} + +// UnmarshalEnvelopeOfType unmarshals an envelope of the specified type, +// including unmarshaling the payload data +func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, message proto.Message) (*cb.ChannelHeader, error) { + payload, err := UnmarshalPayload(envelope.Payload) + if err != nil { + return nil, err + } + + if payload.Header == nil { + return nil, errors.New("envelope must have a Header") + } + + chdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return nil, err + } + + if chdr.Type != int32(headerType) { + return nil, errors.Errorf("invalid type %s, expected %s", cb.HeaderType(chdr.Type), headerType) + } + + err = proto.Unmarshal(payload.Data, message) + err = errors.Wrapf(err, "error unmarshaling message for type %s", headerType) + return chdr, err +} + +// ExtractEnvelopeOrPanic retrieves the requested envelope from a given block +// and unmarshals it -- it panics if either of these operations fail +func ExtractEnvelopeOrPanic(block *cb.Block, index int) *cb.Envelope { + envelope, err := ExtractEnvelope(block, index) + if err != nil { + panic(err) + } + return envelope +} + +// ExtractEnvelope retrieves the requested envelope from a given block and +// unmarshals it +func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error) { + if block.Data == nil { + return nil, errors.New("block data is nil") + } + + envelopeCount := len(block.Data.Data) + if index < 0 || index >= envelopeCount { + return nil, errors.New("envelope index out of bounds") + } + marshaledEnvelope := block.Data.Data[index] + envelope, err := GetEnvelopeFromBlock(marshaledEnvelope) + err = errors.WithMessagef(err, "block data does not carry an envelope at index %d", index) + return envelope, err +} + +// MakeChannelHeader creates a ChannelHeader. +func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader { + return &cb.ChannelHeader{ + Type: int32(headerType), + Version: version, + Timestamp: ×tamp.Timestamp{ + Seconds: time.Now().Unix(), + Nanos: 0, + }, + ChannelId: chainID, + Epoch: epoch, + } +} + +// MakeSignatureHeader creates a SignatureHeader. +func MakeSignatureHeader(serializedCreatorCertChain []byte, nonce []byte) *cb.SignatureHeader { + return &cb.SignatureHeader{ + Creator: serializedCreatorCertChain, + Nonce: nonce, + } +} + +// SetTxID generates a transaction id based on the provided signature header +// and sets the TxId field in the channel header +func SetTxID(channelHeader *cb.ChannelHeader, signatureHeader *cb.SignatureHeader) { + channelHeader.TxId = ComputeTxID( + signatureHeader.Nonce, + signatureHeader.Creator, + ) +} + +// MakePayloadHeader creates a Payload Header. +func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header { + return &cb.Header{ + ChannelHeader: MarshalOrPanic(ch), + SignatureHeader: MarshalOrPanic(sh), + } +} + +// NewSignatureHeader returns a SignatureHeader with a valid nonce. +func NewSignatureHeader(id identity.Serializer) (*cb.SignatureHeader, error) { + creator, err := id.Serialize() + if err != nil { + return nil, err + } + nonce, err := CreateNonce() + if err != nil { + return nil, err + } + + return &cb.SignatureHeader{ + Creator: creator, + Nonce: nonce, + }, nil +} + +// NewSignatureHeaderOrPanic returns a signature header and panics on error. +func NewSignatureHeaderOrPanic(id identity.Serializer) *cb.SignatureHeader { + if id == nil { + panic(errors.New("invalid signer. cannot be nil")) + } + + signatureHeader, err := NewSignatureHeader(id) + if err != nil { + panic(fmt.Errorf("failed generating a new SignatureHeader: %s", err)) + } + + return signatureHeader +} + +// SignOrPanic signs a message and panics on error. +func SignOrPanic(signer identity.Signer, msg []byte) []byte { + if signer == nil { + panic(errors.New("invalid signer. cannot be nil")) + } + + sigma, err := signer.Sign(msg) + if err != nil { + panic(fmt.Errorf("failed generating signature: %s", err)) + } + return sigma +} + +// IsConfigBlock validates whenever given block contains configuration +// update transaction +func IsConfigBlock(block *cb.Block) bool { + envelope, err := ExtractEnvelope(block, 0) + if err != nil { + return false + } + + payload, err := UnmarshalPayload(envelope.Payload) + if err != nil { + return false + } + + if payload.Header == nil { + return false + } + + hdr, err := UnmarshalChannelHeader(payload.Header.ChannelHeader) + if err != nil { + return false + } + + return cb.HeaderType(hdr.Type) == cb.HeaderType_CONFIG || cb.HeaderType(hdr.Type) == cb.HeaderType_ORDERER_TRANSACTION +} + +// ChannelHeader returns the *cb.ChannelHeader for a given *cb.Envelope. +func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error) { + if env == nil { + return nil, errors.New("Invalid envelope payload. can't be nil") + } + + envPayload, err := UnmarshalPayload(env.Payload) + if err != nil { + return nil, err + } + + if envPayload.Header == nil { + return nil, errors.New("header not set") + } + + if envPayload.Header.ChannelHeader == nil { + return nil, errors.New("channel header not set") + } + + chdr, err := UnmarshalChannelHeader(envPayload.Header.ChannelHeader) + if err != nil { + return nil, errors.WithMessage(err, "error unmarshaling channel header") + } + + return chdr, nil +} + +// ChannelID returns the Channel ID for a given *cb.Envelope. +func ChannelID(env *cb.Envelope) (string, error) { + chdr, err := ChannelHeader(env) + if err != nil { + return "", errors.WithMessage(err, "error retrieving channel header") + } + + return chdr.ChannelId, nil +} + +// EnvelopeToConfigUpdate is used to extract a ConfigUpdateEnvelope from an envelope of +// type CONFIG_UPDATE +func EnvelopeToConfigUpdate(configtx *cb.Envelope) (*cb.ConfigUpdateEnvelope, error) { + configUpdateEnv := &cb.ConfigUpdateEnvelope{} + _, err := UnmarshalEnvelopeOfType(configtx, cb.HeaderType_CONFIG_UPDATE, configUpdateEnv) + if err != nil { + return nil, err + } + return configUpdateEnv, nil +} + +func getRandomNonce() ([]byte, error) { + key := make([]byte, 24) + + _, err := rand.Read(key) + if err != nil { + return nil, errors.Wrap(err, "error getting random bytes") + } + return key, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8f668d42db226cb50393b68dcd5b171a3e91062b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/task.json @@ -0,0 +1,62 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-a469597c1a5d38baeb5d", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-a469597c1a5d38baeb5d", + "project_id": "morefixes__hyperledger__fabric", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "internal/peer/gossip/mcs.go", + "orderer/common/cluster/replication_test.go", + "orderer/common/cluster/util.go", + "orderer/common/cluster/util_test.go", + "protoutil/blockutils.go", + "protoutil/blockutils_test.go", + "protoutil/commonutils.go" + ], + "patch_units": { + "before": [ + "internal/peer/gossip/mcs.go", + "orderer/common/cluster/replication_test.go", + "orderer/common/cluster/util.go", + "orderer/common/cluster/util_test.go", + "protoutil/blockutils.go", + "protoutil/blockutils_test.go", + "protoutil/commonutils.go" + ], + "after": [ + "internal/peer/gossip/mcs.go", + "orderer/common/cluster/replication_test.go", + "orderer/common/cluster/util.go", + "orderer/common/cluster/util_test.go", + "protoutil/blockutils.go", + "protoutil/blockutils_test.go", + "protoutil/commonutils.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/84105975530ca1bcfe7e3b9e2ee2fa7f49bed7e561a816808e6db3c63e3f2498/database", + "cache_key": "84105975530ca1bcfe7e3b9e2ee2fa7f49bed7e561a816808e6db3c63e3f2498", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/056daac315147b6d3b2738b83792c5e60b049331a0ce2fef89b6e9f4c02719f4/database", + "cache_key": "056daac315147b6d3b2738b83792c5e60b049331a0ce2fef89b6e9f4c02719f4", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/8cb8855a76d412ffba55a5bed1e99ac6e596cb2e1d45995df36559b658ad1caa/database", + "cache_key": "8cb8855a76d412ffba55a5bed1e99ac6e596cb2e1d45995df36559b658ad1caa", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-a469597c1a5d38baeb5d/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-a469597c1a5d38baeb5d/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a469597c1a5d38baeb5d/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..097fbbd6b52f7a0aae2a5a3706cafb6e66b7f906 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/patch.diff @@ -0,0 +1,26 @@ +diff --git a/trunk/research/api-server/server.go b/trunk/research/api-server/server.go +index 8942d8c41..aa379528b 100644 +--- a/trunk/research/api-server/server.go ++++ b/trunk/research/api-server/server.go +@@ -400,10 +400,18 @@ func (v *SnapshotJob) do(ffmpegPath, inputUrl string) (err error) { + normalPicPath := path.Join(outputPicDir, fmt.Sprintf("%v", v.Stream)+"-%03d.png") + bestPng := path.Join(outputPicDir, fmt.Sprintf("%v-best.png", v.Stream)) + +- param := fmt.Sprintf("%v -i %v -vf fps=1 -vcodec png -f image2 -an -y -vframes %v -y %v", ffmpegPath, inputUrl, v.vframes, normalPicPath) +- log.Println(fmt.Sprintf("start snapshot, cmd param=%v", param)) ++ params := []string{ ++ "-i", inputUrl, ++ "-vf", "fps=1", ++ "-vcodec", "png", ++ "-f", "image2", ++ "-an", ++ "-vframes", strconv.Itoa(v.vframes), ++ "-y", normalPicPath, ++ } ++ log.Println(fmt.Sprintf("start snapshot, cmd param=%v %v", ffmpegPath, strings.Join(params, " "))) + timeoutCtx, _ := context.WithTimeout(v.cancelCtx, v.timeout) +- cmd := exec.CommandContext(timeoutCtx, "/bin/bash", "-c", param) ++ cmd := exec.CommandContext(timeoutCtx, ffmpegPath, params...) + if err = cmd.Run(); err != nil { + log.Println(fmt.Sprintf("run snapshot %v cmd failed, err is %v", v.Tag(), err)) + return diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..61548e6312c23c6373ec4b65626b08061e364d1b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/post_context.md @@ -0,0 +1,849 @@ +# Patch-overlapping Go context after the fix + +## `trunk/research/api-server/server.go` (changed lines (403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 414)) + +```go +package main + +import ( + "context" + "encoding/json" + "flag" + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + "os/exec" + "path" + "path/filepath" + "strconv" + "strings" + "sync" + "time" +) + +type SrsCommonResponse struct { + Code int `json:"code"` + Data interface{} `json:"data"` +} + +func SrsWriteErrorResponse(w http.ResponseWriter, err error) { + w.WriteHeader(http.StatusInternalServerError) + w.Write([]byte(err.Error())) +} + +func SrsWriteDataResponse(w http.ResponseWriter, data interface{}) { + j, err := json.Marshal(data) + if err != nil { + SrsWriteErrorResponse(w, fmt.Errorf("marshal %v, err %v", err)) + return + } + + w.Header().Set("Content-Type", "application/json") + w.Write(j) +} + +var StaticDir string +var sw *SnapshotWorker + +// SrsCommonRequest is the common fields of request messages from SRS HTTP callback. +type SrsCommonRequest struct { + Action string `json:"action"` + ClientId string `json:"client_id"` + Ip string `json:"ip"` + Vhost string `json:"vhost"` + App string `json:"app"` +} + +func (v *SrsCommonRequest) String() string { + return fmt.Sprintf("action=%v, client_id=%v, ip=%v, vhost=%v", v.Action, v.ClientId, v.Ip, v.Vhost) +} + +/* +handle the clients requests: connect/disconnect vhost/app. +for SRS hook: on_connect/on_close +on_connect: + when client connect to vhost/app, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_connect", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "tcUrl": "rtmp://video.test.com/live?key=d2fa801d08e3f90ed1e1670e6e52651a", + "pageUrl": "http://www.test.com/live.html" + } +on_close: + when client close/disconnect to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_close", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "send_bytes": 10240, + "recv_bytes": 10240 + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ +type SrsClientRequest struct { + SrsCommonRequest + // For on_connect message + TcUrl string `json:"tcUrl"` + PageUrl string `json:"pageUrl"` + // For on_close message + SendBytes int64 `json:"send_bytes"` + RecvBytes int64 `json:"recv_bytes"` +} + +func (v *SrsClientRequest) IsOnConnect() bool { + return v.Action == "on_connect" +} + +func (v *SrsClientRequest) IsOnClose() bool { + return v.Action == "on_close" +} + +func (v *SrsClientRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnConnect() { + sb.WriteString(fmt.Sprintf(", tcUrl=%v, pageUrl=%v", v.TcUrl, v.PageUrl)) + } else if v.IsOnClose() { + sb.WriteString(fmt.Sprintf(", send_bytes=%v, recv_bytes=%v", v.SendBytes, v.RecvBytes)) + } + return sb.String() +} + +/* +for SRS hook: on_publish/on_unpublish +on_publish: + when client(encoder) publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_publish", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +on_unpublish: + when client(encoder) stop publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_unpublish", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ +type SrsStreamRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` +} + +func (v *SrsStreamRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnPublish() || v.IsOnUnPublish() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v", v.Stream, v.Param)) + } + return sb.String() +} + +func (v *SrsStreamRequest) IsOnPublish() bool { + return v.Action == "on_publish" +} + +func (v *SrsStreamRequest) IsOnUnPublish() bool { + return v.Action == "on_unpublish" +} + +/* +for SRS hook: on_play/on_stop +on_play: + when client(encoder) publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_play", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy", + "pageUrl": "http://www.test.com/live.html" + } +on_stop: + when client(encoder) stop publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_stop", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsSessionRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` + // For on_play only. + PageUrl string `json:"pageUrl"` +} + +func (v *SrsSessionRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnPlay() || v.IsOnStop() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v", v.Stream, v.Param)) + } + if v.IsOnPlay() { + sb.WriteString(fmt.Sprintf(", pageUrl=%v", v.PageUrl)) + } + return sb.String() +} + +func (v *SrsSessionRequest) IsOnPlay() bool { + return v.Action == "on_play" +} + +func (v *SrsSessionRequest) IsOnStop() bool { + return v.Action == "on_stop" +} + +/* +for SRS hook: on_dvr +on_dvr: + when srs reap a dvr file, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_dvr", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy", + "cwd": "/usr/local/srs", + "file": "./objs/nginx/html/live/livestream.1420254068776.flv" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsDvrRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` + Cwd string `json:"cwd"` + File string `json:"file"` +} + +func (v *SrsDvrRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnDvr() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v, cwd=%v, file=%v", v.Stream, v.Param, v.Cwd, v.File)) + } + return sb.String() +} + +func (v *SrsDvrRequest) IsOnDvr() bool { + return v.Action == "on_dvr" +} + +/* +for SRS hook: on_hls_notify +on_hls_notify: + when srs reap a ts file of hls, call this hook, + used to push file to cdn network, by get the ts file from cdn network. + so we use HTTP GET and use the variable following: + [app], replace with the app. + [stream], replace with the stream. + [param], replace with the param. + [ts_url], replace with the ts url. + ignore any return data of server. + +for SRS hook: on_hls +on_hls: + when srs reap a dvr file, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_hls", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy", + "duration": 9.68, // in seconds + "cwd": "/usr/local/srs", + "file": "./objs/nginx/html/live/livestream.1420254068776-100.ts", + "seq_no": 100 + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsHlsRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` + Duration float64 `json:"duration"` + Cwd string `json:"cwd"` + File string `json:"file"` + SeqNo int `json:"seq_no"` +} + +func (v *SrsHlsRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnHls() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v, cwd=%v, file=%v, duration=%v, seq_no=%v", v.Stream, v.Param, v.Cwd, v.File, v.Duration, v.SeqNo)) + } + return sb.String() +} + +func (v *SrsHlsRequest) IsOnHls() bool { + return v.Action == "on_hls" +} + +/* +the snapshot api, +to start a snapshot when encoder start publish stream, +stop the snapshot worker when stream finished. + +{"action":"on_publish","client_id":108,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream"} +{"action":"on_unpublish","client_id":108,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream"} +*/ + +type SrsSnapShotRequest struct { + SrsCommonRequest + Stream string `json:"stream"` +} + +func (v *SrsSnapShotRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnPublish() || v.IsOnUnPublish() { + sb.WriteString(fmt.Sprintf(", stream=%v", v.Stream)) + } + return sb.String() +} + +func (v *SrsSnapShotRequest) IsOnPublish() bool { + return v.Action == "on_publish" +} + +func (v *SrsSnapShotRequest) IsOnUnPublish() bool { + return v.Action == "on_unpublish" +} + +type SnapshotJob struct { + SrsSnapShotRequest + updatedAt time.Time + cancelCtx context.Context + cancelFunc context.CancelFunc + vframes int + timeout time.Duration +} + +func NewSnapshotJob() *SnapshotJob { + v := &SnapshotJob{ + vframes: 5, + timeout: time.Duration(30) * time.Second, + } + v.cancelCtx, v.cancelFunc = context.WithCancel(context.Background()) + return v +} + +func (v *SnapshotJob) Tag() string { + return fmt.Sprintf("%v/%v/%v", v.Vhost, v.App, v.Stream) +} + +func (v *SnapshotJob) Abort() { + v.cancelFunc() + log.Println(fmt.Sprintf("cancel snapshot job %v", v.Tag())) +} + +/* +./objs/ffmpeg/bin/ffmpeg -i rtmp://127.0.0.1/live/livestream \ + -vf fps=1 -vcodec png -f image2 -an -vframes 5 \ + -y static-dir/live/livestream-%03d.png +*/ +func (v *SnapshotJob) do(ffmpegPath, inputUrl string) (err error) { + outputPicDir := path.Join(StaticDir, v.App) + if err = os.MkdirAll(outputPicDir, 0777); err != nil { + log.Println(fmt.Sprintf("create snapshot image dir:%v failed, err is %v", outputPicDir, err)) + return + } + + normalPicPath := path.Join(outputPicDir, fmt.Sprintf("%v", v.Stream)+"-%03d.png") + bestPng := path.Join(outputPicDir, fmt.Sprintf("%v-best.png", v.Stream)) + + params := []string{ + "-i", inputUrl, + "-vf", "fps=1", + "-vcodec", "png", + "-f", "image2", + "-an", + "-vframes", strconv.Itoa(v.vframes), + "-y", normalPicPath, + } + log.Println(fmt.Sprintf("start snapshot, cmd param=%v %v", ffmpegPath, strings.Join(params, " "))) + timeoutCtx, _ := context.WithTimeout(v.cancelCtx, v.timeout) + cmd := exec.CommandContext(timeoutCtx, ffmpegPath, params...) + if err = cmd.Run(); err != nil { + log.Println(fmt.Sprintf("run snapshot %v cmd failed, err is %v", v.Tag(), err)) + return + } + + bestFileSize := int64(0) + for i := 1; i <= v.vframes; i++ { + pic := path.Join(outputPicDir, fmt.Sprintf("%v-%03d.png", v.Stream, i)) + fi, err := os.Stat(pic) + if err != nil { + log.Println(fmt.Sprintf("stat pic:%v failed, err is %v", pic, err)) + continue + } + if bestFileSize == 0 { + bestFileSize = fi.Size() + } else if fi.Size() > bestFileSize { + os.Remove(bestPng) + os.Symlink(pic, bestPng) + bestFileSize = fi.Size() + } + } + log.Println(fmt.Sprintf("%v the best thumbnail is %v", v.Tag(), bestPng)) + return +} + +func (v *SnapshotJob) Serve(ffmpegPath, inputUrl string) { + sleep := time.Duration(1) * time.Second + for { + v.do(ffmpegPath, inputUrl) + select { + case <-time.After(sleep): + log.Println(fmt.Sprintf("%v sleep %v to redo snapshot", v.Tag(), sleep)) + break + case <-v.cancelCtx.Done(): + log.Println(fmt.Sprintf("snapshot job %v cancelled", v.Tag())) + return + } + } +} + +type SnapshotWorker struct { + snapshots *sync.Map // key is stream url + ffmpegPath string +} + +func NewSnapshotWorker(ffmpegPath string) *SnapshotWorker { + sw := &SnapshotWorker{ + snapshots: new(sync.Map), + ffmpegPath: ffmpegPath, + } + return sw +} + +func (v *SnapshotWorker) Create(sm *SrsSnapShotRequest) { + streamUrl := fmt.Sprintf("rtmp://127.0.0.1/%v/%v?vhost=%v", sm.App, sm.Stream, sm.Vhost) + if _, ok := v.snapshots.Load(streamUrl); ok { + return + } + sj := NewSnapshotJob() + sj.SrsSnapShotRequest = *sm + sj.updatedAt = time.Now() + go sj.Serve(v.ffmpegPath, streamUrl) + v.snapshots.Store(streamUrl, sj) +} + +func (v *SnapshotWorker) Destroy(sm *SrsSnapShotRequest) { + streamUrl := fmt.Sprintf("rtmp://127.0.0.1/%v/%v?vhost=%v", sm.App, sm.Stream, sm.Vhost) + value, ok := v.snapshots.Load(streamUrl) + if ok { + sj := value.(*SnapshotJob) + sj.Abort() + v.snapshots.Delete(streamUrl) + log.Println(fmt.Sprintf("set stream:%v to destroy, update abort", sm.Stream)) + } else { + log.Println(fmt.Sprintf("cannot find stream:%v in snapshot worker", streamUrl)) + } + return +} + +/* +handle the forward requests: dynamic forward url. +for SRS hook: on_forward +on_forward: + when srs reap a dvr file, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_forward", + "server_id": "server_test", + "client_id": 1985, + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "tcUrl": "rtmp://video.test.com/live?key=d2fa801d08e3f90ed1e1670e6e52651a", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsForwardRequest struct { + SrsCommonRequest + TcUrl string `json:"tc_url"` + Stream string `json:"stream"` + Param string `json:"param"` +} + +func (v *SrsForwardRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnForward() { + sb.WriteString(fmt.Sprintf(", tcUrl=%v, stream=%v, param=%v", v.TcUrl, v.Stream, v.Param)) + } + return sb.String() +} + +func (v *SrsForwardRequest) IsOnForward() bool { + return v.Action == "on_forward" +} + +func main() { + srsBin := os.Args[0] + if strings.HasPrefix(srsBin, "/var") { + srsBin = "go run ." + } + + var port int + var ffmpegPath string + flag.IntVar(&port, "p", 8085, "HTTP listen port. Default is 8085") + flag.StringVar(&StaticDir, "s", "./static-dir", "HTML home for snapshot. Default is ./static-dir") + flag.StringVar(&ffmpegPath, "ffmpeg", "/usr/local/bin/ffmpeg", "FFmpeg for snapshot. Default is /usr/local/bin/ffmpeg") + flag.Usage = func() { + fmt.Println("A demo api-server for SRS\n") + fmt.Println(fmt.Sprintf("Usage: %v [flags]", srsBin)) + flag.PrintDefaults() + fmt.Println(fmt.Sprintf("For example:")) + fmt.Println(fmt.Sprintf(" %v -p 8085", srsBin)) + fmt.Println(fmt.Sprintf(" %v 8085", srsBin)) + } + flag.Parse() + + log.SetFlags(log.Lshortfile | log.Ldate | log.Ltime | log.Lmicroseconds) + + // check if only one number arg + if len(os.Args[1:]) == 1 { + portArg := os.Args[1] + var err error + if port, err = strconv.Atoi(portArg); err != nil { + log.Println(fmt.Sprintf("parse port arg:%v to int failed, err %v", portArg, err)) + flag.Usage() + os.Exit(1) + } + } + + sw = NewSnapshotWorker(ffmpegPath) + StaticDir, err := filepath.Abs(StaticDir) + if err != nil { + panic(err) + } + log.Println(fmt.Sprintf("api server listen at port:%v, static_dir:%v", port, StaticDir)) + + http.Handle("/", http.FileServer(http.Dir(StaticDir))) + http.HandleFunc("/api/v1", func(writer http.ResponseWriter, request *http.Request) { + res := &struct { + Code int `json:"code"` + Urls struct { + Clients string `json:"clients"` + Streams string `json:"streams"` + Sessions string `json:"sessions"` + Dvrs string `json:"dvrs"` + Chats string `json:"chats"` + Servers struct { + Summary string `json:"summary"` + Get string `json:"GET"` + Post string `json:"POST ip=node_ip&device_id=device_id"` + } + } `json:"urls"` + }{ + Code: 0, + } + res.Urls.Clients = "for srs http callback, to handle the clients requests: connect/disconnect vhost/app." + res.Urls.Streams = "for srs http callback, to handle the streams requests: publish/unpublish stream." + res.Urls.Sessions = "for srs http callback, to handle the sessions requests: client play/stop stream." + res.Urls.Dvrs = "for srs http callback, to handle the dvr requests: dvr stream." + //res.Urls.Chats = "for srs demo meeting, the chat streams, public chat room." + res.Urls.Servers.Summary = "for srs raspberry-pi and meeting demo." + res.Urls.Servers.Get = "get the current raspberry-pi servers info." + res.Urls.Servers.Post = "the new raspberry-pi server info." + // TODO: no snapshots + body, _ := json.Marshal(res) + writer.Write(body) + }) + + // handle the clients requests: connect/disconnect vhost/app. + http.HandleFunc("/api/v1/clients", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to clients, req=%v", string(body))) + + msg := &SrsClientRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnConnect() && !msg.IsOnClose() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the streams requests: publish/unpublish stream. + http.HandleFunc("/api/v1/streams", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to streams, req=%v", string(body))) + + msg := &SrsStreamRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnPublish() && !msg.IsOnUnPublish() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the sessions requests: client play/stop stream + http.HandleFunc("/api/v1/sessions", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to sessions, req=%v", string(body))) + + msg := &SrsSessionRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnPlay() && !msg.IsOnStop() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the dvrs requests: dvr stream. + http.HandleFunc("/api/v1/dvrs", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to dvrs, req=%v", string(body))) + + msg := &SrsDvrRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnDvr() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the dvrs requests: on_hls stream. + http.HandleFunc("/api/v1/hls", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to hls, req=%v", string(body))) + + msg := &SrsHlsRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnHls() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // not support yet + http.HandleFunc("/api/v1/chat", func(w http.ResponseWriter, r *http.Request) { + SrsWriteErrorResponse(w, fmt.Errorf("not implemented")) + }) + + http.HandleFunc("/api/v1/snapshots", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to snapshots, req=%v", string(body))) + + msg := &SrsSnapShotRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if msg.IsOnPublish() { + sw.Create(msg) + } else if msg.IsOnUnPublish() { + sw.Destroy(msg) + } else { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the dynamic forward requests: on_forward stream. + http.HandleFunc("/api/v1/forward", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to forward, req=%v", string(body))) + + msg := &SrsForwardRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnForward() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0, Data: &struct { + Urls []string `json:"urls"` + }{ + Urls: []string{"rtmp://127.0.0.1:19350/test/teststream"}, + }}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + addr := fmt.Sprintf(":%v", port) + log.Println(fmt.Sprintf("start listen on:%v", addr)) + if err := http.ListenAndServe(addr, nil); err != nil { + log.Println(fmt.Sprintf("listen on addr:%v failed, err is %v", addr, err)) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..090c26b2c22bf12db3fd7e26a3baf6733f47ad3e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/pre_context.md @@ -0,0 +1,841 @@ +# Patch-overlapping Go context before the fix + +## `trunk/research/api-server/server.go` (changed lines (403, 404, 405, 406, 407)) + +```go +package main + +import ( + "context" + "encoding/json" + "flag" + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + "os/exec" + "path" + "path/filepath" + "strconv" + "strings" + "sync" + "time" +) + +type SrsCommonResponse struct { + Code int `json:"code"` + Data interface{} `json:"data"` +} + +func SrsWriteErrorResponse(w http.ResponseWriter, err error) { + w.WriteHeader(http.StatusInternalServerError) + w.Write([]byte(err.Error())) +} + +func SrsWriteDataResponse(w http.ResponseWriter, data interface{}) { + j, err := json.Marshal(data) + if err != nil { + SrsWriteErrorResponse(w, fmt.Errorf("marshal %v, err %v", err)) + return + } + + w.Header().Set("Content-Type", "application/json") + w.Write(j) +} + +var StaticDir string +var sw *SnapshotWorker + +// SrsCommonRequest is the common fields of request messages from SRS HTTP callback. +type SrsCommonRequest struct { + Action string `json:"action"` + ClientId string `json:"client_id"` + Ip string `json:"ip"` + Vhost string `json:"vhost"` + App string `json:"app"` +} + +func (v *SrsCommonRequest) String() string { + return fmt.Sprintf("action=%v, client_id=%v, ip=%v, vhost=%v", v.Action, v.ClientId, v.Ip, v.Vhost) +} + +/* +handle the clients requests: connect/disconnect vhost/app. +for SRS hook: on_connect/on_close +on_connect: + when client connect to vhost/app, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_connect", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "tcUrl": "rtmp://video.test.com/live?key=d2fa801d08e3f90ed1e1670e6e52651a", + "pageUrl": "http://www.test.com/live.html" + } +on_close: + when client close/disconnect to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_close", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "send_bytes": 10240, + "recv_bytes": 10240 + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ +type SrsClientRequest struct { + SrsCommonRequest + // For on_connect message + TcUrl string `json:"tcUrl"` + PageUrl string `json:"pageUrl"` + // For on_close message + SendBytes int64 `json:"send_bytes"` + RecvBytes int64 `json:"recv_bytes"` +} + +func (v *SrsClientRequest) IsOnConnect() bool { + return v.Action == "on_connect" +} + +func (v *SrsClientRequest) IsOnClose() bool { + return v.Action == "on_close" +} + +func (v *SrsClientRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnConnect() { + sb.WriteString(fmt.Sprintf(", tcUrl=%v, pageUrl=%v", v.TcUrl, v.PageUrl)) + } else if v.IsOnClose() { + sb.WriteString(fmt.Sprintf(", send_bytes=%v, recv_bytes=%v", v.SendBytes, v.RecvBytes)) + } + return sb.String() +} + +/* +for SRS hook: on_publish/on_unpublish +on_publish: + when client(encoder) publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_publish", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +on_unpublish: + when client(encoder) stop publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_unpublish", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ +type SrsStreamRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` +} + +func (v *SrsStreamRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnPublish() || v.IsOnUnPublish() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v", v.Stream, v.Param)) + } + return sb.String() +} + +func (v *SrsStreamRequest) IsOnPublish() bool { + return v.Action == "on_publish" +} + +func (v *SrsStreamRequest) IsOnUnPublish() bool { + return v.Action == "on_unpublish" +} + +/* +for SRS hook: on_play/on_stop +on_play: + when client(encoder) publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_play", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy", + "pageUrl": "http://www.test.com/live.html" + } +on_stop: + when client(encoder) stop publish to vhost/app/stream, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_stop", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsSessionRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` + // For on_play only. + PageUrl string `json:"pageUrl"` +} + +func (v *SrsSessionRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnPlay() || v.IsOnStop() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v", v.Stream, v.Param)) + } + if v.IsOnPlay() { + sb.WriteString(fmt.Sprintf(", pageUrl=%v", v.PageUrl)) + } + return sb.String() +} + +func (v *SrsSessionRequest) IsOnPlay() bool { + return v.Action == "on_play" +} + +func (v *SrsSessionRequest) IsOnStop() bool { + return v.Action == "on_stop" +} + +/* +for SRS hook: on_dvr +on_dvr: + when srs reap a dvr file, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_dvr", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy", + "cwd": "/usr/local/srs", + "file": "./objs/nginx/html/live/livestream.1420254068776.flv" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsDvrRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` + Cwd string `json:"cwd"` + File string `json:"file"` +} + +func (v *SrsDvrRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnDvr() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v, cwd=%v, file=%v", v.Stream, v.Param, v.Cwd, v.File)) + } + return sb.String() +} + +func (v *SrsDvrRequest) IsOnDvr() bool { + return v.Action == "on_dvr" +} + +/* +for SRS hook: on_hls_notify +on_hls_notify: + when srs reap a ts file of hls, call this hook, + used to push file to cdn network, by get the ts file from cdn network. + so we use HTTP GET and use the variable following: + [app], replace with the app. + [stream], replace with the stream. + [param], replace with the param. + [ts_url], replace with the ts url. + ignore any return data of server. + +for SRS hook: on_hls +on_hls: + when srs reap a dvr file, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_hls", + "client_id": "9308h583", + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "stream": "livestream", + "param":"?token=xxx&salt=yyy", + "duration": 9.68, // in seconds + "cwd": "/usr/local/srs", + "file": "./objs/nginx/html/live/livestream.1420254068776-100.ts", + "seq_no": 100 + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsHlsRequest struct { + SrsCommonRequest + Stream string `json:"stream"` + Param string `json:"param"` + Duration float64 `json:"duration"` + Cwd string `json:"cwd"` + File string `json:"file"` + SeqNo int `json:"seq_no"` +} + +func (v *SrsHlsRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnHls() { + sb.WriteString(fmt.Sprintf(", stream=%v, param=%v, cwd=%v, file=%v, duration=%v, seq_no=%v", v.Stream, v.Param, v.Cwd, v.File, v.Duration, v.SeqNo)) + } + return sb.String() +} + +func (v *SrsHlsRequest) IsOnHls() bool { + return v.Action == "on_hls" +} + +/* +the snapshot api, +to start a snapshot when encoder start publish stream, +stop the snapshot worker when stream finished. + +{"action":"on_publish","client_id":108,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream"} +{"action":"on_unpublish","client_id":108,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream"} +*/ + +type SrsSnapShotRequest struct { + SrsCommonRequest + Stream string `json:"stream"` +} + +func (v *SrsSnapShotRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnPublish() || v.IsOnUnPublish() { + sb.WriteString(fmt.Sprintf(", stream=%v", v.Stream)) + } + return sb.String() +} + +func (v *SrsSnapShotRequest) IsOnPublish() bool { + return v.Action == "on_publish" +} + +func (v *SrsSnapShotRequest) IsOnUnPublish() bool { + return v.Action == "on_unpublish" +} + +type SnapshotJob struct { + SrsSnapShotRequest + updatedAt time.Time + cancelCtx context.Context + cancelFunc context.CancelFunc + vframes int + timeout time.Duration +} + +func NewSnapshotJob() *SnapshotJob { + v := &SnapshotJob{ + vframes: 5, + timeout: time.Duration(30) * time.Second, + } + v.cancelCtx, v.cancelFunc = context.WithCancel(context.Background()) + return v +} + +func (v *SnapshotJob) Tag() string { + return fmt.Sprintf("%v/%v/%v", v.Vhost, v.App, v.Stream) +} + +func (v *SnapshotJob) Abort() { + v.cancelFunc() + log.Println(fmt.Sprintf("cancel snapshot job %v", v.Tag())) +} + +/* +./objs/ffmpeg/bin/ffmpeg -i rtmp://127.0.0.1/live/livestream \ + -vf fps=1 -vcodec png -f image2 -an -vframes 5 \ + -y static-dir/live/livestream-%03d.png +*/ +func (v *SnapshotJob) do(ffmpegPath, inputUrl string) (err error) { + outputPicDir := path.Join(StaticDir, v.App) + if err = os.MkdirAll(outputPicDir, 0777); err != nil { + log.Println(fmt.Sprintf("create snapshot image dir:%v failed, err is %v", outputPicDir, err)) + return + } + + normalPicPath := path.Join(outputPicDir, fmt.Sprintf("%v", v.Stream)+"-%03d.png") + bestPng := path.Join(outputPicDir, fmt.Sprintf("%v-best.png", v.Stream)) + + param := fmt.Sprintf("%v -i %v -vf fps=1 -vcodec png -f image2 -an -y -vframes %v -y %v", ffmpegPath, inputUrl, v.vframes, normalPicPath) + log.Println(fmt.Sprintf("start snapshot, cmd param=%v", param)) + timeoutCtx, _ := context.WithTimeout(v.cancelCtx, v.timeout) + cmd := exec.CommandContext(timeoutCtx, "/bin/bash", "-c", param) + if err = cmd.Run(); err != nil { + log.Println(fmt.Sprintf("run snapshot %v cmd failed, err is %v", v.Tag(), err)) + return + } + + bestFileSize := int64(0) + for i := 1; i <= v.vframes; i++ { + pic := path.Join(outputPicDir, fmt.Sprintf("%v-%03d.png", v.Stream, i)) + fi, err := os.Stat(pic) + if err != nil { + log.Println(fmt.Sprintf("stat pic:%v failed, err is %v", pic, err)) + continue + } + if bestFileSize == 0 { + bestFileSize = fi.Size() + } else if fi.Size() > bestFileSize { + os.Remove(bestPng) + os.Symlink(pic, bestPng) + bestFileSize = fi.Size() + } + } + log.Println(fmt.Sprintf("%v the best thumbnail is %v", v.Tag(), bestPng)) + return +} + +func (v *SnapshotJob) Serve(ffmpegPath, inputUrl string) { + sleep := time.Duration(1) * time.Second + for { + v.do(ffmpegPath, inputUrl) + select { + case <-time.After(sleep): + log.Println(fmt.Sprintf("%v sleep %v to redo snapshot", v.Tag(), sleep)) + break + case <-v.cancelCtx.Done(): + log.Println(fmt.Sprintf("snapshot job %v cancelled", v.Tag())) + return + } + } +} + +type SnapshotWorker struct { + snapshots *sync.Map // key is stream url + ffmpegPath string +} + +func NewSnapshotWorker(ffmpegPath string) *SnapshotWorker { + sw := &SnapshotWorker{ + snapshots: new(sync.Map), + ffmpegPath: ffmpegPath, + } + return sw +} + +func (v *SnapshotWorker) Create(sm *SrsSnapShotRequest) { + streamUrl := fmt.Sprintf("rtmp://127.0.0.1/%v/%v?vhost=%v", sm.App, sm.Stream, sm.Vhost) + if _, ok := v.snapshots.Load(streamUrl); ok { + return + } + sj := NewSnapshotJob() + sj.SrsSnapShotRequest = *sm + sj.updatedAt = time.Now() + go sj.Serve(v.ffmpegPath, streamUrl) + v.snapshots.Store(streamUrl, sj) +} + +func (v *SnapshotWorker) Destroy(sm *SrsSnapShotRequest) { + streamUrl := fmt.Sprintf("rtmp://127.0.0.1/%v/%v?vhost=%v", sm.App, sm.Stream, sm.Vhost) + value, ok := v.snapshots.Load(streamUrl) + if ok { + sj := value.(*SnapshotJob) + sj.Abort() + v.snapshots.Delete(streamUrl) + log.Println(fmt.Sprintf("set stream:%v to destroy, update abort", sm.Stream)) + } else { + log.Println(fmt.Sprintf("cannot find stream:%v in snapshot worker", streamUrl)) + } + return +} + +/* +handle the forward requests: dynamic forward url. +for SRS hook: on_forward +on_forward: + when srs reap a dvr file, call the hook, + the request in the POST data string is a object encode by json: + { + "action": "on_forward", + "server_id": "server_test", + "client_id": 1985, + "ip": "192.168.1.10", + "vhost": "video.test.com", + "app": "live", + "tcUrl": "rtmp://video.test.com/live?key=d2fa801d08e3f90ed1e1670e6e52651a", + "stream": "livestream", + "param":"?token=xxx&salt=yyy" + } +if valid, the hook must return HTTP code 200(Stauts OK) and response +an int value specifies the error code(0 corresponding to success): + 0 +*/ + +type SrsForwardRequest struct { + SrsCommonRequest + TcUrl string `json:"tc_url"` + Stream string `json:"stream"` + Param string `json:"param"` +} + +func (v *SrsForwardRequest) String() string { + var sb strings.Builder + sb.WriteString(v.SrsCommonRequest.String()) + if v.IsOnForward() { + sb.WriteString(fmt.Sprintf(", tcUrl=%v, stream=%v, param=%v", v.TcUrl, v.Stream, v.Param)) + } + return sb.String() +} + +func (v *SrsForwardRequest) IsOnForward() bool { + return v.Action == "on_forward" +} + +func main() { + srsBin := os.Args[0] + if strings.HasPrefix(srsBin, "/var") { + srsBin = "go run ." + } + + var port int + var ffmpegPath string + flag.IntVar(&port, "p", 8085, "HTTP listen port. Default is 8085") + flag.StringVar(&StaticDir, "s", "./static-dir", "HTML home for snapshot. Default is ./static-dir") + flag.StringVar(&ffmpegPath, "ffmpeg", "/usr/local/bin/ffmpeg", "FFmpeg for snapshot. Default is /usr/local/bin/ffmpeg") + flag.Usage = func() { + fmt.Println("A demo api-server for SRS\n") + fmt.Println(fmt.Sprintf("Usage: %v [flags]", srsBin)) + flag.PrintDefaults() + fmt.Println(fmt.Sprintf("For example:")) + fmt.Println(fmt.Sprintf(" %v -p 8085", srsBin)) + fmt.Println(fmt.Sprintf(" %v 8085", srsBin)) + } + flag.Parse() + + log.SetFlags(log.Lshortfile | log.Ldate | log.Ltime | log.Lmicroseconds) + + // check if only one number arg + if len(os.Args[1:]) == 1 { + portArg := os.Args[1] + var err error + if port, err = strconv.Atoi(portArg); err != nil { + log.Println(fmt.Sprintf("parse port arg:%v to int failed, err %v", portArg, err)) + flag.Usage() + os.Exit(1) + } + } + + sw = NewSnapshotWorker(ffmpegPath) + StaticDir, err := filepath.Abs(StaticDir) + if err != nil { + panic(err) + } + log.Println(fmt.Sprintf("api server listen at port:%v, static_dir:%v", port, StaticDir)) + + http.Handle("/", http.FileServer(http.Dir(StaticDir))) + http.HandleFunc("/api/v1", func(writer http.ResponseWriter, request *http.Request) { + res := &struct { + Code int `json:"code"` + Urls struct { + Clients string `json:"clients"` + Streams string `json:"streams"` + Sessions string `json:"sessions"` + Dvrs string `json:"dvrs"` + Chats string `json:"chats"` + Servers struct { + Summary string `json:"summary"` + Get string `json:"GET"` + Post string `json:"POST ip=node_ip&device_id=device_id"` + } + } `json:"urls"` + }{ + Code: 0, + } + res.Urls.Clients = "for srs http callback, to handle the clients requests: connect/disconnect vhost/app." + res.Urls.Streams = "for srs http callback, to handle the streams requests: publish/unpublish stream." + res.Urls.Sessions = "for srs http callback, to handle the sessions requests: client play/stop stream." + res.Urls.Dvrs = "for srs http callback, to handle the dvr requests: dvr stream." + //res.Urls.Chats = "for srs demo meeting, the chat streams, public chat room." + res.Urls.Servers.Summary = "for srs raspberry-pi and meeting demo." + res.Urls.Servers.Get = "get the current raspberry-pi servers info." + res.Urls.Servers.Post = "the new raspberry-pi server info." + // TODO: no snapshots + body, _ := json.Marshal(res) + writer.Write(body) + }) + + // handle the clients requests: connect/disconnect vhost/app. + http.HandleFunc("/api/v1/clients", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to clients, req=%v", string(body))) + + msg := &SrsClientRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnConnect() && !msg.IsOnClose() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the streams requests: publish/unpublish stream. + http.HandleFunc("/api/v1/streams", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to streams, req=%v", string(body))) + + msg := &SrsStreamRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnPublish() && !msg.IsOnUnPublish() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the sessions requests: client play/stop stream + http.HandleFunc("/api/v1/sessions", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to sessions, req=%v", string(body))) + + msg := &SrsSessionRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnPlay() && !msg.IsOnStop() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the dvrs requests: dvr stream. + http.HandleFunc("/api/v1/dvrs", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to dvrs, req=%v", string(body))) + + msg := &SrsDvrRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnDvr() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the dvrs requests: on_hls stream. + http.HandleFunc("/api/v1/hls", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to hls, req=%v", string(body))) + + msg := &SrsHlsRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnHls() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // not support yet + http.HandleFunc("/api/v1/chat", func(w http.ResponseWriter, r *http.Request) { + SrsWriteErrorResponse(w, fmt.Errorf("not implemented")) + }) + + http.HandleFunc("/api/v1/snapshots", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to snapshots, req=%v", string(body))) + + msg := &SrsSnapShotRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if msg.IsOnPublish() { + sw.Create(msg) + } else if msg.IsOnUnPublish() { + sw.Destroy(msg) + } else { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + // handle the dynamic forward requests: on_forward stream. + http.HandleFunc("/api/v1/forward", func(w http.ResponseWriter, r *http.Request) { + if r.Method != "POST" { + SrsWriteDataResponse(w, struct{}{}) + return + } + + if err := func() error { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + return fmt.Errorf("read request body, err %v", err) + } + log.Println(fmt.Sprintf("post to forward, req=%v", string(body))) + + msg := &SrsForwardRequest{} + if err := json.Unmarshal(body, msg); err != nil { + return fmt.Errorf("parse message from %v, err %v", string(body), err) + } + log.Println(fmt.Sprintf("Got %v", msg.String())) + + if !msg.IsOnForward() { + return fmt.Errorf("invalid message %v", msg.String()) + } + + SrsWriteDataResponse(w, &SrsCommonResponse{Code: 0, Data: &struct { + Urls []string `json:"urls"` + }{ + Urls: []string{"rtmp://127.0.0.1:19350/test/teststream"}, + }}) + return nil + }(); err != nil { + SrsWriteErrorResponse(w, err) + } + }) + + addr := fmt.Sprintf(":%v", port) + log.Println(fmt.Sprintf("start listen on:%v", addr)) + if err := http.ListenAndServe(addr, nil); err != nil { + log.Println(fmt.Sprintf("listen on addr:%v failed, err is %v", addr, err)) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/task.json new file mode 100644 index 0000000000000000000000000000000000000000..949538b98c78e152b3a5274f798376a16fc58d73 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-a9ee7c2085f2981a7be1", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-a9ee7c2085f2981a7be1", + "project_id": "morefixes__ossrs__srs", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "trunk/research/api-server/server.go" + ], + "patch_units": { + "before": [ + "trunk/research/api-server/server.go" + ], + "after": [ + "trunk/research/api-server/server.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/413d2119d608c1f0d90b902b68d4cf06c2d82ea3ec1fb118d3a4acb374c6eb65/database", + "cache_key": "413d2119d608c1f0d90b902b68d4cf06c2d82ea3ec1fb118d3a4acb374c6eb65", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/edb72e6267072f564ee22bd9d50533dc6618941683a298ba8c6bc84e770a54fc/database", + "cache_key": "edb72e6267072f564ee22bd9d50533dc6618941683a298ba8c6bc84e770a54fc", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/5a759afea9f5969b3cc1506aaa38a1356db9a369994235ae5d7edf46f2f222bf/database", + "cache_key": "5a759afea9f5969b3cc1506aaa38a1356db9a369994235ae5d7edf46f2f222bf", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-a9ee7c2085f2981a7be1/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-a9ee7c2085f2981a7be1/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-a9ee7c2085f2981a7be1/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..a0c38753fcb428624ab0e1cdc57d8393f65856f7 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/patch.diff @@ -0,0 +1,126 @@ +diff --git a/archiver.go b/archiver.go +index 68f8ea3..32baf3e 100644 +--- a/archiver.go ++++ b/archiver.go +@@ -7,6 +7,7 @@ import ( + "os" + "path/filepath" + "runtime" ++ "strings" + ) + + // Archiver represent a archive format +@@ -105,3 +106,14 @@ func mkdir(dirPath string) error { + } + return nil + } ++ ++func sanitizeExtractPath(filePath string, destination string) error { ++ // to avoid zip slip (writing outside of the destination), we resolve ++ // the target path, and make sure it's nested in the intended ++ // destination, or bail otherwise. ++ destpath := filepath.Join(destination, filePath) ++ if !strings.HasPrefix(destpath, destination) { ++ return fmt.Errorf("%s: illegal file path", filePath) ++ } ++ return nil ++} +diff --git a/cmd/archiver/main.go b/cmd/archiver/main.go +index d274e16..2e181fa 100644 +--- a/cmd/archiver/main.go ++++ b/cmd/archiver/main.go +@@ -27,7 +27,10 @@ func main() { + } + err = ff.Make(filename, os.Args[3:]) + case "open": +- dest := "" ++ dest, osErr := os.Getwd() ++ if osErr != nil { ++ fatal(err) ++ } + if len(os.Args) == 4 { + dest = os.Args[3] + } else if len(os.Args) > 4 { +diff --git a/rar.go b/rar.go +index 7744c24..86f8a63 100644 +--- a/rar.go ++++ b/rar.go +@@ -72,8 +72,15 @@ func (rarFormat) Read(input io.Reader, destination string) error { + return err + } + ++ err = sanitizeExtractPath(header.Name, destination) ++ if err != nil { ++ return err ++ } ++ ++ destpath := filepath.Join(destination, header.Name) ++ + if header.IsDir { +- err = mkdir(filepath.Join(destination, header.Name)) ++ err = mkdir(destpath) + if err != nil { + return err + } +@@ -82,12 +89,12 @@ func (rarFormat) Read(input io.Reader, destination string) error { + + // if files come before their containing folders, then we must + // create their folders before writing the file +- err = mkdir(filepath.Dir(filepath.Join(destination, header.Name))) ++ err = mkdir(filepath.Dir(destpath)) + if err != nil { + return err + } + +- err = writeNewFile(filepath.Join(destination, header.Name), rr, header.Mode()) ++ err = writeNewFile(destpath, rr, header.Mode()) + if err != nil { + return err + } +diff --git a/tar.go b/tar.go +index 2fbfbb2..caa9de2 100644 +--- a/tar.go ++++ b/tar.go +@@ -219,15 +219,22 @@ func untar(tr *tar.Reader, destination string) error { + + // untarFile untars a single file from tr with header header into destination. + func untarFile(tr *tar.Reader, header *tar.Header, destination string) error { ++ err := sanitizeExtractPath(header.Name, destination) ++ if err != nil { ++ return err ++ } ++ ++ destpath := filepath.Join(destination, header.Name) ++ + switch header.Typeflag { + case tar.TypeDir: +- return mkdir(filepath.Join(destination, header.Name)) ++ return mkdir(destpath) + case tar.TypeReg, tar.TypeRegA, tar.TypeChar, tar.TypeBlock, tar.TypeFifo: +- return writeNewFile(filepath.Join(destination, header.Name), tr, header.FileInfo().Mode()) ++ return writeNewFile(destpath, tr, header.FileInfo().Mode()) + case tar.TypeSymlink: +- return writeNewSymbolicLink(filepath.Join(destination, header.Name), header.Linkname) ++ return writeNewSymbolicLink(destpath, header.Linkname) + case tar.TypeLink: +- return writeNewHardLink(filepath.Join(destination, header.Name), filepath.Join(destination, header.Linkname)) ++ return writeNewHardLink(destpath, filepath.Join(destination, header.Linkname)) + default: + return fmt.Errorf("%s: unknown type flag: %c", header.Name, header.Typeflag) + } +diff --git a/zip.go b/zip.go +index 5f458ad..9d20bc1 100644 +--- a/zip.go ++++ b/zip.go +@@ -187,6 +187,11 @@ func unzipAll(r *zip.Reader, destination string) error { + } + + func unzipFile(zf *zip.File, destination string) error { ++ err := sanitizeExtractPath(zf.Name, destination) ++ if err != nil { ++ return err ++ } ++ + if strings.HasSuffix(zf.Name, "/") { + return mkdir(filepath.Join(destination, zf.Name)) + } diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..b49af87f180490c186b01081fcae3089fe663999 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/post_context.md @@ -0,0 +1,828 @@ +# Patch-overlapping Go context after the fix + +## `archiver.go` (changed lines (10, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119)) + +```go +package archiver + +import ( + "fmt" + "io" + "log" + "os" + "path/filepath" + "runtime" + "strings" +) + +// Archiver represent a archive format +type Archiver interface { + // Match checks supported files + Match(filename string) bool + // Make makes an archive file on disk. + Make(destination string, sources []string) error + // Open extracts an archive file on disk. + Open(source, destination string) error + // Write writes an archive to a Writer. + Write(output io.Writer, sources []string) error + // Read reads an archive from a Reader. + Read(input io.Reader, destination string) error +} + +// SupportedFormats contains all supported archive formats +var SupportedFormats = map[string]Archiver{} + +// RegisterFormat adds a supported archive format +func RegisterFormat(name string, format Archiver) { + if _, ok := SupportedFormats[name]; ok { + log.Printf("Format %s already exists, skip!\n", name) + return + } + SupportedFormats[name] = format +} + +// MatchingFormat returns the first archive format that matches +// the given file, or nil if there is no match +func MatchingFormat(fpath string) Archiver { + for _, fmt := range SupportedFormats { + if fmt.Match(fpath) { + return fmt + } + } + return nil +} + +func writeNewFile(fpath string, in io.Reader, fm os.FileMode) error { + err := os.MkdirAll(filepath.Dir(fpath), 0755) + if err != nil { + return fmt.Errorf("%s: making directory for file: %v", fpath, err) + } + + out, err := os.Create(fpath) + if err != nil { + return fmt.Errorf("%s: creating new file: %v", fpath, err) + } + defer out.Close() + + err = out.Chmod(fm) + if err != nil && runtime.GOOS != "windows" { + return fmt.Errorf("%s: changing file mode: %v", fpath, err) + } + + _, err = io.Copy(out, in) + if err != nil { + return fmt.Errorf("%s: writing file: %v", fpath, err) + } + return nil +} + +func writeNewSymbolicLink(fpath string, target string) error { + err := os.MkdirAll(filepath.Dir(fpath), 0755) + if err != nil { + return fmt.Errorf("%s: making directory for file: %v", fpath, err) + } + + err = os.Symlink(target, fpath) + if err != nil { + return fmt.Errorf("%s: making symbolic link for: %v", fpath, err) + } + + return nil +} + +func writeNewHardLink(fpath string, target string) error { + err := os.MkdirAll(filepath.Dir(fpath), 0755) + if err != nil { + return fmt.Errorf("%s: making directory for file: %v", fpath, err) + } + + err = os.Link(target, fpath) + if err != nil { + return fmt.Errorf("%s: making hard link for: %v", fpath, err) + } + + return nil +} + +func mkdir(dirPath string) error { + err := os.MkdirAll(dirPath, 0755) + if err != nil { + return fmt.Errorf("%s: making directory: %v", dirPath, err) + } + return nil +} + +func sanitizeExtractPath(filePath string, destination string) error { + // to avoid zip slip (writing outside of the destination), we resolve + // the target path, and make sure it's nested in the intended + // destination, or bail otherwise. + destpath := filepath.Join(destination, filePath) + if !strings.HasPrefix(destpath, destination) { + return fmt.Errorf("%s: illegal file path", filePath) + } + return nil +} +``` + +## `cmd/archiver/main.go` (changed lines (30, 31, 32, 33)) + +```go +package main + +import ( + "fmt" + "os" + + "github.com/mholt/archiver" +) + +func main() { + if len(os.Args) < 3 { + fatal(usage) + } + + cmd, filename := os.Args[1], os.Args[2] + + ff := archiver.MatchingFormat(filename) + if ff == nil { + fatalf("%s: Unsupported file extension", filename) + } + + var err error + switch cmd { + case "make": + if len(os.Args) < 4 { + fatal(usage) + } + err = ff.Make(filename, os.Args[3:]) + case "open": + dest, osErr := os.Getwd() + if osErr != nil { + fatal(err) + } + if len(os.Args) == 4 { + dest = os.Args[3] + } else if len(os.Args) > 4 { + fatal(usage) + } + err = ff.Open(filename, dest) + default: + fatal(usage) + } + if err != nil { + fatal(err) + } +} + +func fatal(v ...interface{}) { + fmt.Fprintln(os.Stderr, v...) + os.Exit(1) +} + +func fatalf(s string, v ...interface{}) { + fmt.Fprintf(os.Stderr, s+"\n", v...) + os.Exit(1) +} + +const usage = `Usage: archiver {make|open} [files...] + make + Create a new archive file. List the files/folders + to include in the archive; at least one required. + open + Extract an archive file. Give only the archive to + open and the destination folder to extract into. + + Specifying archive format: + The format of the archive is determined by its + file extension. Supported extensions: + .zip + .tar + .tar.gz + .tgz + .tar.bz2 + .tbz2 + .tar.xz + .txz + .tar.lz4 + .tlz4 + .tar.sz + .tsz + .rar (open only) + + Existing files: + When creating an archive file that already exists, + archiver will overwrite the existing file. When + extracting files, archiver will NOT overwrite files + that already exist in the destination path; this + is treated as an error and extraction will abort.` +``` + +## `rar.go` (changed lines (75, 76, 77, 78, 79, 80, 81, 83, 92, 97)) + +```go +package archiver + +import ( + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "strings" + + "github.com/nwaples/rardecode" +) + +// Rar is for RAR archive format +var Rar rarFormat + +func init() { + RegisterFormat("Rar", Rar) +} + +type rarFormat struct{} + +func (rarFormat) Match(filename string) bool { + return strings.HasSuffix(strings.ToLower(filename), ".rar") || isRar(filename) +} + +// isRar checks the file has the RAR 1.5 or 5.0 format signature by reading its +// beginning bytes and matching it +func isRar(rarPath string) bool { + f, err := os.Open(rarPath) + if err != nil { + return false + } + defer f.Close() + + buf := make([]byte, 8) + if n, err := f.Read(buf); err != nil || n < 8 { + return false + } + + return bytes.Equal(buf[:7], []byte("Rar!\x1a\x07\x00")) || // ver 1.5 + bytes.Equal(buf, []byte("Rar!\x1a\x07\x01\x00")) // ver 5.0 +} + +// Write outputs a .rar archive, but this is not implemented because +// RAR is a proprietary format. It is here only for symmetry with +// the other archive formats in this package. +func (rarFormat) Write(output io.Writer, filePaths []string) error { + return fmt.Errorf("write: RAR not implemented (proprietary format)") +} + +// Make makes a .rar archive, but this is not implemented because +// RAR is a proprietary format. It is here only for symmetry with +// the other archive formats in this package. +func (rarFormat) Make(rarPath string, filePaths []string) error { + return fmt.Errorf("make %s: RAR not implemented (proprietary format)", rarPath) +} + +// Read extracts the RAR file read from input and puts the contents +// into destination. +func (rarFormat) Read(input io.Reader, destination string) error { + rr, err := rardecode.NewReader(input, "") + if err != nil { + return fmt.Errorf("read: failed to create reader: %v", err) + } + + for { + header, err := rr.Next() + if err == io.EOF { + break + } else if err != nil { + return err + } + + err = sanitizeExtractPath(header.Name, destination) + if err != nil { + return err + } + + destpath := filepath.Join(destination, header.Name) + + if header.IsDir { + err = mkdir(destpath) + if err != nil { + return err + } + continue + } + + // if files come before their containing folders, then we must + // create their folders before writing the file + err = mkdir(filepath.Dir(destpath)) + if err != nil { + return err + } + + err = writeNewFile(destpath, rr, header.Mode()) + if err != nil { + return err + } + } + + return nil +} + +// Open extracts the RAR file at source and puts the contents +// into destination. +func (rarFormat) Open(source, destination string) error { + rf, err := os.Open(source) + if err != nil { + return fmt.Errorf("%s: failed to open file: %v", source, err) + } + defer rf.Close() + + return Rar.Read(rf, destination) +} +``` + +## `tar.go` (changed lines (222, 223, 224, 225, 226, 227, 228, 231, 233, 235, 237)) + +```go +package archiver + +import ( + "archive/tar" + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "strconv" + "strings" +) + +// Tar is for Tar format +var Tar tarFormat + +func init() { + RegisterFormat("Tar", Tar) +} + +type tarFormat struct{} + +func (tarFormat) Match(filename string) bool { + return strings.HasSuffix(strings.ToLower(filename), ".tar") || isTar(filename) +} + +const tarBlockSize int = 512 + +// isTar checks the file has the Tar format header by reading its beginning +// block. +func isTar(tarPath string) bool { + f, err := os.Open(tarPath) + if err != nil { + return false + } + defer f.Close() + + buf := make([]byte, tarBlockSize) + if _, err = io.ReadFull(f, buf); err != nil { + return false + } + + return hasTarHeader(buf) +} + +// hasTarHeader checks passed bytes has a valid tar header or not. buf must +// contain at least 512 bytes and if not, it always returns false. +func hasTarHeader(buf []byte) bool { + if len(buf) < tarBlockSize { + return false + } + + b := buf[148:156] + b = bytes.Trim(b, " \x00") // clean up all spaces and null bytes + if len(b) == 0 { + return false // unknown format + } + hdrSum, err := strconv.ParseUint(string(b), 8, 64) + if err != nil { + return false + } + + // According to the go official archive/tar, Sun tar uses signed byte + // values so this calcs both signed and unsigned + var usum uint64 + var sum int64 + for i, c := range buf { + if 148 <= i && i < 156 { + c = ' ' // checksum field itself is counted as branks + } + usum += uint64(uint8(c)) + sum += int64(int8(c)) + } + + if hdrSum != usum && int64(hdrSum) != sum { + return false // invalid checksum + } + + return true +} + +// Write outputs a .tar file to a Writer containing the +// contents of files listed in filePaths. File paths can +// be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +func (tarFormat) Write(output io.Writer, filePaths []string) error { + return writeTar(filePaths, output, "") +} + +// Make creates a .tar file at tarPath containing the +// contents of files listed in filePaths. File paths can +// be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +func (tarFormat) Make(tarPath string, filePaths []string) error { + out, err := os.Create(tarPath) + if err != nil { + return fmt.Errorf("error creating %s: %v", tarPath, err) + } + defer out.Close() + + return writeTar(filePaths, out, tarPath) +} + +func writeTar(filePaths []string, output io.Writer, dest string) error { + tarWriter := tar.NewWriter(output) + defer tarWriter.Close() + + return tarball(filePaths, tarWriter, dest) +} + +// tarball writes all files listed in filePaths into tarWriter, which is +// writing into a file located at dest. +func tarball(filePaths []string, tarWriter *tar.Writer, dest string) error { + for _, fpath := range filePaths { + err := tarFile(tarWriter, fpath, dest) + if err != nil { + return err + } + } + return nil +} + +// tarFile writes the file at source into tarWriter. It does so +// recursively for directories. +func tarFile(tarWriter *tar.Writer, source, dest string) error { + sourceInfo, err := os.Stat(source) + if err != nil { + return fmt.Errorf("%s: stat: %v", source, err) + } + + var baseDir string + if sourceInfo.IsDir() { + baseDir = filepath.Base(source) + } + + return filepath.Walk(source, func(path string, info os.FileInfo, err error) error { + if err != nil { + return fmt.Errorf("error walking to %s: %v", path, err) + } + + header, err := tar.FileInfoHeader(info, path) + if err != nil { + return fmt.Errorf("%s: making header: %v", path, err) + } + + if baseDir != "" { + header.Name = filepath.Join(baseDir, strings.TrimPrefix(path, source)) + } + + if header.Name == dest { + // our new tar file is inside the directory being archived; skip it + return nil + } + + if info.IsDir() { + header.Name += "/" + } + + err = tarWriter.WriteHeader(header) + if err != nil { + return fmt.Errorf("%s: writing header: %v", path, err) + } + + if info.IsDir() { + return nil + } + + if header.Typeflag == tar.TypeReg { + file, err := os.Open(path) + if err != nil { + return fmt.Errorf("%s: open: %v", path, err) + } + defer file.Close() + + _, err = io.CopyN(tarWriter, file, info.Size()) + if err != nil && err != io.EOF { + return fmt.Errorf("%s: copying contents: %v", path, err) + } + } + return nil + }) +} + +// Read untars a .tar file read from a Reader and puts +// the contents into destination. +func (tarFormat) Read(input io.Reader, destination string) error { + return untar(tar.NewReader(input), destination) +} + +// Open untars source and puts the contents into destination. +func (tarFormat) Open(source, destination string) error { + f, err := os.Open(source) + if err != nil { + return fmt.Errorf("%s: failed to open archive: %v", source, err) + } + defer f.Close() + + return Tar.Read(f, destination) +} + +// untar un-tarballs the contents of tr into destination. +func untar(tr *tar.Reader, destination string) error { + for { + header, err := tr.Next() + if err == io.EOF { + break + } else if err != nil { + return err + } + + if err := untarFile(tr, header, destination); err != nil { + return err + } + } + return nil +} + +// untarFile untars a single file from tr with header header into destination. +func untarFile(tr *tar.Reader, header *tar.Header, destination string) error { + err := sanitizeExtractPath(header.Name, destination) + if err != nil { + return err + } + + destpath := filepath.Join(destination, header.Name) + + switch header.Typeflag { + case tar.TypeDir: + return mkdir(destpath) + case tar.TypeReg, tar.TypeRegA, tar.TypeChar, tar.TypeBlock, tar.TypeFifo: + return writeNewFile(destpath, tr, header.FileInfo().Mode()) + case tar.TypeSymlink: + return writeNewSymbolicLink(destpath, header.Linkname) + case tar.TypeLink: + return writeNewHardLink(destpath, filepath.Join(destination, header.Linkname)) + default: + return fmt.Errorf("%s: unknown type flag: %c", header.Name, header.Typeflag) + } +} +``` + +## `zip.go` (changed lines (190, 191, 192, 193, 194)) + +```go +// Package archiver makes it super easy to create and open .zip, +// .tar.gz, and .tar.bz2 files. +package archiver + +import ( + "archive/zip" + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "path" + "path/filepath" + "strings" +) + +// Zip is for Zip format +var Zip zipFormat + +func init() { + RegisterFormat("Zip", Zip) +} + +type zipFormat struct{} + +func (zipFormat) Match(filename string) bool { + return strings.HasSuffix(strings.ToLower(filename), ".zip") || isZip(filename) +} + +// isZip checks the file has the Zip format signature by reading its beginning +// bytes and matching it against "PK\x03\x04" +func isZip(zipPath string) bool { + f, err := os.Open(zipPath) + if err != nil { + return false + } + defer f.Close() + + buf := make([]byte, 4) + if n, err := f.Read(buf); err != nil || n < 4 { + return false + } + + return bytes.Equal(buf, []byte("PK\x03\x04")) +} + +// Write outputs a .zip file to the given writer with +// the contents of files listed in filePaths. File paths +// can be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +// +// Files with an extension for formats that are already +// compressed will be stored only, not compressed. +func (zipFormat) Write(output io.Writer, filePaths []string) error { + w := zip.NewWriter(output) + for _, fpath := range filePaths { + if err := zipFile(w, fpath); err != nil { + w.Close() + return err + } + } + + return w.Close() +} + +// Make creates a .zip file in the location zipPath containing +// the contents of files listed in filePaths. File paths +// can be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +// +// Files with an extension for formats that are already +// compressed will be stored only, not compressed. +func (zipFormat) Make(zipPath string, filePaths []string) error { + out, err := os.Create(zipPath) + if err != nil { + return fmt.Errorf("error creating %s: %v", zipPath, err) + } + defer out.Close() + + return Zip.Write(out, filePaths) +} + +func zipFile(w *zip.Writer, source string) error { + sourceInfo, err := os.Stat(source) + if err != nil { + return fmt.Errorf("%s: stat: %v", source, err) + } + + var baseDir string + if sourceInfo.IsDir() { + baseDir = filepath.Base(source) + } + + return filepath.Walk(source, func(fpath string, info os.FileInfo, err error) error { + if err != nil { + return fmt.Errorf("walking to %s: %v", fpath, err) + } + + header, err := zip.FileInfoHeader(info) + if err != nil { + return fmt.Errorf("%s: getting header: %v", fpath, err) + } + + if baseDir != "" { + name, err := filepath.Rel(source, fpath) + if err != nil { + return err + } + header.Name = path.Join(baseDir, filepath.ToSlash(name)) + } + + if info.IsDir() { + header.Name += "/" + header.Method = zip.Store + } else { + ext := strings.ToLower(path.Ext(header.Name)) + if _, ok := compressedFormats[ext]; ok { + header.Method = zip.Store + } else { + header.Method = zip.Deflate + } + } + + writer, err := w.CreateHeader(header) + if err != nil { + return fmt.Errorf("%s: making header: %v", fpath, err) + } + + if info.IsDir() { + return nil + } + + if header.Mode().IsRegular() { + file, err := os.Open(fpath) + if err != nil { + return fmt.Errorf("%s: opening: %v", fpath, err) + } + defer file.Close() + + _, err = io.CopyN(writer, file, info.Size()) + if err != nil && err != io.EOF { + return fmt.Errorf("%s: copying contents: %v", fpath, err) + } + } + + return nil + }) +} + +// Read unzips the .zip file read from the input Reader into destination. +func (zipFormat) Read(input io.Reader, destination string) error { + buf, err := ioutil.ReadAll(input) + if err != nil { + return err + } + + rdr := bytes.NewReader(buf) + r, err := zip.NewReader(rdr, rdr.Size()) + if err != nil { + return err + } + + return unzipAll(r, destination) +} + +// Open unzips the .zip file at source into destination. +func (zipFormat) Open(source, destination string) error { + r, err := zip.OpenReader(source) + if err != nil { + return err + } + defer r.Close() + + return unzipAll(&r.Reader, destination) +} + +func unzipAll(r *zip.Reader, destination string) error { + for _, zf := range r.File { + if err := unzipFile(zf, destination); err != nil { + return err + } + } + + return nil +} + +func unzipFile(zf *zip.File, destination string) error { + err := sanitizeExtractPath(zf.Name, destination) + if err != nil { + return err + } + + if strings.HasSuffix(zf.Name, "/") { + return mkdir(filepath.Join(destination, zf.Name)) + } + + rc, err := zf.Open() + if err != nil { + return fmt.Errorf("%s: open compressed file: %v", zf.Name, err) + } + defer rc.Close() + + return writeNewFile(filepath.Join(destination, zf.Name), rc, zf.FileInfo().Mode()) +} + +// compressedFormats is a (non-exhaustive) set of lowercased +// file extensions for formats that are typically already +// compressed. Compressing already-compressed files often +// results in a larger file, so when possible, we check this +// set to avoid that. +var compressedFormats = map[string]struct{}{ + ".7z": {}, + ".avi": {}, + ".bz2": {}, + ".cab": {}, + ".gif": {}, + ".gz": {}, + ".jar": {}, + ".jpeg": {}, + ".jpg": {}, + ".lz": {}, + ".lzma": {}, + ".mov": {}, + ".mp3": {}, + ".mp4": {}, + ".mpeg": {}, + ".mpg": {}, + ".png": {}, + ".rar": {}, + ".tbz2": {}, + ".tgz": {}, + ".txz": {}, + ".xz": {}, + ".zip": {}, + ".zipx": {}, +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..46641c0ea280ed6f87e4962ea6405c2fe070389e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/pre_context.md @@ -0,0 +1,794 @@ +# Patch-overlapping Go context before the fix + +## `archiver.go` (changed lines (10, 108)) + +```go +package archiver + +import ( + "fmt" + "io" + "log" + "os" + "path/filepath" + "runtime" +) + +// Archiver represent a archive format +type Archiver interface { + // Match checks supported files + Match(filename string) bool + // Make makes an archive file on disk. + Make(destination string, sources []string) error + // Open extracts an archive file on disk. + Open(source, destination string) error + // Write writes an archive to a Writer. + Write(output io.Writer, sources []string) error + // Read reads an archive from a Reader. + Read(input io.Reader, destination string) error +} + +// SupportedFormats contains all supported archive formats +var SupportedFormats = map[string]Archiver{} + +// RegisterFormat adds a supported archive format +func RegisterFormat(name string, format Archiver) { + if _, ok := SupportedFormats[name]; ok { + log.Printf("Format %s already exists, skip!\n", name) + return + } + SupportedFormats[name] = format +} + +// MatchingFormat returns the first archive format that matches +// the given file, or nil if there is no match +func MatchingFormat(fpath string) Archiver { + for _, fmt := range SupportedFormats { + if fmt.Match(fpath) { + return fmt + } + } + return nil +} + +func writeNewFile(fpath string, in io.Reader, fm os.FileMode) error { + err := os.MkdirAll(filepath.Dir(fpath), 0755) + if err != nil { + return fmt.Errorf("%s: making directory for file: %v", fpath, err) + } + + out, err := os.Create(fpath) + if err != nil { + return fmt.Errorf("%s: creating new file: %v", fpath, err) + } + defer out.Close() + + err = out.Chmod(fm) + if err != nil && runtime.GOOS != "windows" { + return fmt.Errorf("%s: changing file mode: %v", fpath, err) + } + + _, err = io.Copy(out, in) + if err != nil { + return fmt.Errorf("%s: writing file: %v", fpath, err) + } + return nil +} + +func writeNewSymbolicLink(fpath string, target string) error { + err := os.MkdirAll(filepath.Dir(fpath), 0755) + if err != nil { + return fmt.Errorf("%s: making directory for file: %v", fpath, err) + } + + err = os.Symlink(target, fpath) + if err != nil { + return fmt.Errorf("%s: making symbolic link for: %v", fpath, err) + } + + return nil +} + +func writeNewHardLink(fpath string, target string) error { + err := os.MkdirAll(filepath.Dir(fpath), 0755) + if err != nil { + return fmt.Errorf("%s: making directory for file: %v", fpath, err) + } + + err = os.Link(target, fpath) + if err != nil { + return fmt.Errorf("%s: making hard link for: %v", fpath, err) + } + + return nil +} + +func mkdir(dirPath string) error { + err := os.MkdirAll(dirPath, 0755) + if err != nil { + return fmt.Errorf("%s: making directory: %v", dirPath, err) + } + return nil +} +``` + +## `cmd/archiver/main.go` (changed lines (30, 31)) + +```go +package main + +import ( + "fmt" + "os" + + "github.com/mholt/archiver" +) + +func main() { + if len(os.Args) < 3 { + fatal(usage) + } + + cmd, filename := os.Args[1], os.Args[2] + + ff := archiver.MatchingFormat(filename) + if ff == nil { + fatalf("%s: Unsupported file extension", filename) + } + + var err error + switch cmd { + case "make": + if len(os.Args) < 4 { + fatal(usage) + } + err = ff.Make(filename, os.Args[3:]) + case "open": + dest := "" + if len(os.Args) == 4 { + dest = os.Args[3] + } else if len(os.Args) > 4 { + fatal(usage) + } + err = ff.Open(filename, dest) + default: + fatal(usage) + } + if err != nil { + fatal(err) + } +} + +func fatal(v ...interface{}) { + fmt.Fprintln(os.Stderr, v...) + os.Exit(1) +} + +func fatalf(s string, v ...interface{}) { + fmt.Fprintf(os.Stderr, s+"\n", v...) + os.Exit(1) +} + +const usage = `Usage: archiver {make|open} [files...] + make + Create a new archive file. List the files/folders + to include in the archive; at least one required. + open + Extract an archive file. Give only the archive to + open and the destination folder to extract into. + + Specifying archive format: + The format of the archive is determined by its + file extension. Supported extensions: + .zip + .tar + .tar.gz + .tgz + .tar.bz2 + .tbz2 + .tar.xz + .txz + .tar.lz4 + .tlz4 + .tar.sz + .tsz + .rar (open only) + + Existing files: + When creating an archive file that already exists, + archiver will overwrite the existing file. When + extracting files, archiver will NOT overwrite files + that already exist in the destination path; this + is treated as an error and extraction will abort.` +``` + +## `rar.go` (changed lines (75, 76, 77, 85, 86, 90, 91)) + +```go +package archiver + +import ( + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "strings" + + "github.com/nwaples/rardecode" +) + +// Rar is for RAR archive format +var Rar rarFormat + +func init() { + RegisterFormat("Rar", Rar) +} + +type rarFormat struct{} + +func (rarFormat) Match(filename string) bool { + return strings.HasSuffix(strings.ToLower(filename), ".rar") || isRar(filename) +} + +// isRar checks the file has the RAR 1.5 or 5.0 format signature by reading its +// beginning bytes and matching it +func isRar(rarPath string) bool { + f, err := os.Open(rarPath) + if err != nil { + return false + } + defer f.Close() + + buf := make([]byte, 8) + if n, err := f.Read(buf); err != nil || n < 8 { + return false + } + + return bytes.Equal(buf[:7], []byte("Rar!\x1a\x07\x00")) || // ver 1.5 + bytes.Equal(buf, []byte("Rar!\x1a\x07\x01\x00")) // ver 5.0 +} + +// Write outputs a .rar archive, but this is not implemented because +// RAR is a proprietary format. It is here only for symmetry with +// the other archive formats in this package. +func (rarFormat) Write(output io.Writer, filePaths []string) error { + return fmt.Errorf("write: RAR not implemented (proprietary format)") +} + +// Make makes a .rar archive, but this is not implemented because +// RAR is a proprietary format. It is here only for symmetry with +// the other archive formats in this package. +func (rarFormat) Make(rarPath string, filePaths []string) error { + return fmt.Errorf("make %s: RAR not implemented (proprietary format)", rarPath) +} + +// Read extracts the RAR file read from input and puts the contents +// into destination. +func (rarFormat) Read(input io.Reader, destination string) error { + rr, err := rardecode.NewReader(input, "") + if err != nil { + return fmt.Errorf("read: failed to create reader: %v", err) + } + + for { + header, err := rr.Next() + if err == io.EOF { + break + } else if err != nil { + return err + } + + if header.IsDir { + err = mkdir(filepath.Join(destination, header.Name)) + if err != nil { + return err + } + continue + } + + // if files come before their containing folders, then we must + // create their folders before writing the file + err = mkdir(filepath.Dir(filepath.Join(destination, header.Name))) + if err != nil { + return err + } + + err = writeNewFile(filepath.Join(destination, header.Name), rr, header.Mode()) + if err != nil { + return err + } + } + + return nil +} + +// Open extracts the RAR file at source and puts the contents +// into destination. +func (rarFormat) Open(source, destination string) error { + rf, err := os.Open(source) + if err != nil { + return fmt.Errorf("%s: failed to open file: %v", source, err) + } + defer rf.Close() + + return Rar.Read(rf, destination) +} +``` + +## `tar.go` (changed lines (222, 224, 225, 226, 227, 228, 229, 230, 231)) + +```go +package archiver + +import ( + "archive/tar" + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "strconv" + "strings" +) + +// Tar is for Tar format +var Tar tarFormat + +func init() { + RegisterFormat("Tar", Tar) +} + +type tarFormat struct{} + +func (tarFormat) Match(filename string) bool { + return strings.HasSuffix(strings.ToLower(filename), ".tar") || isTar(filename) +} + +const tarBlockSize int = 512 + +// isTar checks the file has the Tar format header by reading its beginning +// block. +func isTar(tarPath string) bool { + f, err := os.Open(tarPath) + if err != nil { + return false + } + defer f.Close() + + buf := make([]byte, tarBlockSize) + if _, err = io.ReadFull(f, buf); err != nil { + return false + } + + return hasTarHeader(buf) +} + +// hasTarHeader checks passed bytes has a valid tar header or not. buf must +// contain at least 512 bytes and if not, it always returns false. +func hasTarHeader(buf []byte) bool { + if len(buf) < tarBlockSize { + return false + } + + b := buf[148:156] + b = bytes.Trim(b, " \x00") // clean up all spaces and null bytes + if len(b) == 0 { + return false // unknown format + } + hdrSum, err := strconv.ParseUint(string(b), 8, 64) + if err != nil { + return false + } + + // According to the go official archive/tar, Sun tar uses signed byte + // values so this calcs both signed and unsigned + var usum uint64 + var sum int64 + for i, c := range buf { + if 148 <= i && i < 156 { + c = ' ' // checksum field itself is counted as branks + } + usum += uint64(uint8(c)) + sum += int64(int8(c)) + } + + if hdrSum != usum && int64(hdrSum) != sum { + return false // invalid checksum + } + + return true +} + +// Write outputs a .tar file to a Writer containing the +// contents of files listed in filePaths. File paths can +// be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +func (tarFormat) Write(output io.Writer, filePaths []string) error { + return writeTar(filePaths, output, "") +} + +// Make creates a .tar file at tarPath containing the +// contents of files listed in filePaths. File paths can +// be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +func (tarFormat) Make(tarPath string, filePaths []string) error { + out, err := os.Create(tarPath) + if err != nil { + return fmt.Errorf("error creating %s: %v", tarPath, err) + } + defer out.Close() + + return writeTar(filePaths, out, tarPath) +} + +func writeTar(filePaths []string, output io.Writer, dest string) error { + tarWriter := tar.NewWriter(output) + defer tarWriter.Close() + + return tarball(filePaths, tarWriter, dest) +} + +// tarball writes all files listed in filePaths into tarWriter, which is +// writing into a file located at dest. +func tarball(filePaths []string, tarWriter *tar.Writer, dest string) error { + for _, fpath := range filePaths { + err := tarFile(tarWriter, fpath, dest) + if err != nil { + return err + } + } + return nil +} + +// tarFile writes the file at source into tarWriter. It does so +// recursively for directories. +func tarFile(tarWriter *tar.Writer, source, dest string) error { + sourceInfo, err := os.Stat(source) + if err != nil { + return fmt.Errorf("%s: stat: %v", source, err) + } + + var baseDir string + if sourceInfo.IsDir() { + baseDir = filepath.Base(source) + } + + return filepath.Walk(source, func(path string, info os.FileInfo, err error) error { + if err != nil { + return fmt.Errorf("error walking to %s: %v", path, err) + } + + header, err := tar.FileInfoHeader(info, path) + if err != nil { + return fmt.Errorf("%s: making header: %v", path, err) + } + + if baseDir != "" { + header.Name = filepath.Join(baseDir, strings.TrimPrefix(path, source)) + } + + if header.Name == dest { + // our new tar file is inside the directory being archived; skip it + return nil + } + + if info.IsDir() { + header.Name += "/" + } + + err = tarWriter.WriteHeader(header) + if err != nil { + return fmt.Errorf("%s: writing header: %v", path, err) + } + + if info.IsDir() { + return nil + } + + if header.Typeflag == tar.TypeReg { + file, err := os.Open(path) + if err != nil { + return fmt.Errorf("%s: open: %v", path, err) + } + defer file.Close() + + _, err = io.CopyN(tarWriter, file, info.Size()) + if err != nil && err != io.EOF { + return fmt.Errorf("%s: copying contents: %v", path, err) + } + } + return nil + }) +} + +// Read untars a .tar file read from a Reader and puts +// the contents into destination. +func (tarFormat) Read(input io.Reader, destination string) error { + return untar(tar.NewReader(input), destination) +} + +// Open untars source and puts the contents into destination. +func (tarFormat) Open(source, destination string) error { + f, err := os.Open(source) + if err != nil { + return fmt.Errorf("%s: failed to open archive: %v", source, err) + } + defer f.Close() + + return Tar.Read(f, destination) +} + +// untar un-tarballs the contents of tr into destination. +func untar(tr *tar.Reader, destination string) error { + for { + header, err := tr.Next() + if err == io.EOF { + break + } else if err != nil { + return err + } + + if err := untarFile(tr, header, destination); err != nil { + return err + } + } + return nil +} + +// untarFile untars a single file from tr with header header into destination. +func untarFile(tr *tar.Reader, header *tar.Header, destination string) error { + switch header.Typeflag { + case tar.TypeDir: + return mkdir(filepath.Join(destination, header.Name)) + case tar.TypeReg, tar.TypeRegA, tar.TypeChar, tar.TypeBlock, tar.TypeFifo: + return writeNewFile(filepath.Join(destination, header.Name), tr, header.FileInfo().Mode()) + case tar.TypeSymlink: + return writeNewSymbolicLink(filepath.Join(destination, header.Name), header.Linkname) + case tar.TypeLink: + return writeNewHardLink(filepath.Join(destination, header.Name), filepath.Join(destination, header.Linkname)) + default: + return fmt.Errorf("%s: unknown type flag: %c", header.Name, header.Typeflag) + } +} +``` + +## `zip.go` (changed lines (190,)) + +```go +// Package archiver makes it super easy to create and open .zip, +// .tar.gz, and .tar.bz2 files. +package archiver + +import ( + "archive/zip" + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "path" + "path/filepath" + "strings" +) + +// Zip is for Zip format +var Zip zipFormat + +func init() { + RegisterFormat("Zip", Zip) +} + +type zipFormat struct{} + +func (zipFormat) Match(filename string) bool { + return strings.HasSuffix(strings.ToLower(filename), ".zip") || isZip(filename) +} + +// isZip checks the file has the Zip format signature by reading its beginning +// bytes and matching it against "PK\x03\x04" +func isZip(zipPath string) bool { + f, err := os.Open(zipPath) + if err != nil { + return false + } + defer f.Close() + + buf := make([]byte, 4) + if n, err := f.Read(buf); err != nil || n < 4 { + return false + } + + return bytes.Equal(buf, []byte("PK\x03\x04")) +} + +// Write outputs a .zip file to the given writer with +// the contents of files listed in filePaths. File paths +// can be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +// +// Files with an extension for formats that are already +// compressed will be stored only, not compressed. +func (zipFormat) Write(output io.Writer, filePaths []string) error { + w := zip.NewWriter(output) + for _, fpath := range filePaths { + if err := zipFile(w, fpath); err != nil { + w.Close() + return err + } + } + + return w.Close() +} + +// Make creates a .zip file in the location zipPath containing +// the contents of files listed in filePaths. File paths +// can be those of regular files or directories. Regular +// files are stored at the 'root' of the archive, and +// directories are recursively added. +// +// Files with an extension for formats that are already +// compressed will be stored only, not compressed. +func (zipFormat) Make(zipPath string, filePaths []string) error { + out, err := os.Create(zipPath) + if err != nil { + return fmt.Errorf("error creating %s: %v", zipPath, err) + } + defer out.Close() + + return Zip.Write(out, filePaths) +} + +func zipFile(w *zip.Writer, source string) error { + sourceInfo, err := os.Stat(source) + if err != nil { + return fmt.Errorf("%s: stat: %v", source, err) + } + + var baseDir string + if sourceInfo.IsDir() { + baseDir = filepath.Base(source) + } + + return filepath.Walk(source, func(fpath string, info os.FileInfo, err error) error { + if err != nil { + return fmt.Errorf("walking to %s: %v", fpath, err) + } + + header, err := zip.FileInfoHeader(info) + if err != nil { + return fmt.Errorf("%s: getting header: %v", fpath, err) + } + + if baseDir != "" { + name, err := filepath.Rel(source, fpath) + if err != nil { + return err + } + header.Name = path.Join(baseDir, filepath.ToSlash(name)) + } + + if info.IsDir() { + header.Name += "/" + header.Method = zip.Store + } else { + ext := strings.ToLower(path.Ext(header.Name)) + if _, ok := compressedFormats[ext]; ok { + header.Method = zip.Store + } else { + header.Method = zip.Deflate + } + } + + writer, err := w.CreateHeader(header) + if err != nil { + return fmt.Errorf("%s: making header: %v", fpath, err) + } + + if info.IsDir() { + return nil + } + + if header.Mode().IsRegular() { + file, err := os.Open(fpath) + if err != nil { + return fmt.Errorf("%s: opening: %v", fpath, err) + } + defer file.Close() + + _, err = io.CopyN(writer, file, info.Size()) + if err != nil && err != io.EOF { + return fmt.Errorf("%s: copying contents: %v", fpath, err) + } + } + + return nil + }) +} + +// Read unzips the .zip file read from the input Reader into destination. +func (zipFormat) Read(input io.Reader, destination string) error { + buf, err := ioutil.ReadAll(input) + if err != nil { + return err + } + + rdr := bytes.NewReader(buf) + r, err := zip.NewReader(rdr, rdr.Size()) + if err != nil { + return err + } + + return unzipAll(r, destination) +} + +// Open unzips the .zip file at source into destination. +func (zipFormat) Open(source, destination string) error { + r, err := zip.OpenReader(source) + if err != nil { + return err + } + defer r.Close() + + return unzipAll(&r.Reader, destination) +} + +func unzipAll(r *zip.Reader, destination string) error { + for _, zf := range r.File { + if err := unzipFile(zf, destination); err != nil { + return err + } + } + + return nil +} + +func unzipFile(zf *zip.File, destination string) error { + if strings.HasSuffix(zf.Name, "/") { + return mkdir(filepath.Join(destination, zf.Name)) + } + + rc, err := zf.Open() + if err != nil { + return fmt.Errorf("%s: open compressed file: %v", zf.Name, err) + } + defer rc.Close() + + return writeNewFile(filepath.Join(destination, zf.Name), rc, zf.FileInfo().Mode()) +} + +// compressedFormats is a (non-exhaustive) set of lowercased +// file extensions for formats that are typically already +// compressed. Compressing already-compressed files often +// results in a larger file, so when possible, we check this +// set to avoid that. +var compressedFormats = map[string]struct{}{ + ".7z": {}, + ".avi": {}, + ".bz2": {}, + ".cab": {}, + ".gif": {}, + ".gz": {}, + ".jar": {}, + ".jpeg": {}, + ".jpg": {}, + ".lz": {}, + ".lzma": {}, + ".mov": {}, + ".mp3": {}, + ".mp4": {}, + ".mpeg": {}, + ".mpg": {}, + ".png": {}, + ".rar": {}, + ".tbz2": {}, + ".tgz": {}, + ".txz": {}, + ".xz": {}, + ".zip": {}, + ".zipx": {}, +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/task.json new file mode 100644 index 0000000000000000000000000000000000000000..ef04d4d4e2109aee6f5a0c0f245280b0d755daf5 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/task.json @@ -0,0 +1,56 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-c254bd7b8a82b4ef45c1", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-c254bd7b8a82b4ef45c1", + "project_id": "morefixes__mholt__archiver", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "archiver.go", + "cmd/archiver/main.go", + "rar.go", + "tar.go", + "zip.go" + ], + "patch_units": { + "before": [ + "archiver.go", + "cmd/archiver/main.go", + "rar.go", + "tar.go", + "zip.go" + ], + "after": [ + "archiver.go", + "cmd/archiver/main.go", + "rar.go", + "tar.go", + "zip.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/7d4502c7671d31927b3ee3182fcce4fae52ff30a775a40c62085752f6377dbce/database", + "cache_key": "7d4502c7671d31927b3ee3182fcce4fae52ff30a775a40c62085752f6377dbce", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/258fce6c42787c2f7ea94567c00dbe7c5d39e9bc4ce3734ccead707886610a57/database", + "cache_key": "258fce6c42787c2f7ea94567c00dbe7c5d39e9bc4ce3734ccead707886610a57", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/32f483ef6bcea0427cb9ae40632e7381591d36bd379106b1dd70b5b643395130/database", + "cache_key": "32f483ef6bcea0427cb9ae40632e7381591d36bd379106b1dd70b5b643395130", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-c254bd7b8a82b4ef45c1/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-c254bd7b8a82b4ef45c1/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-c254bd7b8a82b4ef45c1/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..b3674b5af85dacc811405b27a6fc8043e610e097 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/patch.diff @@ -0,0 +1,26 @@ +diff --git a/oauthproxy.go b/oauthproxy.go +index 115e562..75fbc9f 100644 +--- a/oauthproxy.go ++++ b/oauthproxy.go +@@ -490,7 +490,7 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) { + } + + redirect := req.Form.Get("state") +- if !strings.HasPrefix(redirect, "/") { ++ if !strings.HasPrefix(redirect, "/") || strings.HasPrefix(redirect, "//") { + redirect = "/" + } + +diff --git a/providers/provider_default.go b/providers/provider_default.go +index 82b73ec..6b8ec40 100644 +--- a/providers/provider_default.go ++++ b/providers/provider_default.go +@@ -88,7 +88,7 @@ func (p *ProviderData) GetLoginURL(redirectURI, finalRedirect string) string { + params.Add("scope", p.Scope) + params.Set("client_id", p.ClientID) + params.Set("response_type", "code") +- if strings.HasPrefix(finalRedirect, "/") { ++ if strings.HasPrefix(finalRedirect, "/") && !strings.HasPrefix(finalRedirect,"//") { + params.Add("state", finalRedirect) + } + a.RawQuery = params.Encode() diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..4827f69b0bb9df46a1f8adf04b6f7e13a3407313 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/post_context.md @@ -0,0 +1,786 @@ +# Patch-overlapping Go context after the fix + +## `oauthproxy.go` (changed lines (493,)) + +```go +package main + +import ( + b64 "encoding/base64" + "errors" + "fmt" + "html/template" + "log" + "net" + "net/http" + "net/http/httputil" + "net/url" + "regexp" + "strings" + "time" + + "github.com/18F/hmacauth" + "github.com/bitly/oauth2_proxy/cookie" + "github.com/bitly/oauth2_proxy/providers" +) + +const SignatureHeader = "GAP-Signature" + +var SignatureHeaders []string = []string{ + "Content-Length", + "Content-Md5", + "Content-Type", + "Date", + "Authorization", + "X-Forwarded-User", + "X-Forwarded-Email", + "X-Forwarded-Access-Token", + "Cookie", + "Gap-Auth", +} + +type OAuthProxy struct { + CookieSeed string + CookieName string + CookieDomain string + CookieSecure bool + CookieHttpOnly bool + CookieExpire time.Duration + CookieRefresh time.Duration + Validator func(string) bool + + RobotsPath string + PingPath string + SignInPath string + SignOutPath string + OAuthStartPath string + OAuthCallbackPath string + AuthOnlyPath string + + redirectURL *url.URL // the url to receive requests at + provider providers.Provider + ProxyPrefix string + SignInMessage string + HtpasswdFile *HtpasswdFile + DisplayHtpasswdForm bool + serveMux http.Handler + PassBasicAuth bool + SkipProviderButton bool + BasicAuthPassword string + PassAccessToken bool + CookieCipher *cookie.Cipher + skipAuthRegex []string + compiledRegex []*regexp.Regexp + templates *template.Template + Footer string +} + +type UpstreamProxy struct { + upstream string + handler http.Handler + auth hmacauth.HmacAuth +} + +func (u *UpstreamProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { + w.Header().Set("GAP-Upstream-Address", u.upstream) + if u.auth != nil { + r.Header.Set("GAP-Auth", w.Header().Get("GAP-Auth")) + u.auth.SignRequest(r) + } + u.handler.ServeHTTP(w, r) +} + +func NewReverseProxy(target *url.URL) (proxy *httputil.ReverseProxy) { + return httputil.NewSingleHostReverseProxy(target) +} +func setProxyUpstreamHostHeader(proxy *httputil.ReverseProxy, target *url.URL) { + director := proxy.Director + proxy.Director = func(req *http.Request) { + director(req) + // use RequestURI so that we aren't unescaping encoded slashes in the request path + req.Host = target.Host + req.URL.Opaque = req.RequestURI + req.URL.RawQuery = "" + } +} +func setProxyDirector(proxy *httputil.ReverseProxy) { + director := proxy.Director + proxy.Director = func(req *http.Request) { + director(req) + // use RequestURI so that we aren't unescaping encoded slashes in the request path + req.URL.Opaque = req.RequestURI + req.URL.RawQuery = "" + } +} +func NewFileServer(path string, filesystemPath string) (proxy http.Handler) { + return http.StripPrefix(path, http.FileServer(http.Dir(filesystemPath))) +} + +func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy { + serveMux := http.NewServeMux() + var auth hmacauth.HmacAuth + if sigData := opts.signatureData; sigData != nil { + auth = hmacauth.NewHmacAuth(sigData.hash, []byte(sigData.key), + SignatureHeader, SignatureHeaders) + } + for _, u := range opts.proxyURLs { + path := u.Path + switch u.Scheme { + case "http", "https": + u.Path = "" + log.Printf("mapping path %q => upstream %q", path, u) + proxy := NewReverseProxy(u) + if !opts.PassHostHeader { + setProxyUpstreamHostHeader(proxy, u) + } else { + setProxyDirector(proxy) + } + serveMux.Handle(path, + &UpstreamProxy{u.Host, proxy, auth}) + case "file": + if u.Fragment != "" { + path = u.Fragment + } + log.Printf("mapping path %q => file system %q", path, u.Path) + proxy := NewFileServer(path, u.Path) + serveMux.Handle(path, &UpstreamProxy{path, proxy, nil}) + default: + panic(fmt.Sprintf("unknown upstream protocol %s", u.Scheme)) + } + } + for _, u := range opts.CompiledRegex { + log.Printf("compiled skip-auth-regex => %q", u) + } + + redirectURL := opts.redirectURL + redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix) + + log.Printf("OAuthProxy configured for %s Client ID: %s", opts.provider.Data().ProviderName, opts.ClientID) + domain := opts.CookieDomain + if domain == "" { + domain = "" + } + refresh := "disabled" + if opts.CookieRefresh != time.Duration(0) { + refresh = fmt.Sprintf("after %s", opts.CookieRefresh) + } + + log.Printf("Cookie settings: name:%s secure(https):%v httponly:%v expiry:%s domain:%s refresh:%s", opts.CookieName, opts.CookieSecure, opts.CookieHttpOnly, opts.CookieExpire, domain, refresh) + + var cipher *cookie.Cipher + if opts.PassAccessToken || (opts.CookieRefresh != time.Duration(0)) { + var err error + cipher, err = cookie.NewCipher(secretBytes(opts.CookieSecret)) + if err != nil { + log.Fatal("cookie-secret error: ", err) + } + } + + return &OAuthProxy{ + CookieName: opts.CookieName, + CookieSeed: opts.CookieSecret, + CookieDomain: opts.CookieDomain, + CookieSecure: opts.CookieSecure, + CookieHttpOnly: opts.CookieHttpOnly, + CookieExpire: opts.CookieExpire, + CookieRefresh: opts.CookieRefresh, + Validator: validator, + + RobotsPath: "/robots.txt", + PingPath: "/ping", + SignInPath: fmt.Sprintf("%s/sign_in", opts.ProxyPrefix), + SignOutPath: fmt.Sprintf("%s/sign_out", opts.ProxyPrefix), + OAuthStartPath: fmt.Sprintf("%s/start", opts.ProxyPrefix), + OAuthCallbackPath: fmt.Sprintf("%s/callback", opts.ProxyPrefix), + AuthOnlyPath: fmt.Sprintf("%s/auth", opts.ProxyPrefix), + + ProxyPrefix: opts.ProxyPrefix, + provider: opts.provider, + serveMux: serveMux, + redirectURL: redirectURL, + skipAuthRegex: opts.SkipAuthRegex, + compiledRegex: opts.CompiledRegex, + PassBasicAuth: opts.PassBasicAuth, + BasicAuthPassword: opts.BasicAuthPassword, + PassAccessToken: opts.PassAccessToken, + SkipProviderButton: opts.SkipProviderButton, + CookieCipher: cipher, + templates: loadTemplates(opts.CustomTemplatesDir), + Footer: opts.Footer, + } +} + +func (p *OAuthProxy) GetRedirectURI(host string) string { + // default to the request Host if not set + if p.redirectURL.Host != "" { + return p.redirectURL.String() + } + var u url.URL + u = *p.redirectURL + if u.Scheme == "" { + if p.CookieSecure { + u.Scheme = "https" + } else { + u.Scheme = "http" + } + } + u.Host = host + return u.String() +} + +func (p *OAuthProxy) displayCustomLoginForm() bool { + return p.HtpasswdFile != nil && p.DisplayHtpasswdForm +} + +func (p *OAuthProxy) redeemCode(host, code string) (s *providers.SessionState, err error) { + if code == "" { + return nil, errors.New("missing code") + } + redirectURI := p.GetRedirectURI(host) + s, err = p.provider.Redeem(redirectURI, code) + if err != nil { + return + } + + if s.Email == "" { + s.Email, err = p.provider.GetEmailAddress(s) + } + return +} + +func (p *OAuthProxy) MakeCookie(req *http.Request, value string, expiration time.Duration, now time.Time) *http.Cookie { + domain := req.Host + if h, _, err := net.SplitHostPort(domain); err == nil { + domain = h + } + if p.CookieDomain != "" { + if !strings.HasSuffix(domain, p.CookieDomain) { + log.Printf("Warning: request host is %q but using configured cookie domain of %q", domain, p.CookieDomain) + } + domain = p.CookieDomain + } + + if value != "" { + value = cookie.SignedValue(p.CookieSeed, p.CookieName, value, now) + } + return &http.Cookie{ + Name: p.CookieName, + Value: value, + Path: "/", + Domain: domain, + HttpOnly: p.CookieHttpOnly, + Secure: p.CookieSecure, + Expires: now.Add(expiration), + } +} + +func (p *OAuthProxy) ClearCookie(rw http.ResponseWriter, req *http.Request) { + http.SetCookie(rw, p.MakeCookie(req, "", time.Hour*-1, time.Now())) +} + +func (p *OAuthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val string) { + http.SetCookie(rw, p.MakeCookie(req, val, p.CookieExpire, time.Now())) +} + +func (p *OAuthProxy) LoadCookiedSession(req *http.Request) (*providers.SessionState, time.Duration, error) { + var age time.Duration + c, err := req.Cookie(p.CookieName) + if err != nil { + // always http.ErrNoCookie + return nil, age, fmt.Errorf("Cookie %q not present", p.CookieName) + } + val, timestamp, ok := cookie.Validate(c, p.CookieSeed, p.CookieExpire) + if !ok { + return nil, age, errors.New("Cookie Signature not valid") + } + + session, err := p.provider.SessionFromCookie(val, p.CookieCipher) + if err != nil { + return nil, age, err + } + + age = time.Now().Truncate(time.Second).Sub(timestamp) + return session, age, nil +} + +func (p *OAuthProxy) SaveSession(rw http.ResponseWriter, req *http.Request, s *providers.SessionState) error { + value, err := p.provider.CookieForSession(s, p.CookieCipher) + if err != nil { + return err + } + p.SetCookie(rw, req, value) + return nil +} + +func (p *OAuthProxy) RobotsTxt(rw http.ResponseWriter) { + rw.WriteHeader(http.StatusOK) + fmt.Fprintf(rw, "User-agent: *\nDisallow: /") +} + +func (p *OAuthProxy) PingPage(rw http.ResponseWriter) { + rw.WriteHeader(http.StatusOK) + fmt.Fprintf(rw, "OK") +} + +func (p *OAuthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) { + log.Printf("ErrorPage %d %s %s", code, title, message) + rw.WriteHeader(code) + t := struct { + Title string + Message string + ProxyPrefix string + }{ + Title: fmt.Sprintf("%d %s", code, title), + Message: message, + ProxyPrefix: p.ProxyPrefix, + } + p.templates.ExecuteTemplate(rw, "error.html", t) +} + +func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code int) { + p.ClearCookie(rw, req) + rw.WriteHeader(code) + + redirect_url := req.URL.RequestURI() + if redirect_url == p.SignInPath { + redirect_url = "/" + } + + t := struct { + ProviderName string + SignInMessage string + CustomLogin bool + Redirect string + Version string + ProxyPrefix string + Footer template.HTML + }{ + ProviderName: p.provider.Data().ProviderName, + SignInMessage: p.SignInMessage, + CustomLogin: p.displayCustomLoginForm(), + Redirect: redirect_url, + Version: VERSION, + ProxyPrefix: p.ProxyPrefix, + Footer: template.HTML(p.Footer), + } + p.templates.ExecuteTemplate(rw, "sign_in.html", t) +} + +func (p *OAuthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool) { + if req.Method != "POST" || p.HtpasswdFile == nil { + return "", false + } + user := req.FormValue("username") + passwd := req.FormValue("password") + if user == "" { + return "", false + } + // check auth + if p.HtpasswdFile.Validate(user, passwd) { + log.Printf("authenticated %q via HtpasswdFile", user) + return user, true + } + return "", false +} + +func (p *OAuthProxy) GetRedirect(req *http.Request) (string, error) { + err := req.ParseForm() + + if err != nil { + return "", err + } + + redirect := req.FormValue("rd") + + if redirect == "" { + redirect = "/" + } + + return redirect, err +} + +func (p *OAuthProxy) IsWhitelistedPath(path string) (ok bool) { + for _, u := range p.compiledRegex { + ok = u.MatchString(path) + if ok { + return + } + } + return +} + +func getRemoteAddr(req *http.Request) (s string) { + s = req.RemoteAddr + if req.Header.Get("X-Real-IP") != "" { + s += fmt.Sprintf(" (%q)", req.Header.Get("X-Real-IP")) + } + return +} + +func (p *OAuthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { + switch path := req.URL.Path; { + case path == p.RobotsPath: + p.RobotsTxt(rw) + case path == p.PingPath: + p.PingPage(rw) + case p.IsWhitelistedPath(path): + p.serveMux.ServeHTTP(rw, req) + case path == p.SignInPath: + p.SignIn(rw, req) + case path == p.SignOutPath: + p.SignOut(rw, req) + case path == p.OAuthStartPath: + p.OAuthStart(rw, req) + case path == p.OAuthCallbackPath: + p.OAuthCallback(rw, req) + case path == p.AuthOnlyPath: + p.AuthenticateOnly(rw, req) + default: + p.Proxy(rw, req) + } +} + +func (p *OAuthProxy) SignIn(rw http.ResponseWriter, req *http.Request) { + redirect, err := p.GetRedirect(req) + if err != nil { + p.ErrorPage(rw, 500, "Internal Error", err.Error()) + return + } + + user, ok := p.ManualSignIn(rw, req) + if ok { + session := &providers.SessionState{User: user} + p.SaveSession(rw, req, session) + http.Redirect(rw, req, redirect, 302) + } else { + p.SignInPage(rw, req, 200) + } +} + +func (p *OAuthProxy) SignOut(rw http.ResponseWriter, req *http.Request) { + p.ClearCookie(rw, req) + http.Redirect(rw, req, "/", 302) +} + +func (p *OAuthProxy) OAuthStart(rw http.ResponseWriter, req *http.Request) { + redirect, err := p.GetRedirect(req) + if err != nil { + p.ErrorPage(rw, 500, "Internal Error", err.Error()) + return + } + redirectURI := p.GetRedirectURI(req.Host) + http.Redirect(rw, req, p.provider.GetLoginURL(redirectURI, redirect), 302) +} + +func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) { + remoteAddr := getRemoteAddr(req) + + // finish the oauth cycle + err := req.ParseForm() + if err != nil { + p.ErrorPage(rw, 500, "Internal Error", err.Error()) + return + } + errorString := req.Form.Get("error") + if errorString != "" { + p.ErrorPage(rw, 403, "Permission Denied", errorString) + return + } + + session, err := p.redeemCode(req.Host, req.Form.Get("code")) + if err != nil { + log.Printf("%s error redeeming code %s", remoteAddr, err) + p.ErrorPage(rw, 500, "Internal Error", "Internal Error") + return + } + + redirect := req.Form.Get("state") + if !strings.HasPrefix(redirect, "/") || strings.HasPrefix(redirect, "//") { + redirect = "/" + } + + // set cookie, or deny + if p.Validator(session.Email) && p.provider.ValidateGroup(session.Email) { + log.Printf("%s authentication complete %s", remoteAddr, session) + err := p.SaveSession(rw, req, session) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + p.ErrorPage(rw, 500, "Internal Error", "Internal Error") + return + } + http.Redirect(rw, req, redirect, 302) + } else { + log.Printf("%s Permission Denied: %q is unauthorized", remoteAddr, session.Email) + p.ErrorPage(rw, 403, "Permission Denied", "Invalid Account") + } +} + +func (p *OAuthProxy) AuthenticateOnly(rw http.ResponseWriter, req *http.Request) { + status := p.Authenticate(rw, req) + if status == http.StatusAccepted { + rw.WriteHeader(http.StatusAccepted) + } else { + http.Error(rw, "unauthorized request", http.StatusUnauthorized) + } +} + +func (p *OAuthProxy) Proxy(rw http.ResponseWriter, req *http.Request) { + status := p.Authenticate(rw, req) + if status == http.StatusInternalServerError { + p.ErrorPage(rw, http.StatusInternalServerError, + "Internal Error", "Internal Error") + } else if status == http.StatusForbidden { + if p.SkipProviderButton { + p.OAuthStart(rw, req) + } else { + p.SignInPage(rw, req, http.StatusForbidden) + } + } else { + p.serveMux.ServeHTTP(rw, req) + } +} + +func (p *OAuthProxy) Authenticate(rw http.ResponseWriter, req *http.Request) int { + var saveSession, clearSession, revalidated bool + remoteAddr := getRemoteAddr(req) + + session, sessionAge, err := p.LoadCookiedSession(req) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + } + if session != nil && sessionAge > p.CookieRefresh && p.CookieRefresh != time.Duration(0) { + log.Printf("%s refreshing %s old session cookie for %s (refresh after %s)", remoteAddr, sessionAge, session, p.CookieRefresh) + saveSession = true + } + + if ok, err := p.provider.RefreshSessionIfNeeded(session); err != nil { + log.Printf("%s removing session. error refreshing access token %s %s", remoteAddr, err, session) + clearSession = true + session = nil + } else if ok { + saveSession = true + revalidated = true + } + + if session != nil && session.IsExpired() { + log.Printf("%s removing session. token expired %s", remoteAddr, session) + session = nil + saveSession = false + clearSession = true + } + + if saveSession && !revalidated && session != nil && session.AccessToken != "" { + if !p.provider.ValidateSessionState(session) { + log.Printf("%s removing session. error validating %s", remoteAddr, session) + saveSession = false + session = nil + clearSession = true + } + } + + if session != nil && session.Email != "" && !p.Validator(session.Email) { + log.Printf("%s Permission Denied: removing session %s", remoteAddr, session) + session = nil + saveSession = false + clearSession = true + } + + if saveSession && session != nil { + err := p.SaveSession(rw, req, session) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + return http.StatusInternalServerError + } + } + + if clearSession { + p.ClearCookie(rw, req) + } + + if session == nil { + session, err = p.CheckBasicAuth(req) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + } + } + + if session == nil { + return http.StatusForbidden + } + + // At this point, the user is authenticated. proxy normally + if p.PassBasicAuth { + req.SetBasicAuth(session.User, p.BasicAuthPassword) + req.Header["X-Forwarded-User"] = []string{session.User} + if session.Email != "" { + req.Header["X-Forwarded-Email"] = []string{session.Email} + } + } + if p.PassAccessToken && session.AccessToken != "" { + req.Header["X-Forwarded-Access-Token"] = []string{session.AccessToken} + } + if session.Email == "" { + rw.Header().Set("GAP-Auth", session.User) + } else { + rw.Header().Set("GAP-Auth", session.Email) + } + return http.StatusAccepted +} + +func (p *OAuthProxy) CheckBasicAuth(req *http.Request) (*providers.SessionState, error) { + if p.HtpasswdFile == nil { + return nil, nil + } + auth := req.Header.Get("Authorization") + if auth == "" { + return nil, nil + } + s := strings.SplitN(auth, " ", 2) + if len(s) != 2 || s[0] != "Basic" { + return nil, fmt.Errorf("invalid Authorization header %s", req.Header.Get("Authorization")) + } + b, err := b64.StdEncoding.DecodeString(s[1]) + if err != nil { + return nil, err + } + pair := strings.SplitN(string(b), ":", 2) + if len(pair) != 2 { + return nil, fmt.Errorf("invalid format %s", b) + } + if p.HtpasswdFile.Validate(pair[0], pair[1]) { + log.Printf("authenticated %q via basic auth", pair[0]) + return &providers.SessionState{User: pair[0]}, nil + } + return nil, fmt.Errorf("%s not in HtpasswdFile", pair[0]) +} +``` + +## `providers/provider_default.go` (changed lines (91,)) + +```go +package providers + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/bitly/oauth2_proxy/cookie" +) + +func (p *ProviderData) Redeem(redirectURL, code string) (s *SessionState, err error) { + if code == "" { + err = errors.New("missing code") + return + } + + params := url.Values{} + params.Add("redirect_uri", redirectURL) + params.Add("client_id", p.ClientID) + params.Add("client_secret", p.ClientSecret) + params.Add("code", code) + params.Add("grant_type", "authorization_code") + if p.ProtectedResource != nil && p.ProtectedResource.String() != "" { + params.Add("resource", p.ProtectedResource.String()) + } + + var req *http.Request + req, err = http.NewRequest("POST", p.RedeemURL.String(), bytes.NewBufferString(params.Encode())) + if err != nil { + return + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + var resp *http.Response + resp, err = http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + var body []byte + body, err = ioutil.ReadAll(resp.Body) + resp.Body.Close() + if err != nil { + return + } + + if resp.StatusCode != 200 { + err = fmt.Errorf("got %d from %q %s", resp.StatusCode, p.RedeemURL.String(), body) + return + } + + // blindly try json and x-www-form-urlencoded + var jsonResponse struct { + AccessToken string `json:"access_token"` + } + err = json.Unmarshal(body, &jsonResponse) + if err == nil { + s = &SessionState{ + AccessToken: jsonResponse.AccessToken, + } + return + } + + var v url.Values + v, err = url.ParseQuery(string(body)) + if err != nil { + return + } + if a := v.Get("access_token"); a != "" { + s = &SessionState{AccessToken: a} + } else { + err = fmt.Errorf("no access token found %s", body) + } + return +} + +// GetLoginURL with typical oauth parameters +func (p *ProviderData) GetLoginURL(redirectURI, finalRedirect string) string { + var a url.URL + a = *p.LoginURL + params, _ := url.ParseQuery(a.RawQuery) + params.Set("redirect_uri", redirectURI) + params.Set("approval_prompt", p.ApprovalPrompt) + params.Add("scope", p.Scope) + params.Set("client_id", p.ClientID) + params.Set("response_type", "code") + if strings.HasPrefix(finalRedirect, "/") && !strings.HasPrefix(finalRedirect,"//") { + params.Add("state", finalRedirect) + } + a.RawQuery = params.Encode() + return a.String() +} + +// CookieForSession serializes a session state for storage in a cookie +func (p *ProviderData) CookieForSession(s *SessionState, c *cookie.Cipher) (string, error) { + return s.EncodeSessionState(c) +} + +// SessionFromCookie deserializes a session from a cookie value +func (p *ProviderData) SessionFromCookie(v string, c *cookie.Cipher) (s *SessionState, err error) { + return DecodeSessionState(v, c) +} + +func (p *ProviderData) GetEmailAddress(s *SessionState) (string, error) { + return "", errors.New("not implemented") +} + +// ValidateGroup validates that the provided email exists in the configured provider +// email group(s). +func (p *ProviderData) ValidateGroup(email string) bool { + return true +} + +func (p *ProviderData) ValidateSessionState(s *SessionState) bool { + return validateToken(p, s.AccessToken, nil) +} + +// RefreshSessionIfNeeded +func (p *ProviderData) RefreshSessionIfNeeded(s *SessionState) (bool, error) { + return false, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..1a3e189d371615c874e4325647da2fffa54dd026 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/pre_context.md @@ -0,0 +1,786 @@ +# Patch-overlapping Go context before the fix + +## `oauthproxy.go` (changed lines (493, 494)) + +```go +package main + +import ( + b64 "encoding/base64" + "errors" + "fmt" + "html/template" + "log" + "net" + "net/http" + "net/http/httputil" + "net/url" + "regexp" + "strings" + "time" + + "github.com/18F/hmacauth" + "github.com/bitly/oauth2_proxy/cookie" + "github.com/bitly/oauth2_proxy/providers" +) + +const SignatureHeader = "GAP-Signature" + +var SignatureHeaders []string = []string{ + "Content-Length", + "Content-Md5", + "Content-Type", + "Date", + "Authorization", + "X-Forwarded-User", + "X-Forwarded-Email", + "X-Forwarded-Access-Token", + "Cookie", + "Gap-Auth", +} + +type OAuthProxy struct { + CookieSeed string + CookieName string + CookieDomain string + CookieSecure bool + CookieHttpOnly bool + CookieExpire time.Duration + CookieRefresh time.Duration + Validator func(string) bool + + RobotsPath string + PingPath string + SignInPath string + SignOutPath string + OAuthStartPath string + OAuthCallbackPath string + AuthOnlyPath string + + redirectURL *url.URL // the url to receive requests at + provider providers.Provider + ProxyPrefix string + SignInMessage string + HtpasswdFile *HtpasswdFile + DisplayHtpasswdForm bool + serveMux http.Handler + PassBasicAuth bool + SkipProviderButton bool + BasicAuthPassword string + PassAccessToken bool + CookieCipher *cookie.Cipher + skipAuthRegex []string + compiledRegex []*regexp.Regexp + templates *template.Template + Footer string +} + +type UpstreamProxy struct { + upstream string + handler http.Handler + auth hmacauth.HmacAuth +} + +func (u *UpstreamProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { + w.Header().Set("GAP-Upstream-Address", u.upstream) + if u.auth != nil { + r.Header.Set("GAP-Auth", w.Header().Get("GAP-Auth")) + u.auth.SignRequest(r) + } + u.handler.ServeHTTP(w, r) +} + +func NewReverseProxy(target *url.URL) (proxy *httputil.ReverseProxy) { + return httputil.NewSingleHostReverseProxy(target) +} +func setProxyUpstreamHostHeader(proxy *httputil.ReverseProxy, target *url.URL) { + director := proxy.Director + proxy.Director = func(req *http.Request) { + director(req) + // use RequestURI so that we aren't unescaping encoded slashes in the request path + req.Host = target.Host + req.URL.Opaque = req.RequestURI + req.URL.RawQuery = "" + } +} +func setProxyDirector(proxy *httputil.ReverseProxy) { + director := proxy.Director + proxy.Director = func(req *http.Request) { + director(req) + // use RequestURI so that we aren't unescaping encoded slashes in the request path + req.URL.Opaque = req.RequestURI + req.URL.RawQuery = "" + } +} +func NewFileServer(path string, filesystemPath string) (proxy http.Handler) { + return http.StripPrefix(path, http.FileServer(http.Dir(filesystemPath))) +} + +func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy { + serveMux := http.NewServeMux() + var auth hmacauth.HmacAuth + if sigData := opts.signatureData; sigData != nil { + auth = hmacauth.NewHmacAuth(sigData.hash, []byte(sigData.key), + SignatureHeader, SignatureHeaders) + } + for _, u := range opts.proxyURLs { + path := u.Path + switch u.Scheme { + case "http", "https": + u.Path = "" + log.Printf("mapping path %q => upstream %q", path, u) + proxy := NewReverseProxy(u) + if !opts.PassHostHeader { + setProxyUpstreamHostHeader(proxy, u) + } else { + setProxyDirector(proxy) + } + serveMux.Handle(path, + &UpstreamProxy{u.Host, proxy, auth}) + case "file": + if u.Fragment != "" { + path = u.Fragment + } + log.Printf("mapping path %q => file system %q", path, u.Path) + proxy := NewFileServer(path, u.Path) + serveMux.Handle(path, &UpstreamProxy{path, proxy, nil}) + default: + panic(fmt.Sprintf("unknown upstream protocol %s", u.Scheme)) + } + } + for _, u := range opts.CompiledRegex { + log.Printf("compiled skip-auth-regex => %q", u) + } + + redirectURL := opts.redirectURL + redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix) + + log.Printf("OAuthProxy configured for %s Client ID: %s", opts.provider.Data().ProviderName, opts.ClientID) + domain := opts.CookieDomain + if domain == "" { + domain = "" + } + refresh := "disabled" + if opts.CookieRefresh != time.Duration(0) { + refresh = fmt.Sprintf("after %s", opts.CookieRefresh) + } + + log.Printf("Cookie settings: name:%s secure(https):%v httponly:%v expiry:%s domain:%s refresh:%s", opts.CookieName, opts.CookieSecure, opts.CookieHttpOnly, opts.CookieExpire, domain, refresh) + + var cipher *cookie.Cipher + if opts.PassAccessToken || (opts.CookieRefresh != time.Duration(0)) { + var err error + cipher, err = cookie.NewCipher(secretBytes(opts.CookieSecret)) + if err != nil { + log.Fatal("cookie-secret error: ", err) + } + } + + return &OAuthProxy{ + CookieName: opts.CookieName, + CookieSeed: opts.CookieSecret, + CookieDomain: opts.CookieDomain, + CookieSecure: opts.CookieSecure, + CookieHttpOnly: opts.CookieHttpOnly, + CookieExpire: opts.CookieExpire, + CookieRefresh: opts.CookieRefresh, + Validator: validator, + + RobotsPath: "/robots.txt", + PingPath: "/ping", + SignInPath: fmt.Sprintf("%s/sign_in", opts.ProxyPrefix), + SignOutPath: fmt.Sprintf("%s/sign_out", opts.ProxyPrefix), + OAuthStartPath: fmt.Sprintf("%s/start", opts.ProxyPrefix), + OAuthCallbackPath: fmt.Sprintf("%s/callback", opts.ProxyPrefix), + AuthOnlyPath: fmt.Sprintf("%s/auth", opts.ProxyPrefix), + + ProxyPrefix: opts.ProxyPrefix, + provider: opts.provider, + serveMux: serveMux, + redirectURL: redirectURL, + skipAuthRegex: opts.SkipAuthRegex, + compiledRegex: opts.CompiledRegex, + PassBasicAuth: opts.PassBasicAuth, + BasicAuthPassword: opts.BasicAuthPassword, + PassAccessToken: opts.PassAccessToken, + SkipProviderButton: opts.SkipProviderButton, + CookieCipher: cipher, + templates: loadTemplates(opts.CustomTemplatesDir), + Footer: opts.Footer, + } +} + +func (p *OAuthProxy) GetRedirectURI(host string) string { + // default to the request Host if not set + if p.redirectURL.Host != "" { + return p.redirectURL.String() + } + var u url.URL + u = *p.redirectURL + if u.Scheme == "" { + if p.CookieSecure { + u.Scheme = "https" + } else { + u.Scheme = "http" + } + } + u.Host = host + return u.String() +} + +func (p *OAuthProxy) displayCustomLoginForm() bool { + return p.HtpasswdFile != nil && p.DisplayHtpasswdForm +} + +func (p *OAuthProxy) redeemCode(host, code string) (s *providers.SessionState, err error) { + if code == "" { + return nil, errors.New("missing code") + } + redirectURI := p.GetRedirectURI(host) + s, err = p.provider.Redeem(redirectURI, code) + if err != nil { + return + } + + if s.Email == "" { + s.Email, err = p.provider.GetEmailAddress(s) + } + return +} + +func (p *OAuthProxy) MakeCookie(req *http.Request, value string, expiration time.Duration, now time.Time) *http.Cookie { + domain := req.Host + if h, _, err := net.SplitHostPort(domain); err == nil { + domain = h + } + if p.CookieDomain != "" { + if !strings.HasSuffix(domain, p.CookieDomain) { + log.Printf("Warning: request host is %q but using configured cookie domain of %q", domain, p.CookieDomain) + } + domain = p.CookieDomain + } + + if value != "" { + value = cookie.SignedValue(p.CookieSeed, p.CookieName, value, now) + } + return &http.Cookie{ + Name: p.CookieName, + Value: value, + Path: "/", + Domain: domain, + HttpOnly: p.CookieHttpOnly, + Secure: p.CookieSecure, + Expires: now.Add(expiration), + } +} + +func (p *OAuthProxy) ClearCookie(rw http.ResponseWriter, req *http.Request) { + http.SetCookie(rw, p.MakeCookie(req, "", time.Hour*-1, time.Now())) +} + +func (p *OAuthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val string) { + http.SetCookie(rw, p.MakeCookie(req, val, p.CookieExpire, time.Now())) +} + +func (p *OAuthProxy) LoadCookiedSession(req *http.Request) (*providers.SessionState, time.Duration, error) { + var age time.Duration + c, err := req.Cookie(p.CookieName) + if err != nil { + // always http.ErrNoCookie + return nil, age, fmt.Errorf("Cookie %q not present", p.CookieName) + } + val, timestamp, ok := cookie.Validate(c, p.CookieSeed, p.CookieExpire) + if !ok { + return nil, age, errors.New("Cookie Signature not valid") + } + + session, err := p.provider.SessionFromCookie(val, p.CookieCipher) + if err != nil { + return nil, age, err + } + + age = time.Now().Truncate(time.Second).Sub(timestamp) + return session, age, nil +} + +func (p *OAuthProxy) SaveSession(rw http.ResponseWriter, req *http.Request, s *providers.SessionState) error { + value, err := p.provider.CookieForSession(s, p.CookieCipher) + if err != nil { + return err + } + p.SetCookie(rw, req, value) + return nil +} + +func (p *OAuthProxy) RobotsTxt(rw http.ResponseWriter) { + rw.WriteHeader(http.StatusOK) + fmt.Fprintf(rw, "User-agent: *\nDisallow: /") +} + +func (p *OAuthProxy) PingPage(rw http.ResponseWriter) { + rw.WriteHeader(http.StatusOK) + fmt.Fprintf(rw, "OK") +} + +func (p *OAuthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) { + log.Printf("ErrorPage %d %s %s", code, title, message) + rw.WriteHeader(code) + t := struct { + Title string + Message string + ProxyPrefix string + }{ + Title: fmt.Sprintf("%d %s", code, title), + Message: message, + ProxyPrefix: p.ProxyPrefix, + } + p.templates.ExecuteTemplate(rw, "error.html", t) +} + +func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code int) { + p.ClearCookie(rw, req) + rw.WriteHeader(code) + + redirect_url := req.URL.RequestURI() + if redirect_url == p.SignInPath { + redirect_url = "/" + } + + t := struct { + ProviderName string + SignInMessage string + CustomLogin bool + Redirect string + Version string + ProxyPrefix string + Footer template.HTML + }{ + ProviderName: p.provider.Data().ProviderName, + SignInMessage: p.SignInMessage, + CustomLogin: p.displayCustomLoginForm(), + Redirect: redirect_url, + Version: VERSION, + ProxyPrefix: p.ProxyPrefix, + Footer: template.HTML(p.Footer), + } + p.templates.ExecuteTemplate(rw, "sign_in.html", t) +} + +func (p *OAuthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool) { + if req.Method != "POST" || p.HtpasswdFile == nil { + return "", false + } + user := req.FormValue("username") + passwd := req.FormValue("password") + if user == "" { + return "", false + } + // check auth + if p.HtpasswdFile.Validate(user, passwd) { + log.Printf("authenticated %q via HtpasswdFile", user) + return user, true + } + return "", false +} + +func (p *OAuthProxy) GetRedirect(req *http.Request) (string, error) { + err := req.ParseForm() + + if err != nil { + return "", err + } + + redirect := req.FormValue("rd") + + if redirect == "" { + redirect = "/" + } + + return redirect, err +} + +func (p *OAuthProxy) IsWhitelistedPath(path string) (ok bool) { + for _, u := range p.compiledRegex { + ok = u.MatchString(path) + if ok { + return + } + } + return +} + +func getRemoteAddr(req *http.Request) (s string) { + s = req.RemoteAddr + if req.Header.Get("X-Real-IP") != "" { + s += fmt.Sprintf(" (%q)", req.Header.Get("X-Real-IP")) + } + return +} + +func (p *OAuthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { + switch path := req.URL.Path; { + case path == p.RobotsPath: + p.RobotsTxt(rw) + case path == p.PingPath: + p.PingPage(rw) + case p.IsWhitelistedPath(path): + p.serveMux.ServeHTTP(rw, req) + case path == p.SignInPath: + p.SignIn(rw, req) + case path == p.SignOutPath: + p.SignOut(rw, req) + case path == p.OAuthStartPath: + p.OAuthStart(rw, req) + case path == p.OAuthCallbackPath: + p.OAuthCallback(rw, req) + case path == p.AuthOnlyPath: + p.AuthenticateOnly(rw, req) + default: + p.Proxy(rw, req) + } +} + +func (p *OAuthProxy) SignIn(rw http.ResponseWriter, req *http.Request) { + redirect, err := p.GetRedirect(req) + if err != nil { + p.ErrorPage(rw, 500, "Internal Error", err.Error()) + return + } + + user, ok := p.ManualSignIn(rw, req) + if ok { + session := &providers.SessionState{User: user} + p.SaveSession(rw, req, session) + http.Redirect(rw, req, redirect, 302) + } else { + p.SignInPage(rw, req, 200) + } +} + +func (p *OAuthProxy) SignOut(rw http.ResponseWriter, req *http.Request) { + p.ClearCookie(rw, req) + http.Redirect(rw, req, "/", 302) +} + +func (p *OAuthProxy) OAuthStart(rw http.ResponseWriter, req *http.Request) { + redirect, err := p.GetRedirect(req) + if err != nil { + p.ErrorPage(rw, 500, "Internal Error", err.Error()) + return + } + redirectURI := p.GetRedirectURI(req.Host) + http.Redirect(rw, req, p.provider.GetLoginURL(redirectURI, redirect), 302) +} + +func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) { + remoteAddr := getRemoteAddr(req) + + // finish the oauth cycle + err := req.ParseForm() + if err != nil { + p.ErrorPage(rw, 500, "Internal Error", err.Error()) + return + } + errorString := req.Form.Get("error") + if errorString != "" { + p.ErrorPage(rw, 403, "Permission Denied", errorString) + return + } + + session, err := p.redeemCode(req.Host, req.Form.Get("code")) + if err != nil { + log.Printf("%s error redeeming code %s", remoteAddr, err) + p.ErrorPage(rw, 500, "Internal Error", "Internal Error") + return + } + + redirect := req.Form.Get("state") + if !strings.HasPrefix(redirect, "/") { + redirect = "/" + } + + // set cookie, or deny + if p.Validator(session.Email) && p.provider.ValidateGroup(session.Email) { + log.Printf("%s authentication complete %s", remoteAddr, session) + err := p.SaveSession(rw, req, session) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + p.ErrorPage(rw, 500, "Internal Error", "Internal Error") + return + } + http.Redirect(rw, req, redirect, 302) + } else { + log.Printf("%s Permission Denied: %q is unauthorized", remoteAddr, session.Email) + p.ErrorPage(rw, 403, "Permission Denied", "Invalid Account") + } +} + +func (p *OAuthProxy) AuthenticateOnly(rw http.ResponseWriter, req *http.Request) { + status := p.Authenticate(rw, req) + if status == http.StatusAccepted { + rw.WriteHeader(http.StatusAccepted) + } else { + http.Error(rw, "unauthorized request", http.StatusUnauthorized) + } +} + +func (p *OAuthProxy) Proxy(rw http.ResponseWriter, req *http.Request) { + status := p.Authenticate(rw, req) + if status == http.StatusInternalServerError { + p.ErrorPage(rw, http.StatusInternalServerError, + "Internal Error", "Internal Error") + } else if status == http.StatusForbidden { + if p.SkipProviderButton { + p.OAuthStart(rw, req) + } else { + p.SignInPage(rw, req, http.StatusForbidden) + } + } else { + p.serveMux.ServeHTTP(rw, req) + } +} + +func (p *OAuthProxy) Authenticate(rw http.ResponseWriter, req *http.Request) int { + var saveSession, clearSession, revalidated bool + remoteAddr := getRemoteAddr(req) + + session, sessionAge, err := p.LoadCookiedSession(req) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + } + if session != nil && sessionAge > p.CookieRefresh && p.CookieRefresh != time.Duration(0) { + log.Printf("%s refreshing %s old session cookie for %s (refresh after %s)", remoteAddr, sessionAge, session, p.CookieRefresh) + saveSession = true + } + + if ok, err := p.provider.RefreshSessionIfNeeded(session); err != nil { + log.Printf("%s removing session. error refreshing access token %s %s", remoteAddr, err, session) + clearSession = true + session = nil + } else if ok { + saveSession = true + revalidated = true + } + + if session != nil && session.IsExpired() { + log.Printf("%s removing session. token expired %s", remoteAddr, session) + session = nil + saveSession = false + clearSession = true + } + + if saveSession && !revalidated && session != nil && session.AccessToken != "" { + if !p.provider.ValidateSessionState(session) { + log.Printf("%s removing session. error validating %s", remoteAddr, session) + saveSession = false + session = nil + clearSession = true + } + } + + if session != nil && session.Email != "" && !p.Validator(session.Email) { + log.Printf("%s Permission Denied: removing session %s", remoteAddr, session) + session = nil + saveSession = false + clearSession = true + } + + if saveSession && session != nil { + err := p.SaveSession(rw, req, session) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + return http.StatusInternalServerError + } + } + + if clearSession { + p.ClearCookie(rw, req) + } + + if session == nil { + session, err = p.CheckBasicAuth(req) + if err != nil { + log.Printf("%s %s", remoteAddr, err) + } + } + + if session == nil { + return http.StatusForbidden + } + + // At this point, the user is authenticated. proxy normally + if p.PassBasicAuth { + req.SetBasicAuth(session.User, p.BasicAuthPassword) + req.Header["X-Forwarded-User"] = []string{session.User} + if session.Email != "" { + req.Header["X-Forwarded-Email"] = []string{session.Email} + } + } + if p.PassAccessToken && session.AccessToken != "" { + req.Header["X-Forwarded-Access-Token"] = []string{session.AccessToken} + } + if session.Email == "" { + rw.Header().Set("GAP-Auth", session.User) + } else { + rw.Header().Set("GAP-Auth", session.Email) + } + return http.StatusAccepted +} + +func (p *OAuthProxy) CheckBasicAuth(req *http.Request) (*providers.SessionState, error) { + if p.HtpasswdFile == nil { + return nil, nil + } + auth := req.Header.Get("Authorization") + if auth == "" { + return nil, nil + } + s := strings.SplitN(auth, " ", 2) + if len(s) != 2 || s[0] != "Basic" { + return nil, fmt.Errorf("invalid Authorization header %s", req.Header.Get("Authorization")) + } + b, err := b64.StdEncoding.DecodeString(s[1]) + if err != nil { + return nil, err + } + pair := strings.SplitN(string(b), ":", 2) + if len(pair) != 2 { + return nil, fmt.Errorf("invalid format %s", b) + } + if p.HtpasswdFile.Validate(pair[0], pair[1]) { + log.Printf("authenticated %q via basic auth", pair[0]) + return &providers.SessionState{User: pair[0]}, nil + } + return nil, fmt.Errorf("%s not in HtpasswdFile", pair[0]) +} +``` + +## `providers/provider_default.go` (changed lines (91, 92)) + +```go +package providers + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "github.com/bitly/oauth2_proxy/cookie" +) + +func (p *ProviderData) Redeem(redirectURL, code string) (s *SessionState, err error) { + if code == "" { + err = errors.New("missing code") + return + } + + params := url.Values{} + params.Add("redirect_uri", redirectURL) + params.Add("client_id", p.ClientID) + params.Add("client_secret", p.ClientSecret) + params.Add("code", code) + params.Add("grant_type", "authorization_code") + if p.ProtectedResource != nil && p.ProtectedResource.String() != "" { + params.Add("resource", p.ProtectedResource.String()) + } + + var req *http.Request + req, err = http.NewRequest("POST", p.RedeemURL.String(), bytes.NewBufferString(params.Encode())) + if err != nil { + return + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + var resp *http.Response + resp, err = http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + var body []byte + body, err = ioutil.ReadAll(resp.Body) + resp.Body.Close() + if err != nil { + return + } + + if resp.StatusCode != 200 { + err = fmt.Errorf("got %d from %q %s", resp.StatusCode, p.RedeemURL.String(), body) + return + } + + // blindly try json and x-www-form-urlencoded + var jsonResponse struct { + AccessToken string `json:"access_token"` + } + err = json.Unmarshal(body, &jsonResponse) + if err == nil { + s = &SessionState{ + AccessToken: jsonResponse.AccessToken, + } + return + } + + var v url.Values + v, err = url.ParseQuery(string(body)) + if err != nil { + return + } + if a := v.Get("access_token"); a != "" { + s = &SessionState{AccessToken: a} + } else { + err = fmt.Errorf("no access token found %s", body) + } + return +} + +// GetLoginURL with typical oauth parameters +func (p *ProviderData) GetLoginURL(redirectURI, finalRedirect string) string { + var a url.URL + a = *p.LoginURL + params, _ := url.ParseQuery(a.RawQuery) + params.Set("redirect_uri", redirectURI) + params.Set("approval_prompt", p.ApprovalPrompt) + params.Add("scope", p.Scope) + params.Set("client_id", p.ClientID) + params.Set("response_type", "code") + if strings.HasPrefix(finalRedirect, "/") { + params.Add("state", finalRedirect) + } + a.RawQuery = params.Encode() + return a.String() +} + +// CookieForSession serializes a session state for storage in a cookie +func (p *ProviderData) CookieForSession(s *SessionState, c *cookie.Cipher) (string, error) { + return s.EncodeSessionState(c) +} + +// SessionFromCookie deserializes a session from a cookie value +func (p *ProviderData) SessionFromCookie(v string, c *cookie.Cipher) (s *SessionState, err error) { + return DecodeSessionState(v, c) +} + +func (p *ProviderData) GetEmailAddress(s *SessionState) (string, error) { + return "", errors.New("not implemented") +} + +// ValidateGroup validates that the provided email exists in the configured provider +// email group(s). +func (p *ProviderData) ValidateGroup(email string) bool { + return true +} + +func (p *ProviderData) ValidateSessionState(s *SessionState) bool { + return validateToken(p, s.AccessToken, nil) +} + +// RefreshSessionIfNeeded +func (p *ProviderData) RefreshSessionIfNeeded(s *SessionState) (bool, error) { + return false, nil +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/task.json new file mode 100644 index 0000000000000000000000000000000000000000..e2a675aee3790ab292595876ba935368ae2ff96b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-cd95b2e4d63395291cd3", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-cd95b2e4d63395291cd3", + "project_id": "morefixes__bitly__oauth2_proxy", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "oauthproxy.go", + "providers/provider_default.go" + ], + "patch_units": { + "before": [ + "oauthproxy.go", + "providers/provider_default.go" + ], + "after": [ + "oauthproxy.go", + "providers/provider_default.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/e11737b5052a9a1327d37bdc5e823651d01bccc55ef43d749c19f7f03649b945/database", + "cache_key": "e11737b5052a9a1327d37bdc5e823651d01bccc55ef43d749c19f7f03649b945", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/cf4b65c741d86571b2eda244af85f1f6f88525bc43bbd02d7d20c6b157300348/database", + "cache_key": "cf4b65c741d86571b2eda244af85f1f6f88525bc43bbd02d7d20c6b157300348", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/0fbdc74eb81d480728d73737568ea6a50d4a95e0fd4c2de3e888ab5f39e0791d/database", + "cache_key": "0fbdc74eb81d480728d73737568ea6a50d4a95e0fd4c2de3e888ab5f39e0791d", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-cd95b2e4d63395291cd3/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-cd95b2e4d63395291cd3/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-cd95b2e4d63395291cd3/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..455a50f85edd541ca784dfdd9fa98e2a2fab8e2e --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/patch.diff @@ -0,0 +1,249 @@ +diff --git a/plugins/meta/portmap/portmap_nftables.go b/plugins/meta/portmap/portmap_nftables.go +index d3e7049d..bd58e4ae 100644 +--- a/plugins/meta/portmap/portmap_nftables.go ++++ b/plugins/meta/portmap/portmap_nftables.go +@@ -26,9 +26,14 @@ import ( + const ( + tableName = "cni_hostport" + ++ // Intermediate chain to jump to both 'hostip_hostports' and 'hostports' ++ hostPortsAllChain = "hostports_all" ++ // This chain was used for rules with hostIP, we do not use it anymore, ++ // but we keep it to make upgrade transparent + hostIPHostPortsChain = "hostip_hostports" +- hostPortsChain = "hostports" +- masqueradingChain = "masquerading" ++ // Chain containing all the rules ++ hostPortsChain = "hostports" ++ masqueradingChain = "masquerading" + ) + + // The nftables portmap implementation is fairly similar to the iptables implementation: +@@ -104,58 +109,69 @@ func (pmNFT *portMapperNFTables) forwardPorts(config *PortMapConf, containerNet + }) + + tx.Add(&knftables.Chain{ +- Name: "hostports", ++ Name: hostPortsChain, + }) ++ + tx.Add(&knftables.Chain{ +- Name: "hostip_hostports", ++ Name: hostIPHostPortsChain, + }) + ++ // setup intermediate chain + tx.Add(&knftables.Chain{ +- Name: "prerouting", +- Type: knftables.PtrTo(knftables.NATType), +- Hook: knftables.PtrTo(knftables.PreroutingHook), +- Priority: knftables.PtrTo(knftables.DNATPriority), ++ Name: hostPortsAllChain, + }) ++ + tx.Flush(&knftables.Chain{ +- Name: "prerouting", ++ Name: hostPortsAllChain, + }) ++ + tx.Add(&knftables.Rule{ +- Chain: "prerouting", ++ Chain: hostPortsAllChain, + Rule: knftables.Concat( +- conditions, + "jump", hostIPHostPortsChain, + ), + }) ++ + tx.Add(&knftables.Rule{ +- Chain: "prerouting", ++ Chain: hostPortsAllChain, + Rule: knftables.Concat( +- conditions, + "jump", hostPortsChain, + ), + }) + + tx.Add(&knftables.Chain{ +- Name: "output", ++ Name: "prerouting", + Type: knftables.PtrTo(knftables.NATType), +- Hook: knftables.PtrTo(knftables.OutputHook), ++ Hook: knftables.PtrTo(knftables.PreroutingHook), + Priority: knftables.PtrTo(knftables.DNATPriority), + }) + tx.Flush(&knftables.Chain{ +- Name: "output", ++ Name: "prerouting", + }) + tx.Add(&knftables.Rule{ +- Chain: "output", ++ Chain: "prerouting", + Rule: knftables.Concat( + conditions, +- "jump", hostIPHostPortsChain, ++ "fib daddr type local", ++ "jump", hostPortsAllChain, + ), + }) ++ ++ tx.Add(&knftables.Chain{ ++ Name: "output", ++ Type: knftables.PtrTo(knftables.NATType), ++ Hook: knftables.PtrTo(knftables.OutputHook), ++ Priority: knftables.PtrTo(knftables.DNATPriority), ++ }) ++ tx.Flush(&knftables.Chain{ ++ Name: "output", ++ }) + tx.Add(&knftables.Rule{ + Chain: "output", + Rule: knftables.Concat( + conditions, + "fib daddr type local", +- "jump", hostPortsChain, ++ "jump", hostPortsAllChain, + ), + }) + +@@ -184,8 +200,10 @@ func (pmNFT *portMapperNFTables) forwardPorts(config *PortMapConf, containerNet + } + + if useHostIP { ++ // we add the rule to 'hostports' instead of 'hostip_hostports' ++ // as we want to remove 'hostip_hostports' long-term + tx.Add(&knftables.Rule{ +- Chain: hostIPHostPortsChain, ++ Chain: hostPortsChain, + Rule: knftables.Concat( + ipX, "daddr", e.HostIP, + e.Protocol, "dport", e.HostPort, +@@ -243,7 +261,7 @@ func (pmNFT *portMapperNFTables) forwardPorts(config *PortMapConf, containerNet + func (pmNFT *portMapperNFTables) checkPorts(config *PortMapConf, containerNet net.IPNet) error { + isV6 := (containerNet.IP.To4() == nil) + +- var hostPorts, hostIPHostPorts, masqueradings int ++ var hostPorts, masqueradings int + for _, e := range config.RuntimeConfig.PortMaps { + if e.HostIP != "" { + hostIP := net.ParseIP(e.HostIP) +@@ -252,14 +270,8 @@ func (pmNFT *portMapperNFTables) checkPorts(config *PortMapConf, containerNet ne + if isV6 != isHostV6 { + continue + } +- if hostIP.IsUnspecified() { +- hostPorts++ +- } else { +- hostIPHostPorts++ +- } +- } else { +- hostPorts++ + } ++ hostPorts++ + } + if *config.SNAT { + masqueradings = 1 +@@ -278,12 +290,6 @@ func (pmNFT *portMapperNFTables) checkPorts(config *PortMapConf, containerNet ne + return err + } + } +- if hostIPHostPorts > 0 { +- err := checkPortsAgainstRules(nft, hostIPHostPortsChain, config.ContainerID, hostIPHostPorts) +- if err != nil { +- return err +- } +- } + if masqueradings > 0 { + err := checkPortsAgainstRules(nft, masqueradingChain, config.ContainerID, masqueradings) + if err != nil { +diff --git a/plugins/meta/portmap/portmap_nftables_test.go b/plugins/meta/portmap/portmap_nftables_test.go +index c367f7ad..340c88a4 100644 +--- a/plugins/meta/portmap/portmap_nftables_test.go ++++ b/plugins/meta/portmap/portmap_nftables_test.go +@@ -84,21 +84,22 @@ var _ = Describe("portmapping configuration (nftables)", func() { + add table ip cni_hostport { comment "CNI portmap plugin" ; } + add chain ip cni_hostport hostip_hostports + add chain ip cni_hostport hostports ++add chain ip cni_hostport hostports_all + add chain ip cni_hostport masquerading { type nat hook postrouting priority 100 ; } + add chain ip cni_hostport output { type nat hook output priority -100 ; } + add chain ip cni_hostport prerouting { type nat hook prerouting priority -100 ; } +-add rule ip cni_hostport hostip_hostports ip daddr 192.168.0.2 tcp dport 8083 dnat to 10.0.0.2:83 comment "icee6giejonei6so" + add rule ip cni_hostport hostports tcp dport 8080 dnat to 10.0.0.2:80 comment "icee6giejonei6so" + add rule ip cni_hostport hostports tcp dport 8081 dnat to 10.0.0.2:80 comment "icee6giejonei6so" + add rule ip cni_hostport hostports udp dport 8080 dnat to 10.0.0.2:81 comment "icee6giejonei6so" + add rule ip cni_hostport hostports udp dport 8082 dnat to 10.0.0.2:82 comment "icee6giejonei6so" ++add rule ip cni_hostport hostports ip daddr 192.168.0.2 tcp dport 8083 dnat to 10.0.0.2:83 comment "icee6giejonei6so" + add rule ip cni_hostport hostports tcp dport 8084 dnat to 10.0.0.2:84 comment "icee6giejonei6so" ++add rule ip cni_hostport hostports_all jump hostip_hostports ++add rule ip cni_hostport hostports_all jump hostports + add rule ip cni_hostport masquerading ip saddr 10.0.0.2 ip daddr 10.0.0.2 masquerade comment "icee6giejonei6so" + add rule ip cni_hostport masquerading ip saddr 127.0.0.1 ip daddr 10.0.0.2 masquerade comment "icee6giejonei6so" +-add rule ip cni_hostport output a b jump hostip_hostports +-add rule ip cni_hostport output a b fib daddr type local jump hostports +-add rule ip cni_hostport prerouting a b jump hostip_hostports +-add rule ip cni_hostport prerouting a b jump hostports ++add rule ip cni_hostport output a b fib daddr type local jump hostports_all ++add rule ip cni_hostport prerouting a b fib daddr type local jump hostports_all + `) + actualRules := strings.TrimSpace(ipv4Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) +@@ -113,18 +114,53 @@ add rule ip cni_hostport prerouting a b jump hostports + add table ip6 cni_hostport { comment "CNI portmap plugin" ; } + add chain ip6 cni_hostport hostip_hostports + add chain ip6 cni_hostport hostports ++add chain ip6 cni_hostport hostports_all + add chain ip6 cni_hostport output { type nat hook output priority -100 ; } + add chain ip6 cni_hostport prerouting { type nat hook prerouting priority -100 ; } +-add rule ip6 cni_hostport hostip_hostports ip6 daddr 2001:db8:a::1 tcp dport 8085 dnat to [2001:db8::2]:85 comment "icee6giejonei6so" + add rule ip6 cni_hostport hostports tcp dport 8080 dnat to [2001:db8::2]:80 comment "icee6giejonei6so" + add rule ip6 cni_hostport hostports tcp dport 8081 dnat to [2001:db8::2]:80 comment "icee6giejonei6so" + add rule ip6 cni_hostport hostports udp dport 8080 dnat to [2001:db8::2]:81 comment "icee6giejonei6so" + add rule ip6 cni_hostport hostports udp dport 8082 dnat to [2001:db8::2]:82 comment "icee6giejonei6so" ++add rule ip6 cni_hostport hostports ip6 daddr 2001:db8:a::1 tcp dport 8085 dnat to [2001:db8::2]:85 comment "icee6giejonei6so" + add rule ip6 cni_hostport hostports tcp dport 8086 dnat to [2001:db8::2]:86 comment "icee6giejonei6so" +-add rule ip6 cni_hostport output c d jump hostip_hostports +-add rule ip6 cni_hostport output c d fib daddr type local jump hostports +-add rule ip6 cni_hostport prerouting c d jump hostip_hostports +-add rule ip6 cni_hostport prerouting c d jump hostports ++add rule ip6 cni_hostport hostports_all jump hostip_hostports ++add rule ip6 cni_hostport hostports_all jump hostports ++add rule ip6 cni_hostport output c d fib daddr type local jump hostports_all ++add rule ip6 cni_hostport prerouting c d fib daddr type local jump hostports_all ++`) ++ actualRules = strings.TrimSpace(ipv6Fake.Dump()) ++ Expect(actualRules).To(Equal(expectedRules)) ++ ++ err = pmNFT.unforwardPorts(conf) ++ Expect(err).NotTo(HaveOccurred()) ++ ++ expectedRules = strings.TrimSpace(` ++add table ip cni_hostport { comment "CNI portmap plugin" ; } ++add chain ip cni_hostport hostip_hostports ++add chain ip cni_hostport hostports ++add chain ip cni_hostport hostports_all ++add chain ip cni_hostport masquerading { type nat hook postrouting priority 100 ; } ++add chain ip cni_hostport output { type nat hook output priority -100 ; } ++add chain ip cni_hostport prerouting { type nat hook prerouting priority -100 ; } ++add rule ip cni_hostport hostports_all jump hostip_hostports ++add rule ip cni_hostport hostports_all jump hostports ++add rule ip cni_hostport output a b fib daddr type local jump hostports_all ++add rule ip cni_hostport prerouting a b fib daddr type local jump hostports_all ++`) ++ actualRules = strings.TrimSpace(ipv4Fake.Dump()) ++ Expect(actualRules).To(Equal(expectedRules)) ++ ++ expectedRules = strings.TrimSpace(` ++add table ip6 cni_hostport { comment "CNI portmap plugin" ; } ++add chain ip6 cni_hostport hostip_hostports ++add chain ip6 cni_hostport hostports ++add chain ip6 cni_hostport hostports_all ++add chain ip6 cni_hostport output { type nat hook output priority -100 ; } ++add chain ip6 cni_hostport prerouting { type nat hook prerouting priority -100 ; } ++add rule ip6 cni_hostport hostports_all jump hostip_hostports ++add rule ip6 cni_hostport hostports_all jump hostports ++add rule ip6 cni_hostport output c d fib daddr type local jump hostports_all ++add rule ip6 cni_hostport prerouting c d fib daddr type local jump hostports_all + `) + actualRules = strings.TrimSpace(ipv6Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..290959017859dd2727597bf7b372c50ef1eaa55f --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/post_context.md @@ -0,0 +1,595 @@ +# Patch-overlapping Go context after the fix + +## `plugins/meta/portmap/portmap_nftables.go` (changed lines (29, 30, 31, 32, 34, 35, 36, 112, 114, 116, 119, 121, 123, 125, 127, 129, 131, 134, 136, 138, 143, 145, 149, 152, 155, 156, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 174, 203, 204, 206, 264, 273, 274, 293)) + +```go +// Copyright 2023 CNI authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "context" + "fmt" + "net" + "strconv" + + "sigs.k8s.io/knftables" +) + +const ( + tableName = "cni_hostport" + + // Intermediate chain to jump to both 'hostip_hostports' and 'hostports' + hostPortsAllChain = "hostports_all" + // This chain was used for rules with hostIP, we do not use it anymore, + // but we keep it to make upgrade transparent + hostIPHostPortsChain = "hostip_hostports" + // Chain containing all the rules + hostPortsChain = "hostports" + masqueradingChain = "masquerading" +) + +// The nftables portmap implementation is fairly similar to the iptables implementation: +// we add a rule for each mapping, with a comment containing a hash of the container ID, +// so that we can later reliably delete the rules we want. (This is important because in +// edge cases, it's possible the plugin might see "ADD container A with IP 192.168.1.3", +// followed by "ADD container B with IP 192.168.1.3" followed by "DEL container A with IP +// 192.168.1.3", and we need to make sure that the DEL causes us to delete the rule for +// container A, and not the rule for container B.) This iptables implementation actually +// uses a separate chain per container but there's not really any need for that... +// +// As with pkg/ip/ipmasq_nftables_linux.go, it would be more nftables-y to have a chain +// with a single rule doing a lookup against a map with an element per mapping, rather +// than having a chain with a rule per mapping. But there's no easy, non-racy way to say +// "delete the element 192.168.1.3 from the map, but only if it was added for container A, +// not if it was added for container B". + +type portMapperNFTables struct { + ipv4 knftables.Interface + ipv6 knftables.Interface +} + +// getPortMapNFT creates an nftables.Interface for port mapping for the IP family of ipn +func (pmNFT *portMapperNFTables) getPortMapNFT(ipv6 bool) (knftables.Interface, error) { + var err error + if ipv6 { + if pmNFT.ipv6 == nil { + pmNFT.ipv6, err = knftables.New(knftables.IPv6Family, tableName) + if err != nil { + return nil, err + } + } + return pmNFT.ipv6, nil + } + + if pmNFT.ipv4 == nil { + pmNFT.ipv4, err = knftables.New(knftables.IPv4Family, tableName) + if err != nil { + return nil, err + } + } + return pmNFT.ipv4, err +} + +// forwardPorts establishes port forwarding to a given container IP. +// containerNet.IP can be either v4 or v6. +func (pmNFT *portMapperNFTables) forwardPorts(config *PortMapConf, containerNet net.IPNet) error { + isV6 := (containerNet.IP.To4() == nil) + nft, err := pmNFT.getPortMapNFT(isV6) + if err != nil { + return err + } + + var ipX string + var conditions []string + if isV6 { + ipX = "ip6" + if config.ConditionsV6 != nil { + conditions = *config.ConditionsV6 + } + } else if !isV6 { + ipX = "ip" + if config.ConditionsV4 != nil { + conditions = *config.ConditionsV4 + } + } + + tx := nft.NewTransaction() + + // Ensure basic rule structure + tx.Add(&knftables.Table{ + Comment: knftables.PtrTo("CNI portmap plugin"), + }) + + tx.Add(&knftables.Chain{ + Name: hostPortsChain, + }) + + tx.Add(&knftables.Chain{ + Name: hostIPHostPortsChain, + }) + + // setup intermediate chain + tx.Add(&knftables.Chain{ + Name: hostPortsAllChain, + }) + + tx.Flush(&knftables.Chain{ + Name: hostPortsAllChain, + }) + + tx.Add(&knftables.Rule{ + Chain: hostPortsAllChain, + Rule: knftables.Concat( + "jump", hostIPHostPortsChain, + ), + }) + + tx.Add(&knftables.Rule{ + Chain: hostPortsAllChain, + Rule: knftables.Concat( + "jump", hostPortsChain, + ), + }) + + tx.Add(&knftables.Chain{ + Name: "prerouting", + Type: knftables.PtrTo(knftables.NATType), + Hook: knftables.PtrTo(knftables.PreroutingHook), + Priority: knftables.PtrTo(knftables.DNATPriority), + }) + tx.Flush(&knftables.Chain{ + Name: "prerouting", + }) + tx.Add(&knftables.Rule{ + Chain: "prerouting", + Rule: knftables.Concat( + conditions, + "fib daddr type local", + "jump", hostPortsAllChain, + ), + }) + + tx.Add(&knftables.Chain{ + Name: "output", + Type: knftables.PtrTo(knftables.NATType), + Hook: knftables.PtrTo(knftables.OutputHook), + Priority: knftables.PtrTo(knftables.DNATPriority), + }) + tx.Flush(&knftables.Chain{ + Name: "output", + }) + tx.Add(&knftables.Rule{ + Chain: "output", + Rule: knftables.Concat( + conditions, + "fib daddr type local", + "jump", hostPortsAllChain, + ), + }) + + if *config.SNAT { + tx.Add(&knftables.Chain{ + Name: masqueradingChain, + Type: knftables.PtrTo(knftables.NATType), + Hook: knftables.PtrTo(knftables.PostroutingHook), + Priority: knftables.PtrTo(knftables.SNATPriority), + }) + } + + // Set up this container + for _, e := range config.RuntimeConfig.PortMaps { + useHostIP := false + if e.HostIP != "" { + hostIP := net.ParseIP(e.HostIP) + isHostV6 := (hostIP.To4() == nil) + // Ignore wrong-IP-family HostIPs + if isV6 != isHostV6 { + continue + } + + // Unspecified addresses cannot be used as destination + useHostIP = !hostIP.IsUnspecified() + } + + if useHostIP { + // we add the rule to 'hostports' instead of 'hostip_hostports' + // as we want to remove 'hostip_hostports' long-term + tx.Add(&knftables.Rule{ + Chain: hostPortsChain, + Rule: knftables.Concat( + ipX, "daddr", e.HostIP, + e.Protocol, "dport", e.HostPort, + "dnat to", net.JoinHostPort(containerNet.IP.String(), strconv.Itoa(e.ContainerPort)), + ), + Comment: &config.ContainerID, + }) + } else { + tx.Add(&knftables.Rule{ + Chain: hostPortsChain, + Rule: knftables.Concat( + e.Protocol, "dport", e.HostPort, + "dnat to", net.JoinHostPort(containerNet.IP.String(), strconv.Itoa(e.ContainerPort)), + ), + Comment: &config.ContainerID, + }) + } + } + + if *config.SNAT { + // Add mark-to-masquerade rules for hairpin and localhost + // In theory we should validate that the original dst IP and port are as + // expected, but *any* traffic matching one of these patterns would need + // to be masqueraded to be able to work correctly anyway. + tx.Add(&knftables.Rule{ + Chain: masqueradingChain, + Rule: knftables.Concat( + ipX, "saddr", containerNet.IP, + ipX, "daddr", containerNet.IP, + "masquerade", + ), + Comment: &config.ContainerID, + }) + if !isV6 { + tx.Add(&knftables.Rule{ + Chain: masqueradingChain, + Rule: knftables.Concat( + ipX, "saddr 127.0.0.1", + ipX, "daddr", containerNet.IP, + "masquerade", + ), + Comment: &config.ContainerID, + }) + } + } + + err = nft.Run(context.TODO(), tx) + if err != nil { + return fmt.Errorf("unable to set up nftables rules for port mappings: %v", err) + } + + return nil +} + +func (pmNFT *portMapperNFTables) checkPorts(config *PortMapConf, containerNet net.IPNet) error { + isV6 := (containerNet.IP.To4() == nil) + + var hostPorts, masqueradings int + for _, e := range config.RuntimeConfig.PortMaps { + if e.HostIP != "" { + hostIP := net.ParseIP(e.HostIP) + isHostV6 := (hostIP.To4() == nil) + // Ignore wrong-IP-family HostIPs + if isV6 != isHostV6 { + continue + } + } + hostPorts++ + } + if *config.SNAT { + masqueradings = 1 + if !isV6 { + masqueradings *= 2 + } + } + + nft, err := pmNFT.getPortMapNFT(isV6) + if err != nil { + return err + } + if hostPorts > 0 { + err := checkPortsAgainstRules(nft, hostPortsChain, config.ContainerID, hostPorts) + if err != nil { + return err + } + } + if masqueradings > 0 { + err := checkPortsAgainstRules(nft, masqueradingChain, config.ContainerID, masqueradings) + if err != nil { + return err + } + } + + return nil +} + +func checkPortsAgainstRules(nft knftables.Interface, chain, comment string, nPorts int) error { + rules, err := nft.ListRules(context.TODO(), chain) + if err != nil { + return err + } + + found := 0 + for _, r := range rules { + if r.Comment != nil && *r.Comment == comment { + found++ + } + } + if found < nPorts { + return fmt.Errorf("missing hostport rules in %q chain", chain) + } + + return nil +} + +// unforwardPorts deletes any nftables rules created by this plugin. +// It should be idempotent - it will not error if the chain does not exist. +func (pmNFT *portMapperNFTables) unforwardPorts(config *PortMapConf) error { + // Always clear both IPv4 and IPv6, just to be sure + for _, family := range []knftables.Family{knftables.IPv4Family, knftables.IPv6Family} { + nft, err := pmNFT.getPortMapNFT(family == knftables.IPv6Family) + if err != nil { + continue + } + + tx := nft.NewTransaction() + for _, chain := range []string{hostPortsChain, hostIPHostPortsChain, masqueradingChain} { + rules, err := nft.ListRules(context.TODO(), chain) + if err != nil { + if knftables.IsNotFound(err) { + continue + } + return fmt.Errorf("could not list rules in table %s: %w", tableName, err) + } + + for _, r := range rules { + if r.Comment != nil && *r.Comment == config.ContainerID { + tx.Delete(r) + } + } + } + + err = nft.Run(context.TODO(), tx) + if err != nil { + return fmt.Errorf("error deleting nftables rules: %w", err) + } + } + + return nil +} +``` + +## `plugins/meta/portmap/portmap_nftables_test.go` (changed lines (87, 91, 95, 97, 98, 101, 102, 117, 120, 124, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163)) + +```go +// Copyright 2023 CNI authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + "strings" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "sigs.k8s.io/knftables" + + "github.com/containernetworking/cni/pkg/types" +) + +var _ = Describe("portmapping configuration (nftables)", func() { + containerID := "icee6giejonei6so" + configTmpl := `{ + "name": "test", + "type": "portmap", + "cniVersion": "%s", + "backend": "nftables", + "runtimeConfig": { + "portMappings": [ + { "hostPort": 8080, "containerPort": 80, "protocol": "tcp"}, + { "hostPort": 8081, "containerPort": 80, "protocol": "tcp"}, + { "hostPort": 8080, "containerPort": 81, "protocol": "udp"}, + { "hostPort": 8082, "containerPort": 82, "protocol": "udp"}, + { "hostPort": 8083, "containerPort": 83, "protocol": "tcp", "hostIP": "192.168.0.2"}, + { "hostPort": 8084, "containerPort": 84, "protocol": "tcp", "hostIP": "0.0.0.0"}, + { "hostPort": 8085, "containerPort": 85, "protocol": "tcp", "hostIP": "2001:db8:a::1"}, + { "hostPort": 8086, "containerPort": 86, "protocol": "tcp", "hostIP": "::"} + ] + }, + "snat": true, + "conditionsV4": ["a", "b"], + "conditionsV6": ["c", "d"] + }` + containerNet4, err := types.ParseCIDR("10.0.0.2/24") + Expect(err).NotTo(HaveOccurred()) + containerNet6, err := types.ParseCIDR("2001:db8::2/64") + Expect(err).NotTo(HaveOccurred()) + + for _, ver := range []string{"0.3.0", "0.3.1", "0.4.0", "1.0.0"} { + // Redefine ver inside for scope so real value is picked up by each dynamically defined It() + // See Gingkgo's "Patterns for dynamically generating tests" documentation. + ver := ver + + Describe("nftables rules", func() { + var pmNFT *portMapperNFTables + var ipv4Fake, ipv6Fake *knftables.Fake + BeforeEach(func() { + ipv4Fake = knftables.NewFake(knftables.IPv4Family, tableName) + ipv6Fake = knftables.NewFake(knftables.IPv6Family, tableName) + pmNFT = &portMapperNFTables{ + ipv4: ipv4Fake, + ipv6: ipv6Fake, + } + }) + + It(fmt.Sprintf("[%s] generates correct rules", ver), func() { + configBytes := []byte(fmt.Sprintf(configTmpl, ver)) + + conf, _, err := parseConfig(configBytes, "foo") + Expect(err).NotTo(HaveOccurred()) + conf.ContainerID = containerID + + err = pmNFT.forwardPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + + expectedRules := strings.TrimSpace(` +add table ip cni_hostport { comment "CNI portmap plugin" ; } +add chain ip cni_hostport hostip_hostports +add chain ip cni_hostport hostports +add chain ip cni_hostport hostports_all +add chain ip cni_hostport masquerading { type nat hook postrouting priority 100 ; } +add chain ip cni_hostport output { type nat hook output priority -100 ; } +add chain ip cni_hostport prerouting { type nat hook prerouting priority -100 ; } +add rule ip cni_hostport hostports tcp dport 8080 dnat to 10.0.0.2:80 comment "icee6giejonei6so" +add rule ip cni_hostport hostports tcp dport 8081 dnat to 10.0.0.2:80 comment "icee6giejonei6so" +add rule ip cni_hostport hostports udp dport 8080 dnat to 10.0.0.2:81 comment "icee6giejonei6so" +add rule ip cni_hostport hostports udp dport 8082 dnat to 10.0.0.2:82 comment "icee6giejonei6so" +add rule ip cni_hostport hostports ip daddr 192.168.0.2 tcp dport 8083 dnat to 10.0.0.2:83 comment "icee6giejonei6so" +add rule ip cni_hostport hostports tcp dport 8084 dnat to 10.0.0.2:84 comment "icee6giejonei6so" +add rule ip cni_hostport hostports_all jump hostip_hostports +add rule ip cni_hostport hostports_all jump hostports +add rule ip cni_hostport masquerading ip saddr 10.0.0.2 ip daddr 10.0.0.2 masquerade comment "icee6giejonei6so" +add rule ip cni_hostport masquerading ip saddr 127.0.0.1 ip daddr 10.0.0.2 masquerade comment "icee6giejonei6so" +add rule ip cni_hostport output a b fib daddr type local jump hostports_all +add rule ip cni_hostport prerouting a b fib daddr type local jump hostports_all +`) + actualRules := strings.TrimSpace(ipv4Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) + + // Disable snat, generate IPv6 rules + *conf.SNAT = false + + err = pmNFT.forwardPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + expectedRules = strings.TrimSpace(` +add table ip6 cni_hostport { comment "CNI portmap plugin" ; } +add chain ip6 cni_hostport hostip_hostports +add chain ip6 cni_hostport hostports +add chain ip6 cni_hostport hostports_all +add chain ip6 cni_hostport output { type nat hook output priority -100 ; } +add chain ip6 cni_hostport prerouting { type nat hook prerouting priority -100 ; } +add rule ip6 cni_hostport hostports tcp dport 8080 dnat to [2001:db8::2]:80 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports tcp dport 8081 dnat to [2001:db8::2]:80 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports udp dport 8080 dnat to [2001:db8::2]:81 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports udp dport 8082 dnat to [2001:db8::2]:82 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports ip6 daddr 2001:db8:a::1 tcp dport 8085 dnat to [2001:db8::2]:85 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports tcp dport 8086 dnat to [2001:db8::2]:86 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports_all jump hostip_hostports +add rule ip6 cni_hostport hostports_all jump hostports +add rule ip6 cni_hostport output c d fib daddr type local jump hostports_all +add rule ip6 cni_hostport prerouting c d fib daddr type local jump hostports_all +`) + actualRules = strings.TrimSpace(ipv6Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) + + err = pmNFT.unforwardPorts(conf) + Expect(err).NotTo(HaveOccurred()) + + expectedRules = strings.TrimSpace(` +add table ip cni_hostport { comment "CNI portmap plugin" ; } +add chain ip cni_hostport hostip_hostports +add chain ip cni_hostport hostports +add chain ip cni_hostport hostports_all +add chain ip cni_hostport masquerading { type nat hook postrouting priority 100 ; } +add chain ip cni_hostport output { type nat hook output priority -100 ; } +add chain ip cni_hostport prerouting { type nat hook prerouting priority -100 ; } +add rule ip cni_hostport hostports_all jump hostip_hostports +add rule ip cni_hostport hostports_all jump hostports +add rule ip cni_hostport output a b fib daddr type local jump hostports_all +add rule ip cni_hostport prerouting a b fib daddr type local jump hostports_all +`) + actualRules = strings.TrimSpace(ipv4Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) + + expectedRules = strings.TrimSpace(` +add table ip6 cni_hostport { comment "CNI portmap plugin" ; } +add chain ip6 cni_hostport hostip_hostports +add chain ip6 cni_hostport hostports +add chain ip6 cni_hostport hostports_all +add chain ip6 cni_hostport output { type nat hook output priority -100 ; } +add chain ip6 cni_hostport prerouting { type nat hook prerouting priority -100 ; } +add rule ip6 cni_hostport hostports_all jump hostip_hostports +add rule ip6 cni_hostport hostports_all jump hostports +add rule ip6 cni_hostport output c d fib daddr type local jump hostports_all +add rule ip6 cni_hostport prerouting c d fib daddr type local jump hostports_all +`) + actualRules = strings.TrimSpace(ipv6Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) + }) + + It(fmt.Sprintf("[%s] has working CHECK", ver), func() { + configBytes := []byte(fmt.Sprintf(configTmpl, ver)) + + conf, _, err := parseConfig(configBytes, "foo") + Expect(err).NotTo(HaveOccurred()) + conf.ContainerID = containerID + + // CHECK KO: Missing all rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).To(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).To(HaveOccurred()) + + *conf.SNAT = false + + // ADD with SNAT=false + err = pmNFT.forwardPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.forwardPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + // CHECK OK: no SNAT rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + *conf.SNAT = true + + // CHECK KO: missing SNAT rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).To(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).To(HaveOccurred()) + + // ADD with SNAT=true + err = pmNFT.forwardPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.forwardPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + // CHECK OK: All rules present + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + // DELETE + err = pmNFT.unforwardPorts(conf) + Expect(err).NotTo(HaveOccurred()) + + // CHECK KO: Missing all rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).To(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).To(HaveOccurred()) + }) + }) + } +}) +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..72fdbe79384a7854bdbe592d26f516a25e9873be --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/pre_context.md @@ -0,0 +1,553 @@ +# Patch-overlapping Go context before the fix + +## `plugins/meta/portmap/portmap_nftables.go` (changed lines (29, 30, 31, 32, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 129, 130, 131, 132, 138, 139, 140, 141, 144, 145, 147, 148, 150, 151, 153, 158, 159, 187, 188, 189, 246, 247, 255, 256, 257, 258, 259, 260, 261, 263, 281, 282, 283, 284, 285, 286)) + +```go +// Copyright 2023 CNI authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "context" + "fmt" + "net" + "strconv" + + "sigs.k8s.io/knftables" +) + +const ( + tableName = "cni_hostport" + + hostIPHostPortsChain = "hostip_hostports" + hostPortsChain = "hostports" + masqueradingChain = "masquerading" +) + +// The nftables portmap implementation is fairly similar to the iptables implementation: +// we add a rule for each mapping, with a comment containing a hash of the container ID, +// so that we can later reliably delete the rules we want. (This is important because in +// edge cases, it's possible the plugin might see "ADD container A with IP 192.168.1.3", +// followed by "ADD container B with IP 192.168.1.3" followed by "DEL container A with IP +// 192.168.1.3", and we need to make sure that the DEL causes us to delete the rule for +// container A, and not the rule for container B.) This iptables implementation actually +// uses a separate chain per container but there's not really any need for that... +// +// As with pkg/ip/ipmasq_nftables_linux.go, it would be more nftables-y to have a chain +// with a single rule doing a lookup against a map with an element per mapping, rather +// than having a chain with a rule per mapping. But there's no easy, non-racy way to say +// "delete the element 192.168.1.3 from the map, but only if it was added for container A, +// not if it was added for container B". + +type portMapperNFTables struct { + ipv4 knftables.Interface + ipv6 knftables.Interface +} + +// getPortMapNFT creates an nftables.Interface for port mapping for the IP family of ipn +func (pmNFT *portMapperNFTables) getPortMapNFT(ipv6 bool) (knftables.Interface, error) { + var err error + if ipv6 { + if pmNFT.ipv6 == nil { + pmNFT.ipv6, err = knftables.New(knftables.IPv6Family, tableName) + if err != nil { + return nil, err + } + } + return pmNFT.ipv6, nil + } + + if pmNFT.ipv4 == nil { + pmNFT.ipv4, err = knftables.New(knftables.IPv4Family, tableName) + if err != nil { + return nil, err + } + } + return pmNFT.ipv4, err +} + +// forwardPorts establishes port forwarding to a given container IP. +// containerNet.IP can be either v4 or v6. +func (pmNFT *portMapperNFTables) forwardPorts(config *PortMapConf, containerNet net.IPNet) error { + isV6 := (containerNet.IP.To4() == nil) + nft, err := pmNFT.getPortMapNFT(isV6) + if err != nil { + return err + } + + var ipX string + var conditions []string + if isV6 { + ipX = "ip6" + if config.ConditionsV6 != nil { + conditions = *config.ConditionsV6 + } + } else if !isV6 { + ipX = "ip" + if config.ConditionsV4 != nil { + conditions = *config.ConditionsV4 + } + } + + tx := nft.NewTransaction() + + // Ensure basic rule structure + tx.Add(&knftables.Table{ + Comment: knftables.PtrTo("CNI portmap plugin"), + }) + + tx.Add(&knftables.Chain{ + Name: "hostports", + }) + tx.Add(&knftables.Chain{ + Name: "hostip_hostports", + }) + + tx.Add(&knftables.Chain{ + Name: "prerouting", + Type: knftables.PtrTo(knftables.NATType), + Hook: knftables.PtrTo(knftables.PreroutingHook), + Priority: knftables.PtrTo(knftables.DNATPriority), + }) + tx.Flush(&knftables.Chain{ + Name: "prerouting", + }) + tx.Add(&knftables.Rule{ + Chain: "prerouting", + Rule: knftables.Concat( + conditions, + "jump", hostIPHostPortsChain, + ), + }) + tx.Add(&knftables.Rule{ + Chain: "prerouting", + Rule: knftables.Concat( + conditions, + "jump", hostPortsChain, + ), + }) + + tx.Add(&knftables.Chain{ + Name: "output", + Type: knftables.PtrTo(knftables.NATType), + Hook: knftables.PtrTo(knftables.OutputHook), + Priority: knftables.PtrTo(knftables.DNATPriority), + }) + tx.Flush(&knftables.Chain{ + Name: "output", + }) + tx.Add(&knftables.Rule{ + Chain: "output", + Rule: knftables.Concat( + conditions, + "jump", hostIPHostPortsChain, + ), + }) + tx.Add(&knftables.Rule{ + Chain: "output", + Rule: knftables.Concat( + conditions, + "fib daddr type local", + "jump", hostPortsChain, + ), + }) + + if *config.SNAT { + tx.Add(&knftables.Chain{ + Name: masqueradingChain, + Type: knftables.PtrTo(knftables.NATType), + Hook: knftables.PtrTo(knftables.PostroutingHook), + Priority: knftables.PtrTo(knftables.SNATPriority), + }) + } + + // Set up this container + for _, e := range config.RuntimeConfig.PortMaps { + useHostIP := false + if e.HostIP != "" { + hostIP := net.ParseIP(e.HostIP) + isHostV6 := (hostIP.To4() == nil) + // Ignore wrong-IP-family HostIPs + if isV6 != isHostV6 { + continue + } + + // Unspecified addresses cannot be used as destination + useHostIP = !hostIP.IsUnspecified() + } + + if useHostIP { + tx.Add(&knftables.Rule{ + Chain: hostIPHostPortsChain, + Rule: knftables.Concat( + ipX, "daddr", e.HostIP, + e.Protocol, "dport", e.HostPort, + "dnat to", net.JoinHostPort(containerNet.IP.String(), strconv.Itoa(e.ContainerPort)), + ), + Comment: &config.ContainerID, + }) + } else { + tx.Add(&knftables.Rule{ + Chain: hostPortsChain, + Rule: knftables.Concat( + e.Protocol, "dport", e.HostPort, + "dnat to", net.JoinHostPort(containerNet.IP.String(), strconv.Itoa(e.ContainerPort)), + ), + Comment: &config.ContainerID, + }) + } + } + + if *config.SNAT { + // Add mark-to-masquerade rules for hairpin and localhost + // In theory we should validate that the original dst IP and port are as + // expected, but *any* traffic matching one of these patterns would need + // to be masqueraded to be able to work correctly anyway. + tx.Add(&knftables.Rule{ + Chain: masqueradingChain, + Rule: knftables.Concat( + ipX, "saddr", containerNet.IP, + ipX, "daddr", containerNet.IP, + "masquerade", + ), + Comment: &config.ContainerID, + }) + if !isV6 { + tx.Add(&knftables.Rule{ + Chain: masqueradingChain, + Rule: knftables.Concat( + ipX, "saddr 127.0.0.1", + ipX, "daddr", containerNet.IP, + "masquerade", + ), + Comment: &config.ContainerID, + }) + } + } + + err = nft.Run(context.TODO(), tx) + if err != nil { + return fmt.Errorf("unable to set up nftables rules for port mappings: %v", err) + } + + return nil +} + +func (pmNFT *portMapperNFTables) checkPorts(config *PortMapConf, containerNet net.IPNet) error { + isV6 := (containerNet.IP.To4() == nil) + + var hostPorts, hostIPHostPorts, masqueradings int + for _, e := range config.RuntimeConfig.PortMaps { + if e.HostIP != "" { + hostIP := net.ParseIP(e.HostIP) + isHostV6 := (hostIP.To4() == nil) + // Ignore wrong-IP-family HostIPs + if isV6 != isHostV6 { + continue + } + if hostIP.IsUnspecified() { + hostPorts++ + } else { + hostIPHostPorts++ + } + } else { + hostPorts++ + } + } + if *config.SNAT { + masqueradings = 1 + if !isV6 { + masqueradings *= 2 + } + } + + nft, err := pmNFT.getPortMapNFT(isV6) + if err != nil { + return err + } + if hostPorts > 0 { + err := checkPortsAgainstRules(nft, hostPortsChain, config.ContainerID, hostPorts) + if err != nil { + return err + } + } + if hostIPHostPorts > 0 { + err := checkPortsAgainstRules(nft, hostIPHostPortsChain, config.ContainerID, hostIPHostPorts) + if err != nil { + return err + } + } + if masqueradings > 0 { + err := checkPortsAgainstRules(nft, masqueradingChain, config.ContainerID, masqueradings) + if err != nil { + return err + } + } + + return nil +} + +func checkPortsAgainstRules(nft knftables.Interface, chain, comment string, nPorts int) error { + rules, err := nft.ListRules(context.TODO(), chain) + if err != nil { + return err + } + + found := 0 + for _, r := range rules { + if r.Comment != nil && *r.Comment == comment { + found++ + } + } + if found < nPorts { + return fmt.Errorf("missing hostport rules in %q chain", chain) + } + + return nil +} + +// unforwardPorts deletes any nftables rules created by this plugin. +// It should be idempotent - it will not error if the chain does not exist. +func (pmNFT *portMapperNFTables) unforwardPorts(config *PortMapConf) error { + // Always clear both IPv4 and IPv6, just to be sure + for _, family := range []knftables.Family{knftables.IPv4Family, knftables.IPv6Family} { + nft, err := pmNFT.getPortMapNFT(family == knftables.IPv6Family) + if err != nil { + continue + } + + tx := nft.NewTransaction() + for _, chain := range []string{hostPortsChain, hostIPHostPortsChain, masqueradingChain} { + rules, err := nft.ListRules(context.TODO(), chain) + if err != nil { + if knftables.IsNotFound(err) { + continue + } + return fmt.Errorf("could not list rules in table %s: %w", tableName, err) + } + + for _, r := range rules { + if r.Comment != nil && *r.Comment == config.ContainerID { + tx.Delete(r) + } + } + } + + err = nft.Run(context.TODO(), tx) + if err != nil { + return fmt.Errorf("error deleting nftables rules: %w", err) + } + } + + return nil +} +``` + +## `plugins/meta/portmap/portmap_nftables_test.go` (changed lines (87, 90, 95, 96, 98, 99, 100, 101, 102, 116, 118, 123, 124, 125, 126, 127, 128)) + +```go +// Copyright 2023 CNI authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + "strings" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "sigs.k8s.io/knftables" + + "github.com/containernetworking/cni/pkg/types" +) + +var _ = Describe("portmapping configuration (nftables)", func() { + containerID := "icee6giejonei6so" + configTmpl := `{ + "name": "test", + "type": "portmap", + "cniVersion": "%s", + "backend": "nftables", + "runtimeConfig": { + "portMappings": [ + { "hostPort": 8080, "containerPort": 80, "protocol": "tcp"}, + { "hostPort": 8081, "containerPort": 80, "protocol": "tcp"}, + { "hostPort": 8080, "containerPort": 81, "protocol": "udp"}, + { "hostPort": 8082, "containerPort": 82, "protocol": "udp"}, + { "hostPort": 8083, "containerPort": 83, "protocol": "tcp", "hostIP": "192.168.0.2"}, + { "hostPort": 8084, "containerPort": 84, "protocol": "tcp", "hostIP": "0.0.0.0"}, + { "hostPort": 8085, "containerPort": 85, "protocol": "tcp", "hostIP": "2001:db8:a::1"}, + { "hostPort": 8086, "containerPort": 86, "protocol": "tcp", "hostIP": "::"} + ] + }, + "snat": true, + "conditionsV4": ["a", "b"], + "conditionsV6": ["c", "d"] + }` + containerNet4, err := types.ParseCIDR("10.0.0.2/24") + Expect(err).NotTo(HaveOccurred()) + containerNet6, err := types.ParseCIDR("2001:db8::2/64") + Expect(err).NotTo(HaveOccurred()) + + for _, ver := range []string{"0.3.0", "0.3.1", "0.4.0", "1.0.0"} { + // Redefine ver inside for scope so real value is picked up by each dynamically defined It() + // See Gingkgo's "Patterns for dynamically generating tests" documentation. + ver := ver + + Describe("nftables rules", func() { + var pmNFT *portMapperNFTables + var ipv4Fake, ipv6Fake *knftables.Fake + BeforeEach(func() { + ipv4Fake = knftables.NewFake(knftables.IPv4Family, tableName) + ipv6Fake = knftables.NewFake(knftables.IPv6Family, tableName) + pmNFT = &portMapperNFTables{ + ipv4: ipv4Fake, + ipv6: ipv6Fake, + } + }) + + It(fmt.Sprintf("[%s] generates correct rules", ver), func() { + configBytes := []byte(fmt.Sprintf(configTmpl, ver)) + + conf, _, err := parseConfig(configBytes, "foo") + Expect(err).NotTo(HaveOccurred()) + conf.ContainerID = containerID + + err = pmNFT.forwardPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + + expectedRules := strings.TrimSpace(` +add table ip cni_hostport { comment "CNI portmap plugin" ; } +add chain ip cni_hostport hostip_hostports +add chain ip cni_hostport hostports +add chain ip cni_hostport masquerading { type nat hook postrouting priority 100 ; } +add chain ip cni_hostport output { type nat hook output priority -100 ; } +add chain ip cni_hostport prerouting { type nat hook prerouting priority -100 ; } +add rule ip cni_hostport hostip_hostports ip daddr 192.168.0.2 tcp dport 8083 dnat to 10.0.0.2:83 comment "icee6giejonei6so" +add rule ip cni_hostport hostports tcp dport 8080 dnat to 10.0.0.2:80 comment "icee6giejonei6so" +add rule ip cni_hostport hostports tcp dport 8081 dnat to 10.0.0.2:80 comment "icee6giejonei6so" +add rule ip cni_hostport hostports udp dport 8080 dnat to 10.0.0.2:81 comment "icee6giejonei6so" +add rule ip cni_hostport hostports udp dport 8082 dnat to 10.0.0.2:82 comment "icee6giejonei6so" +add rule ip cni_hostport hostports tcp dport 8084 dnat to 10.0.0.2:84 comment "icee6giejonei6so" +add rule ip cni_hostport masquerading ip saddr 10.0.0.2 ip daddr 10.0.0.2 masquerade comment "icee6giejonei6so" +add rule ip cni_hostport masquerading ip saddr 127.0.0.1 ip daddr 10.0.0.2 masquerade comment "icee6giejonei6so" +add rule ip cni_hostport output a b jump hostip_hostports +add rule ip cni_hostport output a b fib daddr type local jump hostports +add rule ip cni_hostport prerouting a b jump hostip_hostports +add rule ip cni_hostport prerouting a b jump hostports +`) + actualRules := strings.TrimSpace(ipv4Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) + + // Disable snat, generate IPv6 rules + *conf.SNAT = false + + err = pmNFT.forwardPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + expectedRules = strings.TrimSpace(` +add table ip6 cni_hostport { comment "CNI portmap plugin" ; } +add chain ip6 cni_hostport hostip_hostports +add chain ip6 cni_hostport hostports +add chain ip6 cni_hostport output { type nat hook output priority -100 ; } +add chain ip6 cni_hostport prerouting { type nat hook prerouting priority -100 ; } +add rule ip6 cni_hostport hostip_hostports ip6 daddr 2001:db8:a::1 tcp dport 8085 dnat to [2001:db8::2]:85 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports tcp dport 8080 dnat to [2001:db8::2]:80 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports tcp dport 8081 dnat to [2001:db8::2]:80 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports udp dport 8080 dnat to [2001:db8::2]:81 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports udp dport 8082 dnat to [2001:db8::2]:82 comment "icee6giejonei6so" +add rule ip6 cni_hostport hostports tcp dport 8086 dnat to [2001:db8::2]:86 comment "icee6giejonei6so" +add rule ip6 cni_hostport output c d jump hostip_hostports +add rule ip6 cni_hostport output c d fib daddr type local jump hostports +add rule ip6 cni_hostport prerouting c d jump hostip_hostports +add rule ip6 cni_hostport prerouting c d jump hostports +`) + actualRules = strings.TrimSpace(ipv6Fake.Dump()) + Expect(actualRules).To(Equal(expectedRules)) + }) + + It(fmt.Sprintf("[%s] has working CHECK", ver), func() { + configBytes := []byte(fmt.Sprintf(configTmpl, ver)) + + conf, _, err := parseConfig(configBytes, "foo") + Expect(err).NotTo(HaveOccurred()) + conf.ContainerID = containerID + + // CHECK KO: Missing all rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).To(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).To(HaveOccurred()) + + *conf.SNAT = false + + // ADD with SNAT=false + err = pmNFT.forwardPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.forwardPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + // CHECK OK: no SNAT rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + *conf.SNAT = true + + // CHECK KO: missing SNAT rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).To(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).To(HaveOccurred()) + + // ADD with SNAT=true + err = pmNFT.forwardPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.forwardPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + // CHECK OK: All rules present + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).NotTo(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).NotTo(HaveOccurred()) + + // DELETE + err = pmNFT.unforwardPorts(conf) + Expect(err).NotTo(HaveOccurred()) + + // CHECK KO: Missing all rules + err = pmNFT.checkPorts(conf, *containerNet4) + Expect(err).To(HaveOccurred()) + err = pmNFT.checkPorts(conf, *containerNet6) + Expect(err).To(HaveOccurred()) + }) + }) + } +}) +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/task.json new file mode 100644 index 0000000000000000000000000000000000000000..1c237f817d490a02abde280656bf90c26c908fb0 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-d3400ed5292d19661685", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-d3400ed5292d19661685", + "project_id": "morefixes__containernetworking__plugins", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "plugins/meta/portmap/portmap_nftables.go", + "plugins/meta/portmap/portmap_nftables_test.go" + ], + "patch_units": { + "before": [ + "plugins/meta/portmap/portmap_nftables.go", + "plugins/meta/portmap/portmap_nftables_test.go" + ], + "after": [ + "plugins/meta/portmap/portmap_nftables.go", + "plugins/meta/portmap/portmap_nftables_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/bc27e7b41f22c5c800322fd6768a190167ea6037b14168e883eba707ccc1bfbb/database", + "cache_key": "bc27e7b41f22c5c800322fd6768a190167ea6037b14168e883eba707ccc1bfbb", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/05492d20e83f91cf68642fded2aee70aef733bee2c069c12ae0215728017527c/database", + "cache_key": "05492d20e83f91cf68642fded2aee70aef733bee2c069c12ae0215728017527c", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/452f57c39821d863e96566f4a06f9c05d72c0c249a9d9df5ab56bd46fe3b01e0/database", + "cache_key": "452f57c39821d863e96566f4a06f9c05d72c0c249a9d9df5ab56bd46fe3b01e0", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-d3400ed5292d19661685/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-d3400ed5292d19661685/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-d3400ed5292d19661685/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..c749591390172eacbed6c028186c8ca526c14823 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/patch.diff @@ -0,0 +1,578 @@ +diff --git a/prometheus/promhttp/instrument_client.go b/prometheus/promhttp/instrument_client.go +index 83c49b6..861b4d2 100644 +--- a/prometheus/promhttp/instrument_client.go ++++ b/prometheus/promhttp/instrument_client.go +@@ -49,7 +49,10 @@ func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripp + // http.RoundTripper to observe the request result with the provided CounterVec. + // The CounterVec must have zero, one, or two non-const non-curried labels. For + // those, the only allowed label names are "code" and "method". The function +-// panics otherwise. Partitioning of the CounterVec happens by HTTP status code ++// panics otherwise. For the "method" label a predefined default label value set ++// is used to filter given values. Values besides predefined values will count ++// as `unknown` method.`WithExtraMethods` can be used to add more ++// methods to the set. Partitioning of the CounterVec happens by HTTP status code + // and/or HTTP method if the respective instance label names are present in the + // CounterVec. For unpartitioned counting, use a CounterVec with zero labels. + // +@@ -57,13 +60,18 @@ func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripp + // is not incremented. + // + // See the example for ExampleInstrumentRoundTripperDuration for example usage. +-func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.RoundTripper) RoundTripperFunc { ++func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { ++ rtOpts := &option{} ++ for _, o := range opts { ++ o(rtOpts) ++ } ++ + code, method := checkLabels(counter) + + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + resp, err := next.RoundTrip(r) + if err == nil { +- counter.With(labels(code, method, r.Method, resp.StatusCode)).Inc() ++ counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Inc() + } + return resp, err + }) +@@ -73,7 +81,10 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou + // http.RoundTripper to observe the request duration with the provided + // ObserverVec. The ObserverVec must have zero, one, or two non-const + // non-curried labels. For those, the only allowed label names are "code" and +-// "method". The function panics otherwise. The Observe method of the Observer ++// "method". The function panics otherwise. For the "method" label a predefined ++// default label value set is used to filter given values. Values besides ++// predefined values will count as `unknown` method. `WithExtraMethods` ++// can be used to add more methods to the set. The Observe method of the Observer + // in the ObserverVec is called with the request duration in + // seconds. Partitioning happens by HTTP status code and/or HTTP method if the + // respective instance label names are present in the ObserverVec. For +@@ -85,14 +96,19 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou + // + // Note that this method is only guaranteed to never observe negative durations + // if used with Go1.9+. +-func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundTripper) RoundTripperFunc { ++func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { ++ rtOpts := &option{} ++ for _, o := range opts { ++ o(rtOpts) ++ } ++ + code, method := checkLabels(obs) + + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + start := time.Now() + resp, err := next.RoundTrip(r) + if err == nil { +- obs.With(labels(code, method, r.Method, resp.StatusCode)).Observe(time.Since(start).Seconds()) ++ obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Observe(time.Since(start).Seconds()) + } + return resp, err + }) +diff --git a/prometheus/promhttp/instrument_server.go b/prometheus/promhttp/instrument_server.go +index ab037db..a23f0ed 100644 +--- a/prometheus/promhttp/instrument_server.go ++++ b/prometheus/promhttp/instrument_server.go +@@ -45,7 +45,10 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl + // http.Handler to observe the request duration with the provided ObserverVec. + // The ObserverVec must have valid metric and label names and must have zero, + // one, or two non-const non-curried labels. For those, the only allowed label +-// names are "code" and "method". The function panics otherwise. The Observe ++// names are "code" and "method". The function panics otherwise. For the "method" ++// label a predefined default label value set is used to filter given values. ++// Values besides predefined values will count as `unknown` method. ++//`WithExtraMethods` can be used to add more methods to the set. The Observe + // method of the Observer in the ObserverVec is called with the request duration + // in seconds. Partitioning happens by HTTP status code and/or HTTP method if + // the respective instance label names are present in the ObserverVec. For +@@ -58,7 +61,12 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl + // + // Note that this method is only guaranteed to never observe negative durations + // if used with Go1.9+. +-func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler) http.HandlerFunc { ++func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { ++ mwOpts := &option{} ++ for _, o := range opts { ++ o(mwOpts) ++ } ++ + code, method := checkLabels(obs) + + if code { +@@ -67,14 +75,14 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler) ht + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + +- obs.With(labels(code, method, r.Method, d.Status())).Observe(time.Since(now).Seconds()) ++ obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + next.ServeHTTP(w, r) +- obs.With(labels(code, method, r.Method, 0)).Observe(time.Since(now).Seconds()) ++ obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + }) + } + +@@ -82,7 +90,10 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler) ht + // to observe the request result with the provided CounterVec. The CounterVec + // must have valid metric and label names and must have zero, one, or two + // non-const non-curried labels. For those, the only allowed label names are +-// "code" and "method". The function panics otherwise. Partitioning of the ++// "code" and "method". The function panics otherwise. For the "method" ++// label a predefined default label value set is used to filter given values. ++// Values besides predefined values will count as `unknown` method. ++// `WithExtraMethods` can be used to add more methods to the set. Partitioning of the + // CounterVec happens by HTTP status code and/or HTTP method if the respective + // instance label names are present in the CounterVec. For unpartitioned + // counting, use a CounterVec with zero labels. +@@ -92,20 +103,25 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler) ht + // If the wrapped Handler panics, the Counter is not incremented. + // + // See the example for InstrumentHandlerDuration for example usage. +-func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler) http.HandlerFunc { ++func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, opts ...Option) http.HandlerFunc { ++ mwOpts := &option{} ++ for _, o := range opts { ++ o(mwOpts) ++ } ++ + code, method := checkLabels(counter) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) +- counter.With(labels(code, method, r.Method, d.Status())).Inc() ++ counter.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Inc() + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) +- counter.With(labels(code, method, r.Method, 0)).Inc() ++ counter.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Inc() + }) + } + +@@ -114,7 +130,10 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler) + // until the response headers are written. The ObserverVec must have valid + // metric and label names and must have zero, one, or two non-const non-curried + // labels. For those, the only allowed label names are "code" and "method". The +-// function panics otherwise. The Observe method of the Observer in the ++// function panics otherwise. For the "method" label a predefined default label ++// value set is used to filter given values. Values besides predefined values ++// will count as `unknown` method.`WithExtraMethods` can be used to add more ++// methods to the set. The Observe method of the Observer in the + // ObserverVec is called with the request duration in seconds. Partitioning + // happens by HTTP status code and/or HTTP method if the respective instance + // label names are present in the ObserverVec. For unpartitioned observations, +@@ -128,13 +147,18 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler) + // if used with Go1.9+. + // + // See the example for InstrumentHandlerDuration for example usage. +-func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Handler) http.HandlerFunc { ++func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { ++ mwOpts := &option{} ++ for _, o := range opts { ++ o(mwOpts) ++ } ++ + code, method := checkLabels(obs) + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + d := newDelegator(w, func(status int) { +- obs.With(labels(code, method, r.Method, status)).Observe(time.Since(now).Seconds()) ++ obs.With(labels(code, method, r.Method, status, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + }) + next.ServeHTTP(d, r) + }) +@@ -144,8 +168,11 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha + // http.Handler to observe the request size with the provided ObserverVec. The + // ObserverVec must have valid metric and label names and must have zero, one, + // or two non-const non-curried labels. For those, the only allowed label names +-// are "code" and "method". The function panics otherwise. The Observe method of +-// the Observer in the ObserverVec is called with the request size in ++// are "code" and "method". The function panics otherwise. For the "method" ++// label a predefined default label value set is used to filter given values. ++// Values besides predefined values will count as `unknown` method. ++// `WithExtraMethods` can be used to add more methods to the set. The Observe ++// method of the Observer in the ObserverVec is called with the request size in + // bytes. Partitioning happens by HTTP status code and/or HTTP method if the + // respective instance label names are present in the ObserverVec. For + // unpartitioned observations, use an ObserverVec with zero labels. Note that +@@ -156,7 +183,12 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha + // If the wrapped Handler panics, no values are reported. + // + // See the example for InstrumentHandlerDuration for example usage. +-func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler) http.HandlerFunc { ++func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { ++ mwOpts := &option{} ++ for _, o := range opts { ++ o(mwOpts) ++ } ++ + code, method := checkLabels(obs) + + if code { +@@ -164,14 +196,14 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler) + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + size := computeApproximateRequestSize(r) +- obs.With(labels(code, method, r.Method, d.Status())).Observe(float64(size)) ++ obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(size)) + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) + size := computeApproximateRequestSize(r) +- obs.With(labels(code, method, r.Method, 0)).Observe(float64(size)) ++ obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(float64(size)) + }) + } + +@@ -179,8 +211,11 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler) + // http.Handler to observe the response size with the provided ObserverVec. The + // ObserverVec must have valid metric and label names and must have zero, one, + // or two non-const non-curried labels. For those, the only allowed label names +-// are "code" and "method". The function panics otherwise. The Observe method of +-// the Observer in the ObserverVec is called with the response size in ++// are "code" and "method". The function panics otherwise. For the "method" ++// label a predefined default label value set is used to filter given values. ++// Values besides predefined values will count as `unknown` method. ++// `WithExtraMethods` can be used to add more methods to the set. The Observe ++// method of the Observer in the ObserverVec is called with the response size in + // bytes. Partitioning happens by HTTP status code and/or HTTP method if the + // respective instance label names are present in the ObserverVec. For + // unpartitioned observations, use an ObserverVec with zero labels. Note that +@@ -191,12 +226,18 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler) + // If the wrapped Handler panics, no values are reported. + // + // See the example for InstrumentHandlerDuration for example usage. +-func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler) http.Handler { ++func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.Handler { ++ mwOpts := &option{} ++ for _, o := range opts { ++ o(mwOpts) ++ } ++ + code, method := checkLabels(obs) ++ + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) +- obs.With(labels(code, method, r.Method, d.Status())).Observe(float64(d.Written())) ++ obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(d.Written())) + }) + } + +@@ -290,7 +331,7 @@ func isLabelCurried(c prometheus.Collector, label string) bool { + // unnecessary allocations on each request. + var emptyLabels = prometheus.Labels{} + +-func labels(code, method bool, reqMethod string, status int) prometheus.Labels { ++func labels(code, method bool, reqMethod string, status int, extraMethods ...string) prometheus.Labels { + if !(code || method) { + return emptyLabels + } +@@ -300,7 +341,7 @@ func labels(code, method bool, reqMethod string, status int) prometheus.Labels { + labels["code"] = sanitizeCode(status) + } + if method { +- labels["method"] = sanitizeMethod(reqMethod) ++ labels["method"] = sanitizeMethod(reqMethod, extraMethods...) + } + + return labels +@@ -330,7 +371,12 @@ func computeApproximateRequestSize(r *http.Request) int { + return s + } + +-func sanitizeMethod(m string) string { ++// If the wrapped http.Handler has a known method, it will be sanitized and returned. ++// Otherwise, "unknown" will be returned. The known method list can be extended ++// as needed by using extraMethods parameter. ++func sanitizeMethod(m string, extraMethods ...string) string { ++ // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for ++ // the methods chosen as default. + switch m { + case "GET", "get": + return "get" +@@ -348,15 +394,25 @@ func sanitizeMethod(m string) string { + return "options" + case "NOTIFY", "notify": + return "notify" ++ case "TRACE", "trace": ++ return "trace" ++ case "PATCH", "patch": ++ return "patch" + default: +- return strings.ToLower(m) ++ for _, method := range extraMethods { ++ if strings.EqualFold(m, method) { ++ return strings.ToLower(m) ++ } ++ } ++ return "unknown" + } + } + + // If the wrapped http.Handler has not set a status code, i.e. the value is +-// currently 0, santizeCode will return 200, for consistency with behavior in ++// currently 0, sanitizeCode will return 200, for consistency with behavior in + // the stdlib. + func sanitizeCode(s int) string { ++ // See for accepted codes https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + switch s { + case 100: + return "100" +@@ -453,6 +509,9 @@ func sanitizeCode(s int) string { + return "511" + + default: +- return strconv.Itoa(s) ++ if s >= 100 && s <= 599 { ++ return strconv.Itoa(s) ++ } ++ return "unknown" + } + } +diff --git a/prometheus/promhttp/instrument_server_test.go b/prometheus/promhttp/instrument_server_test.go +index 545ae4c..5db50fb 100644 +--- a/prometheus/promhttp/instrument_server_test.go ++++ b/prometheus/promhttp/instrument_server_test.go +@@ -204,6 +204,122 @@ func TestLabelCheck(t *testing.T) { + } + } + ++func TestLabels(t *testing.T) { ++ scenarios := map[string]struct { ++ varLabels []string ++ reqMethod string ++ respStatus int ++ extraMethods []string ++ wantLabels prometheus.Labels ++ ok bool ++ }{ ++ "empty": { ++ varLabels: []string{}, ++ wantLabels: emptyLabels, ++ reqMethod: "GET", ++ respStatus: 200, ++ ok: true, ++ }, ++ "code as single var label": { ++ varLabels: []string{"code"}, ++ reqMethod: "GET", ++ respStatus: 200, ++ wantLabels: prometheus.Labels{"code": "200"}, ++ ok: true, ++ }, ++ "code as single var label and out-of-range code": { ++ varLabels: []string{"code"}, ++ reqMethod: "GET", ++ respStatus: 99, ++ wantLabels: prometheus.Labels{"code": "unknown"}, ++ ok: true, ++ }, ++ "code as single var label and in-range but unrecognized code": { ++ varLabels: []string{"code"}, ++ reqMethod: "GET", ++ respStatus: 308, ++ wantLabels: prometheus.Labels{"code": "308"}, ++ ok: true, ++ }, ++ "method as single var label": { ++ varLabels: []string{"method"}, ++ reqMethod: "GET", ++ respStatus: 200, ++ wantLabels: prometheus.Labels{"method": "get"}, ++ ok: true, ++ }, ++ "method as single var label and unknown method": { ++ varLabels: []string{"method"}, ++ reqMethod: "CUSTOM_METHOD", ++ respStatus: 200, ++ wantLabels: prometheus.Labels{"method": "unknown"}, ++ ok: true, ++ }, ++ "code and method as var labels": { ++ varLabels: []string{"method", "code"}, ++ reqMethod: "GET", ++ respStatus: 200, ++ wantLabels: prometheus.Labels{"method": "get", "code": "200"}, ++ ok: true, ++ }, ++ "method as single var label with extra methods specified": { ++ varLabels: []string{"method"}, ++ reqMethod: "CUSTOM_METHOD", ++ respStatus: 200, ++ extraMethods: []string{"CUSTOM_METHOD", "CUSTOM_METHOD_1"}, ++ wantLabels: prometheus.Labels{"method": "custom_method"}, ++ ok: true, ++ }, ++ "all labels used with an unknown method and out-of-range code": { ++ varLabels: []string{"code", "method"}, ++ reqMethod: "CUSTOM_METHOD", ++ respStatus: 99, ++ wantLabels: prometheus.Labels{"method": "unknown", "code": "unknown"}, ++ ok: false, ++ }, ++ } ++ checkLabels := func(labels []string) (gotCode bool, gotMethod bool) { ++ for _, label := range labels { ++ switch label { ++ case "code": ++ gotCode = true ++ case "method": ++ gotMethod = true ++ default: ++ panic("metric partitioned with non-supported labels for this test") ++ } ++ } ++ return ++ } ++ equalLabels := func(gotLabels, wantLabels prometheus.Labels) bool { ++ if len(gotLabels) != len(wantLabels) { ++ return false ++ } ++ for ln, lv := range gotLabels { ++ olv, ok := wantLabels[ln] ++ if !ok { ++ return false ++ } ++ if olv != lv { ++ return false ++ } ++ } ++ return true ++ } ++ ++ for name, sc := range scenarios { ++ t.Run(name, func(t *testing.T) { ++ if sc.ok { ++ gotCode, gotMethod := checkLabels(sc.varLabels) ++ gotLabels := labels(gotCode, gotMethod, sc.reqMethod, sc.respStatus, sc.extraMethods...) ++ if !equalLabels(gotLabels, sc.wantLabels) { ++ t.Errorf("wanted labels=%v for counter, got code=%v", sc.wantLabels, gotLabels) ++ } ++ } ++ }) ++ } ++} ++ + func TestMiddlewareAPI(t *testing.T) { + reg := prometheus.NewRegistry() + +diff --git a/prometheus/promhttp/option.go b/prometheus/promhttp/option.go +new file mode 100644 +index 0000000..35e41bd +--- /dev/null ++++ b/prometheus/promhttp/option.go +@@ -0,0 +1,31 @@ ++// Copyright 2022 The Prometheus Authors ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++package promhttp ++ ++// Option are used to configure a middleware or round tripper.. ++type Option func(*option) ++ ++type option struct { ++ extraMethods []string ++} ++ ++// WithExtraMethods adds additional HTTP methods to the list of allowed methods. ++// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for the default list. ++// ++// See the example for ExampleInstrumentHandlerWithExtraMethods for example usage. ++func WithExtraMethods(methods ...string) Option { ++ return func(o *option) { ++ o.extraMethods = methods ++ } ++} +diff --git a/prometheus/promhttp/option_test.go b/prometheus/promhttp/option_test.go +new file mode 100644 +index 0000000..301fd06 +--- /dev/null ++++ b/prometheus/promhttp/option_test.go +@@ -0,0 +1,65 @@ ++// Copyright 2022 The Prometheus Authors ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++package promhttp ++ ++import ( ++ "log" ++ "net/http" ++ ++ "github.com/prometheus/client_golang/prometheus" ++) ++ ++func ExampleInstrumentHandlerWithExtraMethods() { ++ counter := prometheus.NewCounterVec( ++ prometheus.CounterOpts{ ++ Name: "api_requests_total", ++ Help: "A counter for requests to the wrapped handler.", ++ }, ++ []string{"code", "method"}, ++ ) ++ ++ // duration is partitioned by the HTTP method and handler. It uses custom ++ // buckets based on the expected request duration. ++ duration := prometheus.NewHistogramVec( ++ prometheus.HistogramOpts{ ++ Name: "request_duration_seconds", ++ Help: "A histogram of latencies for requests.", ++ Buckets: []float64{.25, .5, 1, 2.5, 5, 10}, ++ }, ++ []string{"handler", "method"}, ++ ) ++ ++ // Create the handlers that will be wrapped by the middleware. ++ pullHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ++ w.Write([]byte("Pull")) ++ }) ++ ++ // Specify additional HTTP methods to be added to the label allow list. ++ opts := WithExtraMethods("CUSTOM_METHOD") ++ ++ // Instrument the handlers with all the metrics, injecting the "handler" ++ // label by currying. ++ pullChain := ++ InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "pull"}), ++ InstrumentHandlerCounter(counter, pullHandler, opts), ++ opts, ++ ) ++ ++ http.Handle("/metrics", Handler()) ++ http.Handle("/pull", pullChain) ++ ++ if err := http.ListenAndServe(":3000", nil); err != nil { ++ log.Fatal(err) ++ } ++} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..1b008a77188a091c60788b622436cb77eca4dd9f --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/post_context.md @@ -0,0 +1,1418 @@ +# Patch-overlapping Go context after the fix + +## `prometheus/promhttp/instrument_client.go` (changed lines (52, 53, 54, 55, 63, 64, 65, 66, 67, 68, 74, 84, 85, 86, 87, 99, 100, 101, 102, 103, 104, 111)) + +```go +// Copyright 2017 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "crypto/tls" + "net/http" + "net/http/httptrace" + "time" + + "github.com/prometheus/client_golang/prometheus" +) + +// The RoundTripperFunc type is an adapter to allow the use of ordinary +// functions as RoundTrippers. If f is a function with the appropriate +// signature, RountTripperFunc(f) is a RoundTripper that calls f. +type RoundTripperFunc func(req *http.Request) (*http.Response, error) + +// RoundTrip implements the RoundTripper interface. +func (rt RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { + return rt(r) +} + +// InstrumentRoundTripperInFlight is a middleware that wraps the provided +// http.RoundTripper. It sets the provided prometheus.Gauge to the number of +// requests currently handled by the wrapped http.RoundTripper. +// +// See the example for ExampleInstrumentRoundTripperDuration for example usage. +func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripper) RoundTripperFunc { + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + gauge.Inc() + defer gauge.Dec() + return next.RoundTrip(r) + }) +} + +// InstrumentRoundTripperCounter is a middleware that wraps the provided +// http.RoundTripper to observe the request result with the provided CounterVec. +// The CounterVec must have zero, one, or two non-const non-curried labels. For +// those, the only allowed label names are "code" and "method". The function +// panics otherwise. For the "method" label a predefined default label value set +// is used to filter given values. Values besides predefined values will count +// as `unknown` method.`WithExtraMethods` can be used to add more +// methods to the set. Partitioning of the CounterVec happens by HTTP status code +// and/or HTTP method if the respective instance label names are present in the +// CounterVec. For unpartitioned counting, use a CounterVec with zero labels. +// +// If the wrapped RoundTripper panics or returns a non-nil error, the Counter +// is not incremented. +// +// See the example for ExampleInstrumentRoundTripperDuration for example usage. +func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { + rtOpts := &option{} + for _, o := range opts { + o(rtOpts) + } + + code, method := checkLabels(counter) + + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + resp, err := next.RoundTrip(r) + if err == nil { + counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Inc() + } + return resp, err + }) +} + +// InstrumentRoundTripperDuration is a middleware that wraps the provided +// http.RoundTripper to observe the request duration with the provided +// ObserverVec. The ObserverVec must have zero, one, or two non-const +// non-curried labels. For those, the only allowed label names are "code" and +// "method". The function panics otherwise. For the "method" label a predefined +// default label value set is used to filter given values. Values besides +// predefined values will count as `unknown` method. `WithExtraMethods` +// can be used to add more methods to the set. The Observe method of the Observer +// in the ObserverVec is called with the request duration in +// seconds. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped RoundTripper panics or returns a non-nil error, no values are +// reported. +// +// Note that this method is only guaranteed to never observe negative durations +// if used with Go1.9+. +func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { + rtOpts := &option{} + for _, o := range opts { + o(rtOpts) + } + + code, method := checkLabels(obs) + + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + start := time.Now() + resp, err := next.RoundTrip(r) + if err == nil { + obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Observe(time.Since(start).Seconds()) + } + return resp, err + }) +} + +// InstrumentTrace is used to offer flexibility in instrumenting the available +// httptrace.ClientTrace hook functions. Each function is passed a float64 +// representing the time in seconds since the start of the http request. A user +// may choose to use separately buckets Histograms, or implement custom +// instance labels on a per function basis. +type InstrumentTrace struct { + GotConn func(float64) + PutIdleConn func(float64) + GotFirstResponseByte func(float64) + Got100Continue func(float64) + DNSStart func(float64) + DNSDone func(float64) + ConnectStart func(float64) + ConnectDone func(float64) + TLSHandshakeStart func(float64) + TLSHandshakeDone func(float64) + WroteHeaders func(float64) + Wait100Continue func(float64) + WroteRequest func(float64) +} + +// InstrumentRoundTripperTrace is a middleware that wraps the provided +// RoundTripper and reports times to hook functions provided in the +// InstrumentTrace struct. Hook functions that are not present in the provided +// InstrumentTrace struct are ignored. Times reported to the hook functions are +// time since the start of the request. Only with Go1.9+, those times are +// guaranteed to never be negative. (Earlier Go versions are not using a +// monotonic clock.) Note that partitioning of Histograms is expensive and +// should be used judiciously. +// +// For hook functions that receive an error as an argument, no observations are +// made in the event of a non-nil error value. +// +// See the example for ExampleInstrumentRoundTripperDuration for example usage. +func InstrumentRoundTripperTrace(it *InstrumentTrace, next http.RoundTripper) RoundTripperFunc { + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + start := time.Now() + + trace := &httptrace.ClientTrace{ + GotConn: func(_ httptrace.GotConnInfo) { + if it.GotConn != nil { + it.GotConn(time.Since(start).Seconds()) + } + }, + PutIdleConn: func(err error) { + if err != nil { + return + } + if it.PutIdleConn != nil { + it.PutIdleConn(time.Since(start).Seconds()) + } + }, + DNSStart: func(_ httptrace.DNSStartInfo) { + if it.DNSStart != nil { + it.DNSStart(time.Since(start).Seconds()) + } + }, + DNSDone: func(_ httptrace.DNSDoneInfo) { + if it.DNSDone != nil { + it.DNSDone(time.Since(start).Seconds()) + } + }, + ConnectStart: func(_, _ string) { + if it.ConnectStart != nil { + it.ConnectStart(time.Since(start).Seconds()) + } + }, + ConnectDone: func(_, _ string, err error) { + if err != nil { + return + } + if it.ConnectDone != nil { + it.ConnectDone(time.Since(start).Seconds()) + } + }, + GotFirstResponseByte: func() { + if it.GotFirstResponseByte != nil { + it.GotFirstResponseByte(time.Since(start).Seconds()) + } + }, + Got100Continue: func() { + if it.Got100Continue != nil { + it.Got100Continue(time.Since(start).Seconds()) + } + }, + TLSHandshakeStart: func() { + if it.TLSHandshakeStart != nil { + it.TLSHandshakeStart(time.Since(start).Seconds()) + } + }, + TLSHandshakeDone: func(_ tls.ConnectionState, err error) { + if err != nil { + return + } + if it.TLSHandshakeDone != nil { + it.TLSHandshakeDone(time.Since(start).Seconds()) + } + }, + WroteHeaders: func() { + if it.WroteHeaders != nil { + it.WroteHeaders(time.Since(start).Seconds()) + } + }, + Wait100Continue: func() { + if it.Wait100Continue != nil { + it.Wait100Continue(time.Since(start).Seconds()) + } + }, + WroteRequest: func(_ httptrace.WroteRequestInfo) { + if it.WroteRequest != nil { + it.WroteRequest(time.Since(start).Seconds()) + } + }, + } + r = r.WithContext(httptrace.WithClientTrace(r.Context(), trace)) + + return next.RoundTrip(r) + }) +} +``` + +## `prometheus/promhttp/instrument_server.go` (changed lines (48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 78, 85, 93, 94, 95, 96, 106, 107, 108, 109, 110, 111, 118, 124, 133, 134, 135, 136, 150, 151, 152, 153, 154, 155, 161, 171, 172, 173, 174, 175, 186, 187, 188, 189, 190, 191, 199, 206, 214, 215, 216, 217, 218, 229, 230, 231, 232, 233, 234, 236, 240, 334, 344, 374, 375, 376, 377, 378, 379, 397, 398, 399, 400, 402, 403, 404, 405, 406, 407, 412, 415, 512, 513, 514, 515)) + +```go +// Copyright 2017 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "errors" + "net/http" + "strconv" + "strings" + "time" + + dto "github.com/prometheus/client_model/go" + + "github.com/prometheus/client_golang/prometheus" +) + +// magicString is used for the hacky label test in checkLabels. Remove once fixed. +const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufDa" + +// InstrumentHandlerInFlight is a middleware that wraps the provided +// http.Handler. It sets the provided prometheus.Gauge to the number of +// requests currently handled by the wrapped http.Handler. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + g.Inc() + defer g.Dec() + next.ServeHTTP(w, r) + }) +} + +// InstrumentHandlerDuration is a middleware that wraps the provided +// http.Handler to observe the request duration with the provided ObserverVec. +// The ObserverVec must have valid metric and label names and must have zero, +// one, or two non-const non-curried labels. For those, the only allowed label +// names are "code" and "method". The function panics otherwise. For the "method" +// label a predefined default label value set is used to filter given values. +// Values besides predefined values will count as `unknown` method. +//`WithExtraMethods` can be used to add more methods to the set. The Observe +// method of the Observer in the ObserverVec is called with the request duration +// in seconds. Partitioning happens by HTTP status code and/or HTTP method if +// the respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, no values are reported. +// +// Note that this method is only guaranteed to never observe negative durations +// if used with Go1.9+. +func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { + mwOpts := &option{} + for _, o := range opts { + o(mwOpts) + } + + code, method := checkLabels(obs) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + + obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + next.ServeHTTP(w, r) + obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + }) +} + +// InstrumentHandlerCounter is a middleware that wraps the provided http.Handler +// to observe the request result with the provided CounterVec. The CounterVec +// must have valid metric and label names and must have zero, one, or two +// non-const non-curried labels. For those, the only allowed label names are +// "code" and "method". The function panics otherwise. For the "method" +// label a predefined default label value set is used to filter given values. +// Values besides predefined values will count as `unknown` method. +// `WithExtraMethods` can be used to add more methods to the set. Partitioning of the +// CounterVec happens by HTTP status code and/or HTTP method if the respective +// instance label names are present in the CounterVec. For unpartitioned +// counting, use a CounterVec with zero labels. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, the Counter is not incremented. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, opts ...Option) http.HandlerFunc { + mwOpts := &option{} + for _, o := range opts { + o(mwOpts) + } + + code, method := checkLabels(counter) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + counter.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Inc() + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) + counter.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Inc() + }) +} + +// InstrumentHandlerTimeToWriteHeader is a middleware that wraps the provided +// http.Handler to observe with the provided ObserverVec the request duration +// until the response headers are written. The ObserverVec must have valid +// metric and label names and must have zero, one, or two non-const non-curried +// labels. For those, the only allowed label names are "code" and "method". The +// function panics otherwise. For the "method" label a predefined default label +// value set is used to filter given values. Values besides predefined values +// will count as `unknown` method.`WithExtraMethods` can be used to add more +// methods to the set. The Observe method of the Observer in the +// ObserverVec is called with the request duration in seconds. Partitioning +// happens by HTTP status code and/or HTTP method if the respective instance +// label names are present in the ObserverVec. For unpartitioned observations, +// use an ObserverVec with zero labels. Note that partitioning of Histograms is +// expensive and should be used judiciously. +// +// If the wrapped Handler panics before calling WriteHeader, no value is +// reported. +// +// Note that this method is only guaranteed to never observe negative durations +// if used with Go1.9+. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { + mwOpts := &option{} + for _, o := range opts { + o(mwOpts) + } + + code, method := checkLabels(obs) + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + d := newDelegator(w, func(status int) { + obs.With(labels(code, method, r.Method, status, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + }) + next.ServeHTTP(d, r) + }) +} + +// InstrumentHandlerRequestSize is a middleware that wraps the provided +// http.Handler to observe the request size with the provided ObserverVec. The +// ObserverVec must have valid metric and label names and must have zero, one, +// or two non-const non-curried labels. For those, the only allowed label names +// are "code" and "method". The function panics otherwise. For the "method" +// label a predefined default label value set is used to filter given values. +// Values besides predefined values will count as `unknown` method. +// `WithExtraMethods` can be used to add more methods to the set. The Observe +// method of the Observer in the ObserverVec is called with the request size in +// bytes. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, no values are reported. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { + mwOpts := &option{} + for _, o := range opts { + o(mwOpts) + } + + code, method := checkLabels(obs) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + size := computeApproximateRequestSize(r) + obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(size)) + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) + size := computeApproximateRequestSize(r) + obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(float64(size)) + }) +} + +// InstrumentHandlerResponseSize is a middleware that wraps the provided +// http.Handler to observe the response size with the provided ObserverVec. The +// ObserverVec must have valid metric and label names and must have zero, one, +// or two non-const non-curried labels. For those, the only allowed label names +// are "code" and "method". The function panics otherwise. For the "method" +// label a predefined default label value set is used to filter given values. +// Values besides predefined values will count as `unknown` method. +// `WithExtraMethods` can be used to add more methods to the set. The Observe +// method of the Observer in the ObserverVec is called with the response size in +// bytes. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, no values are reported. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.Handler { + mwOpts := &option{} + for _, o := range opts { + o(mwOpts) + } + + code, method := checkLabels(obs) + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(d.Written())) + }) +} + +// checkLabels returns whether the provided Collector has a non-const, +// non-curried label named "code" and/or "method". It panics if the provided +// Collector does not have a Desc or has more than one Desc or its Desc is +// invalid. It also panics if the Collector has any non-const, non-curried +// labels that are not named "code" or "method". +func checkLabels(c prometheus.Collector) (code bool, method bool) { + // TODO(beorn7): Remove this hacky way to check for instance labels + // once Descriptors can have their dimensionality queried. + var ( + desc *prometheus.Desc + m prometheus.Metric + pm dto.Metric + lvs []string + ) + + // Get the Desc from the Collector. + descc := make(chan *prometheus.Desc, 1) + c.Describe(descc) + + select { + case desc = <-descc: + default: + panic("no description provided by collector") + } + select { + case <-descc: + panic("more than one description provided by collector") + default: + } + + close(descc) + + // Make sure the Collector has a valid Desc by registering it with a + // temporary registry. + prometheus.NewRegistry().MustRegister(c) + + // Create a ConstMetric with the Desc. Since we don't know how many + // variable labels there are, try for as long as it needs. + for err := errors.New("dummy"); err != nil; lvs = append(lvs, magicString) { + m, err = prometheus.NewConstMetric(desc, prometheus.UntypedValue, 0, lvs...) + } + + // Write out the metric into a proto message and look at the labels. + // If the value is not the magicString, it is a constLabel, which doesn't interest us. + // If the label is curried, it doesn't interest us. + // In all other cases, only "code" or "method" is allowed. + if err := m.Write(&pm); err != nil { + panic("error checking metric for labels") + } + for _, label := range pm.Label { + name, value := label.GetName(), label.GetValue() + if value != magicString || isLabelCurried(c, name) { + continue + } + switch name { + case "code": + code = true + case "method": + method = true + default: + panic("metric partitioned with non-supported labels") + } + } + return +} + +func isLabelCurried(c prometheus.Collector, label string) bool { + // This is even hackier than the label test above. + // We essentially try to curry again and see if it works. + // But for that, we need to type-convert to the two + // types we use here, ObserverVec or *CounterVec. + switch v := c.(type) { + case *prometheus.CounterVec: + if _, err := v.CurryWith(prometheus.Labels{label: "dummy"}); err == nil { + return false + } + case prometheus.ObserverVec: + if _, err := v.CurryWith(prometheus.Labels{label: "dummy"}); err == nil { + return false + } + default: + panic("unsupported metric vec type") + } + return true +} + +// emptyLabels is a one-time allocation for non-partitioned metrics to avoid +// unnecessary allocations on each request. +var emptyLabels = prometheus.Labels{} + +func labels(code, method bool, reqMethod string, status int, extraMethods ...string) prometheus.Labels { + if !(code || method) { + return emptyLabels + } + labels := prometheus.Labels{} + + if code { + labels["code"] = sanitizeCode(status) + } + if method { + labels["method"] = sanitizeMethod(reqMethod, extraMethods...) + } + + return labels +} + +func computeApproximateRequestSize(r *http.Request) int { + s := 0 + if r.URL != nil { + s += len(r.URL.String()) + } + + s += len(r.Method) + s += len(r.Proto) + for name, values := range r.Header { + s += len(name) + for _, value := range values { + s += len(value) + } + } + s += len(r.Host) + + // N.B. r.Form and r.MultipartForm are assumed to be included in r.URL. + + if r.ContentLength != -1 { + s += int(r.ContentLength) + } + return s +} + +// If the wrapped http.Handler has a known method, it will be sanitized and returned. +// Otherwise, "unknown" will be returned. The known method list can be extended +// as needed by using extraMethods parameter. +func sanitizeMethod(m string, extraMethods ...string) string { + // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for + // the methods chosen as default. + switch m { + case "GET", "get": + return "get" + case "PUT", "put": + return "put" + case "HEAD", "head": + return "head" + case "POST", "post": + return "post" + case "DELETE", "delete": + return "delete" + case "CONNECT", "connect": + return "connect" + case "OPTIONS", "options": + return "options" + case "NOTIFY", "notify": + return "notify" + case "TRACE", "trace": + return "trace" + case "PATCH", "patch": + return "patch" + default: + for _, method := range extraMethods { + if strings.EqualFold(m, method) { + return strings.ToLower(m) + } + } + return "unknown" + } +} + +// If the wrapped http.Handler has not set a status code, i.e. the value is +// currently 0, sanitizeCode will return 200, for consistency with behavior in +// the stdlib. +func sanitizeCode(s int) string { + // See for accepted codes https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + switch s { + case 100: + return "100" + case 101: + return "101" + + case 200, 0: + return "200" + case 201: + return "201" + case 202: + return "202" + case 203: + return "203" + case 204: + return "204" + case 205: + return "205" + case 206: + return "206" + + case 300: + return "300" + case 301: + return "301" + case 302: + return "302" + case 304: + return "304" + case 305: + return "305" + case 307: + return "307" + + case 400: + return "400" + case 401: + return "401" + case 402: + return "402" + case 403: + return "403" + case 404: + return "404" + case 405: + return "405" + case 406: + return "406" + case 407: + return "407" + case 408: + return "408" + case 409: + return "409" + case 410: + return "410" + case 411: + return "411" + case 412: + return "412" + case 413: + return "413" + case 414: + return "414" + case 415: + return "415" + case 416: + return "416" + case 417: + return "417" + case 418: + return "418" + + case 500: + return "500" + case 501: + return "501" + case 502: + return "502" + case 503: + return "503" + case 504: + return "504" + case 505: + return "505" + + case 428: + return "428" + case 429: + return "429" + case 431: + return "431" + case 511: + return "511" + + default: + if s >= 100 && s <= 599 { + return strconv.Itoa(s) + } + return "unknown" + } +} +``` + +## `prometheus/promhttp/instrument_server_test.go` (changed lines (207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322)) + +```go +// Copyright 2017 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "io" + "log" + "net/http" + "net/http/httptest" + "testing" + + "github.com/prometheus/client_golang/prometheus" +) + +func TestLabelCheck(t *testing.T) { + scenarios := map[string]struct { + metricName string // Defaults to "c". + varLabels []string + constLabels []string + curriedLabels []string + ok bool + }{ + "empty": { + varLabels: []string{}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "code as single var label": { + varLabels: []string{"code"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "method as single var label": { + varLabels: []string{"method"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "code and method as var labels": { + varLabels: []string{"method", "code"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "valid case with all labels used": { + varLabels: []string{"code", "method"}, + constLabels: []string{"foo", "bar"}, + curriedLabels: []string{"dings", "bums"}, + ok: true, + }, + "all labels used with an invalid const label name": { + varLabels: []string{"code", "method"}, + constLabels: []string{"in-valid", "bar"}, + curriedLabels: []string{"dings", "bums"}, + ok: false, + }, + "unsupported var label": { + varLabels: []string{"foo"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: false, + }, + "mixed var labels": { + varLabels: []string{"method", "foo", "code"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: false, + }, + "unsupported var label but curried": { + varLabels: []string{}, + constLabels: []string{}, + curriedLabels: []string{"foo"}, + ok: true, + }, + "mixed var labels but unsupported curried": { + varLabels: []string{"code", "method"}, + constLabels: []string{}, + curriedLabels: []string{"foo"}, + ok: true, + }, + "supported label as const and curry": { + varLabels: []string{}, + constLabels: []string{"code"}, + curriedLabels: []string{"method"}, + ok: true, + }, + "supported label as const and curry with unsupported as var": { + varLabels: []string{"foo"}, + constLabels: []string{"code"}, + curriedLabels: []string{"method"}, + ok: false, + }, + "invalid name and otherwise empty": { + metricName: "in-valid", + varLabels: []string{}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: false, + }, + "invalid name with all the otherwise valid labels": { + metricName: "in-valid", + varLabels: []string{"code", "method"}, + constLabels: []string{"foo", "bar"}, + curriedLabels: []string{"dings", "bums"}, + ok: false, + }, + } + + for name, sc := range scenarios { + t.Run(name, func(t *testing.T) { + metricName := sc.metricName + if metricName == "" { + metricName = "c" + } + constLabels := prometheus.Labels{} + for _, l := range sc.constLabels { + constLabels[l] = "dummy" + } + c := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: metricName, + Help: "c help", + ConstLabels: constLabels, + }, + append(sc.varLabels, sc.curriedLabels...), + ) + o := prometheus.ObserverVec(prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: metricName, + Help: "c help", + ConstLabels: constLabels, + }, + append(sc.varLabels, sc.curriedLabels...), + )) + for _, l := range sc.curriedLabels { + c = c.MustCurryWith(prometheus.Labels{l: "dummy"}) + o = o.MustCurryWith(prometheus.Labels{l: "dummy"}) + } + + func() { + defer func() { + if err := recover(); err != nil { + if sc.ok { + t.Error("unexpected panic:", err) + } + } else if !sc.ok { + t.Error("expected panic") + } + }() + InstrumentHandlerCounter(c, nil) + }() + func() { + defer func() { + if err := recover(); err != nil { + if sc.ok { + t.Error("unexpected panic:", err) + } + } else if !sc.ok { + t.Error("expected panic") + } + }() + InstrumentHandlerDuration(o, nil) + }() + if sc.ok { + // Test if wantCode and wantMethod were detected correctly. + var wantCode, wantMethod bool + for _, l := range sc.varLabels { + if l == "code" { + wantCode = true + } + if l == "method" { + wantMethod = true + } + } + gotCode, gotMethod := checkLabels(c) + if gotCode != wantCode { + t.Errorf("wanted code=%t for counter, got code=%t", wantCode, gotCode) + } + if gotMethod != wantMethod { + t.Errorf("wanted method=%t for counter, got method=%t", wantMethod, gotMethod) + } + gotCode, gotMethod = checkLabels(o) + if gotCode != wantCode { + t.Errorf("wanted code=%t for observer, got code=%t", wantCode, gotCode) + } + if gotMethod != wantMethod { + t.Errorf("wanted method=%t for observer, got method=%t", wantMethod, gotMethod) + } + } + }) + } +} + +func TestLabels(t *testing.T) { + scenarios := map[string]struct { + varLabels []string + reqMethod string + respStatus int + extraMethods []string + wantLabels prometheus.Labels + ok bool + }{ + "empty": { + varLabels: []string{}, + wantLabels: emptyLabels, + reqMethod: "GET", + respStatus: 200, + ok: true, + }, + "code as single var label": { + varLabels: []string{"code"}, + reqMethod: "GET", + respStatus: 200, + wantLabels: prometheus.Labels{"code": "200"}, + ok: true, + }, + "code as single var label and out-of-range code": { + varLabels: []string{"code"}, + reqMethod: "GET", + respStatus: 99, + wantLabels: prometheus.Labels{"code": "unknown"}, + ok: true, + }, + "code as single var label and in-range but unrecognized code": { + varLabels: []string{"code"}, + reqMethod: "GET", + respStatus: 308, + wantLabels: prometheus.Labels{"code": "308"}, + ok: true, + }, + "method as single var label": { + varLabels: []string{"method"}, + reqMethod: "GET", + respStatus: 200, + wantLabels: prometheus.Labels{"method": "get"}, + ok: true, + }, + "method as single var label and unknown method": { + varLabels: []string{"method"}, + reqMethod: "CUSTOM_METHOD", + respStatus: 200, + wantLabels: prometheus.Labels{"method": "unknown"}, + ok: true, + }, + "code and method as var labels": { + varLabels: []string{"method", "code"}, + reqMethod: "GET", + respStatus: 200, + wantLabels: prometheus.Labels{"method": "get", "code": "200"}, + ok: true, + }, + "method as single var label with extra methods specified": { + varLabels: []string{"method"}, + reqMethod: "CUSTOM_METHOD", + respStatus: 200, + extraMethods: []string{"CUSTOM_METHOD", "CUSTOM_METHOD_1"}, + wantLabels: prometheus.Labels{"method": "custom_method"}, + ok: true, + }, + "all labels used with an unknown method and out-of-range code": { + varLabels: []string{"code", "method"}, + reqMethod: "CUSTOM_METHOD", + respStatus: 99, + wantLabels: prometheus.Labels{"method": "unknown", "code": "unknown"}, + ok: false, + }, + } + checkLabels := func(labels []string) (gotCode bool, gotMethod bool) { + for _, label := range labels { + switch label { + case "code": + gotCode = true + case "method": + gotMethod = true + default: + panic("metric partitioned with non-supported labels for this test") + } + } + return + } + equalLabels := func(gotLabels, wantLabels prometheus.Labels) bool { + if len(gotLabels) != len(wantLabels) { + return false + } + for ln, lv := range gotLabels { + olv, ok := wantLabels[ln] + if !ok { + return false + } + if olv != lv { + return false + } + } + return true + } + + for name, sc := range scenarios { + t.Run(name, func(t *testing.T) { + if sc.ok { + gotCode, gotMethod := checkLabels(sc.varLabels) + gotLabels := labels(gotCode, gotMethod, sc.reqMethod, sc.respStatus, sc.extraMethods...) + if !equalLabels(gotLabels, sc.wantLabels) { + t.Errorf("wanted labels=%v for counter, got code=%v", sc.wantLabels, gotLabels) + } + } + }) + } +} + +func TestMiddlewareAPI(t *testing.T) { + reg := prometheus.NewRegistry() + + inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{ + Name: "in_flight_requests", + Help: "A gauge of requests currently being served by the wrapped handler.", + }) + + counter := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "api_requests_total", + Help: "A counter for requests to the wrapped handler.", + }, + []string{"code", "method"}, + ) + + histVec := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "response_duration_seconds", + Help: "A histogram of request latencies.", + Buckets: prometheus.DefBuckets, + ConstLabels: prometheus.Labels{"handler": "api"}, + }, + []string{"method"}, + ) + + writeHeaderVec := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "write_header_duration_seconds", + Help: "A histogram of time to first write latencies.", + Buckets: prometheus.DefBuckets, + ConstLabels: prometheus.Labels{"handler": "api"}, + }, + []string{}, + ) + + responseSize := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "push_request_size_bytes", + Help: "A histogram of request sizes for requests.", + Buckets: []float64{200, 500, 900, 1500}, + }, + []string{}, + ) + + handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("OK")) + }) + + reg.MustRegister(inFlightGauge, counter, histVec, responseSize, writeHeaderVec) + + chain := InstrumentHandlerInFlight(inFlightGauge, + InstrumentHandlerCounter(counter, + InstrumentHandlerDuration(histVec, + InstrumentHandlerTimeToWriteHeader(writeHeaderVec, + InstrumentHandlerResponseSize(responseSize, handler), + ), + ), + ), + ) + + r, _ := http.NewRequest("GET", "www.example.com", nil) + w := httptest.NewRecorder() + chain.ServeHTTP(w, r) +} + +func TestInstrumentTimeToFirstWrite(t *testing.T) { + var i int + dobs := &responseWriterDelegator{ + ResponseWriter: httptest.NewRecorder(), + observeWriteHeader: func(status int) { + i = status + }, + } + d := newDelegator(dobs, nil) + + d.WriteHeader(http.StatusOK) + + if i != http.StatusOK { + t.Fatalf("failed to execute observeWriteHeader") + } +} + +// testResponseWriter is an http.ResponseWriter that also implements +// http.CloseNotifier, http.Flusher, and io.ReaderFrom. +type testResponseWriter struct { + closeNotifyCalled, flushCalled, readFromCalled bool +} + +func (t *testResponseWriter) Header() http.Header { return nil } +func (t *testResponseWriter) Write([]byte) (int, error) { return 0, nil } +func (t *testResponseWriter) WriteHeader(int) {} +func (t *testResponseWriter) CloseNotify() <-chan bool { + t.closeNotifyCalled = true + return nil +} +func (t *testResponseWriter) Flush() { t.flushCalled = true } +func (t *testResponseWriter) ReadFrom(io.Reader) (int64, error) { + t.readFromCalled = true + return 0, nil +} + +// testFlusher is an http.ResponseWriter that also implements http.Flusher. +type testFlusher struct { + flushCalled bool +} + +func (t *testFlusher) Header() http.Header { return nil } +func (t *testFlusher) Write([]byte) (int, error) { return 0, nil } +func (t *testFlusher) WriteHeader(int) {} +func (t *testFlusher) Flush() { t.flushCalled = true } + +func TestInterfaceUpgrade(t *testing.T) { + w := &testResponseWriter{} + d := newDelegator(w, nil) + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. + d.(http.CloseNotifier).CloseNotify() + if !w.closeNotifyCalled { + t.Error("CloseNotify not called") + } + d.(http.Flusher).Flush() + if !w.flushCalled { + t.Error("Flush not called") + } + d.(io.ReaderFrom).ReadFrom(nil) + if !w.readFromCalled { + t.Error("ReadFrom not called") + } + if _, ok := d.(http.Hijacker); ok { + t.Error("delegator unexpectedly implements http.Hijacker") + } + + f := &testFlusher{} + d = newDelegator(f, nil) + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. + if _, ok := d.(http.CloseNotifier); ok { + t.Error("delegator unexpectedly implements http.CloseNotifier") + } + d.(http.Flusher).Flush() + if !w.flushCalled { + t.Error("Flush not called") + } + if _, ok := d.(io.ReaderFrom); ok { + t.Error("delegator unexpectedly implements io.ReaderFrom") + } + if _, ok := d.(http.Hijacker); ok { + t.Error("delegator unexpectedly implements http.Hijacker") + } +} + +func ExampleInstrumentHandlerDuration() { + inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{ + Name: "in_flight_requests", + Help: "A gauge of requests currently being served by the wrapped handler.", + }) + + counter := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "api_requests_total", + Help: "A counter for requests to the wrapped handler.", + }, + []string{"code", "method"}, + ) + + // duration is partitioned by the HTTP method and handler. It uses custom + // buckets based on the expected request duration. + duration := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "request_duration_seconds", + Help: "A histogram of latencies for requests.", + Buckets: []float64{.25, .5, 1, 2.5, 5, 10}, + }, + []string{"handler", "method"}, + ) + + // responseSize has no labels, making it a zero-dimensional + // ObserverVec. + responseSize := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "response_size_bytes", + Help: "A histogram of response sizes for requests.", + Buckets: []float64{200, 500, 900, 1500}, + }, + []string{}, + ) + + // Create the handlers that will be wrapped by the middleware. + pushHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Push")) + }) + pullHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Pull")) + }) + + // Register all of the metrics in the standard registry. + prometheus.MustRegister(inFlightGauge, counter, duration, responseSize) + + // Instrument the handlers with all the metrics, injecting the "handler" + // label by currying. + pushChain := InstrumentHandlerInFlight(inFlightGauge, + InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "push"}), + InstrumentHandlerCounter(counter, + InstrumentHandlerResponseSize(responseSize, pushHandler), + ), + ), + ) + pullChain := InstrumentHandlerInFlight(inFlightGauge, + InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "pull"}), + InstrumentHandlerCounter(counter, + InstrumentHandlerResponseSize(responseSize, pullHandler), + ), + ), + ) + + http.Handle("/metrics", Handler()) + http.Handle("/push", pushChain) + http.Handle("/pull", pullChain) + + if err := http.ListenAndServe(":3000", nil); err != nil { + log.Fatal(err) + } +} +``` + +## `prometheus/promhttp/option.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)) + +```go +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +// Option are used to configure a middleware or round tripper.. +type Option func(*option) + +type option struct { + extraMethods []string +} + +// WithExtraMethods adds additional HTTP methods to the list of allowed methods. +// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for the default list. +// +// See the example for ExampleInstrumentHandlerWithExtraMethods for example usage. +func WithExtraMethods(methods ...string) Option { + return func(o *option) { + o.extraMethods = methods + } +} +``` + +## `prometheus/promhttp/option_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65)) + +```go +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "log" + "net/http" + + "github.com/prometheus/client_golang/prometheus" +) + +func ExampleInstrumentHandlerWithExtraMethods() { + counter := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "api_requests_total", + Help: "A counter for requests to the wrapped handler.", + }, + []string{"code", "method"}, + ) + + // duration is partitioned by the HTTP method and handler. It uses custom + // buckets based on the expected request duration. + duration := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "request_duration_seconds", + Help: "A histogram of latencies for requests.", + Buckets: []float64{.25, .5, 1, 2.5, 5, 10}, + }, + []string{"handler", "method"}, + ) + + // Create the handlers that will be wrapped by the middleware. + pullHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Pull")) + }) + + // Specify additional HTTP methods to be added to the label allow list. + opts := WithExtraMethods("CUSTOM_METHOD") + + // Instrument the handlers with all the metrics, injecting the "handler" + // label by currying. + pullChain := + InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "pull"}), + InstrumentHandlerCounter(counter, pullHandler, opts), + opts, + ) + + http.Handle("/metrics", Handler()) + http.Handle("/pull", pullChain) + + if err := http.ListenAndServe(":3000", nil); err != nil { + log.Fatal(err) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..9eb5a4b300972fd93b76dd33a3a10d849dbdc021 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/pre_context.md @@ -0,0 +1,1121 @@ +# Patch-overlapping Go context before the fix + +## `prometheus/promhttp/instrument_client.go` (changed lines (52, 53, 60, 61, 66, 67, 76, 77, 88, 89, 95, 96)) + +```go +// Copyright 2017 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "crypto/tls" + "net/http" + "net/http/httptrace" + "time" + + "github.com/prometheus/client_golang/prometheus" +) + +// The RoundTripperFunc type is an adapter to allow the use of ordinary +// functions as RoundTrippers. If f is a function with the appropriate +// signature, RountTripperFunc(f) is a RoundTripper that calls f. +type RoundTripperFunc func(req *http.Request) (*http.Response, error) + +// RoundTrip implements the RoundTripper interface. +func (rt RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { + return rt(r) +} + +// InstrumentRoundTripperInFlight is a middleware that wraps the provided +// http.RoundTripper. It sets the provided prometheus.Gauge to the number of +// requests currently handled by the wrapped http.RoundTripper. +// +// See the example for ExampleInstrumentRoundTripperDuration for example usage. +func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripper) RoundTripperFunc { + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + gauge.Inc() + defer gauge.Dec() + return next.RoundTrip(r) + }) +} + +// InstrumentRoundTripperCounter is a middleware that wraps the provided +// http.RoundTripper to observe the request result with the provided CounterVec. +// The CounterVec must have zero, one, or two non-const non-curried labels. For +// those, the only allowed label names are "code" and "method". The function +// panics otherwise. Partitioning of the CounterVec happens by HTTP status code +// and/or HTTP method if the respective instance label names are present in the +// CounterVec. For unpartitioned counting, use a CounterVec with zero labels. +// +// If the wrapped RoundTripper panics or returns a non-nil error, the Counter +// is not incremented. +// +// See the example for ExampleInstrumentRoundTripperDuration for example usage. +func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.RoundTripper) RoundTripperFunc { + code, method := checkLabels(counter) + + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + resp, err := next.RoundTrip(r) + if err == nil { + counter.With(labels(code, method, r.Method, resp.StatusCode)).Inc() + } + return resp, err + }) +} + +// InstrumentRoundTripperDuration is a middleware that wraps the provided +// http.RoundTripper to observe the request duration with the provided +// ObserverVec. The ObserverVec must have zero, one, or two non-const +// non-curried labels. For those, the only allowed label names are "code" and +// "method". The function panics otherwise. The Observe method of the Observer +// in the ObserverVec is called with the request duration in +// seconds. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped RoundTripper panics or returns a non-nil error, no values are +// reported. +// +// Note that this method is only guaranteed to never observe negative durations +// if used with Go1.9+. +func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundTripper) RoundTripperFunc { + code, method := checkLabels(obs) + + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + start := time.Now() + resp, err := next.RoundTrip(r) + if err == nil { + obs.With(labels(code, method, r.Method, resp.StatusCode)).Observe(time.Since(start).Seconds()) + } + return resp, err + }) +} + +// InstrumentTrace is used to offer flexibility in instrumenting the available +// httptrace.ClientTrace hook functions. Each function is passed a float64 +// representing the time in seconds since the start of the http request. A user +// may choose to use separately buckets Histograms, or implement custom +// instance labels on a per function basis. +type InstrumentTrace struct { + GotConn func(float64) + PutIdleConn func(float64) + GotFirstResponseByte func(float64) + Got100Continue func(float64) + DNSStart func(float64) + DNSDone func(float64) + ConnectStart func(float64) + ConnectDone func(float64) + TLSHandshakeStart func(float64) + TLSHandshakeDone func(float64) + WroteHeaders func(float64) + Wait100Continue func(float64) + WroteRequest func(float64) +} + +// InstrumentRoundTripperTrace is a middleware that wraps the provided +// RoundTripper and reports times to hook functions provided in the +// InstrumentTrace struct. Hook functions that are not present in the provided +// InstrumentTrace struct are ignored. Times reported to the hook functions are +// time since the start of the request. Only with Go1.9+, those times are +// guaranteed to never be negative. (Earlier Go versions are not using a +// monotonic clock.) Note that partitioning of Histograms is expensive and +// should be used judiciously. +// +// For hook functions that receive an error as an argument, no observations are +// made in the event of a non-nil error value. +// +// See the example for ExampleInstrumentRoundTripperDuration for example usage. +func InstrumentRoundTripperTrace(it *InstrumentTrace, next http.RoundTripper) RoundTripperFunc { + return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + start := time.Now() + + trace := &httptrace.ClientTrace{ + GotConn: func(_ httptrace.GotConnInfo) { + if it.GotConn != nil { + it.GotConn(time.Since(start).Seconds()) + } + }, + PutIdleConn: func(err error) { + if err != nil { + return + } + if it.PutIdleConn != nil { + it.PutIdleConn(time.Since(start).Seconds()) + } + }, + DNSStart: func(_ httptrace.DNSStartInfo) { + if it.DNSStart != nil { + it.DNSStart(time.Since(start).Seconds()) + } + }, + DNSDone: func(_ httptrace.DNSDoneInfo) { + if it.DNSDone != nil { + it.DNSDone(time.Since(start).Seconds()) + } + }, + ConnectStart: func(_, _ string) { + if it.ConnectStart != nil { + it.ConnectStart(time.Since(start).Seconds()) + } + }, + ConnectDone: func(_, _ string, err error) { + if err != nil { + return + } + if it.ConnectDone != nil { + it.ConnectDone(time.Since(start).Seconds()) + } + }, + GotFirstResponseByte: func() { + if it.GotFirstResponseByte != nil { + it.GotFirstResponseByte(time.Since(start).Seconds()) + } + }, + Got100Continue: func() { + if it.Got100Continue != nil { + it.Got100Continue(time.Since(start).Seconds()) + } + }, + TLSHandshakeStart: func() { + if it.TLSHandshakeStart != nil { + it.TLSHandshakeStart(time.Since(start).Seconds()) + } + }, + TLSHandshakeDone: func(_ tls.ConnectionState, err error) { + if err != nil { + return + } + if it.TLSHandshakeDone != nil { + it.TLSHandshakeDone(time.Since(start).Seconds()) + } + }, + WroteHeaders: func() { + if it.WroteHeaders != nil { + it.WroteHeaders(time.Since(start).Seconds()) + } + }, + Wait100Continue: func() { + if it.Wait100Continue != nil { + it.Wait100Continue(time.Since(start).Seconds()) + } + }, + WroteRequest: func(_ httptrace.WroteRequestInfo) { + if it.WroteRequest != nil { + it.WroteRequest(time.Since(start).Seconds()) + } + }, + } + r = r.WithContext(httptrace.WithClientTrace(r.Context(), trace)) + + return next.RoundTrip(r) + }) +} +``` + +## `prometheus/promhttp/instrument_server.go` (changed lines (48, 49, 61, 62, 70, 71, 77, 78, 85, 86, 95, 96, 102, 103, 108, 109, 117, 118, 131, 132, 137, 138, 147, 148, 149, 159, 160, 167, 168, 174, 175, 182, 183, 184, 194, 195, 196, 199, 200, 293, 294, 303, 304, 333, 334, 351, 352, 353, 357, 358, 360, 456, 457)) + +```go +// Copyright 2017 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "errors" + "net/http" + "strconv" + "strings" + "time" + + dto "github.com/prometheus/client_model/go" + + "github.com/prometheus/client_golang/prometheus" +) + +// magicString is used for the hacky label test in checkLabels. Remove once fixed. +const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufDa" + +// InstrumentHandlerInFlight is a middleware that wraps the provided +// http.Handler. It sets the provided prometheus.Gauge to the number of +// requests currently handled by the wrapped http.Handler. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + g.Inc() + defer g.Dec() + next.ServeHTTP(w, r) + }) +} + +// InstrumentHandlerDuration is a middleware that wraps the provided +// http.Handler to observe the request duration with the provided ObserverVec. +// The ObserverVec must have valid metric and label names and must have zero, +// one, or two non-const non-curried labels. For those, the only allowed label +// names are "code" and "method". The function panics otherwise. The Observe +// method of the Observer in the ObserverVec is called with the request duration +// in seconds. Partitioning happens by HTTP status code and/or HTTP method if +// the respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, no values are reported. +// +// Note that this method is only guaranteed to never observe negative durations +// if used with Go1.9+. +func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler) http.HandlerFunc { + code, method := checkLabels(obs) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + + obs.With(labels(code, method, r.Method, d.Status())).Observe(time.Since(now).Seconds()) + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + next.ServeHTTP(w, r) + obs.With(labels(code, method, r.Method, 0)).Observe(time.Since(now).Seconds()) + }) +} + +// InstrumentHandlerCounter is a middleware that wraps the provided http.Handler +// to observe the request result with the provided CounterVec. The CounterVec +// must have valid metric and label names and must have zero, one, or two +// non-const non-curried labels. For those, the only allowed label names are +// "code" and "method". The function panics otherwise. Partitioning of the +// CounterVec happens by HTTP status code and/or HTTP method if the respective +// instance label names are present in the CounterVec. For unpartitioned +// counting, use a CounterVec with zero labels. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, the Counter is not incremented. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler) http.HandlerFunc { + code, method := checkLabels(counter) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + counter.With(labels(code, method, r.Method, d.Status())).Inc() + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) + counter.With(labels(code, method, r.Method, 0)).Inc() + }) +} + +// InstrumentHandlerTimeToWriteHeader is a middleware that wraps the provided +// http.Handler to observe with the provided ObserverVec the request duration +// until the response headers are written. The ObserverVec must have valid +// metric and label names and must have zero, one, or two non-const non-curried +// labels. For those, the only allowed label names are "code" and "method". The +// function panics otherwise. The Observe method of the Observer in the +// ObserverVec is called with the request duration in seconds. Partitioning +// happens by HTTP status code and/or HTTP method if the respective instance +// label names are present in the ObserverVec. For unpartitioned observations, +// use an ObserverVec with zero labels. Note that partitioning of Histograms is +// expensive and should be used judiciously. +// +// If the wrapped Handler panics before calling WriteHeader, no value is +// reported. +// +// Note that this method is only guaranteed to never observe negative durations +// if used with Go1.9+. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Handler) http.HandlerFunc { + code, method := checkLabels(obs) + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + now := time.Now() + d := newDelegator(w, func(status int) { + obs.With(labels(code, method, r.Method, status)).Observe(time.Since(now).Seconds()) + }) + next.ServeHTTP(d, r) + }) +} + +// InstrumentHandlerRequestSize is a middleware that wraps the provided +// http.Handler to observe the request size with the provided ObserverVec. The +// ObserverVec must have valid metric and label names and must have zero, one, +// or two non-const non-curried labels. For those, the only allowed label names +// are "code" and "method". The function panics otherwise. The Observe method of +// the Observer in the ObserverVec is called with the request size in +// bytes. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, no values are reported. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler) http.HandlerFunc { + code, method := checkLabels(obs) + + if code { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + size := computeApproximateRequestSize(r) + obs.With(labels(code, method, r.Method, d.Status())).Observe(float64(size)) + }) + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) + size := computeApproximateRequestSize(r) + obs.With(labels(code, method, r.Method, 0)).Observe(float64(size)) + }) +} + +// InstrumentHandlerResponseSize is a middleware that wraps the provided +// http.Handler to observe the response size with the provided ObserverVec. The +// ObserverVec must have valid metric and label names and must have zero, one, +// or two non-const non-curried labels. For those, the only allowed label names +// are "code" and "method". The function panics otherwise. The Observe method of +// the Observer in the ObserverVec is called with the response size in +// bytes. Partitioning happens by HTTP status code and/or HTTP method if the +// respective instance label names are present in the ObserverVec. For +// unpartitioned observations, use an ObserverVec with zero labels. Note that +// partitioning of Histograms is expensive and should be used judiciously. +// +// If the wrapped Handler does not set a status code, a status code of 200 is assumed. +// +// If the wrapped Handler panics, no values are reported. +// +// See the example for InstrumentHandlerDuration for example usage. +func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler) http.Handler { + code, method := checkLabels(obs) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + d := newDelegator(w, nil) + next.ServeHTTP(d, r) + obs.With(labels(code, method, r.Method, d.Status())).Observe(float64(d.Written())) + }) +} + +// checkLabels returns whether the provided Collector has a non-const, +// non-curried label named "code" and/or "method". It panics if the provided +// Collector does not have a Desc or has more than one Desc or its Desc is +// invalid. It also panics if the Collector has any non-const, non-curried +// labels that are not named "code" or "method". +func checkLabels(c prometheus.Collector) (code bool, method bool) { + // TODO(beorn7): Remove this hacky way to check for instance labels + // once Descriptors can have their dimensionality queried. + var ( + desc *prometheus.Desc + m prometheus.Metric + pm dto.Metric + lvs []string + ) + + // Get the Desc from the Collector. + descc := make(chan *prometheus.Desc, 1) + c.Describe(descc) + + select { + case desc = <-descc: + default: + panic("no description provided by collector") + } + select { + case <-descc: + panic("more than one description provided by collector") + default: + } + + close(descc) + + // Make sure the Collector has a valid Desc by registering it with a + // temporary registry. + prometheus.NewRegistry().MustRegister(c) + + // Create a ConstMetric with the Desc. Since we don't know how many + // variable labels there are, try for as long as it needs. + for err := errors.New("dummy"); err != nil; lvs = append(lvs, magicString) { + m, err = prometheus.NewConstMetric(desc, prometheus.UntypedValue, 0, lvs...) + } + + // Write out the metric into a proto message and look at the labels. + // If the value is not the magicString, it is a constLabel, which doesn't interest us. + // If the label is curried, it doesn't interest us. + // In all other cases, only "code" or "method" is allowed. + if err := m.Write(&pm); err != nil { + panic("error checking metric for labels") + } + for _, label := range pm.Label { + name, value := label.GetName(), label.GetValue() + if value != magicString || isLabelCurried(c, name) { + continue + } + switch name { + case "code": + code = true + case "method": + method = true + default: + panic("metric partitioned with non-supported labels") + } + } + return +} + +func isLabelCurried(c prometheus.Collector, label string) bool { + // This is even hackier than the label test above. + // We essentially try to curry again and see if it works. + // But for that, we need to type-convert to the two + // types we use here, ObserverVec or *CounterVec. + switch v := c.(type) { + case *prometheus.CounterVec: + if _, err := v.CurryWith(prometheus.Labels{label: "dummy"}); err == nil { + return false + } + case prometheus.ObserverVec: + if _, err := v.CurryWith(prometheus.Labels{label: "dummy"}); err == nil { + return false + } + default: + panic("unsupported metric vec type") + } + return true +} + +// emptyLabels is a one-time allocation for non-partitioned metrics to avoid +// unnecessary allocations on each request. +var emptyLabels = prometheus.Labels{} + +func labels(code, method bool, reqMethod string, status int) prometheus.Labels { + if !(code || method) { + return emptyLabels + } + labels := prometheus.Labels{} + + if code { + labels["code"] = sanitizeCode(status) + } + if method { + labels["method"] = sanitizeMethod(reqMethod) + } + + return labels +} + +func computeApproximateRequestSize(r *http.Request) int { + s := 0 + if r.URL != nil { + s += len(r.URL.String()) + } + + s += len(r.Method) + s += len(r.Proto) + for name, values := range r.Header { + s += len(name) + for _, value := range values { + s += len(value) + } + } + s += len(r.Host) + + // N.B. r.Form and r.MultipartForm are assumed to be included in r.URL. + + if r.ContentLength != -1 { + s += int(r.ContentLength) + } + return s +} + +func sanitizeMethod(m string) string { + switch m { + case "GET", "get": + return "get" + case "PUT", "put": + return "put" + case "HEAD", "head": + return "head" + case "POST", "post": + return "post" + case "DELETE", "delete": + return "delete" + case "CONNECT", "connect": + return "connect" + case "OPTIONS", "options": + return "options" + case "NOTIFY", "notify": + return "notify" + default: + return strings.ToLower(m) + } +} + +// If the wrapped http.Handler has not set a status code, i.e. the value is +// currently 0, santizeCode will return 200, for consistency with behavior in +// the stdlib. +func sanitizeCode(s int) string { + switch s { + case 100: + return "100" + case 101: + return "101" + + case 200, 0: + return "200" + case 201: + return "201" + case 202: + return "202" + case 203: + return "203" + case 204: + return "204" + case 205: + return "205" + case 206: + return "206" + + case 300: + return "300" + case 301: + return "301" + case 302: + return "302" + case 304: + return "304" + case 305: + return "305" + case 307: + return "307" + + case 400: + return "400" + case 401: + return "401" + case 402: + return "402" + case 403: + return "403" + case 404: + return "404" + case 405: + return "405" + case 406: + return "406" + case 407: + return "407" + case 408: + return "408" + case 409: + return "409" + case 410: + return "410" + case 411: + return "411" + case 412: + return "412" + case 413: + return "413" + case 414: + return "414" + case 415: + return "415" + case 416: + return "416" + case 417: + return "417" + case 418: + return "418" + + case 500: + return "500" + case 501: + return "501" + case 502: + return "502" + case 503: + return "503" + case 504: + return "504" + case 505: + return "505" + + case 428: + return "428" + case 429: + return "429" + case 431: + return "431" + case 511: + return "511" + + default: + return strconv.Itoa(s) + } +} +``` + +## `prometheus/promhttp/instrument_server_test.go` (changed lines (207,)) + +```go +// Copyright 2017 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package promhttp + +import ( + "io" + "log" + "net/http" + "net/http/httptest" + "testing" + + "github.com/prometheus/client_golang/prometheus" +) + +func TestLabelCheck(t *testing.T) { + scenarios := map[string]struct { + metricName string // Defaults to "c". + varLabels []string + constLabels []string + curriedLabels []string + ok bool + }{ + "empty": { + varLabels: []string{}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "code as single var label": { + varLabels: []string{"code"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "method as single var label": { + varLabels: []string{"method"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "code and method as var labels": { + varLabels: []string{"method", "code"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: true, + }, + "valid case with all labels used": { + varLabels: []string{"code", "method"}, + constLabels: []string{"foo", "bar"}, + curriedLabels: []string{"dings", "bums"}, + ok: true, + }, + "all labels used with an invalid const label name": { + varLabels: []string{"code", "method"}, + constLabels: []string{"in-valid", "bar"}, + curriedLabels: []string{"dings", "bums"}, + ok: false, + }, + "unsupported var label": { + varLabels: []string{"foo"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: false, + }, + "mixed var labels": { + varLabels: []string{"method", "foo", "code"}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: false, + }, + "unsupported var label but curried": { + varLabels: []string{}, + constLabels: []string{}, + curriedLabels: []string{"foo"}, + ok: true, + }, + "mixed var labels but unsupported curried": { + varLabels: []string{"code", "method"}, + constLabels: []string{}, + curriedLabels: []string{"foo"}, + ok: true, + }, + "supported label as const and curry": { + varLabels: []string{}, + constLabels: []string{"code"}, + curriedLabels: []string{"method"}, + ok: true, + }, + "supported label as const and curry with unsupported as var": { + varLabels: []string{"foo"}, + constLabels: []string{"code"}, + curriedLabels: []string{"method"}, + ok: false, + }, + "invalid name and otherwise empty": { + metricName: "in-valid", + varLabels: []string{}, + constLabels: []string{}, + curriedLabels: []string{}, + ok: false, + }, + "invalid name with all the otherwise valid labels": { + metricName: "in-valid", + varLabels: []string{"code", "method"}, + constLabels: []string{"foo", "bar"}, + curriedLabels: []string{"dings", "bums"}, + ok: false, + }, + } + + for name, sc := range scenarios { + t.Run(name, func(t *testing.T) { + metricName := sc.metricName + if metricName == "" { + metricName = "c" + } + constLabels := prometheus.Labels{} + for _, l := range sc.constLabels { + constLabels[l] = "dummy" + } + c := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: metricName, + Help: "c help", + ConstLabels: constLabels, + }, + append(sc.varLabels, sc.curriedLabels...), + ) + o := prometheus.ObserverVec(prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: metricName, + Help: "c help", + ConstLabels: constLabels, + }, + append(sc.varLabels, sc.curriedLabels...), + )) + for _, l := range sc.curriedLabels { + c = c.MustCurryWith(prometheus.Labels{l: "dummy"}) + o = o.MustCurryWith(prometheus.Labels{l: "dummy"}) + } + + func() { + defer func() { + if err := recover(); err != nil { + if sc.ok { + t.Error("unexpected panic:", err) + } + } else if !sc.ok { + t.Error("expected panic") + } + }() + InstrumentHandlerCounter(c, nil) + }() + func() { + defer func() { + if err := recover(); err != nil { + if sc.ok { + t.Error("unexpected panic:", err) + } + } else if !sc.ok { + t.Error("expected panic") + } + }() + InstrumentHandlerDuration(o, nil) + }() + if sc.ok { + // Test if wantCode and wantMethod were detected correctly. + var wantCode, wantMethod bool + for _, l := range sc.varLabels { + if l == "code" { + wantCode = true + } + if l == "method" { + wantMethod = true + } + } + gotCode, gotMethod := checkLabels(c) + if gotCode != wantCode { + t.Errorf("wanted code=%t for counter, got code=%t", wantCode, gotCode) + } + if gotMethod != wantMethod { + t.Errorf("wanted method=%t for counter, got method=%t", wantMethod, gotMethod) + } + gotCode, gotMethod = checkLabels(o) + if gotCode != wantCode { + t.Errorf("wanted code=%t for observer, got code=%t", wantCode, gotCode) + } + if gotMethod != wantMethod { + t.Errorf("wanted method=%t for observer, got method=%t", wantMethod, gotMethod) + } + } + }) + } +} + +func TestMiddlewareAPI(t *testing.T) { + reg := prometheus.NewRegistry() + + inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{ + Name: "in_flight_requests", + Help: "A gauge of requests currently being served by the wrapped handler.", + }) + + counter := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "api_requests_total", + Help: "A counter for requests to the wrapped handler.", + }, + []string{"code", "method"}, + ) + + histVec := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "response_duration_seconds", + Help: "A histogram of request latencies.", + Buckets: prometheus.DefBuckets, + ConstLabels: prometheus.Labels{"handler": "api"}, + }, + []string{"method"}, + ) + + writeHeaderVec := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "write_header_duration_seconds", + Help: "A histogram of time to first write latencies.", + Buckets: prometheus.DefBuckets, + ConstLabels: prometheus.Labels{"handler": "api"}, + }, + []string{}, + ) + + responseSize := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "push_request_size_bytes", + Help: "A histogram of request sizes for requests.", + Buckets: []float64{200, 500, 900, 1500}, + }, + []string{}, + ) + + handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("OK")) + }) + + reg.MustRegister(inFlightGauge, counter, histVec, responseSize, writeHeaderVec) + + chain := InstrumentHandlerInFlight(inFlightGauge, + InstrumentHandlerCounter(counter, + InstrumentHandlerDuration(histVec, + InstrumentHandlerTimeToWriteHeader(writeHeaderVec, + InstrumentHandlerResponseSize(responseSize, handler), + ), + ), + ), + ) + + r, _ := http.NewRequest("GET", "www.example.com", nil) + w := httptest.NewRecorder() + chain.ServeHTTP(w, r) +} + +func TestInstrumentTimeToFirstWrite(t *testing.T) { + var i int + dobs := &responseWriterDelegator{ + ResponseWriter: httptest.NewRecorder(), + observeWriteHeader: func(status int) { + i = status + }, + } + d := newDelegator(dobs, nil) + + d.WriteHeader(http.StatusOK) + + if i != http.StatusOK { + t.Fatalf("failed to execute observeWriteHeader") + } +} + +// testResponseWriter is an http.ResponseWriter that also implements +// http.CloseNotifier, http.Flusher, and io.ReaderFrom. +type testResponseWriter struct { + closeNotifyCalled, flushCalled, readFromCalled bool +} + +func (t *testResponseWriter) Header() http.Header { return nil } +func (t *testResponseWriter) Write([]byte) (int, error) { return 0, nil } +func (t *testResponseWriter) WriteHeader(int) {} +func (t *testResponseWriter) CloseNotify() <-chan bool { + t.closeNotifyCalled = true + return nil +} +func (t *testResponseWriter) Flush() { t.flushCalled = true } +func (t *testResponseWriter) ReadFrom(io.Reader) (int64, error) { + t.readFromCalled = true + return 0, nil +} + +// testFlusher is an http.ResponseWriter that also implements http.Flusher. +type testFlusher struct { + flushCalled bool +} + +func (t *testFlusher) Header() http.Header { return nil } +func (t *testFlusher) Write([]byte) (int, error) { return 0, nil } +func (t *testFlusher) WriteHeader(int) {} +func (t *testFlusher) Flush() { t.flushCalled = true } + +func TestInterfaceUpgrade(t *testing.T) { + w := &testResponseWriter{} + d := newDelegator(w, nil) + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. + d.(http.CloseNotifier).CloseNotify() + if !w.closeNotifyCalled { + t.Error("CloseNotify not called") + } + d.(http.Flusher).Flush() + if !w.flushCalled { + t.Error("Flush not called") + } + d.(io.ReaderFrom).ReadFrom(nil) + if !w.readFromCalled { + t.Error("ReadFrom not called") + } + if _, ok := d.(http.Hijacker); ok { + t.Error("delegator unexpectedly implements http.Hijacker") + } + + f := &testFlusher{} + d = newDelegator(f, nil) + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. + if _, ok := d.(http.CloseNotifier); ok { + t.Error("delegator unexpectedly implements http.CloseNotifier") + } + d.(http.Flusher).Flush() + if !w.flushCalled { + t.Error("Flush not called") + } + if _, ok := d.(io.ReaderFrom); ok { + t.Error("delegator unexpectedly implements io.ReaderFrom") + } + if _, ok := d.(http.Hijacker); ok { + t.Error("delegator unexpectedly implements http.Hijacker") + } +} + +func ExampleInstrumentHandlerDuration() { + inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{ + Name: "in_flight_requests", + Help: "A gauge of requests currently being served by the wrapped handler.", + }) + + counter := prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "api_requests_total", + Help: "A counter for requests to the wrapped handler.", + }, + []string{"code", "method"}, + ) + + // duration is partitioned by the HTTP method and handler. It uses custom + // buckets based on the expected request duration. + duration := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "request_duration_seconds", + Help: "A histogram of latencies for requests.", + Buckets: []float64{.25, .5, 1, 2.5, 5, 10}, + }, + []string{"handler", "method"}, + ) + + // responseSize has no labels, making it a zero-dimensional + // ObserverVec. + responseSize := prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: "response_size_bytes", + Help: "A histogram of response sizes for requests.", + Buckets: []float64{200, 500, 900, 1500}, + }, + []string{}, + ) + + // Create the handlers that will be wrapped by the middleware. + pushHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Push")) + }) + pullHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Pull")) + }) + + // Register all of the metrics in the standard registry. + prometheus.MustRegister(inFlightGauge, counter, duration, responseSize) + + // Instrument the handlers with all the metrics, injecting the "handler" + // label by currying. + pushChain := InstrumentHandlerInFlight(inFlightGauge, + InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "push"}), + InstrumentHandlerCounter(counter, + InstrumentHandlerResponseSize(responseSize, pushHandler), + ), + ), + ) + pullChain := InstrumentHandlerInFlight(inFlightGauge, + InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "pull"}), + InstrumentHandlerCounter(counter, + InstrumentHandlerResponseSize(responseSize, pullHandler), + ), + ), + ) + + http.Handle("/metrics", Handler()) + http.Handle("/push", pushChain) + http.Handle("/pull", pullChain) + + if err := http.ListenAndServe(":3000", nil); err != nil { + log.Fatal(err) + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..84b996ef538e41c7f04da0a036822e1fdfb188b6 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/task.json @@ -0,0 +1,54 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-e3f3ac87786e2080b81f", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-e3f3ac87786e2080b81f", + "project_id": "morefixes__prometheus__client_golang", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "prometheus/promhttp/instrument_client.go", + "prometheus/promhttp/instrument_server.go", + "prometheus/promhttp/instrument_server_test.go", + "prometheus/promhttp/option.go", + "prometheus/promhttp/option_test.go" + ], + "patch_units": { + "before": [ + "prometheus/promhttp/instrument_client.go", + "prometheus/promhttp/instrument_server.go", + "prometheus/promhttp/instrument_server_test.go" + ], + "after": [ + "prometheus/promhttp/instrument_client.go", + "prometheus/promhttp/instrument_server.go", + "prometheus/promhttp/instrument_server_test.go", + "prometheus/promhttp/option.go", + "prometheus/promhttp/option_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/63448da1f5ec39fc27afd6502ee2b22f9a2bc002451fd5d18e43468311240d1c/database", + "cache_key": "63448da1f5ec39fc27afd6502ee2b22f9a2bc002451fd5d18e43468311240d1c", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/ce1973d2f6f53068ab6fb64194f81e95b5c3fd0cb7796075b2b53684d30f43a7/database", + "cache_key": "ce1973d2f6f53068ab6fb64194f81e95b5c3fd0cb7796075b2b53684d30f43a7", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/91696e403e1910dcdf4e0304b5d2b8eda2a99376793facb46762dedf8193448e/database", + "cache_key": "91696e403e1910dcdf4e0304b5d2b8eda2a99376793facb46762dedf8193448e", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-e3f3ac87786e2080b81f/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-e3f3ac87786e2080b81f/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-e3f3ac87786e2080b81f/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..43d2cd723c994072e0d61239cbfc51f13b6fe1f4 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/patch.diff @@ -0,0 +1,68 @@ +diff --git a/generator.go b/generator.go +index 499dc35..c50d33c 100644 +--- a/generator.go ++++ b/generator.go +@@ -165,7 +165,7 @@ func (g *rfc4122Generator) NewV3(ns UUID, name string) UUID { + // NewV4 returns random generated UUID. + func (g *rfc4122Generator) NewV4() (UUID, error) { + u := UUID{} +- if _, err := g.rand.Read(u[:]); err != nil { ++ if _, err := io.ReadFull(g.rand, u[:]); err != nil { + return Nil, err + } + u.SetVersion(V4) +@@ -188,7 +188,7 @@ func (g *rfc4122Generator) getClockSequence() (uint64, uint16, error) { + var err error + g.clockSequenceOnce.Do(func() { + buf := make([]byte, 2) +- if _, err = g.rand.Read(buf); err != nil { ++ if _, err = io.ReadFull(g.rand, buf); err != nil { + return + } + g.clockSequence = binary.BigEndian.Uint16(buf) +@@ -222,7 +222,7 @@ func (g *rfc4122Generator) getHardwareAddr() ([]byte, error) { + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence. +- if _, err = g.rand.Read(g.hardwareAddr[:]); err != nil { ++ if _, err = io.ReadFull(g.rand, g.hardwareAddr[:]); err != nil { + return + } + // Set multicast bit as recommended by RFC 4122 +diff --git a/generator_test.go b/generator_test.go +index 82a236a..a445fb0 100644 +--- a/generator_test.go ++++ b/generator_test.go +@@ -22,9 +22,11 @@ + package uuid + + import ( ++ "bytes" + "crypto/rand" + "fmt" + "net" ++ "testing/iotest" + "time" + + . "gopkg.in/check.v1" +@@ -195,6 +197,20 @@ func (s *genTestSuite) TestNewV4FaultyRand(c *C) { + c.Assert(u1, Equals, Nil) + } + ++func (s *genTestSuite) TestNewV4PartialRead(c *C) { ++ g := &rfc4122Generator{ ++ epochFunc: time.Now, ++ hwAddrFunc: defaultHWAddrFunc, ++ rand: iotest.OneByteReader(rand.Reader), ++ } ++ u1, err := g.NewV4() ++ zeros := bytes.Count(u1.Bytes(), []byte{0}) ++ mostlyZeros := zeros >= 10 ++ ++ c.Assert(err, IsNil) ++ c.Assert(mostlyZeros, Equals, false) ++} ++ + func (s *genTestSuite) BenchmarkNewV4(c *C) { + for i := 0; i < c.N; i++ { + NewV4() diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..affb5c04717755da5bd71b31cdcadd5122a430c7 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/post_context.md @@ -0,0 +1,516 @@ +# Patch-overlapping Go context after the fix + +## `generator.go` (changed lines (168, 191, 225)) + +```go +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/binary" + "fmt" + "hash" + "io" + "net" + "os" + "sync" + "time" +) + +// Difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). +const epochStart = 122192928000000000 + +type epochFunc func() time.Time +type hwAddrFunc func() (net.HardwareAddr, error) + +var ( + global = newRFC4122Generator() + + posixUID = uint32(os.Getuid()) + posixGID = uint32(os.Getgid()) +) + +// NewV1 returns UUID based on current timestamp and MAC address. +func NewV1() (UUID, error) { + return global.NewV1() +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func NewV2(domain byte) (UUID, error) { + return global.NewV2(domain) +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func NewV3(ns UUID, name string) UUID { + return global.NewV3(ns, name) +} + +// NewV4 returns random generated UUID. +func NewV4() (UUID, error) { + return global.NewV4() +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func NewV5(ns UUID, name string) UUID { + return global.NewV5(ns, name) +} + +// Generator provides interface for generating UUIDs. +type Generator interface { + NewV1() (UUID, error) + NewV2(domain byte) (UUID, error) + NewV3(ns UUID, name string) UUID + NewV4() (UUID, error) + NewV5(ns UUID, name string) UUID +} + +// Default generator implementation. +type rfc4122Generator struct { + clockSequenceOnce sync.Once + hardwareAddrOnce sync.Once + storageMutex sync.Mutex + + rand io.Reader + + epochFunc epochFunc + hwAddrFunc hwAddrFunc + lastTime uint64 + clockSequence uint16 + hardwareAddr [6]byte +} + +func newRFC4122Generator() Generator { + return &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: rand.Reader, + } +} + +// NewV1 returns UUID based on current timestamp and MAC address. +func (g *rfc4122Generator) NewV1() (UUID, error) { + u := UUID{} + + timeNow, clockSeq, err := g.getClockSequence() + if err != nil { + return Nil, err + } + binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + + hardwareAddr, err := g.getHardwareAddr() + if err != nil { + return Nil, err + } + copy(u[10:], hardwareAddr) + + u.SetVersion(V1) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func (g *rfc4122Generator) NewV2(domain byte) (UUID, error) { + u, err := g.NewV1() + if err != nil { + return Nil, err + } + + switch domain { + case DomainPerson: + binary.BigEndian.PutUint32(u[:], posixUID) + case DomainGroup: + binary.BigEndian.PutUint32(u[:], posixGID) + } + + u[9] = domain + + u.SetVersion(V2) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func (g *rfc4122Generator) NewV3(ns UUID, name string) UUID { + u := newFromHash(md5.New(), ns, name) + u.SetVersion(V3) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV4 returns random generated UUID. +func (g *rfc4122Generator) NewV4() (UUID, error) { + u := UUID{} + if _, err := io.ReadFull(g.rand, u[:]); err != nil { + return Nil, err + } + u.SetVersion(V4) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func (g *rfc4122Generator) NewV5(ns UUID, name string) UUID { + u := newFromHash(sha1.New(), ns, name) + u.SetVersion(V5) + u.SetVariant(VariantRFC4122) + + return u +} + +// Returns epoch and clock sequence. +func (g *rfc4122Generator) getClockSequence() (uint64, uint16, error) { + var err error + g.clockSequenceOnce.Do(func() { + buf := make([]byte, 2) + if _, err = io.ReadFull(g.rand, buf); err != nil { + return + } + g.clockSequence = binary.BigEndian.Uint16(buf) + }) + if err != nil { + return 0, 0, err + } + + g.storageMutex.Lock() + defer g.storageMutex.Unlock() + + timeNow := g.getEpoch() + // Clock didn't change since last UUID generation. + // Should increase clock sequence. + if timeNow <= g.lastTime { + g.clockSequence++ + } + g.lastTime = timeNow + + return timeNow, g.clockSequence, nil +} + +// Returns hardware address. +func (g *rfc4122Generator) getHardwareAddr() ([]byte, error) { + var err error + g.hardwareAddrOnce.Do(func() { + if hwAddr, err := g.hwAddrFunc(); err == nil { + copy(g.hardwareAddr[:], hwAddr) + return + } + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence. + if _, err = io.ReadFull(g.rand, g.hardwareAddr[:]); err != nil { + return + } + // Set multicast bit as recommended by RFC 4122 + g.hardwareAddr[0] |= 0x01 + }) + if err != nil { + return []byte{}, err + } + return g.hardwareAddr[:], nil +} + +// Returns difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and current time. +func (g *rfc4122Generator) getEpoch() uint64 { + return epochStart + uint64(g.epochFunc().UnixNano()/100) +} + +// Returns UUID based on hashing of namespace UUID and name. +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} + +// Returns hardware address. +func defaultHWAddrFunc() (net.HardwareAddr, error) { + ifaces, err := net.Interfaces() + if err != nil { + return []byte{}, err + } + for _, iface := range ifaces { + if len(iface.HardwareAddr) >= 6 { + return iface.HardwareAddr, nil + } + } + return []byte{}, fmt.Errorf("uuid: no HW address found") +} +``` + +## `generator_test.go` (changed lines (25, 29, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213)) + +```go +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "bytes" + "crypto/rand" + "fmt" + "net" + "testing/iotest" + "time" + + . "gopkg.in/check.v1" +) + +type faultyReader struct { + callsNum int + readToFail int // Read call number to fail +} + +func (r *faultyReader) Read(dest []byte) (int, error) { + r.callsNum++ + if (r.callsNum - 1) == r.readToFail { + return 0, fmt.Errorf("io: reader is faulty") + } + return rand.Read(dest) +} + +type genTestSuite struct{} + +var _ = Suite(&genTestSuite{}) + +func (s *genTestSuite) TestNewV1(c *C) { + u1, err := NewV1() + c.Assert(err, IsNil) + c.Assert(u1.Version(), Equals, V1) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + + u2, err := NewV1() + c.Assert(err, IsNil) + c.Assert(u1, Not(Equals), u2) +} + +func (s *genTestSuite) TestNewV1EpochStale(c *C) { + g := &rfc4122Generator{ + epochFunc: func() time.Time { + return time.Unix(0, 0) + }, + hwAddrFunc: defaultHWAddrFunc, + rand: rand.Reader, + } + u1, err := g.NewV1() + c.Assert(err, IsNil) + u2, err := g.NewV1() + c.Assert(err, IsNil) + c.Assert(u1, Not(Equals), u2) +} + +func (s *genTestSuite) TestNewV1FaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: &faultyReader{}, + } + u1, err := g.NewV1() + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) TestNewV1MissingNetworkInterfaces(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: func() (net.HardwareAddr, error) { + return []byte{}, fmt.Errorf("uuid: no hw address found") + }, + rand: rand.Reader, + } + _, err := g.NewV1() + c.Assert(err, IsNil) +} + +func (s *genTestSuite) TestNewV1MissingNetInterfacesAndFaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: func() (net.HardwareAddr, error) { + return []byte{}, fmt.Errorf("uuid: no hw address found") + }, + rand: &faultyReader{ + readToFail: 1, + }, + } + u1, err := g.NewV1() + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) BenchmarkNewV1(c *C) { + for i := 0; i < c.N; i++ { + NewV1() + } +} + +func (s *genTestSuite) TestNewV2(c *C) { + u1, err := NewV2(DomainPerson) + c.Assert(err, IsNil) + c.Assert(u1.Version(), Equals, V2) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + + u2, err := NewV2(DomainGroup) + c.Assert(err, IsNil) + c.Assert(u2.Version(), Equals, V2) + c.Assert(u2.Variant(), Equals, VariantRFC4122) + + u3, err := NewV2(DomainOrg) + c.Assert(err, IsNil) + c.Assert(u3.Version(), Equals, V2) + c.Assert(u3.Variant(), Equals, VariantRFC4122) +} + +func (s *genTestSuite) TestNewV2FaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: &faultyReader{}, + } + u1, err := g.NewV2(DomainPerson) + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) BenchmarkNewV2(c *C) { + for i := 0; i < c.N; i++ { + NewV2(DomainPerson) + } +} + +func (s *genTestSuite) TestNewV3(c *C) { + u1 := NewV3(NamespaceDNS, "www.example.com") + c.Assert(u1.Version(), Equals, V3) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + c.Assert(u1.String(), Equals, "5df41881-3aed-3515-88a7-2f4a814cf09e") + + u2 := NewV3(NamespaceDNS, "example.com") + c.Assert(u2, Not(Equals), u1) + + u3 := NewV3(NamespaceDNS, "example.com") + c.Assert(u3, Equals, u2) + + u4 := NewV3(NamespaceURL, "example.com") + c.Assert(u4, Not(Equals), u3) +} + +func (s *genTestSuite) BenchmarkNewV3(c *C) { + for i := 0; i < c.N; i++ { + NewV3(NamespaceDNS, "www.example.com") + } +} + +func (s *genTestSuite) TestNewV4(c *C) { + u1, err := NewV4() + c.Assert(err, IsNil) + c.Assert(u1.Version(), Equals, V4) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + + u2, err := NewV4() + c.Assert(err, IsNil) + c.Assert(u1, Not(Equals), u2) +} + +func (s *genTestSuite) TestNewV4FaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: &faultyReader{}, + } + u1, err := g.NewV4() + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) TestNewV4PartialRead(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: iotest.OneByteReader(rand.Reader), + } + u1, err := g.NewV4() + zeros := bytes.Count(u1.Bytes(), []byte{0}) + mostlyZeros := zeros >= 10 + + c.Assert(err, IsNil) + c.Assert(mostlyZeros, Equals, false) +} + +func (s *genTestSuite) BenchmarkNewV4(c *C) { + for i := 0; i < c.N; i++ { + NewV4() + } +} + +func (s *genTestSuite) TestNewV5(c *C) { + u1 := NewV5(NamespaceDNS, "www.example.com") + c.Assert(u1.Version(), Equals, V5) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + c.Assert(u1.String(), Equals, "2ed6657d-e927-568b-95e1-2665a8aea6a2") + + u2 := NewV5(NamespaceDNS, "example.com") + c.Assert(u2, Not(Equals), u1) + + u3 := NewV5(NamespaceDNS, "example.com") + c.Assert(u3, Equals, u2) + + u4 := NewV5(NamespaceURL, "example.com") + c.Assert(u4, Not(Equals), u3) +} + +func (s *genTestSuite) BenchmarkNewV5(c *C) { + for i := 0; i < c.N; i++ { + NewV5(NamespaceDNS, "www.example.com") + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..17c499026c65e6a96cfc16475974ba677ca379ca --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/pre_context.md @@ -0,0 +1,500 @@ +# Patch-overlapping Go context before the fix + +## `generator.go` (changed lines (168, 169, 191, 192, 225, 226)) + +```go +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/binary" + "fmt" + "hash" + "io" + "net" + "os" + "sync" + "time" +) + +// Difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). +const epochStart = 122192928000000000 + +type epochFunc func() time.Time +type hwAddrFunc func() (net.HardwareAddr, error) + +var ( + global = newRFC4122Generator() + + posixUID = uint32(os.Getuid()) + posixGID = uint32(os.Getgid()) +) + +// NewV1 returns UUID based on current timestamp and MAC address. +func NewV1() (UUID, error) { + return global.NewV1() +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func NewV2(domain byte) (UUID, error) { + return global.NewV2(domain) +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func NewV3(ns UUID, name string) UUID { + return global.NewV3(ns, name) +} + +// NewV4 returns random generated UUID. +func NewV4() (UUID, error) { + return global.NewV4() +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func NewV5(ns UUID, name string) UUID { + return global.NewV5(ns, name) +} + +// Generator provides interface for generating UUIDs. +type Generator interface { + NewV1() (UUID, error) + NewV2(domain byte) (UUID, error) + NewV3(ns UUID, name string) UUID + NewV4() (UUID, error) + NewV5(ns UUID, name string) UUID +} + +// Default generator implementation. +type rfc4122Generator struct { + clockSequenceOnce sync.Once + hardwareAddrOnce sync.Once + storageMutex sync.Mutex + + rand io.Reader + + epochFunc epochFunc + hwAddrFunc hwAddrFunc + lastTime uint64 + clockSequence uint16 + hardwareAddr [6]byte +} + +func newRFC4122Generator() Generator { + return &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: rand.Reader, + } +} + +// NewV1 returns UUID based on current timestamp and MAC address. +func (g *rfc4122Generator) NewV1() (UUID, error) { + u := UUID{} + + timeNow, clockSeq, err := g.getClockSequence() + if err != nil { + return Nil, err + } + binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + + hardwareAddr, err := g.getHardwareAddr() + if err != nil { + return Nil, err + } + copy(u[10:], hardwareAddr) + + u.SetVersion(V1) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func (g *rfc4122Generator) NewV2(domain byte) (UUID, error) { + u, err := g.NewV1() + if err != nil { + return Nil, err + } + + switch domain { + case DomainPerson: + binary.BigEndian.PutUint32(u[:], posixUID) + case DomainGroup: + binary.BigEndian.PutUint32(u[:], posixGID) + } + + u[9] = domain + + u.SetVersion(V2) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func (g *rfc4122Generator) NewV3(ns UUID, name string) UUID { + u := newFromHash(md5.New(), ns, name) + u.SetVersion(V3) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV4 returns random generated UUID. +func (g *rfc4122Generator) NewV4() (UUID, error) { + u := UUID{} + if _, err := g.rand.Read(u[:]); err != nil { + return Nil, err + } + u.SetVersion(V4) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func (g *rfc4122Generator) NewV5(ns UUID, name string) UUID { + u := newFromHash(sha1.New(), ns, name) + u.SetVersion(V5) + u.SetVariant(VariantRFC4122) + + return u +} + +// Returns epoch and clock sequence. +func (g *rfc4122Generator) getClockSequence() (uint64, uint16, error) { + var err error + g.clockSequenceOnce.Do(func() { + buf := make([]byte, 2) + if _, err = g.rand.Read(buf); err != nil { + return + } + g.clockSequence = binary.BigEndian.Uint16(buf) + }) + if err != nil { + return 0, 0, err + } + + g.storageMutex.Lock() + defer g.storageMutex.Unlock() + + timeNow := g.getEpoch() + // Clock didn't change since last UUID generation. + // Should increase clock sequence. + if timeNow <= g.lastTime { + g.clockSequence++ + } + g.lastTime = timeNow + + return timeNow, g.clockSequence, nil +} + +// Returns hardware address. +func (g *rfc4122Generator) getHardwareAddr() ([]byte, error) { + var err error + g.hardwareAddrOnce.Do(func() { + if hwAddr, err := g.hwAddrFunc(); err == nil { + copy(g.hardwareAddr[:], hwAddr) + return + } + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence. + if _, err = g.rand.Read(g.hardwareAddr[:]); err != nil { + return + } + // Set multicast bit as recommended by RFC 4122 + g.hardwareAddr[0] |= 0x01 + }) + if err != nil { + return []byte{}, err + } + return g.hardwareAddr[:], nil +} + +// Returns difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and current time. +func (g *rfc4122Generator) getEpoch() uint64 { + return epochStart + uint64(g.epochFunc().UnixNano()/100) +} + +// Returns UUID based on hashing of namespace UUID and name. +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} + +// Returns hardware address. +func defaultHWAddrFunc() (net.HardwareAddr, error) { + ifaces, err := net.Interfaces() + if err != nil { + return []byte{}, err + } + for _, iface := range ifaces { + if len(iface.HardwareAddr) >= 6 { + return iface.HardwareAddr, nil + } + } + return []byte{}, fmt.Errorf("uuid: no HW address found") +} +``` + +## `generator_test.go` (changed lines (25, 28, 198)) + +```go +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "crypto/rand" + "fmt" + "net" + "time" + + . "gopkg.in/check.v1" +) + +type faultyReader struct { + callsNum int + readToFail int // Read call number to fail +} + +func (r *faultyReader) Read(dest []byte) (int, error) { + r.callsNum++ + if (r.callsNum - 1) == r.readToFail { + return 0, fmt.Errorf("io: reader is faulty") + } + return rand.Read(dest) +} + +type genTestSuite struct{} + +var _ = Suite(&genTestSuite{}) + +func (s *genTestSuite) TestNewV1(c *C) { + u1, err := NewV1() + c.Assert(err, IsNil) + c.Assert(u1.Version(), Equals, V1) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + + u2, err := NewV1() + c.Assert(err, IsNil) + c.Assert(u1, Not(Equals), u2) +} + +func (s *genTestSuite) TestNewV1EpochStale(c *C) { + g := &rfc4122Generator{ + epochFunc: func() time.Time { + return time.Unix(0, 0) + }, + hwAddrFunc: defaultHWAddrFunc, + rand: rand.Reader, + } + u1, err := g.NewV1() + c.Assert(err, IsNil) + u2, err := g.NewV1() + c.Assert(err, IsNil) + c.Assert(u1, Not(Equals), u2) +} + +func (s *genTestSuite) TestNewV1FaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: &faultyReader{}, + } + u1, err := g.NewV1() + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) TestNewV1MissingNetworkInterfaces(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: func() (net.HardwareAddr, error) { + return []byte{}, fmt.Errorf("uuid: no hw address found") + }, + rand: rand.Reader, + } + _, err := g.NewV1() + c.Assert(err, IsNil) +} + +func (s *genTestSuite) TestNewV1MissingNetInterfacesAndFaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: func() (net.HardwareAddr, error) { + return []byte{}, fmt.Errorf("uuid: no hw address found") + }, + rand: &faultyReader{ + readToFail: 1, + }, + } + u1, err := g.NewV1() + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) BenchmarkNewV1(c *C) { + for i := 0; i < c.N; i++ { + NewV1() + } +} + +func (s *genTestSuite) TestNewV2(c *C) { + u1, err := NewV2(DomainPerson) + c.Assert(err, IsNil) + c.Assert(u1.Version(), Equals, V2) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + + u2, err := NewV2(DomainGroup) + c.Assert(err, IsNil) + c.Assert(u2.Version(), Equals, V2) + c.Assert(u2.Variant(), Equals, VariantRFC4122) + + u3, err := NewV2(DomainOrg) + c.Assert(err, IsNil) + c.Assert(u3.Version(), Equals, V2) + c.Assert(u3.Variant(), Equals, VariantRFC4122) +} + +func (s *genTestSuite) TestNewV2FaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: &faultyReader{}, + } + u1, err := g.NewV2(DomainPerson) + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) BenchmarkNewV2(c *C) { + for i := 0; i < c.N; i++ { + NewV2(DomainPerson) + } +} + +func (s *genTestSuite) TestNewV3(c *C) { + u1 := NewV3(NamespaceDNS, "www.example.com") + c.Assert(u1.Version(), Equals, V3) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + c.Assert(u1.String(), Equals, "5df41881-3aed-3515-88a7-2f4a814cf09e") + + u2 := NewV3(NamespaceDNS, "example.com") + c.Assert(u2, Not(Equals), u1) + + u3 := NewV3(NamespaceDNS, "example.com") + c.Assert(u3, Equals, u2) + + u4 := NewV3(NamespaceURL, "example.com") + c.Assert(u4, Not(Equals), u3) +} + +func (s *genTestSuite) BenchmarkNewV3(c *C) { + for i := 0; i < c.N; i++ { + NewV3(NamespaceDNS, "www.example.com") + } +} + +func (s *genTestSuite) TestNewV4(c *C) { + u1, err := NewV4() + c.Assert(err, IsNil) + c.Assert(u1.Version(), Equals, V4) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + + u2, err := NewV4() + c.Assert(err, IsNil) + c.Assert(u1, Not(Equals), u2) +} + +func (s *genTestSuite) TestNewV4FaultyRand(c *C) { + g := &rfc4122Generator{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: &faultyReader{}, + } + u1, err := g.NewV4() + c.Assert(err, NotNil) + c.Assert(u1, Equals, Nil) +} + +func (s *genTestSuite) BenchmarkNewV4(c *C) { + for i := 0; i < c.N; i++ { + NewV4() + } +} + +func (s *genTestSuite) TestNewV5(c *C) { + u1 := NewV5(NamespaceDNS, "www.example.com") + c.Assert(u1.Version(), Equals, V5) + c.Assert(u1.Variant(), Equals, VariantRFC4122) + c.Assert(u1.String(), Equals, "2ed6657d-e927-568b-95e1-2665a8aea6a2") + + u2 := NewV5(NamespaceDNS, "example.com") + c.Assert(u2, Not(Equals), u1) + + u3 := NewV5(NamespaceDNS, "example.com") + c.Assert(u3, Equals, u2) + + u4 := NewV5(NamespaceURL, "example.com") + c.Assert(u4, Not(Equals), u3) +} + +func (s *genTestSuite) BenchmarkNewV5(c *C) { + for i := 0; i < c.N; i++ { + NewV5(NamespaceDNS, "www.example.com") + } +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/task.json new file mode 100644 index 0000000000000000000000000000000000000000..09ad95918b45c68d421ec93025878113c40cfddc --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-f0d857f4ad82fae5a3a9", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-f0d857f4ad82fae5a3a9", + "project_id": "morefixes__satori__go.uuid", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "generator.go", + "generator_test.go" + ], + "patch_units": { + "before": [ + "generator.go", + "generator_test.go" + ], + "after": [ + "generator.go", + "generator_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/5b704d3ba96cb2c9fb00af6c75318a196bbde35b934ddbee37fb75221bf5591c/database", + "cache_key": "5b704d3ba96cb2c9fb00af6c75318a196bbde35b934ddbee37fb75221bf5591c", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/b2cfddd03c40ab87482a03bbf1d2a06efbed82435fc825b7a3c1489581a87099/database", + "cache_key": "b2cfddd03c40ab87482a03bbf1d2a06efbed82435fc825b7a3c1489581a87099", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/2f208e2e3a3988e06ed73538a0a328a84ca78cc9c4ac27ff197e675178f09a23/database", + "cache_key": "2f208e2e3a3988e06ed73538a0a328a84ca78cc9c4ac27ff197e675178f09a23", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-f0d857f4ad82fae5a3a9/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-f0d857f4ad82fae5a3a9/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-f0d857f4ad82fae5a3a9/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/patch.diff b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..aee027c733d95487c598c787d50984fa3db0d33c --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/patch.diff @@ -0,0 +1,3632 @@ +diff --git a/pkg/apis/events/openapi/openapi_generated.go b/pkg/apis/events/openapi/openapi_generated.go +index 88281a67..107f30de 100644 +--- a/pkg/apis/events/openapi/openapi_generated.go ++++ b/pkg/apis/events/openapi/openapi_generated.go +@@ -58,6 +58,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime": schema_pkg_apis_events_v1alpha1_ConditionsResetByTime(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria": schema_pkg_apis_events_v1alpha1_ConditionsResetCriteria(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence": schema_pkg_apis_events_v1alpha1_ConfigMapPersistence(ref), ++ "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Container": schema_pkg_apis_events_v1alpha1_Container(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate": schema_pkg_apis_events_v1alpha1_ContainerTemplate(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger": schema_pkg_apis_events_v1alpha1_CustomTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter": schema_pkg_apis_events_v1alpha1_DataFilter(ref), +@@ -1760,6 +1761,77 @@ func schema_pkg_apis_events_v1alpha1_ConfigMapPersistence(ref common.ReferenceCa + } + } + ++func schema_pkg_apis_events_v1alpha1_Container(ref common.ReferenceCallback) common.OpenAPIDefinition { ++ return common.OpenAPIDefinition{ ++ Schema: spec.Schema{ ++ SchemaProps: spec.SchemaProps{ ++ Description: "Container defines customized spec for a container", ++ Type: []string{"object"}, ++ Properties: map[string]spec.Schema{ ++ "resources": { ++ SchemaProps: spec.SchemaProps{ ++ Default: map[string]interface{}{}, ++ Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), ++ }, ++ }, ++ "imagePullPolicy": { ++ SchemaProps: spec.SchemaProps{ ++ Type: []string{"string"}, ++ Format: "", ++ }, ++ }, ++ "securityContext": { ++ SchemaProps: spec.SchemaProps{ ++ Ref: ref("k8s.io/api/core/v1.SecurityContext"), ++ }, ++ }, ++ "volumeMounts": { ++ SchemaProps: spec.SchemaProps{ ++ Type: []string{"array"}, ++ Items: &spec.SchemaOrArray{ ++ Schema: &spec.Schema{ ++ SchemaProps: spec.SchemaProps{ ++ Default: map[string]interface{}{}, ++ Ref: ref("k8s.io/api/core/v1.VolumeMount"), ++ }, ++ }, ++ }, ++ }, ++ }, ++ "env": { ++ SchemaProps: spec.SchemaProps{ ++ Type: []string{"array"}, ++ Items: &spec.SchemaOrArray{ ++ Schema: &spec.Schema{ ++ SchemaProps: spec.SchemaProps{ ++ Default: map[string]interface{}{}, ++ Ref: ref("k8s.io/api/core/v1.EnvVar"), ++ }, ++ }, ++ }, ++ }, ++ }, ++ "envFrom": { ++ SchemaProps: spec.SchemaProps{ ++ Type: []string{"array"}, ++ Items: &spec.SchemaOrArray{ ++ Schema: &spec.Schema{ ++ SchemaProps: spec.SchemaProps{ ++ Default: map[string]interface{}{}, ++ Ref: ref("k8s.io/api/core/v1.EnvFromSource"), ++ }, ++ }, ++ }, ++ }, ++ }, ++ }, ++ }, ++ }, ++ Dependencies: []string{ ++ "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeMount"}, ++ } ++} ++ + func schema_pkg_apis_events_v1alpha1_ContainerTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ +@@ -7905,7 +7977,7 @@ func schema_pkg_apis_events_v1alpha1_Template(ref common.ReferenceCallback) comm + "container": { + SchemaProps: spec.SchemaProps{ + Description: "Container is the main container image to run in the sensor pod", +- Ref: ref("k8s.io/api/core/v1.Container"), ++ Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Container"), + }, + }, + "volumes": { +@@ -8008,7 +8080,7 @@ func schema_pkg_apis_events_v1alpha1_Template(ref common.ReferenceCallback) comm + }, + }, + Dependencies: []string{ +- "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.Container", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/api/core/v1.Volume"}, ++ "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Container", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/api/core/v1.Volume"}, + } + } + +diff --git a/pkg/apis/events/v1alpha1/container_template.go b/pkg/apis/events/v1alpha1/container_template.go +index 0dac09f0..4f2f13da 100644 +--- a/pkg/apis/events/v1alpha1/container_template.go ++++ b/pkg/apis/events/v1alpha1/container_template.go +@@ -4,7 +4,10 @@ import corev1 "k8s.io/api/core/v1" + + // ContainerTemplate defines customized spec for a container + type ContainerTemplate struct { +- Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` +- ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,2,opt,name=imagePullPolicy,casttype=PullPolicy"` +- SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,3,opt,name=securityContext"` ++ // +optional ++ Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` ++ // +optional ++ ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,2,opt,name=imagePullPolicy,casttype=PullPolicy"` ++ // +optional ++ SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,3,opt,name=securityContext"` + } +diff --git a/pkg/apis/events/v1alpha1/generated.pb.go b/pkg/apis/events/v1alpha1/generated.pb.go +index d5832e2f..82c74076 100644 +--- a/pkg/apis/events/v1alpha1/generated.pb.go ++++ b/pkg/apis/events/v1alpha1/generated.pb.go +@@ -861,10 +861,38 @@ func (m *ConfigMapPersistence) XXX_DiscardUnknown() { + + var xxx_messageInfo_ConfigMapPersistence proto.InternalMessageInfo + ++func (m *Container) Reset() { *m = Container{} } ++func (*Container) ProtoMessage() {} ++func (*Container) Descriptor() ([]byte, []int) { ++ return fileDescriptor_e864cc3344a263b9, []int{29} ++} ++func (m *Container) XXX_Unmarshal(b []byte) error { ++ return m.Unmarshal(b) ++} ++func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { ++ b = b[:cap(b)] ++ n, err := m.MarshalToSizedBuffer(b) ++ if err != nil { ++ return nil, err ++ } ++ return b[:n], nil ++} ++func (m *Container) XXX_Merge(src proto.Message) { ++ xxx_messageInfo_Container.Merge(m, src) ++} ++func (m *Container) XXX_Size() int { ++ return m.Size() ++} ++func (m *Container) XXX_DiscardUnknown() { ++ xxx_messageInfo_Container.DiscardUnknown(m) ++} ++ ++var xxx_messageInfo_Container proto.InternalMessageInfo ++ + func (m *ContainerTemplate) Reset() { *m = ContainerTemplate{} } + func (*ContainerTemplate) ProtoMessage() {} + func (*ContainerTemplate) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{29} ++ return fileDescriptor_e864cc3344a263b9, []int{30} + } + func (m *ContainerTemplate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -892,7 +920,7 @@ var xxx_messageInfo_ContainerTemplate proto.InternalMessageInfo + func (m *CustomTrigger) Reset() { *m = CustomTrigger{} } + func (*CustomTrigger) ProtoMessage() {} + func (*CustomTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{30} ++ return fileDescriptor_e864cc3344a263b9, []int{31} + } + func (m *CustomTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -920,7 +948,7 @@ var xxx_messageInfo_CustomTrigger proto.InternalMessageInfo + func (m *DataFilter) Reset() { *m = DataFilter{} } + func (*DataFilter) ProtoMessage() {} + func (*DataFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{31} ++ return fileDescriptor_e864cc3344a263b9, []int{32} + } + func (m *DataFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -948,7 +976,7 @@ var xxx_messageInfo_DataFilter proto.InternalMessageInfo + func (m *EmailTrigger) Reset() { *m = EmailTrigger{} } + func (*EmailTrigger) ProtoMessage() {} + func (*EmailTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{32} ++ return fileDescriptor_e864cc3344a263b9, []int{33} + } + func (m *EmailTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -976,7 +1004,7 @@ var xxx_messageInfo_EmailTrigger proto.InternalMessageInfo + func (m *EmitterEventSource) Reset() { *m = EmitterEventSource{} } + func (*EmitterEventSource) ProtoMessage() {} + func (*EmitterEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{33} ++ return fileDescriptor_e864cc3344a263b9, []int{34} + } + func (m *EmitterEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1004,7 +1032,7 @@ var xxx_messageInfo_EmitterEventSource proto.InternalMessageInfo + func (m *Event) Reset() { *m = Event{} } + func (*Event) ProtoMessage() {} + func (*Event) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{34} ++ return fileDescriptor_e864cc3344a263b9, []int{35} + } + func (m *Event) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1032,7 +1060,7 @@ var xxx_messageInfo_Event proto.InternalMessageInfo + func (m *EventBus) Reset() { *m = EventBus{} } + func (*EventBus) ProtoMessage() {} + func (*EventBus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{35} ++ return fileDescriptor_e864cc3344a263b9, []int{36} + } + func (m *EventBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1060,7 +1088,7 @@ var xxx_messageInfo_EventBus proto.InternalMessageInfo + func (m *EventBusList) Reset() { *m = EventBusList{} } + func (*EventBusList) ProtoMessage() {} + func (*EventBusList) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{36} ++ return fileDescriptor_e864cc3344a263b9, []int{37} + } + func (m *EventBusList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1088,7 +1116,7 @@ var xxx_messageInfo_EventBusList proto.InternalMessageInfo + func (m *EventBusSpec) Reset() { *m = EventBusSpec{} } + func (*EventBusSpec) ProtoMessage() {} + func (*EventBusSpec) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{37} ++ return fileDescriptor_e864cc3344a263b9, []int{38} + } + func (m *EventBusSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1116,7 +1144,7 @@ var xxx_messageInfo_EventBusSpec proto.InternalMessageInfo + func (m *EventBusStatus) Reset() { *m = EventBusStatus{} } + func (*EventBusStatus) ProtoMessage() {} + func (*EventBusStatus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{38} ++ return fileDescriptor_e864cc3344a263b9, []int{39} + } + func (m *EventBusStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1144,7 +1172,7 @@ var xxx_messageInfo_EventBusStatus proto.InternalMessageInfo + func (m *EventContext) Reset() { *m = EventContext{} } + func (*EventContext) ProtoMessage() {} + func (*EventContext) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{39} ++ return fileDescriptor_e864cc3344a263b9, []int{40} + } + func (m *EventContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1172,7 +1200,7 @@ var xxx_messageInfo_EventContext proto.InternalMessageInfo + func (m *EventDependency) Reset() { *m = EventDependency{} } + func (*EventDependency) ProtoMessage() {} + func (*EventDependency) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{40} ++ return fileDescriptor_e864cc3344a263b9, []int{41} + } + func (m *EventDependency) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1200,7 +1228,7 @@ var xxx_messageInfo_EventDependency proto.InternalMessageInfo + func (m *EventDependencyFilter) Reset() { *m = EventDependencyFilter{} } + func (*EventDependencyFilter) ProtoMessage() {} + func (*EventDependencyFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{41} ++ return fileDescriptor_e864cc3344a263b9, []int{42} + } + func (m *EventDependencyFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1228,7 +1256,7 @@ var xxx_messageInfo_EventDependencyFilter proto.InternalMessageInfo + func (m *EventDependencyTransformer) Reset() { *m = EventDependencyTransformer{} } + func (*EventDependencyTransformer) ProtoMessage() {} + func (*EventDependencyTransformer) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{42} ++ return fileDescriptor_e864cc3344a263b9, []int{43} + } + func (m *EventDependencyTransformer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1256,7 +1284,7 @@ var xxx_messageInfo_EventDependencyTransformer proto.InternalMessageInfo + func (m *EventPersistence) Reset() { *m = EventPersistence{} } + func (*EventPersistence) ProtoMessage() {} + func (*EventPersistence) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{43} ++ return fileDescriptor_e864cc3344a263b9, []int{44} + } + func (m *EventPersistence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1284,7 +1312,7 @@ var xxx_messageInfo_EventPersistence proto.InternalMessageInfo + func (m *EventSource) Reset() { *m = EventSource{} } + func (*EventSource) ProtoMessage() {} + func (*EventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{44} ++ return fileDescriptor_e864cc3344a263b9, []int{45} + } + func (m *EventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1312,7 +1340,7 @@ var xxx_messageInfo_EventSource proto.InternalMessageInfo + func (m *EventSourceFilter) Reset() { *m = EventSourceFilter{} } + func (*EventSourceFilter) ProtoMessage() {} + func (*EventSourceFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{45} ++ return fileDescriptor_e864cc3344a263b9, []int{46} + } + func (m *EventSourceFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1340,7 +1368,7 @@ var xxx_messageInfo_EventSourceFilter proto.InternalMessageInfo + func (m *EventSourceList) Reset() { *m = EventSourceList{} } + func (*EventSourceList) ProtoMessage() {} + func (*EventSourceList) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{46} ++ return fileDescriptor_e864cc3344a263b9, []int{47} + } + func (m *EventSourceList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1368,7 +1396,7 @@ var xxx_messageInfo_EventSourceList proto.InternalMessageInfo + func (m *EventSourceSpec) Reset() { *m = EventSourceSpec{} } + func (*EventSourceSpec) ProtoMessage() {} + func (*EventSourceSpec) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{47} ++ return fileDescriptor_e864cc3344a263b9, []int{48} + } + func (m *EventSourceSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1396,7 +1424,7 @@ var xxx_messageInfo_EventSourceSpec proto.InternalMessageInfo + func (m *EventSourceStatus) Reset() { *m = EventSourceStatus{} } + func (*EventSourceStatus) ProtoMessage() {} + func (*EventSourceStatus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{48} ++ return fileDescriptor_e864cc3344a263b9, []int{49} + } + func (m *EventSourceStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1424,7 +1452,7 @@ var xxx_messageInfo_EventSourceStatus proto.InternalMessageInfo + func (m *ExprFilter) Reset() { *m = ExprFilter{} } + func (*ExprFilter) ProtoMessage() {} + func (*ExprFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{49} ++ return fileDescriptor_e864cc3344a263b9, []int{50} + } + func (m *ExprFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1452,7 +1480,7 @@ var xxx_messageInfo_ExprFilter proto.InternalMessageInfo + func (m *FileArtifact) Reset() { *m = FileArtifact{} } + func (*FileArtifact) ProtoMessage() {} + func (*FileArtifact) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{50} ++ return fileDescriptor_e864cc3344a263b9, []int{51} + } + func (m *FileArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1480,7 +1508,7 @@ var xxx_messageInfo_FileArtifact proto.InternalMessageInfo + func (m *FileEventSource) Reset() { *m = FileEventSource{} } + func (*FileEventSource) ProtoMessage() {} + func (*FileEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{51} ++ return fileDescriptor_e864cc3344a263b9, []int{52} + } + func (m *FileEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1508,7 +1536,7 @@ var xxx_messageInfo_FileEventSource proto.InternalMessageInfo + func (m *GenericEventSource) Reset() { *m = GenericEventSource{} } + func (*GenericEventSource) ProtoMessage() {} + func (*GenericEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{52} ++ return fileDescriptor_e864cc3344a263b9, []int{53} + } + func (m *GenericEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1536,7 +1564,7 @@ var xxx_messageInfo_GenericEventSource proto.InternalMessageInfo + func (m *GerritEventSource) Reset() { *m = GerritEventSource{} } + func (*GerritEventSource) ProtoMessage() {} + func (*GerritEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{53} ++ return fileDescriptor_e864cc3344a263b9, []int{54} + } + func (m *GerritEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1564,7 +1592,7 @@ var xxx_messageInfo_GerritEventSource proto.InternalMessageInfo + func (m *GitArtifact) Reset() { *m = GitArtifact{} } + func (*GitArtifact) ProtoMessage() {} + func (*GitArtifact) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{54} ++ return fileDescriptor_e864cc3344a263b9, []int{55} + } + func (m *GitArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1592,7 +1620,7 @@ var xxx_messageInfo_GitArtifact proto.InternalMessageInfo + func (m *GitCreds) Reset() { *m = GitCreds{} } + func (*GitCreds) ProtoMessage() {} + func (*GitCreds) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{55} ++ return fileDescriptor_e864cc3344a263b9, []int{56} + } + func (m *GitCreds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1620,7 +1648,7 @@ var xxx_messageInfo_GitCreds proto.InternalMessageInfo + func (m *GitRemoteConfig) Reset() { *m = GitRemoteConfig{} } + func (*GitRemoteConfig) ProtoMessage() {} + func (*GitRemoteConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{56} ++ return fileDescriptor_e864cc3344a263b9, []int{57} + } + func (m *GitRemoteConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1648,7 +1676,7 @@ var xxx_messageInfo_GitRemoteConfig proto.InternalMessageInfo + func (m *GithubAppCreds) Reset() { *m = GithubAppCreds{} } + func (*GithubAppCreds) ProtoMessage() {} + func (*GithubAppCreds) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{57} ++ return fileDescriptor_e864cc3344a263b9, []int{58} + } + func (m *GithubAppCreds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1676,7 +1704,7 @@ var xxx_messageInfo_GithubAppCreds proto.InternalMessageInfo + func (m *GithubEventSource) Reset() { *m = GithubEventSource{} } + func (*GithubEventSource) ProtoMessage() {} + func (*GithubEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{58} ++ return fileDescriptor_e864cc3344a263b9, []int{59} + } + func (m *GithubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1704,7 +1732,7 @@ var xxx_messageInfo_GithubEventSource proto.InternalMessageInfo + func (m *GitlabEventSource) Reset() { *m = GitlabEventSource{} } + func (*GitlabEventSource) ProtoMessage() {} + func (*GitlabEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{59} ++ return fileDescriptor_e864cc3344a263b9, []int{60} + } + func (m *GitlabEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1732,7 +1760,7 @@ var xxx_messageInfo_GitlabEventSource proto.InternalMessageInfo + func (m *HDFSEventSource) Reset() { *m = HDFSEventSource{} } + func (*HDFSEventSource) ProtoMessage() {} + func (*HDFSEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{60} ++ return fileDescriptor_e864cc3344a263b9, []int{61} + } + func (m *HDFSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1760,7 +1788,7 @@ var xxx_messageInfo_HDFSEventSource proto.InternalMessageInfo + func (m *HTTPTrigger) Reset() { *m = HTTPTrigger{} } + func (*HTTPTrigger) ProtoMessage() {} + func (*HTTPTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{61} ++ return fileDescriptor_e864cc3344a263b9, []int{62} + } + func (m *HTTPTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1788,7 +1816,7 @@ var xxx_messageInfo_HTTPTrigger proto.InternalMessageInfo + func (m *Int64OrString) Reset() { *m = Int64OrString{} } + func (*Int64OrString) ProtoMessage() {} + func (*Int64OrString) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{62} ++ return fileDescriptor_e864cc3344a263b9, []int{63} + } + func (m *Int64OrString) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1816,7 +1844,7 @@ var xxx_messageInfo_Int64OrString proto.InternalMessageInfo + func (m *JetStreamBus) Reset() { *m = JetStreamBus{} } + func (*JetStreamBus) ProtoMessage() {} + func (*JetStreamBus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{63} ++ return fileDescriptor_e864cc3344a263b9, []int{64} + } + func (m *JetStreamBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1844,7 +1872,7 @@ var xxx_messageInfo_JetStreamBus proto.InternalMessageInfo + func (m *JetStreamConfig) Reset() { *m = JetStreamConfig{} } + func (*JetStreamConfig) ProtoMessage() {} + func (*JetStreamConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{64} ++ return fileDescriptor_e864cc3344a263b9, []int{65} + } + func (m *JetStreamConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1872,7 +1900,7 @@ var xxx_messageInfo_JetStreamConfig proto.InternalMessageInfo + func (m *K8SResource) Reset() { *m = K8SResource{} } + func (*K8SResource) ProtoMessage() {} + func (*K8SResource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{65} ++ return fileDescriptor_e864cc3344a263b9, []int{66} + } + func (m *K8SResource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1900,7 +1928,7 @@ var xxx_messageInfo_K8SResource proto.InternalMessageInfo + func (m *K8SResourcePolicy) Reset() { *m = K8SResourcePolicy{} } + func (*K8SResourcePolicy) ProtoMessage() {} + func (*K8SResourcePolicy) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{66} ++ return fileDescriptor_e864cc3344a263b9, []int{67} + } + func (m *K8SResourcePolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1928,7 +1956,7 @@ var xxx_messageInfo_K8SResourcePolicy proto.InternalMessageInfo + func (m *KafkaBus) Reset() { *m = KafkaBus{} } + func (*KafkaBus) ProtoMessage() {} + func (*KafkaBus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{67} ++ return fileDescriptor_e864cc3344a263b9, []int{68} + } + func (m *KafkaBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1956,7 +1984,7 @@ var xxx_messageInfo_KafkaBus proto.InternalMessageInfo + func (m *KafkaConsumerGroup) Reset() { *m = KafkaConsumerGroup{} } + func (*KafkaConsumerGroup) ProtoMessage() {} + func (*KafkaConsumerGroup) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{68} ++ return fileDescriptor_e864cc3344a263b9, []int{69} + } + func (m *KafkaConsumerGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -1984,7 +2012,7 @@ var xxx_messageInfo_KafkaConsumerGroup proto.InternalMessageInfo + func (m *KafkaEventSource) Reset() { *m = KafkaEventSource{} } + func (*KafkaEventSource) ProtoMessage() {} + func (*KafkaEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{69} ++ return fileDescriptor_e864cc3344a263b9, []int{70} + } + func (m *KafkaEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2012,7 +2040,7 @@ var xxx_messageInfo_KafkaEventSource proto.InternalMessageInfo + func (m *KafkaTrigger) Reset() { *m = KafkaTrigger{} } + func (*KafkaTrigger) ProtoMessage() {} + func (*KafkaTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{70} ++ return fileDescriptor_e864cc3344a263b9, []int{71} + } + func (m *KafkaTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2040,7 +2068,7 @@ var xxx_messageInfo_KafkaTrigger proto.InternalMessageInfo + func (m *LogTrigger) Reset() { *m = LogTrigger{} } + func (*LogTrigger) ProtoMessage() {} + func (*LogTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{71} ++ return fileDescriptor_e864cc3344a263b9, []int{72} + } + func (m *LogTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2068,7 +2096,7 @@ var xxx_messageInfo_LogTrigger proto.InternalMessageInfo + func (m *MQTTEventSource) Reset() { *m = MQTTEventSource{} } + func (*MQTTEventSource) ProtoMessage() {} + func (*MQTTEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{72} ++ return fileDescriptor_e864cc3344a263b9, []int{73} + } + func (m *MQTTEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2096,7 +2124,7 @@ var xxx_messageInfo_MQTTEventSource proto.InternalMessageInfo + func (m *Metadata) Reset() { *m = Metadata{} } + func (*Metadata) ProtoMessage() {} + func (*Metadata) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{73} ++ return fileDescriptor_e864cc3344a263b9, []int{74} + } + func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2124,7 +2152,7 @@ var xxx_messageInfo_Metadata proto.InternalMessageInfo + func (m *NATSAuth) Reset() { *m = NATSAuth{} } + func (*NATSAuth) ProtoMessage() {} + func (*NATSAuth) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{74} ++ return fileDescriptor_e864cc3344a263b9, []int{75} + } + func (m *NATSAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2152,7 +2180,7 @@ var xxx_messageInfo_NATSAuth proto.InternalMessageInfo + func (m *NATSBus) Reset() { *m = NATSBus{} } + func (*NATSBus) ProtoMessage() {} + func (*NATSBus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{75} ++ return fileDescriptor_e864cc3344a263b9, []int{76} + } + func (m *NATSBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2180,7 +2208,7 @@ var xxx_messageInfo_NATSBus proto.InternalMessageInfo + func (m *NATSConfig) Reset() { *m = NATSConfig{} } + func (*NATSConfig) ProtoMessage() {} + func (*NATSConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{76} ++ return fileDescriptor_e864cc3344a263b9, []int{77} + } + func (m *NATSConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2208,7 +2236,7 @@ var xxx_messageInfo_NATSConfig proto.InternalMessageInfo + func (m *NATSEventsSource) Reset() { *m = NATSEventsSource{} } + func (*NATSEventsSource) ProtoMessage() {} + func (*NATSEventsSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{77} ++ return fileDescriptor_e864cc3344a263b9, []int{78} + } + func (m *NATSEventsSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2236,7 +2264,7 @@ var xxx_messageInfo_NATSEventsSource proto.InternalMessageInfo + func (m *NATSTrigger) Reset() { *m = NATSTrigger{} } + func (*NATSTrigger) ProtoMessage() {} + func (*NATSTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{78} ++ return fileDescriptor_e864cc3344a263b9, []int{79} + } + func (m *NATSTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2264,7 +2292,7 @@ var xxx_messageInfo_NATSTrigger proto.InternalMessageInfo + func (m *NSQEventSource) Reset() { *m = NSQEventSource{} } + func (*NSQEventSource) ProtoMessage() {} + func (*NSQEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{79} ++ return fileDescriptor_e864cc3344a263b9, []int{80} + } + func (m *NSQEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2292,7 +2320,7 @@ var xxx_messageInfo_NSQEventSource proto.InternalMessageInfo + func (m *NativeStrategy) Reset() { *m = NativeStrategy{} } + func (*NativeStrategy) ProtoMessage() {} + func (*NativeStrategy) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{80} ++ return fileDescriptor_e864cc3344a263b9, []int{81} + } + func (m *NativeStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2320,7 +2348,7 @@ var xxx_messageInfo_NativeStrategy proto.InternalMessageInfo + func (m *OpenWhiskTrigger) Reset() { *m = OpenWhiskTrigger{} } + func (*OpenWhiskTrigger) ProtoMessage() {} + func (*OpenWhiskTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{81} ++ return fileDescriptor_e864cc3344a263b9, []int{82} + } + func (m *OpenWhiskTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2348,7 +2376,7 @@ var xxx_messageInfo_OpenWhiskTrigger proto.InternalMessageInfo + func (m *OwnedRepositories) Reset() { *m = OwnedRepositories{} } + func (*OwnedRepositories) ProtoMessage() {} + func (*OwnedRepositories) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{82} ++ return fileDescriptor_e864cc3344a263b9, []int{83} + } + func (m *OwnedRepositories) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2376,7 +2404,7 @@ var xxx_messageInfo_OwnedRepositories proto.InternalMessageInfo + func (m *PayloadField) Reset() { *m = PayloadField{} } + func (*PayloadField) ProtoMessage() {} + func (*PayloadField) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{83} ++ return fileDescriptor_e864cc3344a263b9, []int{84} + } + func (m *PayloadField) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2404,7 +2432,7 @@ var xxx_messageInfo_PayloadField proto.InternalMessageInfo + func (m *PersistenceStrategy) Reset() { *m = PersistenceStrategy{} } + func (*PersistenceStrategy) ProtoMessage() {} + func (*PersistenceStrategy) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{84} ++ return fileDescriptor_e864cc3344a263b9, []int{85} + } + func (m *PersistenceStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2432,7 +2460,7 @@ var xxx_messageInfo_PersistenceStrategy proto.InternalMessageInfo + func (m *PubSubEventSource) Reset() { *m = PubSubEventSource{} } + func (*PubSubEventSource) ProtoMessage() {} + func (*PubSubEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{85} ++ return fileDescriptor_e864cc3344a263b9, []int{86} + } + func (m *PubSubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2460,7 +2488,7 @@ var xxx_messageInfo_PubSubEventSource proto.InternalMessageInfo + func (m *PulsarEventSource) Reset() { *m = PulsarEventSource{} } + func (*PulsarEventSource) ProtoMessage() {} + func (*PulsarEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{86} ++ return fileDescriptor_e864cc3344a263b9, []int{87} + } + func (m *PulsarEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2488,7 +2516,7 @@ var xxx_messageInfo_PulsarEventSource proto.InternalMessageInfo + func (m *PulsarTrigger) Reset() { *m = PulsarTrigger{} } + func (*PulsarTrigger) ProtoMessage() {} + func (*PulsarTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{87} ++ return fileDescriptor_e864cc3344a263b9, []int{88} + } + func (m *PulsarTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2516,7 +2544,7 @@ var xxx_messageInfo_PulsarTrigger proto.InternalMessageInfo + func (m *RateLimit) Reset() { *m = RateLimit{} } + func (*RateLimit) ProtoMessage() {} + func (*RateLimit) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{88} ++ return fileDescriptor_e864cc3344a263b9, []int{89} + } + func (m *RateLimit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2544,7 +2572,7 @@ var xxx_messageInfo_RateLimit proto.InternalMessageInfo + func (m *RedisEventSource) Reset() { *m = RedisEventSource{} } + func (*RedisEventSource) ProtoMessage() {} + func (*RedisEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{89} ++ return fileDescriptor_e864cc3344a263b9, []int{90} + } + func (m *RedisEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2572,7 +2600,7 @@ var xxx_messageInfo_RedisEventSource proto.InternalMessageInfo + func (m *RedisStreamEventSource) Reset() { *m = RedisStreamEventSource{} } + func (*RedisStreamEventSource) ProtoMessage() {} + func (*RedisStreamEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{90} ++ return fileDescriptor_e864cc3344a263b9, []int{91} + } + func (m *RedisStreamEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2600,7 +2628,7 @@ var xxx_messageInfo_RedisStreamEventSource proto.InternalMessageInfo + func (m *ResourceEventSource) Reset() { *m = ResourceEventSource{} } + func (*ResourceEventSource) ProtoMessage() {} + func (*ResourceEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{91} ++ return fileDescriptor_e864cc3344a263b9, []int{92} + } + func (m *ResourceEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2628,7 +2656,7 @@ var xxx_messageInfo_ResourceEventSource proto.InternalMessageInfo + func (m *ResourceFilter) Reset() { *m = ResourceFilter{} } + func (*ResourceFilter) ProtoMessage() {} + func (*ResourceFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{92} ++ return fileDescriptor_e864cc3344a263b9, []int{93} + } + func (m *ResourceFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2656,7 +2684,7 @@ var xxx_messageInfo_ResourceFilter proto.InternalMessageInfo + func (m *S3Artifact) Reset() { *m = S3Artifact{} } + func (*S3Artifact) ProtoMessage() {} + func (*S3Artifact) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{93} ++ return fileDescriptor_e864cc3344a263b9, []int{94} + } + func (m *S3Artifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2684,7 +2712,7 @@ var xxx_messageInfo_S3Artifact proto.InternalMessageInfo + func (m *S3Bucket) Reset() { *m = S3Bucket{} } + func (*S3Bucket) ProtoMessage() {} + func (*S3Bucket) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{94} ++ return fileDescriptor_e864cc3344a263b9, []int{95} + } + func (m *S3Bucket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2712,7 +2740,7 @@ var xxx_messageInfo_S3Bucket proto.InternalMessageInfo + func (m *S3Filter) Reset() { *m = S3Filter{} } + func (*S3Filter) ProtoMessage() {} + func (*S3Filter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{95} ++ return fileDescriptor_e864cc3344a263b9, []int{96} + } + func (m *S3Filter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2740,7 +2768,7 @@ var xxx_messageInfo_S3Filter proto.InternalMessageInfo + func (m *SASLConfig) Reset() { *m = SASLConfig{} } + func (*SASLConfig) ProtoMessage() {} + func (*SASLConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{96} ++ return fileDescriptor_e864cc3344a263b9, []int{97} + } + func (m *SASLConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2768,7 +2796,7 @@ var xxx_messageInfo_SASLConfig proto.InternalMessageInfo + func (m *SFTPEventSource) Reset() { *m = SFTPEventSource{} } + func (*SFTPEventSource) ProtoMessage() {} + func (*SFTPEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{97} ++ return fileDescriptor_e864cc3344a263b9, []int{98} + } + func (m *SFTPEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2796,7 +2824,7 @@ var xxx_messageInfo_SFTPEventSource proto.InternalMessageInfo + func (m *SNSEventSource) Reset() { *m = SNSEventSource{} } + func (*SNSEventSource) ProtoMessage() {} + func (*SNSEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{98} ++ return fileDescriptor_e864cc3344a263b9, []int{99} + } + func (m *SNSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2824,7 +2852,7 @@ var xxx_messageInfo_SNSEventSource proto.InternalMessageInfo + func (m *SQSEventSource) Reset() { *m = SQSEventSource{} } + func (*SQSEventSource) ProtoMessage() {} + func (*SQSEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{99} ++ return fileDescriptor_e864cc3344a263b9, []int{100} + } + func (m *SQSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2852,7 +2880,7 @@ var xxx_messageInfo_SQSEventSource proto.InternalMessageInfo + func (m *SchemaRegistryConfig) Reset() { *m = SchemaRegistryConfig{} } + func (*SchemaRegistryConfig) ProtoMessage() {} + func (*SchemaRegistryConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{100} ++ return fileDescriptor_e864cc3344a263b9, []int{101} + } + func (m *SchemaRegistryConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2880,7 +2908,7 @@ var xxx_messageInfo_SchemaRegistryConfig proto.InternalMessageInfo + func (m *SecureHeader) Reset() { *m = SecureHeader{} } + func (*SecureHeader) ProtoMessage() {} + func (*SecureHeader) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{101} ++ return fileDescriptor_e864cc3344a263b9, []int{102} + } + func (m *SecureHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2908,7 +2936,7 @@ var xxx_messageInfo_SecureHeader proto.InternalMessageInfo + func (m *Selector) Reset() { *m = Selector{} } + func (*Selector) ProtoMessage() {} + func (*Selector) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{102} ++ return fileDescriptor_e864cc3344a263b9, []int{103} + } + func (m *Selector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2936,7 +2964,7 @@ var xxx_messageInfo_Selector proto.InternalMessageInfo + func (m *Sensor) Reset() { *m = Sensor{} } + func (*Sensor) ProtoMessage() {} + func (*Sensor) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{103} ++ return fileDescriptor_e864cc3344a263b9, []int{104} + } + func (m *Sensor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2964,7 +2992,7 @@ var xxx_messageInfo_Sensor proto.InternalMessageInfo + func (m *SensorList) Reset() { *m = SensorList{} } + func (*SensorList) ProtoMessage() {} + func (*SensorList) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{104} ++ return fileDescriptor_e864cc3344a263b9, []int{105} + } + func (m *SensorList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -2992,7 +3020,7 @@ var xxx_messageInfo_SensorList proto.InternalMessageInfo + func (m *SensorSpec) Reset() { *m = SensorSpec{} } + func (*SensorSpec) ProtoMessage() {} + func (*SensorSpec) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{105} ++ return fileDescriptor_e864cc3344a263b9, []int{106} + } + func (m *SensorSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3020,7 +3048,7 @@ var xxx_messageInfo_SensorSpec proto.InternalMessageInfo + func (m *SensorStatus) Reset() { *m = SensorStatus{} } + func (*SensorStatus) ProtoMessage() {} + func (*SensorStatus) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{106} ++ return fileDescriptor_e864cc3344a263b9, []int{107} + } + func (m *SensorStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3048,7 +3076,7 @@ var xxx_messageInfo_SensorStatus proto.InternalMessageInfo + func (m *Service) Reset() { *m = Service{} } + func (*Service) ProtoMessage() {} + func (*Service) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{107} ++ return fileDescriptor_e864cc3344a263b9, []int{108} + } + func (m *Service) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3076,7 +3104,7 @@ var xxx_messageInfo_Service proto.InternalMessageInfo + func (m *SlackEventSource) Reset() { *m = SlackEventSource{} } + func (*SlackEventSource) ProtoMessage() {} + func (*SlackEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{108} ++ return fileDescriptor_e864cc3344a263b9, []int{109} + } + func (m *SlackEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3104,7 +3132,7 @@ var xxx_messageInfo_SlackEventSource proto.InternalMessageInfo + func (m *SlackSender) Reset() { *m = SlackSender{} } + func (*SlackSender) ProtoMessage() {} + func (*SlackSender) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{109} ++ return fileDescriptor_e864cc3344a263b9, []int{110} + } + func (m *SlackSender) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3132,7 +3160,7 @@ var xxx_messageInfo_SlackSender proto.InternalMessageInfo + func (m *SlackThread) Reset() { *m = SlackThread{} } + func (*SlackThread) ProtoMessage() {} + func (*SlackThread) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{110} ++ return fileDescriptor_e864cc3344a263b9, []int{111} + } + func (m *SlackThread) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3160,7 +3188,7 @@ var xxx_messageInfo_SlackThread proto.InternalMessageInfo + func (m *SlackTrigger) Reset() { *m = SlackTrigger{} } + func (*SlackTrigger) ProtoMessage() {} + func (*SlackTrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{111} ++ return fileDescriptor_e864cc3344a263b9, []int{112} + } + func (m *SlackTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3188,7 +3216,7 @@ var xxx_messageInfo_SlackTrigger proto.InternalMessageInfo + func (m *StandardK8STrigger) Reset() { *m = StandardK8STrigger{} } + func (*StandardK8STrigger) ProtoMessage() {} + func (*StandardK8STrigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{112} ++ return fileDescriptor_e864cc3344a263b9, []int{113} + } + func (m *StandardK8STrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3216,7 +3244,7 @@ var xxx_messageInfo_StandardK8STrigger proto.InternalMessageInfo + func (m *Status) Reset() { *m = Status{} } + func (*Status) ProtoMessage() {} + func (*Status) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{113} ++ return fileDescriptor_e864cc3344a263b9, []int{114} + } + func (m *Status) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3244,7 +3272,7 @@ var xxx_messageInfo_Status proto.InternalMessageInfo + func (m *StatusPolicy) Reset() { *m = StatusPolicy{} } + func (*StatusPolicy) ProtoMessage() {} + func (*StatusPolicy) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{114} ++ return fileDescriptor_e864cc3344a263b9, []int{115} + } + func (m *StatusPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3272,7 +3300,7 @@ var xxx_messageInfo_StatusPolicy proto.InternalMessageInfo + func (m *StorageGridEventSource) Reset() { *m = StorageGridEventSource{} } + func (*StorageGridEventSource) ProtoMessage() {} + func (*StorageGridEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{115} ++ return fileDescriptor_e864cc3344a263b9, []int{116} + } + func (m *StorageGridEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3300,7 +3328,7 @@ var xxx_messageInfo_StorageGridEventSource proto.InternalMessageInfo + func (m *StorageGridFilter) Reset() { *m = StorageGridFilter{} } + func (*StorageGridFilter) ProtoMessage() {} + func (*StorageGridFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{116} ++ return fileDescriptor_e864cc3344a263b9, []int{117} + } + func (m *StorageGridFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3328,7 +3356,7 @@ var xxx_messageInfo_StorageGridFilter proto.InternalMessageInfo + func (m *StripeEventSource) Reset() { *m = StripeEventSource{} } + func (*StripeEventSource) ProtoMessage() {} + func (*StripeEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{117} ++ return fileDescriptor_e864cc3344a263b9, []int{118} + } + func (m *StripeEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3356,7 +3384,7 @@ var xxx_messageInfo_StripeEventSource proto.InternalMessageInfo + func (m *TLSConfig) Reset() { *m = TLSConfig{} } + func (*TLSConfig) ProtoMessage() {} + func (*TLSConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{118} ++ return fileDescriptor_e864cc3344a263b9, []int{119} + } + func (m *TLSConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3384,7 +3412,7 @@ var xxx_messageInfo_TLSConfig proto.InternalMessageInfo + func (m *Template) Reset() { *m = Template{} } + func (*Template) ProtoMessage() {} + func (*Template) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{119} ++ return fileDescriptor_e864cc3344a263b9, []int{120} + } + func (m *Template) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3412,7 +3440,7 @@ var xxx_messageInfo_Template proto.InternalMessageInfo + func (m *TimeFilter) Reset() { *m = TimeFilter{} } + func (*TimeFilter) ProtoMessage() {} + func (*TimeFilter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{120} ++ return fileDescriptor_e864cc3344a263b9, []int{121} + } + func (m *TimeFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3440,7 +3468,7 @@ var xxx_messageInfo_TimeFilter proto.InternalMessageInfo + func (m *Trigger) Reset() { *m = Trigger{} } + func (*Trigger) ProtoMessage() {} + func (*Trigger) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{121} ++ return fileDescriptor_e864cc3344a263b9, []int{122} + } + func (m *Trigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3468,7 +3496,7 @@ var xxx_messageInfo_Trigger proto.InternalMessageInfo + func (m *TriggerParameter) Reset() { *m = TriggerParameter{} } + func (*TriggerParameter) ProtoMessage() {} + func (*TriggerParameter) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{122} ++ return fileDescriptor_e864cc3344a263b9, []int{123} + } + func (m *TriggerParameter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3496,7 +3524,7 @@ var xxx_messageInfo_TriggerParameter proto.InternalMessageInfo + func (m *TriggerParameterSource) Reset() { *m = TriggerParameterSource{} } + func (*TriggerParameterSource) ProtoMessage() {} + func (*TriggerParameterSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{123} ++ return fileDescriptor_e864cc3344a263b9, []int{124} + } + func (m *TriggerParameterSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3524,7 +3552,7 @@ var xxx_messageInfo_TriggerParameterSource proto.InternalMessageInfo + func (m *TriggerPolicy) Reset() { *m = TriggerPolicy{} } + func (*TriggerPolicy) ProtoMessage() {} + func (*TriggerPolicy) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{124} ++ return fileDescriptor_e864cc3344a263b9, []int{125} + } + func (m *TriggerPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3552,7 +3580,7 @@ var xxx_messageInfo_TriggerPolicy proto.InternalMessageInfo + func (m *TriggerTemplate) Reset() { *m = TriggerTemplate{} } + func (*TriggerTemplate) ProtoMessage() {} + func (*TriggerTemplate) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{125} ++ return fileDescriptor_e864cc3344a263b9, []int{126} + } + func (m *TriggerTemplate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3580,7 +3608,7 @@ var xxx_messageInfo_TriggerTemplate proto.InternalMessageInfo + func (m *URLArtifact) Reset() { *m = URLArtifact{} } + func (*URLArtifact) ProtoMessage() {} + func (*URLArtifact) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{126} ++ return fileDescriptor_e864cc3344a263b9, []int{127} + } + func (m *URLArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3608,7 +3636,7 @@ var xxx_messageInfo_URLArtifact proto.InternalMessageInfo + func (m *ValueFromSource) Reset() { *m = ValueFromSource{} } + func (*ValueFromSource) ProtoMessage() {} + func (*ValueFromSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{127} ++ return fileDescriptor_e864cc3344a263b9, []int{128} + } + func (m *ValueFromSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3636,7 +3664,7 @@ var xxx_messageInfo_ValueFromSource proto.InternalMessageInfo + func (m *WatchPathConfig) Reset() { *m = WatchPathConfig{} } + func (*WatchPathConfig) ProtoMessage() {} + func (*WatchPathConfig) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{128} ++ return fileDescriptor_e864cc3344a263b9, []int{129} + } + func (m *WatchPathConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3664,7 +3692,7 @@ var xxx_messageInfo_WatchPathConfig proto.InternalMessageInfo + func (m *WebhookContext) Reset() { *m = WebhookContext{} } + func (*WebhookContext) ProtoMessage() {} + func (*WebhookContext) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{129} ++ return fileDescriptor_e864cc3344a263b9, []int{130} + } + func (m *WebhookContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3692,7 +3720,7 @@ var xxx_messageInfo_WebhookContext proto.InternalMessageInfo + func (m *WebhookEventSource) Reset() { *m = WebhookEventSource{} } + func (*WebhookEventSource) ProtoMessage() {} + func (*WebhookEventSource) Descriptor() ([]byte, []int) { +- return fileDescriptor_e864cc3344a263b9, []int{130} ++ return fileDescriptor_e864cc3344a263b9, []int{131} + } + func (m *WebhookEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +@@ -3754,6 +3782,7 @@ func init() { + proto.RegisterType((*ConditionsResetByTime)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConditionsResetByTime") + proto.RegisterType((*ConditionsResetCriteria)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConditionsResetCriteria") + proto.RegisterType((*ConfigMapPersistence)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConfigMapPersistence") ++ proto.RegisterType((*Container)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Container") + proto.RegisterType((*ContainerTemplate)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ContainerTemplate") + proto.RegisterType((*CustomTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CustomTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CustomTrigger.SpecEntry") +@@ -3930,818 +3959,824 @@ func init() { + } + + var fileDescriptor_e864cc3344a263b9 = []byte{ +- // 12967 bytes of a gzipped FileDescriptorProto +- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x6c, 0x24, 0xd9, +- 0x75, 0x18, 0xbc, 0xfd, 0x24, 0xfb, 0xf0, 0x35, 0x73, 0xe7, 0xb1, 0xbd, 0xe3, 0xdd, 0xe1, 0xb8, +- 0x17, 0xda, 0x6f, 0xd7, 0x5e, 0x91, 0xd2, 0x4a, 0xb2, 0xc7, 0xab, 0xcf, 0x6b, 0x35, 0x5f, 0x33, +- 0xdc, 0x21, 0x39, 0x9c, 0xd3, 0x9c, 0x19, 0xbd, 0xbc, 0xda, 0x62, 0xf7, 0x65, 0xb3, 0x96, 0xdd, +- 0x55, 0x3d, 0x55, 0xd5, 0x9c, 0xe1, 0x06, 0x92, 0xd7, 0x96, 0xb4, 0x96, 0x64, 0x45, 0x92, 0x05, +- 0xc1, 0x50, 0x02, 0xc7, 0x88, 0x61, 0x24, 0xb6, 0x93, 0x18, 0x08, 0x62, 0xc0, 0xf9, 0x1b, 0x24, +- 0x48, 0x22, 0x04, 0x0e, 0x60, 0x03, 0x76, 0x6c, 0x24, 0xc1, 0x20, 0x1a, 0x39, 0x09, 0x10, 0xc0, +- 0x79, 0xfc, 0x4a, 0x32, 0xf9, 0x13, 0xdc, 0x67, 0xdd, 0xaa, 0xae, 0x26, 0xd9, 0xac, 0x6e, 0xce, +- 0x0e, 0xe2, 0x5f, 0x64, 0xdf, 0x73, 0xee, 0x39, 0xb7, 0xee, 0xe3, 0xdc, 0x73, 0xcf, 0x3d, 0xe7, +- 0x5c, 0xb8, 0xde, 0xb4, 0x83, 0xdd, 0xee, 0xf6, 0x5c, 0xdd, 0x6d, 0xcf, 0x5b, 0x5e, 0xd3, 0xed, +- 0x78, 0xee, 0x3b, 0xfc, 0x9f, 0x0f, 0xd3, 0x7d, 0xea, 0x04, 0xfe, 0x7c, 0x67, 0xaf, 0x39, 0x6f, +- 0x75, 0x6c, 0x7f, 0x5e, 0xfe, 0xde, 0xff, 0xa8, 0xd5, 0xea, 0xec, 0x5a, 0x1f, 0x9d, 0x6f, 0x52, +- 0x87, 0x7a, 0x56, 0x40, 0x1b, 0x73, 0x1d, 0xcf, 0x0d, 0x5c, 0x72, 0x35, 0xa4, 0x34, 0xa7, 0x28, +- 0xf1, 0x7f, 0xbe, 0x20, 0x6a, 0xce, 0x75, 0xf6, 0x9a, 0x73, 0x8c, 0xd2, 0x9c, 0xfc, 0xad, 0x28, +- 0x5d, 0xfa, 0xb0, 0xd1, 0x86, 0xa6, 0xdb, 0x74, 0xe7, 0x39, 0xc1, 0xed, 0xee, 0x0e, 0xff, 0xc5, +- 0x7f, 0xf0, 0xff, 0x04, 0xa3, 0x4b, 0x95, 0xbd, 0xab, 0xfe, 0x9c, 0xed, 0xb2, 0x56, 0xcd, 0xd7, +- 0x5d, 0x8f, 0xce, 0xef, 0xf7, 0x34, 0xe6, 0xd2, 0xc7, 0x43, 0x9c, 0xb6, 0x55, 0xdf, 0xb5, 0x1d, +- 0xea, 0x1d, 0xa8, 0x4f, 0x99, 0xf7, 0xa8, 0xef, 0x76, 0xbd, 0x3a, 0x1d, 0xa8, 0x96, 0x3f, 0xdf, +- 0xa6, 0x81, 0x95, 0xc4, 0x6b, 0xbe, 0x5f, 0x2d, 0xaf, 0xeb, 0x04, 0x76, 0xbb, 0x97, 0xcd, 0x4f, +- 0x1d, 0x55, 0xc1, 0xaf, 0xef, 0xd2, 0xb6, 0x15, 0xaf, 0x57, 0xf9, 0xdf, 0x19, 0x38, 0x5b, 0x5d, +- 0xbf, 0xb5, 0xb9, 0xe8, 0x3a, 0x7e, 0xb7, 0x4d, 0x17, 0x5d, 0x67, 0xc7, 0x6e, 0x92, 0x4f, 0xc0, +- 0x44, 0x5d, 0x14, 0x78, 0x5b, 0x56, 0xb3, 0x9c, 0xb9, 0x92, 0x79, 0xb9, 0xb4, 0x70, 0xee, 0x07, +- 0x0f, 0x67, 0x9f, 0x79, 0xf4, 0x70, 0x76, 0x62, 0x31, 0x04, 0xa1, 0x89, 0x47, 0x5e, 0x81, 0x31, +- 0xab, 0x1b, 0xb8, 0xd5, 0xfa, 0x5e, 0x39, 0x7b, 0x25, 0xf3, 0xf2, 0xf8, 0xc2, 0x8c, 0xac, 0x32, +- 0x56, 0x15, 0xc5, 0xa8, 0xe0, 0x64, 0x1e, 0x4a, 0xf4, 0x41, 0xbd, 0xd5, 0xf5, 0xed, 0x7d, 0x5a, +- 0xce, 0x71, 0xe4, 0xb3, 0x12, 0xb9, 0xb4, 0xac, 0x00, 0x18, 0xe2, 0x30, 0xda, 0x8e, 0xbb, 0xe6, +- 0xd6, 0xad, 0x56, 0x39, 0x1f, 0xa5, 0xbd, 0x21, 0x8a, 0x51, 0xc1, 0xc9, 0x4b, 0x50, 0x74, 0xdc, +- 0xbb, 0x96, 0x1d, 0x94, 0x0b, 0x1c, 0x73, 0x5a, 0x62, 0x16, 0x37, 0x78, 0x29, 0x4a, 0x68, 0xe5, +- 0xbf, 0x4c, 0xc0, 0x0c, 0xfb, 0xf6, 0x65, 0x36, 0x77, 0x6a, 0x7c, 0xf8, 0xc8, 0x0b, 0x90, 0xeb, +- 0x7a, 0x2d, 0xf9, 0xc5, 0x13, 0xb2, 0x62, 0xee, 0x36, 0xae, 0x21, 0x2b, 0x27, 0x57, 0x61, 0x92, +- 0x3e, 0xa8, 0xef, 0x5a, 0x4e, 0x93, 0x6e, 0x58, 0x6d, 0xca, 0x3f, 0xb3, 0xb4, 0x70, 0x5e, 0xe2, +- 0x4d, 0x2e, 0x1b, 0x30, 0x8c, 0x60, 0x9a, 0x35, 0xb7, 0x0e, 0x3a, 0xe2, 0x9b, 0x13, 0x6a, 0x32, +- 0x18, 0x46, 0x30, 0xc9, 0x6b, 0x00, 0x9e, 0xdb, 0x0d, 0x6c, 0xa7, 0x79, 0x83, 0x1e, 0xf0, 0x8f, +- 0x2f, 0x2d, 0x10, 0x59, 0x0f, 0x50, 0x43, 0xd0, 0xc0, 0x22, 0xef, 0x67, 0xe0, 0x6c, 0xdd, 0x75, +- 0x1c, 0x5a, 0x0f, 0x6c, 0xd7, 0x59, 0xb0, 0xea, 0x7b, 0xee, 0xce, 0x0e, 0xef, 0x8e, 0x89, 0xd7, +- 0xaa, 0x73, 0x27, 0x5d, 0x55, 0x73, 0x92, 0xd0, 0xc2, 0x85, 0x47, 0x0f, 0x67, 0xcf, 0x2e, 0xc6, +- 0xe9, 0x63, 0x2f, 0x4b, 0xf2, 0x2a, 0x8c, 0xbf, 0xe3, 0xbb, 0xce, 0x82, 0xdb, 0x38, 0x28, 0x17, +- 0xf9, 0x68, 0x9c, 0x91, 0x4d, 0x1f, 0x7f, 0xb3, 0x76, 0x73, 0x83, 0x95, 0xa3, 0xc6, 0x20, 0x6f, +- 0x41, 0x2e, 0x68, 0xf9, 0xe5, 0x31, 0xde, 0xce, 0xc5, 0x93, 0xb7, 0x73, 0x6b, 0xad, 0x26, 0x66, +- 0xf2, 0xc2, 0x18, 0x1b, 0xbe, 0xad, 0xb5, 0x1a, 0x32, 0xc2, 0xe4, 0xab, 0x19, 0x18, 0x67, 0x4b, +- 0xae, 0x61, 0x05, 0x56, 0x79, 0xfc, 0x4a, 0xee, 0xe5, 0x89, 0xd7, 0xee, 0x9e, 0x9c, 0x4b, 0x6c, +- 0xee, 0xcc, 0xad, 0x4b, 0xca, 0xcb, 0x4e, 0xe0, 0x1d, 0x84, 0xdf, 0xa9, 0x8a, 0x51, 0xb3, 0x26, +- 0xdf, 0xcd, 0xc0, 0x8c, 0x1a, 0xe3, 0x25, 0x5a, 0x6f, 0x59, 0x1e, 0x2d, 0x97, 0xf8, 0x47, 0xd7, +- 0x52, 0x36, 0x27, 0x4a, 0x54, 0x76, 0xc2, 0xb9, 0x47, 0x0f, 0x67, 0x67, 0x62, 0x20, 0x8c, 0x37, +- 0x80, 0xcd, 0x99, 0xc9, 0x7b, 0x5d, 0xda, 0xd5, 0x2d, 0x02, 0xde, 0xa2, 0xcd, 0x74, 0x2d, 0xba, +- 0x65, 0x50, 0x94, 0xcd, 0x39, 0xc3, 0x26, 0xbc, 0x59, 0x8e, 0x11, 0xbe, 0xe4, 0x5d, 0x28, 0xf1, +- 0xdf, 0x0b, 0xb6, 0xd3, 0x28, 0x4f, 0xf0, 0x46, 0xac, 0x0f, 0xa1, 0x11, 0x8c, 0x9c, 0x6c, 0xc1, +- 0x14, 0x13, 0x33, 0xba, 0x10, 0x43, 0x76, 0xc4, 0x83, 0x31, 0x29, 0xd1, 0xca, 0x93, 0x9c, 0xf3, +- 0x8d, 0x74, 0x9c, 0x23, 0x72, 0x75, 0x61, 0x82, 0xc9, 0x2b, 0x59, 0x84, 0x8a, 0x11, 0xb1, 0x20, +- 0x6f, 0x75, 0x83, 0xdd, 0xf2, 0x54, 0xda, 0x69, 0xbf, 0x60, 0xf9, 0x76, 0xbd, 0xda, 0x0d, 0x76, +- 0x17, 0xc6, 0x1f, 0x3d, 0x9c, 0xcd, 0xb3, 0xff, 0x90, 0x93, 0x26, 0x08, 0xa5, 0xae, 0xd7, 0xaa, +- 0xd1, 0xba, 0x47, 0x83, 0xf2, 0x34, 0xe7, 0xf3, 0xa1, 0x39, 0xb1, 0x65, 0x30, 0x52, 0x73, 0x6c, +- 0xcf, 0x9b, 0xdb, 0xff, 0xe8, 0x9c, 0xc0, 0xb8, 0x41, 0x0f, 0x6a, 0xb4, 0x45, 0xeb, 0x81, 0xeb, +- 0x89, 0xae, 0xba, 0x8d, 0x6b, 0x02, 0x82, 0x21, 0x19, 0xe2, 0x42, 0x71, 0xc7, 0x6e, 0x05, 0xd4, +- 0x2b, 0xcf, 0xa4, 0xed, 0x29, 0x63, 0x15, 0xad, 0x70, 0x92, 0x0b, 0xc0, 0xe4, 0xb5, 0xf8, 0x1f, +- 0x25, 0x9b, 0x4b, 0x9f, 0x84, 0xa9, 0xc8, 0x12, 0x23, 0x67, 0x20, 0xb7, 0x47, 0x0f, 0x84, 0xb0, +- 0x46, 0xf6, 0x2f, 0x39, 0x0f, 0x85, 0x7d, 0xab, 0xd5, 0x95, 0x82, 0x19, 0xc5, 0x8f, 0xd7, 0xb3, +- 0x57, 0x33, 0x95, 0x3f, 0xca, 0xc0, 0x73, 0x7d, 0x57, 0x08, 0xdb, 0x5d, 0x1a, 0x5d, 0xcf, 0xda, +- 0x6e, 0x51, 0x4e, 0xcd, 0xd8, 0x5d, 0x96, 0x44, 0x31, 0x2a, 0x38, 0x13, 0xc7, 0x6c, 0x13, 0x5b, +- 0xa2, 0x2d, 0x1a, 0x50, 0xb9, 0xcf, 0x69, 0x71, 0x5c, 0xd5, 0x10, 0x34, 0xb0, 0x98, 0x14, 0xb4, +- 0x9d, 0x80, 0x7a, 0x8e, 0xd5, 0x92, 0x9b, 0x9d, 0x96, 0x0e, 0xab, 0xb2, 0x1c, 0x35, 0x86, 0xb1, +- 0x7f, 0xe5, 0x0f, 0xdd, 0xbf, 0x7e, 0x16, 0xce, 0x25, 0x4c, 0x6e, 0xa3, 0x7a, 0xe6, 0xd0, 0xea, +- 0xbf, 0x95, 0x85, 0x8b, 0xc9, 0x2b, 0x94, 0x5c, 0x81, 0xbc, 0xc3, 0xb6, 0x37, 0xb1, 0x0d, 0x4e, +- 0x4a, 0x02, 0x79, 0xbe, 0xad, 0x71, 0x88, 0xd9, 0x61, 0xd9, 0x81, 0x3a, 0x2c, 0x77, 0xac, 0x0e, +- 0x8b, 0xa8, 0x07, 0xf9, 0x63, 0xa8, 0x07, 0xc7, 0xdc, 0xf3, 0x19, 0x61, 0xcb, 0x6b, 0x76, 0xdb, +- 0x6c, 0xfe, 0xf1, 0x0d, 0xa9, 0x14, 0x12, 0xae, 0x2a, 0x00, 0x86, 0x38, 0x95, 0xc7, 0x79, 0x38, +- 0x53, 0xbd, 0x5b, 0x5b, 0xb3, 0xda, 0xdb, 0x0d, 0x6b, 0xcb, 0xb3, 0x9b, 0x4d, 0xea, 0xb1, 0xcd, +- 0x7c, 0xa7, 0xeb, 0xf0, 0x8d, 0x6e, 0x23, 0xec, 0x27, 0xbd, 0x99, 0xaf, 0x18, 0x30, 0x8c, 0x60, +- 0xb2, 0x85, 0x68, 0xd5, 0xeb, 0xd4, 0xf7, 0xd9, 0x5e, 0x9e, 0x1d, 0x78, 0x21, 0x56, 0x55, 0x5d, +- 0x0c, 0xc9, 0x30, 0x9a, 0xbe, 0x42, 0xe7, 0xfd, 0x3b, 0x18, 0x4d, 0x5d, 0x8c, 0x21, 0x19, 0xd6, +- 0x9f, 0x1e, 0x6d, 0xda, 0xae, 0x23, 0x15, 0x0e, 0xdd, 0x9f, 0xc8, 0x4b, 0x51, 0x42, 0x49, 0x17, +- 0xc6, 0x3a, 0xd6, 0x41, 0xcb, 0xb5, 0x1a, 0xe5, 0x02, 0xdf, 0x4f, 0xdf, 0x4c, 0xb1, 0x6b, 0x8b, +- 0xde, 0xdd, 0xb4, 0x3c, 0xab, 0x4d, 0x99, 0x10, 0xd0, 0x73, 0x6a, 0x53, 0xb0, 0x40, 0xc5, 0x8b, +- 0x7c, 0x09, 0xa0, 0xa3, 0xd0, 0xd8, 0x38, 0x0e, 0x9b, 0xb3, 0x9e, 0x9f, 0xba, 0xc8, 0x47, 0x83, +- 0x23, 0x79, 0x1d, 0xa6, 0x6d, 0x67, 0xdf, 0xad, 0x5b, 0x6c, 0x60, 0xb9, 0x3e, 0x37, 0x26, 0xf4, +- 0xb2, 0x47, 0x0f, 0x67, 0xa7, 0x57, 0x23, 0x10, 0x8c, 0x61, 0xb2, 0xa5, 0xe3, 0xb9, 0x2d, 0x5a, +- 0xc5, 0x8d, 0xf2, 0x38, 0xaf, 0xa4, 0x3f, 0x13, 0x45, 0x31, 0x2a, 0x78, 0xe5, 0x15, 0x28, 0x56, +- 0xdb, 0x6e, 0xd7, 0x09, 0xc8, 0xac, 0x12, 0x6c, 0x6c, 0xaa, 0x4d, 0x2e, 0x94, 0x1e, 0x3d, 0x9c, +- 0x2d, 0xdc, 0x61, 0x05, 0x52, 0xc6, 0x55, 0xfe, 0x32, 0x0b, 0xe7, 0xaa, 0x5e, 0xd3, 0xbd, 0xeb, +- 0x7a, 0x7b, 0x3b, 0x2d, 0xf7, 0xbe, 0x9a, 0xaa, 0x0e, 0x14, 0xc5, 0xc9, 0x84, 0xd7, 0x4c, 0xd5, +- 0x4b, 0x55, 0x2f, 0xb0, 0x77, 0xac, 0x7a, 0xb0, 0x26, 0xbf, 0x46, 0x08, 0x69, 0x21, 0xb6, 0x51, +- 0x72, 0x21, 0xd7, 0xa1, 0xe4, 0x76, 0xd8, 0x11, 0x83, 0xcd, 0x1d, 0xa1, 0x1e, 0xff, 0x84, 0x5a, +- 0x60, 0x37, 0x15, 0xe0, 0xf1, 0xc3, 0xd9, 0x0b, 0x66, 0x63, 0x35, 0x00, 0xc3, 0xca, 0xb1, 0x31, +- 0xce, 0x9d, 0xfa, 0x18, 0x3f, 0x0f, 0x79, 0xcb, 0x6b, 0xfa, 0xe5, 0xfc, 0x95, 0xdc, 0xcb, 0x25, +- 0xb9, 0xa3, 0x7a, 0x4d, 0x1f, 0x79, 0x69, 0xe5, 0xfd, 0x02, 0x9c, 0x89, 0x77, 0x08, 0xf9, 0x3c, +- 0x64, 0xfd, 0x8f, 0xc9, 0x8e, 0x5e, 0x3a, 0x79, 0x53, 0x6b, 0x1f, 0x53, 0x94, 0x17, 0x8a, 0x8f, +- 0x1e, 0xce, 0x66, 0x6b, 0x1f, 0xc3, 0xac, 0xff, 0x31, 0x52, 0x81, 0xa2, 0xed, 0xb4, 0x6c, 0x47, +- 0x1d, 0x3b, 0x78, 0xf7, 0xaf, 0xf2, 0x12, 0x94, 0x10, 0xd2, 0x80, 0xfc, 0x8e, 0xdd, 0xa2, 0x52, +- 0x0c, 0xac, 0x9c, 0xbc, 0x0d, 0x2b, 0x76, 0x8b, 0xea, 0x56, 0xf0, 0x8f, 0x67, 0x25, 0xc8, 0xa9, +- 0x93, 0xb7, 0xc5, 0x29, 0x29, 0xcf, 0x99, 0x2c, 0x9f, 0x9c, 0xc9, 0x6d, 0x5c, 0xd3, 0x3c, 0xc6, +- 0x22, 0x07, 0xad, 0xdb, 0x50, 0xaa, 0xf3, 0xbd, 0xa8, 0x6d, 0x75, 0xe4, 0xb9, 0xe5, 0xe5, 0x24, +- 0x99, 0x26, 0x36, 0xac, 0x75, 0xab, 0xd3, 0x23, 0xd6, 0x16, 0x55, 0x75, 0x0c, 0x29, 0xb1, 0x86, +- 0x37, 0xed, 0x80, 0x0b, 0xfe, 0x54, 0x0d, 0xbf, 0x66, 0x07, 0xd1, 0x86, 0x5f, 0xb3, 0x03, 0x64, +- 0xa4, 0x89, 0x0b, 0xe3, 0xca, 0x16, 0x20, 0xcf, 0x31, 0x29, 0xd8, 0xdc, 0xb8, 0x5a, 0x43, 0x49, +- 0x6c, 0x61, 0x92, 0x69, 0x0b, 0xea, 0x17, 0x6a, 0x26, 0x95, 0xdf, 0xcf, 0xc3, 0x85, 0xea, 0xbb, +- 0x5d, 0x8f, 0x72, 0x25, 0xea, 0x7a, 0x77, 0xdb, 0x57, 0x4b, 0xff, 0x0a, 0xe4, 0x77, 0xee, 0x35, +- 0x9c, 0xf8, 0x2e, 0xbe, 0x72, 0x6b, 0x69, 0x03, 0x39, 0x84, 0x89, 0xa2, 0xdd, 0xee, 0xb6, 0x71, +- 0x92, 0xd5, 0xa2, 0xe8, 0xba, 0x28, 0x46, 0x05, 0x27, 0x1d, 0x38, 0xe7, 0xef, 0x5a, 0x1e, 0x6d, +- 0xe8, 0x2d, 0x88, 0x57, 0x1b, 0x68, 0xbb, 0x79, 0xf6, 0xd1, 0xc3, 0xd9, 0x73, 0xb5, 0x5e, 0x2a, +- 0x98, 0x44, 0x9a, 0x34, 0x60, 0x26, 0x56, 0x2c, 0x27, 0xdc, 0x31, 0xb9, 0xf1, 0x53, 0x4f, 0x8c, +- 0x1b, 0xc6, 0x49, 0xfe, 0x3f, 0xba, 0x81, 0x55, 0xde, 0x2b, 0xc0, 0x73, 0xe1, 0xac, 0xf1, 0xaf, +- 0x77, 0xb7, 0x4d, 0x2b, 0xc8, 0xd1, 0x33, 0xa7, 0xcf, 0x74, 0xc8, 0x9e, 0xea, 0x74, 0xc8, 0x0d, +- 0x7f, 0x3a, 0x18, 0x2b, 0x22, 0x7f, 0xc4, 0x8a, 0xf8, 0xb6, 0x69, 0x4c, 0x10, 0x73, 0xc7, 0x4a, +- 0xb1, 0xb9, 0xf6, 0x1b, 0x8c, 0x01, 0xcc, 0x0a, 0xe1, 0x89, 0xac, 0xf8, 0x14, 0x9c, 0xc8, 0x7e, +- 0xad, 0x08, 0xcf, 0xf3, 0xaf, 0xe6, 0x07, 0x90, 0x5a, 0xe0, 0x7a, 0x56, 0x93, 0x9a, 0xb3, 0xf0, +- 0x4d, 0x20, 0xbe, 0x28, 0xad, 0xd6, 0xeb, 0x4c, 0x0b, 0x32, 0x74, 0xed, 0x4b, 0xb2, 0x1b, 0x48, +- 0xad, 0x07, 0x03, 0x13, 0x6a, 0x91, 0x26, 0x9c, 0x09, 0x8d, 0x53, 0xb5, 0xc0, 0xb3, 0x9d, 0xe6, +- 0x60, 0x93, 0xf5, 0xfc, 0xa3, 0x87, 0xb3, 0x67, 0x16, 0x63, 0x24, 0xb0, 0x87, 0x28, 0x3b, 0x60, +- 0x70, 0x6b, 0x82, 0x96, 0x8e, 0xc6, 0x01, 0xe3, 0x96, 0x02, 0x60, 0x88, 0x13, 0xb1, 0x90, 0xe5, +- 0x8f, 0xb4, 0x90, 0xbd, 0x00, 0xb9, 0x46, 0xeb, 0x9e, 0x3c, 0xe4, 0x68, 0xfb, 0xe4, 0xd2, 0xda, +- 0x2d, 0x64, 0xe5, 0xe4, 0xbb, 0xe6, 0x9c, 0x14, 0x52, 0xa5, 0x91, 0x72, 0x4e, 0xf6, 0x19, 0x9d, +- 0x13, 0x4d, 0xcb, 0xb1, 0x53, 0x99, 0x96, 0xe4, 0x93, 0x30, 0xd5, 0xa0, 0x75, 0xb7, 0x41, 0xd7, +- 0xa9, 0xef, 0x5b, 0x4d, 0xca, 0xf5, 0xec, 0xf1, 0x85, 0x0b, 0xb2, 0x8d, 0x53, 0x4b, 0x26, 0x10, +- 0xa3, 0xb8, 0x64, 0x11, 0xce, 0xde, 0xb7, 0xec, 0x60, 0xcb, 0x6e, 0xd3, 0x55, 0xa7, 0x46, 0xeb, +- 0xae, 0xd3, 0xf0, 0xb9, 0x71, 0xae, 0x20, 0xcc, 0x9e, 0x77, 0xe3, 0x40, 0xec, 0xc5, 0x4f, 0xb7, +- 0x30, 0xfe, 0xac, 0x08, 0x97, 0x78, 0xd7, 0xd7, 0xa8, 0xb7, 0x6f, 0xd7, 0xe9, 0x42, 0xd7, 0x37, +- 0x97, 0x45, 0xd2, 0x54, 0xce, 0x8c, 0x7c, 0x2a, 0x67, 0x8f, 0x31, 0x95, 0xe7, 0xa1, 0x14, 0xb8, +- 0x1d, 0xbb, 0x9e, 0x34, 0xf7, 0xb7, 0x14, 0x00, 0x43, 0x1c, 0xb2, 0x04, 0x67, 0xfc, 0xee, 0xb6, +- 0x5f, 0xf7, 0xec, 0x8e, 0x3e, 0x4b, 0x0b, 0xb1, 0x5b, 0x96, 0xf5, 0xce, 0xd4, 0x62, 0x70, 0xec, +- 0xa9, 0xa1, 0xac, 0xc6, 0x85, 0x51, 0x59, 0x8d, 0x07, 0xb3, 0x61, 0x7f, 0xc7, 0x5c, 0x82, 0x63, +- 0x7c, 0x09, 0x6e, 0xa7, 0x5c, 0x82, 0x89, 0xf3, 0xe0, 0x44, 0x0b, 0x70, 0xfc, 0x74, 0x16, 0xe0, +- 0x67, 0xe0, 0xd9, 0x9d, 0x6e, 0xab, 0x75, 0x70, 0xab, 0x6b, 0xb5, 0xec, 0x1d, 0x9b, 0x36, 0xd8, +- 0x38, 0xf9, 0x1d, 0xab, 0x2e, 0xcc, 0xdc, 0xa5, 0x85, 0x59, 0xd9, 0xda, 0x67, 0x57, 0x92, 0xd1, +- 0xb0, 0x5f, 0xfd, 0x74, 0x2b, 0xeb, 0xbd, 0x02, 0x5c, 0x8c, 0xf5, 0xa8, 0x52, 0x96, 0xff, 0x6a, +- 0x55, 0x9d, 0xf2, 0xaa, 0x32, 0x14, 0xef, 0xe2, 0x13, 0x53, 0xbc, 0xc7, 0x4e, 0x5d, 0xf1, 0xfe, +- 0xcb, 0x2c, 0x8c, 0xa9, 0xcb, 0xb1, 0x7b, 0x30, 0xde, 0xe8, 0x4a, 0x53, 0x89, 0x98, 0x6b, 0xd7, +- 0x4e, 0xde, 0x92, 0x55, 0x27, 0xf8, 0xa9, 0x8f, 0xdf, 0xf4, 0xc4, 0x2c, 0x13, 0xa7, 0xc5, 0x25, +- 0x49, 0x1c, 0x35, 0x1b, 0xd2, 0x80, 0x22, 0x3b, 0xb4, 0xba, 0x9e, 0xd4, 0x7e, 0x3e, 0x95, 0x42, +- 0x34, 0x71, 0xcb, 0x94, 0x5c, 0xff, 0x9c, 0x26, 0x4a, 0xda, 0x8c, 0xcb, 0x3b, 0x76, 0xc0, 0x04, +- 0x4e, 0x6e, 0x98, 0x5c, 0xde, 0xe4, 0x34, 0x51, 0xd2, 0x26, 0x2f, 0x42, 0xc1, 0x0f, 0x68, 0xc7, +- 0xe7, 0x93, 0xbb, 0xb0, 0x30, 0x25, 0x7b, 0xbe, 0x50, 0x63, 0x85, 0x28, 0x60, 0x95, 0xdf, 0xcb, +- 0x40, 0x49, 0xdf, 0x8b, 0x90, 0x9b, 0x30, 0xde, 0xf5, 0xa9, 0xa7, 0x8d, 0xdb, 0xc7, 0x5e, 0xdd, +- 0xbc, 0x3f, 0x6f, 0xcb, 0xaa, 0xa8, 0x89, 0x30, 0x82, 0x1d, 0xcb, 0xf7, 0xef, 0xbb, 0x5e, 0x63, +- 0x30, 0x7d, 0x92, 0x13, 0xdc, 0x94, 0x55, 0x51, 0x13, 0xa9, 0xfc, 0x69, 0x06, 0xa6, 0x16, 0xec, +- 0x60, 0xbb, 0x5b, 0xdf, 0xa3, 0x01, 0x6f, 0x73, 0x1b, 0x0a, 0xdb, 0xec, 0x03, 0x64, 0x83, 0xd7, +- 0x52, 0xdc, 0x0f, 0x29, 0xba, 0xe1, 0x45, 0x11, 0x37, 0x24, 0xf2, 0x9f, 0x28, 0xb8, 0x90, 0xdb, +- 0x00, 0xae, 0xd5, 0x0d, 0x76, 0xb7, 0xdc, 0x3d, 0xea, 0x0c, 0xf6, 0x4d, 0xd3, 0x6c, 0xde, 0xdf, +- 0xac, 0xaa, 0xca, 0x68, 0x10, 0xaa, 0xfc, 0x41, 0x06, 0x48, 0x2f, 0xff, 0xa7, 0x60, 0x40, 0xfe, +- 0xed, 0x18, 0x9c, 0xd7, 0x0d, 0x8f, 0x1d, 0x4f, 0x1a, 0xfc, 0xb6, 0xe2, 0xba, 0xeb, 0xee, 0xdd, +- 0x74, 0x56, 0x6c, 0xc7, 0xf6, 0x77, 0xe5, 0x9d, 0x8b, 0x3e, 0x9e, 0x2c, 0xf5, 0x60, 0x60, 0x42, +- 0x2d, 0xf2, 0x0d, 0x53, 0x69, 0xc8, 0x72, 0xa1, 0xf4, 0xf9, 0x21, 0x8c, 0xf3, 0x49, 0xd5, 0x85, +- 0xb1, 0xfb, 0x74, 0x7b, 0xd7, 0x75, 0xf7, 0xe4, 0xf2, 0xbd, 0x7e, 0xf2, 0xa6, 0xdc, 0x15, 0x84, +- 0x16, 0x5d, 0x27, 0xa0, 0x0f, 0x02, 0x71, 0x01, 0x2a, 0xcb, 0x50, 0x71, 0x21, 0x54, 0x5e, 0x80, +- 0xe6, 0xd3, 0xca, 0xc0, 0xc8, 0xc2, 0xe9, 0xb9, 0x04, 0xad, 0x40, 0x51, 0x54, 0xe0, 0xa7, 0x75, +- 0x69, 0x3f, 0x15, 0x47, 0x6e, 0x94, 0x10, 0xf2, 0x61, 0x28, 0xb8, 0xf7, 0x1d, 0x79, 0x82, 0x2e, +- 0x2d, 0x3c, 0x2b, 0xbb, 0x69, 0x66, 0x89, 0x76, 0x3c, 0x5a, 0xb7, 0x02, 0xda, 0xb8, 0xc9, 0xc0, +- 0x28, 0xb0, 0xc8, 0xff, 0x0f, 0xc0, 0x5a, 0x47, 0xeb, 0xfc, 0xee, 0x45, 0xdc, 0x01, 0x3c, 0x2f, +- 0xeb, 0x9c, 0x0f, 0xeb, 0x6c, 0x6a, 0x1c, 0x34, 0xf0, 0xc9, 0x75, 0x98, 0xf6, 0x68, 0xc7, 0xf5, +- 0xed, 0xc0, 0xf5, 0x0e, 0x6a, 0xad, 0x6e, 0x53, 0x5e, 0x08, 0x5c, 0x91, 0x14, 0xca, 0x21, 0x05, +- 0x8c, 0xe0, 0x61, 0xac, 0x1e, 0xf9, 0xe5, 0x0c, 0x4c, 0xea, 0x22, 0x9b, 0xb2, 0x03, 0x4b, 0x2e, +- 0xdd, 0xb5, 0xb9, 0xee, 0xca, 0x90, 0x73, 0x78, 0xc1, 0x85, 0x06, 0x2b, 0x8c, 0x30, 0x36, 0x74, +- 0x4d, 0x78, 0x0a, 0x6c, 0x10, 0xef, 0xc2, 0xb9, 0x84, 0x0f, 0x65, 0x3b, 0x8b, 0x98, 0x05, 0xc2, +- 0xd8, 0xa0, 0x77, 0x96, 0xc8, 0xd8, 0xbf, 0xd1, 0x33, 0x7a, 0x42, 0x9b, 0xbb, 0x28, 0xb1, 0xa7, +- 0x0f, 0x1f, 0xb3, 0xca, 0x7f, 0x9c, 0x80, 0x4b, 0x9a, 0x39, 0x53, 0x48, 0xa9, 0x67, 0x8a, 0x17, +- 0x63, 0x15, 0x66, 0x4e, 0x65, 0x15, 0x46, 0xe7, 0x72, 0x36, 0xf5, 0x5c, 0xce, 0x9d, 0x70, 0x2e, +- 0xbf, 0x0c, 0xe3, 0x92, 0xae, 0xba, 0x7b, 0x11, 0xa2, 0x59, 0x96, 0xa1, 0x86, 0x92, 0xbf, 0x1e, +- 0x9f, 0xf5, 0xc2, 0x0a, 0x57, 0x1b, 0xc2, 0xac, 0x17, 0xe3, 0x31, 0xe0, 0xdc, 0x0f, 0x05, 0x4c, +- 0xb1, 0xaf, 0x80, 0xd9, 0x83, 0x17, 0xfc, 0x3d, 0xbb, 0xb3, 0xe0, 0x59, 0x4e, 0x7d, 0x17, 0xe9, +- 0x8e, 0xbf, 0xc8, 0xdd, 0x11, 0x1a, 0x37, 0x9d, 0x9b, 0x1d, 0xea, 0x6c, 0x22, 0x17, 0x22, 0xe3, +- 0x0b, 0x1f, 0x92, 0xec, 0x5e, 0xa8, 0x1d, 0x86, 0x8c, 0x87, 0xd3, 0x22, 0xd7, 0xe0, 0xac, 0xeb, +- 0x08, 0xab, 0xcd, 0x26, 0xf5, 0x04, 0x54, 0x1a, 0x43, 0x9e, 0x93, 0x0c, 0xce, 0xde, 0x8c, 0x23, +- 0x60, 0x6f, 0x1d, 0xf2, 0x69, 0x98, 0x10, 0xf7, 0xcd, 0x42, 0x2b, 0x28, 0x0d, 0xb2, 0xb1, 0xce, +- 0x3c, 0x7a, 0x38, 0x3b, 0x51, 0x0d, 0x6b, 0xa3, 0x49, 0x8a, 0xbc, 0x05, 0x53, 0x72, 0x02, 0x4a, +- 0xef, 0x14, 0x18, 0x84, 0xf6, 0xd9, 0x47, 0x0f, 0x67, 0xa7, 0xee, 0x9a, 0xf5, 0x31, 0x4a, 0x8e, +- 0xdc, 0x81, 0x8b, 0xdb, 0x6a, 0x50, 0x7d, 0x3e, 0xa8, 0x0b, 0x96, 0x4f, 0x6f, 0xe3, 0x1a, 0xf7, +- 0x2c, 0x2a, 0x2d, 0x5c, 0x96, 0xfd, 0x70, 0x31, 0x36, 0xf4, 0x12, 0x0b, 0xfb, 0xd4, 0xee, 0xb3, +- 0xfb, 0x4f, 0x9e, 0x68, 0xf7, 0x8f, 0x98, 0x0c, 0xa6, 0xd2, 0x9a, 0x0c, 0xfa, 0xcb, 0x94, 0x13, +- 0x99, 0x0c, 0xa6, 0x4f, 0xc7, 0x64, 0x20, 0x8f, 0x9b, 0x33, 0xa3, 0x3a, 0x6e, 0x7e, 0x12, 0xa6, +- 0xea, 0xbb, 0xb4, 0xbe, 0xc7, 0xfd, 0x6d, 0xf6, 0xad, 0x56, 0xf9, 0x0c, 0x1f, 0x7e, 0x6d, 0x13, +- 0x5c, 0x34, 0x81, 0x18, 0xc5, 0x4d, 0xb7, 0xc7, 0x7c, 0x3b, 0x03, 0xcf, 0xf5, 0x95, 0x2b, 0xe4, +- 0xb5, 0x88, 0xd4, 0xcd, 0x44, 0xbd, 0x3b, 0xfb, 0xc8, 0xda, 0xb4, 0x3b, 0xcf, 0x1f, 0x66, 0xa1, +- 0xb4, 0xd0, 0xf5, 0xa5, 0xb3, 0xcf, 0x36, 0xe4, 0x1d, 0x2b, 0xf0, 0xd3, 0x5f, 0x5b, 0x6f, 0x54, +- 0xb7, 0x54, 0xdf, 0x73, 0xd5, 0x8b, 0xfd, 0x46, 0x4e, 0x9b, 0xec, 0x43, 0xe9, 0x1d, 0x1a, 0xf8, +- 0x81, 0x47, 0xad, 0xb6, 0x54, 0xcb, 0x57, 0x4f, 0xce, 0xe8, 0x4d, 0x1a, 0xd4, 0x38, 0x29, 0xd3, +- 0x9d, 0x4f, 0x17, 0x62, 0xc8, 0x8a, 0xd4, 0xa1, 0xb0, 0x67, 0xed, 0xec, 0x59, 0x52, 0x91, 0x5d, +- 0x48, 0x71, 0x15, 0xcb, 0xc8, 0x2c, 0x74, 0x7d, 0x71, 0x62, 0xe2, 0xbf, 0x50, 0xd0, 0xae, 0x7c, +- 0xaf, 0x00, 0xe7, 0x16, 0xad, 0x16, 0x75, 0x1a, 0x56, 0x64, 0x07, 0x7f, 0x15, 0xc6, 0xfd, 0xfa, +- 0x2e, 0x6d, 0x74, 0x5b, 0xea, 0xd6, 0x42, 0xaf, 0xb8, 0x9a, 0x2c, 0x47, 0x8d, 0xa1, 0x7d, 0xc4, +- 0xd8, 0xdc, 0xcc, 0x46, 0xb1, 0xf5, 0xb4, 0xd4, 0x18, 0xe4, 0x75, 0x98, 0x96, 0xce, 0x4f, 0xae, +- 0xb3, 0x64, 0x05, 0x54, 0x38, 0x48, 0x48, 0x07, 0x94, 0xe5, 0x08, 0x04, 0x63, 0x98, 0x8c, 0x53, +- 0x60, 0xb7, 0xe9, 0xbb, 0xae, 0xa3, 0xec, 0x42, 0x9a, 0xd3, 0x96, 0x2c, 0x47, 0x8d, 0x41, 0xbe, +- 0xde, 0x7b, 0xcd, 0xf5, 0xb9, 0x93, 0x77, 0x63, 0x42, 0x3f, 0x0d, 0x20, 0x95, 0xbe, 0x08, 0x13, +- 0x1d, 0xea, 0xf9, 0xb6, 0x1f, 0x50, 0xa7, 0x4e, 0xe5, 0x2d, 0xd7, 0x9b, 0x29, 0x45, 0xd3, 0x66, +- 0x48, 0x51, 0xec, 0x55, 0x46, 0x01, 0x9a, 0xfc, 0x4e, 0xdd, 0x8e, 0x9a, 0x4e, 0xee, 0x3c, 0x80, +- 0xf3, 0x8b, 0x56, 0x50, 0xdf, 0xed, 0x76, 0xc4, 0x32, 0x51, 0x26, 0xa0, 0x57, 0x60, 0x8c, 0x3a, +- 0xd6, 0x76, 0x8b, 0x36, 0xe2, 0xbe, 0x8e, 0xcb, 0xa2, 0x18, 0x15, 0x9c, 0x7c, 0x02, 0x26, 0xda, +- 0xd6, 0x03, 0x65, 0x46, 0x92, 0xd3, 0x52, 0xc7, 0x01, 0xac, 0x87, 0x20, 0x34, 0xf1, 0x2a, 0x7f, +- 0x96, 0x85, 0xd2, 0xa2, 0xeb, 0x34, 0x6c, 0xce, 0xef, 0xa3, 0x90, 0x0f, 0x0e, 0x3a, 0x6a, 0x09, +- 0xbc, 0xa0, 0x2e, 0x93, 0xb7, 0x0e, 0x3a, 0xf4, 0x31, 0x13, 0xbc, 0x0a, 0x91, 0x3b, 0x4b, 0x71, +- 0x54, 0xb2, 0x06, 0x45, 0x3f, 0xb0, 0x82, 0xae, 0x2f, 0x59, 0x7e, 0x5c, 0x79, 0x9f, 0xd5, 0x78, +- 0xe9, 0xe3, 0x87, 0xb3, 0x09, 0x01, 0x1b, 0x73, 0x9a, 0x92, 0xc0, 0x42, 0x49, 0x83, 0xec, 0x03, +- 0x69, 0x59, 0x7e, 0xb0, 0xe5, 0x59, 0x8e, 0x2f, 0x38, 0xd9, 0xda, 0x73, 0xe1, 0x27, 0x0c, 0x3d, +- 0x43, 0x07, 0x4e, 0x84, 0xc3, 0xc6, 0x66, 0x1e, 0xd3, 0x3c, 0x58, 0x8d, 0x70, 0x5b, 0x5f, 0xeb, +- 0xa1, 0x86, 0x09, 0x1c, 0x84, 0x0f, 0x9d, 0xe5, 0x27, 0xf9, 0xd0, 0xb1, 0x52, 0x94, 0x50, 0x36, +- 0x20, 0x6d, 0x79, 0x51, 0x55, 0x88, 0xde, 0x39, 0xab, 0x2b, 0x2a, 0x05, 0xaf, 0x34, 0xe1, 0x82, +- 0xfe, 0x4a, 0x1f, 0xa9, 0x4f, 0x83, 0x85, 0x03, 0xce, 0xeb, 0x0a, 0xe4, 0xeb, 0x9e, 0xdb, 0x73, +- 0x63, 0xbf, 0xe8, 0xb9, 0x0e, 0x72, 0x48, 0x64, 0xd5, 0x67, 0x8f, 0x5a, 0xf5, 0x95, 0x6f, 0x65, +- 0xe0, 0xd9, 0x18, 0xa7, 0x45, 0xcf, 0x0e, 0xa8, 0x67, 0x5b, 0xc4, 0x87, 0xe2, 0x36, 0xe7, 0x2a, +- 0xb7, 0x8c, 0x9b, 0x29, 0xc4, 0x41, 0xd2, 0xc7, 0x88, 0xa5, 0x20, 0xfe, 0x47, 0xc9, 0xaa, 0xf2, +- 0x25, 0x38, 0xaf, 0x7d, 0x7d, 0x8c, 0x05, 0x7a, 0x0c, 0x57, 0xd5, 0x25, 0x38, 0x53, 0xf7, 0xa8, +- 0x15, 0xd0, 0xd5, 0x9d, 0x0d, 0x37, 0x58, 0x7e, 0x60, 0xfb, 0x81, 0xf4, 0x59, 0xd5, 0xe6, 0xf0, +- 0xc5, 0x18, 0x1c, 0x7b, 0x6a, 0x54, 0xfe, 0x20, 0x0b, 0x67, 0xd9, 0xf9, 0xc9, 0x62, 0x33, 0x64, +- 0x8b, 0xb6, 0x3b, 0x2d, 0x2b, 0xa0, 0xe4, 0x33, 0x50, 0x52, 0x8e, 0x38, 0x6a, 0x03, 0x4d, 0x74, +- 0x53, 0xd2, 0x7e, 0x3b, 0xf4, 0x5e, 0xd7, 0xf6, 0x28, 0x77, 0x2d, 0x0d, 0xad, 0xf8, 0x0a, 0xea, +- 0x63, 0x48, 0x8d, 0x6c, 0xc3, 0x8c, 0xdd, 0xb6, 0x9a, 0x74, 0xb3, 0xdb, 0x6a, 0x6d, 0xba, 0x2d, +- 0xbb, 0xae, 0xce, 0x64, 0x57, 0x95, 0x4d, 0x62, 0x35, 0x0a, 0x7e, 0xfc, 0x70, 0xf6, 0x85, 0x84, +- 0x55, 0x11, 0x22, 0x60, 0x9c, 0x20, 0xe3, 0xe1, 0xd3, 0x7a, 0xd7, 0xb3, 0x83, 0x03, 0x79, 0x36, +- 0x94, 0xcb, 0xe2, 0xc5, 0x3e, 0xea, 0xb7, 0x89, 0x2a, 0x3d, 0x2a, 0xa2, 0x85, 0x18, 0x27, 0x58, +- 0xf9, 0x87, 0x05, 0x98, 0x5a, 0xec, 0xfa, 0x81, 0xdb, 0x56, 0x57, 0x2d, 0xf3, 0x50, 0x12, 0xba, +- 0x34, 0xd3, 0xc2, 0x33, 0xd1, 0x0b, 0x8d, 0x9a, 0x02, 0x60, 0x88, 0xc3, 0x16, 0x12, 0xa7, 0xaa, +- 0x7c, 0x8d, 0xf5, 0x42, 0xe2, 0xcc, 0x29, 0x4a, 0x28, 0xb9, 0x0d, 0x50, 0xa7, 0x5e, 0x20, 0x0f, +- 0x12, 0xb9, 0x81, 0x4d, 0x97, 0x8b, 0xba, 0x32, 0x1a, 0x84, 0xb8, 0x1f, 0x02, 0x6f, 0x0b, 0x9b, +- 0x54, 0x37, 0xf7, 0xa9, 0xe7, 0xd9, 0x0d, 0xb5, 0x73, 0x86, 0x7e, 0x08, 0x3d, 0x18, 0x98, 0x50, +- 0x8b, 0xf8, 0x90, 0xf7, 0x3b, 0xb4, 0x2e, 0x37, 0xd2, 0x5b, 0x29, 0x56, 0x8e, 0xd9, 0xa5, 0x73, +- 0xb5, 0x0e, 0xad, 0x8b, 0xed, 0x53, 0xaf, 0x00, 0x56, 0x84, 0x9c, 0xd9, 0x13, 0xf7, 0x96, 0x35, +- 0xae, 0x7a, 0xc6, 0x4e, 0xef, 0xaa, 0xe7, 0xd2, 0x4f, 0x43, 0x49, 0xf7, 0xcb, 0x40, 0x3b, 0xe7, +- 0x5f, 0x66, 0x00, 0x96, 0xac, 0xc0, 0x12, 0xbb, 0x31, 0x13, 0x31, 0x1d, 0x2b, 0xd8, 0x8d, 0x8b, +- 0x98, 0x4d, 0x2b, 0xd8, 0x45, 0x0e, 0x21, 0xaf, 0xca, 0x2d, 0x2e, 0x1b, 0xb9, 0x65, 0x53, 0x5b, +- 0x1c, 0xbf, 0x25, 0x36, 0x76, 0x37, 0xed, 0xcb, 0x2b, 0x54, 0xb6, 0x1e, 0x5f, 0x5e, 0xf2, 0x29, +- 0x80, 0xba, 0xdb, 0x66, 0x1d, 0x18, 0xb8, 0x9e, 0x9c, 0x68, 0xca, 0x8e, 0x02, 0x8b, 0x1a, 0xf2, +- 0x38, 0xf2, 0x0b, 0x8d, 0x3a, 0x5c, 0xd8, 0x4b, 0x19, 0x25, 0xf7, 0x94, 0x50, 0xd8, 0xcb, 0x72, +- 0xd4, 0x18, 0x95, 0xbf, 0xc8, 0xc1, 0xe4, 0x72, 0xdb, 0xb2, 0x5b, 0x6a, 0x85, 0x46, 0x27, 0x4c, +- 0xe6, 0xd4, 0x27, 0xcc, 0xab, 0xc6, 0xad, 0x40, 0x6c, 0xaf, 0x4a, 0x30, 0xf9, 0x7f, 0x0e, 0x26, +- 0xfd, 0x76, 0xd0, 0x51, 0xb6, 0xfb, 0xc1, 0x16, 0x3e, 0x0f, 0x46, 0xaa, 0xad, 0x6f, 0x6d, 0x6a, +- 0xd3, 0x7f, 0x84, 0x18, 0x1b, 0xfc, 0x5d, 0xd7, 0x0f, 0xe4, 0x28, 0xe8, 0xc1, 0xbf, 0xee, 0xfa, +- 0x01, 0x72, 0x08, 0x9f, 0x1e, 0xae, 0x27, 0x02, 0x0f, 0x0a, 0xc6, 0xf4, 0x70, 0xbd, 0x00, 0x39, +- 0x84, 0x5c, 0x84, 0x6c, 0xe0, 0x4a, 0x9b, 0x10, 0x77, 0xe8, 0xdd, 0x72, 0x31, 0x1b, 0xb8, 0xdc, +- 0xcd, 0xce, 0x73, 0xdb, 0xd2, 0x6e, 0x1c, 0xba, 0xd9, 0x79, 0x6e, 0x1b, 0x39, 0x84, 0xa9, 0x06, +- 0x7e, 0x77, 0x9b, 0x9d, 0xfb, 0xe2, 0xbe, 0xe2, 0x35, 0x51, 0x8c, 0x0a, 0xce, 0x88, 0x6d, 0xbb, +- 0x8d, 0x03, 0x79, 0xc1, 0xae, 0x89, 0x71, 0xef, 0x04, 0x0e, 0xa9, 0xfc, 0x8d, 0x31, 0x20, 0xcb, +- 0x6d, 0x7e, 0x77, 0x66, 0x1e, 0x53, 0x5e, 0x82, 0xe2, 0xb6, 0xe7, 0xee, 0x69, 0x6b, 0xa7, 0x96, +- 0xae, 0x0b, 0xbc, 0x14, 0x25, 0x94, 0x9d, 0x54, 0xeb, 0xbb, 0x96, 0xe3, 0xd0, 0x56, 0x68, 0x1f, +- 0xd4, 0x03, 0xb9, 0xa8, 0x21, 0x68, 0x60, 0xf1, 0x40, 0x52, 0xf1, 0xcb, 0xb8, 0xbd, 0x0e, 0x03, +- 0x49, 0x43, 0x10, 0x9a, 0x78, 0x91, 0x5b, 0xa1, 0xfc, 0xb0, 0x6f, 0x85, 0x0a, 0x43, 0xb8, 0x15, +- 0xea, 0x13, 0x60, 0x59, 0x7c, 0xb2, 0x01, 0x96, 0x63, 0xc7, 0x0d, 0xb0, 0x1c, 0x1f, 0x95, 0x95, +- 0xe5, 0x6b, 0xe6, 0x61, 0x51, 0xdc, 0x41, 0x7c, 0x36, 0xc5, 0x21, 0xa9, 0x67, 0xb2, 0x9e, 0xc8, +- 0x82, 0xf5, 0x34, 0x5c, 0x44, 0xfc, 0x46, 0x06, 0x0a, 0x9c, 0x0d, 0x69, 0xf3, 0x08, 0x44, 0xae, +- 0x8b, 0x65, 0xd2, 0x3a, 0xf1, 0x73, 0x8a, 0x11, 0xab, 0xbf, 0x52, 0xd3, 0x14, 0x0f, 0xf2, 0x3c, +- 0xe4, 0xe5, 0xa5, 0x63, 0xe6, 0xe5, 0x49, 0x61, 0xb7, 0x61, 0x5b, 0x1f, 0xf2, 0xd2, 0xd7, 0xc7, +- 0xbf, 0xff, 0xb7, 0x67, 0x9f, 0x79, 0xef, 0xdf, 0x5f, 0x79, 0xa6, 0xf2, 0x83, 0x2c, 0x8c, 0x73, +- 0x72, 0x0b, 0x5d, 0x9f, 0xbc, 0x6d, 0x8c, 0xb2, 0x68, 0xe4, 0x47, 0x8e, 0x77, 0x8e, 0xba, 0xc9, +- 0x65, 0x15, 0xeb, 0xa6, 0x50, 0x74, 0x84, 0x65, 0xc6, 0xe8, 0xed, 0x4a, 0x3d, 0x29, 0x3b, 0x94, +- 0x2e, 0x58, 0xe8, 0xfa, 0x4c, 0x13, 0x48, 0x54, 0x8e, 0x3a, 0xfa, 0xac, 0x99, 0xfa, 0xb2, 0x53, +- 0xf3, 0xe2, 0xf4, 0x0c, 0x35, 0x35, 0x72, 0x1e, 0xad, 0xfc, 0x69, 0x06, 0x26, 0x15, 0xea, 0x9a, +- 0xed, 0x07, 0xe4, 0xf3, 0x3d, 0xdd, 0x39, 0x77, 0xbc, 0xee, 0x64, 0xb5, 0x79, 0x67, 0xea, 0x85, +- 0xa0, 0x4a, 0x8c, 0xae, 0x6c, 0x42, 0xc1, 0x0e, 0x68, 0xdb, 0x97, 0xf7, 0xca, 0x0b, 0xe9, 0xbf, +- 0x2f, 0xbc, 0x10, 0x5b, 0x65, 0x84, 0x51, 0xd0, 0xaf, 0xfc, 0x49, 0x2e, 0xfc, 0x2e, 0xd6, 0xc1, +- 0xe4, 0x0b, 0x11, 0xcb, 0x62, 0x35, 0x9d, 0x65, 0x91, 0xf1, 0x8d, 0x9b, 0x15, 0xfd, 0x5e, 0xb3, +- 0xe2, 0xca, 0x10, 0xcc, 0x8a, 0xfc, 0x13, 0x9f, 0xa8, 0x4d, 0x91, 0x09, 0xd2, 0x19, 0xcd, 0x72, +- 0xf9, 0x81, 0x1b, 0xd8, 0x75, 0xb9, 0x13, 0x0e, 0xd1, 0x6e, 0xca, 0x0f, 0x70, 0xba, 0x50, 0x70, +- 0xc1, 0x38, 0xdb, 0xca, 0x7f, 0xce, 0xc0, 0x74, 0x74, 0x66, 0x93, 0x5d, 0xbd, 0x66, 0x32, 0x69, +- 0xfd, 0x7b, 0x0e, 0x5f, 0x2b, 0x64, 0x0f, 0x8a, 0x22, 0x7a, 0x47, 0x0e, 0x6f, 0x9a, 0xe8, 0x68, +- 0x65, 0xf1, 0x0e, 0x99, 0x89, 0xdf, 0x28, 0x59, 0x54, 0xfe, 0x47, 0x56, 0x4e, 0x60, 0x29, 0x25, +- 0xc9, 0x25, 0xc8, 0xda, 0x0d, 0xa9, 0x16, 0x81, 0xac, 0x94, 0x5d, 0x5d, 0xc2, 0xac, 0xdd, 0xe0, +- 0x87, 0x52, 0x11, 0xe6, 0x93, 0x8d, 0xaa, 0x4d, 0xb1, 0x80, 0xb8, 0x4f, 0xc0, 0x04, 0x93, 0x33, +- 0xfb, 0xd4, 0xf3, 0x6d, 0xd7, 0x89, 0xab, 0x40, 0x6c, 0x9d, 0xdc, 0x11, 0x20, 0x34, 0xf1, 0x98, +- 0x3a, 0xc7, 0x8f, 0x14, 0x31, 0xbd, 0xd3, 0x38, 0x46, 0x54, 0x61, 0x86, 0xad, 0x6f, 0x2e, 0xc8, +- 0x9d, 0x80, 0x23, 0x17, 0x62, 0x4e, 0x0b, 0x56, 0x60, 0x2d, 0x0a, 0x30, 0xaf, 0x17, 0xc7, 0x37, +- 0xd5, 0xcb, 0xe2, 0x11, 0xea, 0xe5, 0x1a, 0xe4, 0x03, 0xbb, 0xad, 0x62, 0x9a, 0x06, 0x31, 0x9b, +- 0x85, 0x6d, 0xb7, 0xdb, 0xac, 0xed, 0x76, 0x9b, 0x1a, 0xfb, 0xca, 0xb7, 0xf2, 0x30, 0xc3, 0xfb, +- 0x7c, 0x89, 0x76, 0xa8, 0xd3, 0xa0, 0x4e, 0xfd, 0xe0, 0x18, 0x36, 0x9d, 0x2a, 0xcc, 0xd0, 0x70, +- 0x53, 0x36, 0x5c, 0x29, 0xf5, 0xb7, 0x2f, 0x47, 0xc1, 0x18, 0xc7, 0xe7, 0x21, 0xc6, 0xac, 0x28, +- 0xc9, 0xad, 0x72, 0x59, 0x01, 0x30, 0xc4, 0x21, 0xfb, 0x30, 0x26, 0x76, 0x7a, 0x5f, 0xae, 0xc4, +- 0x9b, 0x29, 0x25, 0x69, 0xf8, 0xc5, 0x52, 0xab, 0xe0, 0x3b, 0xb4, 0xf8, 0xdf, 0x47, 0xc5, 0x8c, +- 0xfc, 0x62, 0x06, 0x4a, 0x81, 0x67, 0x39, 0xfe, 0x8e, 0xeb, 0xb5, 0xa5, 0xf6, 0xba, 0x35, 0x34, +- 0xd6, 0x5b, 0x8a, 0x32, 0x95, 0x71, 0x73, 0xba, 0x00, 0x43, 0xae, 0xc4, 0x86, 0x8b, 0xb2, 0x39, +- 0x6b, 0x6e, 0xd3, 0xae, 0x5b, 0x2d, 0x11, 0xb1, 0xe9, 0x2a, 0x3f, 0x99, 0x8f, 0xaa, 0x5b, 0xd4, +- 0x95, 0x44, 0xac, 0xc7, 0x0f, 0x67, 0x67, 0x62, 0x45, 0xd8, 0x87, 0x60, 0xe5, 0x77, 0x0b, 0x70, +- 0x21, 0xb1, 0x7b, 0xc8, 0xb6, 0x9c, 0x82, 0xa9, 0x2f, 0xaa, 0xd8, 0x44, 0x94, 0x5d, 0x3e, 0x1e, +- 0x9d, 0x98, 0xa6, 0xf6, 0x95, 0x3d, 0x05, 0xed, 0x6b, 0x47, 0x6a, 0x5f, 0x22, 0xba, 0x35, 0xc5, +- 0x27, 0x85, 0xe6, 0x8a, 0x70, 0xbd, 0x84, 0x7a, 0x1c, 0xb1, 0xa1, 0x40, 0x1f, 0x74, 0x3c, 0xe1, +- 0x50, 0x91, 0x8a, 0xd1, 0xf2, 0x83, 0x8e, 0x27, 0x19, 0x69, 0x2d, 0x80, 0x95, 0xf9, 0x28, 0x38, +- 0x90, 0xb7, 0xe1, 0x1c, 0x63, 0x19, 0x9f, 0x27, 0x42, 0x34, 0xcd, 0xc9, 0x2a, 0xe7, 0x96, 0x7a, +- 0x51, 0x92, 0x26, 0x49, 0x12, 0x29, 0xc6, 0x81, 0xb1, 0x4a, 0x9e, 0x89, 0x9a, 0xc3, 0x72, 0x2f, +- 0x4a, 0x22, 0x87, 0x04, 0x52, 0x5c, 0xb6, 0x73, 0x67, 0x68, 0x79, 0x34, 0x0f, 0x65, 0x3b, 0x2f, +- 0x45, 0x09, 0xad, 0xbc, 0x0d, 0x97, 0xfa, 0x2f, 0x27, 0xb6, 0x7b, 0xbc, 0x73, 0x2f, 0xbe, 0x7b, +- 0xbc, 0x79, 0x0b, 0xb3, 0xef, 0xdc, 0x33, 0x38, 0x64, 0x0f, 0xe5, 0xf0, 0x7e, 0x16, 0xce, 0xc4, +- 0x6f, 0xa9, 0x48, 0x17, 0xc6, 0xea, 0xe2, 0x66, 0x47, 0xae, 0x85, 0x8d, 0x34, 0x17, 0x72, 0xbd, +- 0x57, 0x44, 0x72, 0xb2, 0x0a, 0x08, 0x2a, 0x5e, 0xe4, 0xaf, 0xa9, 0x98, 0xdc, 0x75, 0xab, 0x23, +- 0x57, 0xc7, 0x46, 0x2a, 0xd3, 0x7f, 0x8f, 0x35, 0xdf, 0x8c, 0xdc, 0x5d, 0x0f, 0x23, 0x77, 0xd7, +- 0xad, 0x4e, 0xe5, 0x8f, 0xb3, 0x30, 0x61, 0x5a, 0x2d, 0x46, 0x7f, 0x04, 0xd9, 0x8b, 0x1c, 0x41, +- 0x56, 0x87, 0x72, 0x7c, 0xec, 0x7b, 0x0a, 0xf1, 0x63, 0xa7, 0x90, 0xe1, 0x9c, 0x56, 0x8f, 0x38, +- 0x88, 0x5c, 0x83, 0xb3, 0x3d, 0x47, 0x5b, 0xf2, 0x1a, 0x00, 0x5b, 0x12, 0xd4, 0xf7, 0x6d, 0x7d, +- 0x9f, 0xa4, 0x3b, 0x6a, 0x59, 0x43, 0xd0, 0xc0, 0xaa, 0xfc, 0xbb, 0x0c, 0x98, 0x1b, 0xee, 0x29, +- 0x1c, 0x6a, 0xde, 0x89, 0x1e, 0x6a, 0x96, 0x87, 0xd2, 0x5d, 0x7d, 0xce, 0x35, 0xbf, 0xb2, 0x14, +- 0xf9, 0x3a, 0x7e, 0xb4, 0xb9, 0x0a, 0x93, 0x54, 0xea, 0xc4, 0x49, 0x19, 0x40, 0x96, 0x0d, 0x18, +- 0x46, 0x30, 0x49, 0xcb, 0x30, 0xcd, 0x66, 0xd3, 0x9e, 0x20, 0x94, 0x31, 0x57, 0xd8, 0xa9, 0x7a, +- 0x4d, 0xbb, 0x64, 0x17, 0xc6, 0x7c, 0x11, 0xeb, 0x22, 0x27, 0x56, 0x8a, 0x53, 0x98, 0x0a, 0x9a, +- 0xe1, 0xd2, 0x41, 0xfe, 0x40, 0x45, 0x9e, 0x1c, 0x40, 0xa1, 0x6d, 0x3b, 0xb6, 0x2b, 0xb7, 0x98, +- 0xad, 0xa1, 0xad, 0x97, 0xb9, 0x75, 0x46, 0x56, 0x18, 0x7c, 0xf4, 0x00, 0xf1, 0x32, 0x14, 0x1c, +- 0x79, 0x5a, 0xaf, 0xba, 0x74, 0x2c, 0x90, 0x37, 0x2b, 0x77, 0x87, 0xc7, 0x5e, 0xbb, 0x2c, 0x44, +- 0x4d, 0x4e, 0xaa, 0x18, 0x35, 0x6b, 0xd2, 0x95, 0xc9, 0x17, 0x8a, 0x69, 0xdd, 0x10, 0xe3, 0x4d, +- 0x58, 0xb1, 0x5b, 0x34, 0x76, 0xbd, 0x63, 0x64, 0x63, 0x60, 0x9f, 0x6f, 0xe4, 0x1c, 0x18, 0xf2, +- 0xe7, 0xab, 0xcb, 0xc9, 0xd8, 0xe7, 0xf7, 0x66, 0x22, 0x60, 0x8a, 0xaa, 0x76, 0x59, 0x15, 0xc9, +- 0xd5, 0xee, 0x0c, 0xaf, 0x19, 0xd2, 0xc9, 0x4f, 0xb4, 0x42, 0x1f, 0x53, 0x7a, 0x9c, 0x58, 0xbb, +- 0x90, 0xb7, 0xda, 0xf7, 0x3a, 0xd2, 0xf6, 0x38, 0xc4, 0x21, 0xa8, 0xb6, 0xef, 0x75, 0x62, 0x43, +- 0x50, 0x5d, 0xbf, 0xb5, 0x89, 0x9c, 0x1d, 0x9b, 0xfc, 0xc2, 0x26, 0x00, 0xc3, 0x9e, 0xfc, 0xdc, +- 0x2a, 0x10, 0x9b, 0xfc, 0x11, 0x4b, 0x41, 0x17, 0xf2, 0xed, 0x7b, 0x41, 0x50, 0x9e, 0x18, 0xf6, +- 0x17, 0xaf, 0xdf, 0x0b, 0x82, 0xd8, 0x17, 0xaf, 0xdf, 0xda, 0xda, 0x42, 0xce, 0x8e, 0xb1, 0xe5, +- 0xb6, 0x9d, 0xc9, 0x61, 0xb3, 0xdd, 0xb0, 0x02, 0x3f, 0xc6, 0xd6, 0xb0, 0xf8, 0xdc, 0x83, 0x9c, +- 0xef, 0xf8, 0xd2, 0x49, 0x12, 0x87, 0xc7, 0xb5, 0xe6, 0x48, 0xa6, 0x3a, 0xa6, 0xba, 0xb6, 0x51, +- 0x43, 0xc6, 0x8b, 0xb3, 0xbc, 0xe7, 0x97, 0xa7, 0x87, 0xce, 0xf2, 0x5e, 0x0f, 0xcb, 0x5b, 0x8c, +- 0xe5, 0x3d, 0x9f, 0x7c, 0x11, 0x8a, 0x9d, 0xee, 0x76, 0xad, 0xbb, 0x5d, 0x9e, 0xe1, 0x5c, 0x6f, +- 0x0f, 0x8f, 0xeb, 0x26, 0xa7, 0x2b, 0x18, 0x6b, 0xbd, 0x40, 0x14, 0xa2, 0x64, 0xca, 0xd8, 0x0b, +- 0x7e, 0xe5, 0x33, 0xc3, 0x66, 0x7f, 0x8d, 0x13, 0x8a, 0xb1, 0x17, 0x85, 0x28, 0x99, 0x4a, 0xf6, +- 0x2d, 0x6b, 0xbb, 0x7c, 0x76, 0x04, 0xec, 0x5b, 0x56, 0x02, 0xfb, 0x96, 0x25, 0xd8, 0xb7, 0xac, +- 0x6d, 0x36, 0xb3, 0x77, 0x1b, 0x3b, 0x7e, 0x99, 0x0c, 0x7b, 0x66, 0x5f, 0x6f, 0xec, 0xc4, 0x67, +- 0xf6, 0xf5, 0xa5, 0x95, 0x1a, 0x72, 0x76, 0x4c, 0x84, 0xf8, 0x2d, 0xab, 0xbe, 0x57, 0x3e, 0x37, +- 0x6c, 0x11, 0x52, 0x63, 0x64, 0x63, 0x22, 0x84, 0x97, 0xa1, 0xe0, 0x48, 0x7e, 0x35, 0x03, 0x13, +- 0x32, 0x67, 0xc2, 0x35, 0xcf, 0x6e, 0x94, 0xcf, 0xa7, 0xbe, 0xb8, 0x89, 0xb7, 0x20, 0x24, 0x2e, +- 0xda, 0x11, 0xda, 0xbf, 0x42, 0x08, 0x9a, 0x6d, 0x20, 0x7f, 0x2b, 0x03, 0xd3, 0x56, 0x24, 0x27, +- 0x46, 0xf9, 0x02, 0x6f, 0xd6, 0xcf, 0x0f, 0x51, 0xa6, 0x47, 0x73, 0x6e, 0xf0, 0x96, 0x69, 0x1f, +- 0xda, 0x28, 0x10, 0x63, 0x8d, 0x61, 0x93, 0xd4, 0x0f, 0x3c, 0xbb, 0x43, 0xcb, 0x17, 0x87, 0x3d, +- 0x49, 0x6b, 0x9c, 0x6e, 0x6c, 0x92, 0x8a, 0x42, 0x94, 0x4c, 0xf9, 0x5e, 0x4b, 0xc5, 0xf5, 0x58, +- 0xf9, 0xd9, 0x61, 0xef, 0xb5, 0xea, 0xde, 0x2d, 0xba, 0xd7, 0xca, 0x52, 0x54, 0x7c, 0xd9, 0x8c, +- 0xf5, 0x68, 0xc3, 0xf6, 0xcb, 0xe5, 0x61, 0xcf, 0x58, 0x64, 0x64, 0x63, 0x33, 0x96, 0x97, 0xa1, +- 0xe0, 0xc8, 0x64, 0xb2, 0xe3, 0xdf, 0x2b, 0x3f, 0x37, 0x6c, 0x99, 0xbc, 0xe1, 0xdf, 0x8b, 0xc9, +- 0xe4, 0x8d, 0xda, 0x2d, 0x64, 0xbc, 0x84, 0x4c, 0x6e, 0xf9, 0x96, 0x57, 0xbe, 0x34, 0x7c, 0x99, +- 0xcc, 0xe8, 0xf6, 0xc8, 0x64, 0x56, 0x88, 0x92, 0x29, 0x1f, 0x70, 0x9e, 0xbc, 0xd9, 0xae, 0x97, +- 0x7f, 0x6c, 0xd8, 0x03, 0x7e, 0x4d, 0x10, 0x8e, 0x0d, 0xb8, 0x2c, 0x45, 0xc5, 0x97, 0xbc, 0xcc, +- 0xf4, 0xcc, 0x4e, 0xcb, 0xae, 0x5b, 0x7e, 0xf9, 0x79, 0xe1, 0xed, 0x20, 0x54, 0x41, 0x51, 0x86, +- 0x1a, 0x4a, 0x7e, 0x33, 0x03, 0x33, 0xb1, 0xc0, 0x89, 0xf2, 0x0b, 0xbc, 0xd5, 0x6f, 0x0d, 0xaf, +- 0xd5, 0x0b, 0x51, 0x06, 0xa2, 0xf5, 0xda, 0x00, 0x1c, 0x77, 0xb9, 0x8f, 0xb7, 0x87, 0x7c, 0x3d, +- 0x03, 0x25, 0x5d, 0x56, 0xbe, 0xcc, 0x5b, 0xf7, 0xe9, 0x11, 0xb4, 0x4e, 0xb4, 0x4b, 0xdb, 0x96, +- 0xc3, 0x78, 0xb3, 0x90, 0x3b, 0x97, 0xc0, 0x7c, 0x66, 0x8b, 0xab, 0x98, 0xf2, 0xec, 0xb0, 0x25, +- 0x30, 0x86, 0xc4, 0x63, 0x12, 0xd8, 0x80, 0xa0, 0xd9, 0x06, 0x3e, 0x86, 0x56, 0x34, 0x59, 0x42, +- 0xf9, 0xca, 0xb0, 0xc7, 0x30, 0x9e, 0xdf, 0x22, 0x3a, 0x86, 0x31, 0x28, 0xc6, 0xdb, 0x43, 0x7e, +- 0x37, 0x03, 0x67, 0xad, 0x78, 0x96, 0x9a, 0xf2, 0x8f, 0xf3, 0x56, 0xbe, 0x3d, 0xe4, 0x56, 0x46, +- 0x12, 0xe1, 0xf0, 0x76, 0xea, 0x18, 0xaa, 0x1e, 0x38, 0xf6, 0xb6, 0x8a, 0xe9, 0x15, 0xfe, 0x4e, +- 0xd0, 0x29, 0x57, 0x86, 0xad, 0x57, 0xd4, 0x76, 0x82, 0xf8, 0xd1, 0xa4, 0xb6, 0xb2, 0xb5, 0x89, +- 0x9c, 0x1d, 0xd7, 0xa6, 0xa8, 0xe7, 0xd9, 0x41, 0xf9, 0xc5, 0xa1, 0x6b, 0x53, 0x9c, 0x6e, 0x5c, +- 0x9b, 0xe2, 0x85, 0x28, 0x99, 0x5e, 0xfa, 0x12, 0x40, 0x78, 0x7e, 0x4f, 0x70, 0x89, 0xf8, 0xac, +- 0xe9, 0x12, 0x31, 0xa4, 0xac, 0x89, 0x86, 0x63, 0xc5, 0xa5, 0x6f, 0x64, 0x60, 0x2a, 0x72, 0x82, +- 0x4f, 0x68, 0x43, 0x3d, 0xda, 0x86, 0xf5, 0xa1, 0x86, 0x37, 0x98, 0x8d, 0xf9, 0xa5, 0x0c, 0x94, +- 0xf4, 0x59, 0x3e, 0xa1, 0x21, 0x5f, 0x88, 0x36, 0x64, 0x35, 0x5d, 0xfa, 0xc6, 0x3e, 0x8d, 0x60, +- 0x3d, 0x12, 0x39, 0xd4, 0x8f, 0xb4, 0x47, 0x34, 0xa7, 0xe4, 0xc6, 0x7c, 0x2d, 0x03, 0x93, 0xe6, +- 0xd1, 0x3e, 0xa1, 0x2d, 0xdb, 0xd1, 0xb6, 0xac, 0xa5, 0x0e, 0x83, 0x3d, 0x64, 0x70, 0xf4, 0x29, +- 0x7f, 0xa4, 0x83, 0x13, 0x4b, 0x1c, 0x6f, 0x36, 0xe2, 0x2b, 0x19, 0x80, 0xf0, 0xc8, 0x9f, 0xd0, +- 0x8a, 0xb7, 0xa3, 0xad, 0x78, 0x33, 0xa5, 0xf7, 0xc1, 0x21, 0x7d, 0xa1, 0xcf, 0xff, 0x23, 0xed, +- 0x8b, 0xf5, 0x5b, 0x5b, 0x5b, 0x7d, 0x1a, 0xf1, 0xe5, 0x0c, 0x94, 0xb4, 0x35, 0x60, 0xa4, 0x5d, +- 0xb1, 0x51, 0xdd, 0xaa, 0x09, 0xd5, 0xbe, 0xb7, 0x15, 0xef, 0x65, 0x60, 0x5c, 0x59, 0x07, 0x12, +- 0x1a, 0xf1, 0x56, 0xb4, 0x11, 0x29, 0xbc, 0x87, 0x6a, 0x1b, 0xb5, 0x3e, 0x1d, 0xc1, 0x9b, 0x70, +- 0xef, 0x34, 0x9a, 0x70, 0xab, 0x5f, 0x13, 0xde, 0xcf, 0xc0, 0x84, 0x61, 0x3a, 0x48, 0x68, 0x85, +- 0x15, 0x6d, 0x45, 0x8a, 0x0b, 0x0c, 0xc9, 0xa7, 0x7f, 0x43, 0x0c, 0x23, 0xc2, 0x48, 0x1b, 0x22, +- 0xf9, 0x1c, 0xda, 0x10, 0x65, 0x4e, 0x18, 0x75, 0x43, 0x18, 0x9f, 0xfe, 0x6b, 0x55, 0x9b, 0x16, +- 0x46, 0xba, 0x56, 0xaf, 0x2f, 0xad, 0xd4, 0x0e, 0x91, 0x5b, 0xa1, 0x9d, 0x61, 0xa4, 0x8b, 0x55, +- 0xb0, 0x49, 0x6e, 0xc6, 0x77, 0x32, 0x70, 0x26, 0x6e, 0x6c, 0x48, 0x68, 0xcc, 0x4e, 0xb4, 0x31, +- 0x9b, 0x69, 0xdc, 0x97, 0x42, 0x66, 0xc9, 0x4d, 0xfa, 0xb5, 0x0c, 0x9c, 0x4b, 0x30, 0x34, 0x24, +- 0xb4, 0xca, 0x8e, 0xb6, 0xaa, 0x36, 0x82, 0x64, 0xa2, 0xf1, 0x09, 0x6c, 0x98, 0x1a, 0x46, 0x3a, +- 0x81, 0x25, 0x9f, 0xfe, 0x3a, 0x80, 0x69, 0x72, 0x18, 0xa9, 0x0e, 0xd0, 0xeb, 0x53, 0x1c, 0x9f, +- 0xc6, 0xa1, 0xf1, 0x61, 0xa4, 0xd3, 0x58, 0xb0, 0xe9, 0x2f, 0xf0, 0x95, 0x29, 0x62, 0xa4, 0x02, +- 0x7f, 0xa3, 0x76, 0xeb, 0x50, 0x81, 0xaf, 0xed, 0x12, 0x23, 0x16, 0xf8, 0x9c, 0x4f, 0xff, 0xd9, +- 0x61, 0xda, 0x27, 0x46, 0x3a, 0x3b, 0x14, 0xa3, 0xe4, 0xa6, 0x7c, 0x3f, 0x63, 0xa4, 0x82, 0x32, +- 0x8c, 0x0e, 0x09, 0x4d, 0x7a, 0x27, 0xda, 0xa4, 0xad, 0x51, 0xa4, 0x73, 0x30, 0x9b, 0xf6, 0xcd, +- 0x0c, 0x4c, 0x47, 0x2d, 0x0e, 0x09, 0x8d, 0x6a, 0x44, 0x1b, 0xb5, 0x31, 0xdc, 0x0c, 0x53, 0x71, +- 0x39, 0x1c, 0x37, 0x39, 0x8c, 0x54, 0x0e, 0x9b, 0xcc, 0xfa, 0x0f, 0x5e, 0x92, 0xb5, 0x61, 0xa4, +- 0x83, 0xd7, 0x3f, 0x7d, 0xa7, 0xd9, 0xb4, 0x5f, 0xcf, 0xc8, 0xb4, 0x94, 0x3d, 0x26, 0x86, 0x84, +- 0xc6, 0xb5, 0xa2, 0x8d, 0xbb, 0x33, 0x9a, 0xf4, 0xbe, 0x71, 0x05, 0x43, 0xdb, 0x18, 0x46, 0xaa, +- 0x60, 0xd4, 0x56, 0xb6, 0x36, 0x0f, 0x53, 0xb7, 0x42, 0x7b, 0xc3, 0x68, 0xd5, 0x2d, 0xc1, 0x27, +- 0xb1, 0x21, 0x95, 0x2f, 0x46, 0x9c, 0x66, 0x4e, 0xdb, 0x21, 0xba, 0xf2, 0x1b, 0x19, 0x80, 0xd0, +- 0x07, 0x8f, 0x5c, 0x81, 0x3c, 0x7d, 0xd0, 0xf1, 0xe2, 0xae, 0xb2, 0x0c, 0x03, 0x39, 0x84, 0x38, +- 0x50, 0xdc, 0xb1, 0x69, 0xab, 0xa1, 0x5c, 0x65, 0x52, 0x38, 0x34, 0xca, 0x08, 0xcb, 0x15, 0x46, +- 0x2e, 0x6c, 0x20, 0xff, 0xe9, 0xa3, 0xe4, 0x52, 0xf9, 0x08, 0x4c, 0x9a, 0x6f, 0x47, 0x1c, 0x1d, +- 0x3d, 0x59, 0xf9, 0x47, 0x79, 0x98, 0x89, 0xd9, 0x2b, 0xb4, 0x77, 0xee, 0x56, 0x98, 0x39, 0x20, +- 0xea, 0x9d, 0xcb, 0x1d, 0x9a, 0x43, 0x1c, 0xf2, 0xcd, 0x0c, 0xcc, 0xdc, 0xb7, 0x82, 0xfa, 0x2e, +- 0x23, 0xbc, 0x68, 0xba, 0x8c, 0xa7, 0x98, 0x8f, 0x77, 0xa3, 0x04, 0x43, 0xc3, 0x64, 0x0c, 0x80, +- 0x71, 0xd6, 0xe4, 0x15, 0x18, 0xeb, 0xb8, 0xad, 0x96, 0xed, 0x34, 0xe5, 0x8b, 0x47, 0x61, 0x98, +- 0xaa, 0x28, 0x46, 0x05, 0x8f, 0x3e, 0x4a, 0x97, 0x4f, 0xeb, 0xbe, 0x11, 0xeb, 0xc8, 0x13, 0x05, +- 0x4c, 0x15, 0x9e, 0x82, 0x80, 0xa9, 0x7f, 0x99, 0x07, 0xd2, 0xbb, 0x5b, 0x1f, 0xf5, 0x7e, 0xe3, +- 0x4b, 0x91, 0x70, 0x82, 0x52, 0xbf, 0x48, 0x00, 0x91, 0x8c, 0x45, 0xc6, 0x9c, 0xf7, 0x3c, 0xd8, +- 0x25, 0xca, 0x51, 0x63, 0x0c, 0x98, 0xc2, 0xfd, 0x6b, 0xbd, 0x09, 0x55, 0x3e, 0x3b, 0x4c, 0x8d, +- 0x65, 0x80, 0x21, 0xbf, 0xcd, 0x9f, 0xe6, 0xda, 0x95, 0x01, 0xf3, 0xc5, 0x81, 0x03, 0xe6, 0xab, +- 0xba, 0x32, 0x1a, 0x84, 0x4e, 0x3d, 0xe1, 0x7b, 0xba, 0x99, 0xf4, 0xa7, 0x45, 0x38, 0xdb, 0x23, +- 0xf1, 0x4f, 0x3f, 0xfd, 0xde, 0xab, 0x30, 0xce, 0xfe, 0x6e, 0x24, 0xc4, 0x3c, 0x5f, 0x97, 0xe5, +- 0xa8, 0x31, 0x8c, 0x54, 0x73, 0xb9, 0xbe, 0xa9, 0xe6, 0xac, 0x48, 0x5a, 0xcd, 0x91, 0xbc, 0x2b, +- 0xf8, 0x49, 0x98, 0x12, 0x76, 0x7e, 0x95, 0x54, 0xad, 0x10, 0xcd, 0xaa, 0x75, 0xcd, 0x04, 0x62, +- 0x14, 0xb7, 0x4f, 0x0a, 0xb5, 0xe2, 0x89, 0x52, 0xa8, 0xfd, 0x72, 0x6f, 0xd6, 0xf5, 0xcf, 0x0c, +- 0x51, 0x01, 0x18, 0x60, 0x4d, 0x99, 0xe9, 0x0b, 0xc7, 0x0f, 0x4d, 0x5f, 0x38, 0x0f, 0x25, 0xdf, +- 0x6f, 0xdd, 0xa1, 0x9e, 0xbd, 0x23, 0xc2, 0xb6, 0x8d, 0x47, 0xee, 0x6a, 0x0a, 0x80, 0x21, 0xce, +- 0x53, 0x16, 0xd2, 0xfa, 0x7e, 0x81, 0x1b, 0xc8, 0xb4, 0x22, 0x70, 0x84, 0x68, 0x7e, 0x03, 0xa6, +- 0xeb, 0x2d, 0xd7, 0xa1, 0x4b, 0xb6, 0xc7, 0x25, 0xcc, 0x41, 0x3c, 0xa9, 0xd9, 0x62, 0x04, 0x8a, +- 0x31, 0x6c, 0x52, 0x87, 0x42, 0xdd, 0xa3, 0x0d, 0x3f, 0x7d, 0x58, 0xde, 0x35, 0x3b, 0x58, 0x64, +- 0x94, 0x44, 0x58, 0x1e, 0xff, 0x17, 0x05, 0x6d, 0x9e, 0x6a, 0xc0, 0xdf, 0xe5, 0x72, 0x90, 0x8b, +- 0xcc, 0xfc, 0xe0, 0xa9, 0x06, 0x6a, 0xd7, 0x75, 0x75, 0x8c, 0x10, 0x63, 0x12, 0x60, 0xc7, 0x6e, +- 0x51, 0xa6, 0x45, 0xc4, 0x93, 0x36, 0xac, 0xc8, 0x72, 0xd4, 0x18, 0x22, 0x6c, 0xdf, 0x72, 0xea, +- 0xbb, 0x32, 0xf0, 0xc1, 0x08, 0xdb, 0xe7, 0xe9, 0x20, 0x25, 0x94, 0x75, 0x7b, 0x60, 0x35, 0x65, +- 0x20, 0x83, 0xee, 0xf6, 0x2d, 0xab, 0x89, 0xac, 0x9c, 0x81, 0x3d, 0xba, 0x23, 0xb3, 0x0b, 0x68, +- 0x30, 0xd2, 0x1d, 0x64, 0xe5, 0xa4, 0x0d, 0x45, 0x8f, 0xb6, 0xdd, 0x40, 0xbd, 0x4f, 0xbb, 0x9a, +- 0xaa, 0x5b, 0x91, 0x93, 0x92, 0xca, 0x14, 0x88, 0x54, 0x48, 0xac, 0x04, 0x25, 0x13, 0x52, 0x83, +- 0x0b, 0x6a, 0x57, 0x5d, 0x6d, 0x3a, 0xae, 0x47, 0xaf, 0xbb, 0x3e, 0x4f, 0x8c, 0x07, 0x7c, 0x79, +- 0xa8, 0xe4, 0x51, 0x17, 0x56, 0x93, 0x90, 0x30, 0xb9, 0x6e, 0xe5, 0x1f, 0x64, 0x60, 0x5c, 0x8d, +- 0xe9, 0x53, 0x90, 0x70, 0xfa, 0x16, 0xcc, 0xc4, 0xba, 0xea, 0x18, 0x01, 0x71, 0xcf, 0x43, 0xbe, +- 0xeb, 0xb5, 0x84, 0x8e, 0x2f, 0x1f, 0xab, 0xbb, 0x8d, 0x6b, 0x35, 0xe4, 0xa5, 0x95, 0x3f, 0xcc, +- 0xc0, 0xb4, 0x30, 0x66, 0x57, 0x3b, 0x1d, 0xd1, 0x0f, 0xb7, 0x01, 0x3a, 0x9e, 0xbd, 0x6f, 0x05, +- 0x54, 0xe5, 0x1d, 0x1c, 0x6c, 0xeb, 0xdf, 0xd4, 0x95, 0xd1, 0x20, 0x44, 0x5e, 0x84, 0x82, 0xd5, +- 0xe9, 0xac, 0x2e, 0xf1, 0xae, 0xc8, 0x85, 0xde, 0x3b, 0x55, 0x56, 0x88, 0x02, 0xc6, 0x96, 0xba, +- 0xed, 0xf8, 0x81, 0xd5, 0x6a, 0xf1, 0x70, 0x93, 0xd5, 0x25, 0xbe, 0x66, 0x73, 0xe1, 0x52, 0x5f, +- 0x8d, 0x40, 0x31, 0x86, 0x5d, 0xf9, 0xfb, 0x13, 0x70, 0xb6, 0xc7, 0x36, 0x6f, 0x04, 0x6b, 0xe6, +- 0x7a, 0x82, 0x35, 0x8d, 0xdd, 0x3c, 0x7b, 0x2a, 0xbb, 0xb9, 0xce, 0x23, 0x9d, 0x3b, 0x6e, 0x1e, +- 0xe9, 0x30, 0x47, 0xa3, 0x8c, 0xf9, 0x4c, 0xc8, 0xbd, 0x1b, 0xe6, 0x75, 0x44, 0x03, 0xff, 0x58, +- 0x89, 0xad, 0x6f, 0xc2, 0xb8, 0xd5, 0xb1, 0x45, 0xfa, 0xd6, 0xe2, 0xc0, 0xd3, 0xb4, 0xba, 0xb9, +- 0x2a, 0x72, 0xb7, 0x6a, 0x22, 0xbd, 0x89, 0x5b, 0xc7, 0x86, 0x9b, 0xb8, 0xd5, 0x54, 0xc1, 0xc7, +- 0x8f, 0x54, 0xc1, 0x5f, 0x82, 0xa2, 0x55, 0x0f, 0xec, 0x7d, 0x2a, 0x37, 0x52, 0x2d, 0x0d, 0xab, +- 0xbc, 0x14, 0x25, 0x54, 0xbe, 0x6c, 0xaf, 0x22, 0x62, 0xb9, 0x58, 0x89, 0xbe, 0x6c, 0xaf, 0x83, +- 0x65, 0x4d, 0x3c, 0xae, 0xe7, 0xf0, 0xf9, 0x12, 0x4d, 0x1e, 0x1b, 0xea, 0x39, 0x26, 0x10, 0xa3, +- 0xb8, 0xa4, 0x0a, 0x33, 0xa2, 0xe0, 0x76, 0x87, 0x1d, 0x9f, 0x59, 0xf5, 0xc9, 0xe8, 0xac, 0xb8, +- 0x16, 0x05, 0x63, 0x1c, 0xbf, 0x8f, 0xaa, 0x34, 0x95, 0x5e, 0x55, 0x9a, 0x4e, 0xad, 0x2a, 0xc5, +- 0xd7, 0xe1, 0x00, 0xaa, 0xd2, 0x57, 0xe3, 0xf9, 0x9b, 0x85, 0xb7, 0x73, 0x0a, 0xb5, 0x86, 0x2d, +- 0xaa, 0x86, 0x99, 0xa1, 0xf9, 0x58, 0x79, 0x9b, 0x7f, 0x1a, 0xa6, 0x5c, 0xaf, 0x69, 0x39, 0xf6, +- 0xbb, 0x5c, 0xc2, 0xf8, 0xdc, 0xed, 0xb9, 0x24, 0xe6, 0xe8, 0x4d, 0x13, 0x80, 0x51, 0x3c, 0xd2, +- 0x85, 0x52, 0x53, 0x89, 0xd5, 0xf2, 0xd9, 0xb4, 0x82, 0x25, 0x2a, 0xa1, 0x45, 0x2c, 0x9c, 0x2e, +- 0xc3, 0x90, 0x93, 0xa1, 0x07, 0x92, 0xa7, 0x40, 0x0f, 0xfc, 0x3f, 0x63, 0x5c, 0x5a, 0x47, 0x2f, +- 0x30, 0x4f, 0xff, 0x7c, 0xf5, 0x33, 0x50, 0x92, 0x9a, 0xb7, 0xdc, 0x9d, 0x4a, 0x0b, 0x3f, 0xa6, +- 0xa3, 0x51, 0xe3, 0xd9, 0xcd, 0x57, 0x97, 0x30, 0xc4, 0x3e, 0xd6, 0x61, 0x2b, 0x96, 0x21, 0x3b, +- 0x3f, 0xbc, 0x0c, 0xd9, 0x35, 0xb8, 0x20, 0xf2, 0x71, 0xd6, 0x6a, 0x6b, 0xfc, 0x20, 0x60, 0x8b, +- 0xd7, 0x66, 0xe5, 0x23, 0x70, 0x5a, 0x27, 0x5a, 0x4e, 0x42, 0xc2, 0xe4, 0xba, 0x52, 0xa0, 0xb5, +- 0x2c, 0x2d, 0xd0, 0x8a, 0x3d, 0x02, 0x2d, 0x04, 0x62, 0x14, 0xb7, 0x8f, 0x34, 0x1a, 0x4f, 0x2f, +- 0x8d, 0x4a, 0x43, 0x90, 0x46, 0xd1, 0x79, 0x76, 0xc2, 0x83, 0x1b, 0x1c, 0x7a, 0x70, 0xfb, 0x34, +- 0x4c, 0x88, 0x97, 0xb2, 0xc5, 0x58, 0x4f, 0x0c, 0x3c, 0xd6, 0xb5, 0xb0, 0x36, 0x9a, 0xa4, 0x8c, +- 0x95, 0x3d, 0x79, 0x3a, 0x69, 0xb7, 0x2b, 0x50, 0x6c, 0x7a, 0x6e, 0xb7, 0x23, 0x42, 0x6a, 0xe4, +- 0xd4, 0xbe, 0xc6, 0x4b, 0x50, 0x42, 0xd2, 0xad, 0xfe, 0x6f, 0x95, 0x60, 0x26, 0xe6, 0x37, 0x90, +- 0x68, 0xab, 0xcd, 0x3c, 0x39, 0x5b, 0xed, 0x95, 0x48, 0xf6, 0xbe, 0xa4, 0x54, 0x1b, 0x3d, 0xc9, +- 0xc3, 0x73, 0xc7, 0x4f, 0x1e, 0x4e, 0x7e, 0x12, 0x4a, 0x56, 0xa3, 0xe1, 0x51, 0xdf, 0xa7, 0xea, +- 0x41, 0x03, 0xf1, 0x96, 0xbb, 0x2a, 0xc4, 0x10, 0xce, 0xad, 0x40, 0x8d, 0x1d, 0x9f, 0x9d, 0x33, +- 0xe2, 0x67, 0x40, 0xd6, 0x8b, 0xac, 0x1c, 0x35, 0x06, 0x69, 0xc0, 0xcc, 0x9e, 0xb7, 0xbd, 0xb8, +- 0x68, 0xd5, 0x77, 0xe9, 0x49, 0x8c, 0x78, 0x3c, 0x01, 0xcc, 0x8d, 0x28, 0x05, 0x8c, 0x93, 0x94, +- 0x5c, 0x6e, 0xd0, 0x83, 0xc0, 0xda, 0x3e, 0x89, 0xae, 0xa7, 0xb8, 0x98, 0x14, 0x30, 0x4e, 0x92, +- 0x69, 0x66, 0x7b, 0xde, 0xb6, 0x3a, 0x60, 0xc9, 0x03, 0xa9, 0xd6, 0xcc, 0x6e, 0x84, 0x20, 0x34, +- 0xf1, 0x58, 0x87, 0xed, 0x79, 0xdb, 0x48, 0xad, 0x56, 0x5b, 0xa6, 0xbe, 0xd3, 0x1d, 0x76, 0x43, +- 0x96, 0xa3, 0xc6, 0x20, 0x1d, 0x20, 0xec, 0xeb, 0xf8, 0xb8, 0xeb, 0x30, 0x73, 0x69, 0x4d, 0x39, +- 0xfe, 0xfb, 0xd2, 0x17, 0x99, 0x7c, 0xbb, 0xd1, 0x43, 0x07, 0x13, 0x68, 0x93, 0xcf, 0xc0, 0xb3, +- 0x7b, 0xde, 0xb6, 0xbc, 0x02, 0xdc, 0xf4, 0x6c, 0xa7, 0x6e, 0x77, 0x2c, 0x91, 0x0d, 0x6f, 0x22, +- 0xfa, 0x14, 0xde, 0x8d, 0x64, 0x34, 0xec, 0x57, 0x3f, 0x7a, 0x71, 0x30, 0x99, 0xf6, 0xe2, 0x20, +- 0xb6, 0x48, 0x4f, 0x74, 0x71, 0x30, 0xf5, 0x14, 0xa8, 0x23, 0x5f, 0x19, 0x83, 0x89, 0xeb, 0x5b, +- 0x5b, 0x9b, 0x2a, 0xd7, 0xe5, 0x11, 0x66, 0x29, 0x23, 0x77, 0x69, 0xf6, 0x14, 0x9f, 0xa9, 0x93, +- 0x89, 0xfa, 0x72, 0xa3, 0x4a, 0xd4, 0xf7, 0x12, 0x14, 0xdb, 0x34, 0xd8, 0x75, 0x1b, 0xf1, 0xdc, +- 0xd4, 0xeb, 0xbc, 0x14, 0x25, 0x34, 0x96, 0x09, 0xb4, 0x70, 0xea, 0x99, 0x40, 0x5f, 0x81, 0xb1, +- 0xc0, 0x6e, 0x53, 0xb7, 0x2b, 0x24, 0x5b, 0x2e, 0xec, 0xb2, 0x2d, 0x51, 0x8c, 0x0a, 0x4e, 0x3a, +- 0x50, 0xda, 0x56, 0x86, 0x6a, 0x29, 0xa0, 0x86, 0x62, 0xf3, 0xe6, 0xc2, 0x5a, 0xff, 0xc4, 0x90, +- 0x09, 0xf9, 0x22, 0x8c, 0xed, 0x52, 0xab, 0xc1, 0x7a, 0x66, 0x3c, 0x6d, 0x24, 0x92, 0x31, 0x25, +- 0xe7, 0xae, 0x0b, 0xa2, 0xb1, 0x70, 0x1c, 0x59, 0x8a, 0x8a, 0x27, 0xf9, 0x05, 0x98, 0x12, 0xa7, +- 0x5f, 0x09, 0x91, 0xea, 0xd3, 0x4a, 0x9a, 0x08, 0xff, 0x90, 0x9c, 0x38, 0xfe, 0x98, 0x25, 0x3e, +- 0x46, 0xf9, 0x5d, 0x7a, 0x1d, 0x26, 0xcd, 0xa6, 0x0e, 0xfa, 0x2a, 0xc6, 0x54, 0xe4, 0xc9, 0x42, +- 0xf2, 0xb2, 0x91, 0x27, 0x3e, 0xa7, 0xcf, 0x6d, 0x2a, 0x89, 0xae, 0xb9, 0x1d, 0x8b, 0xa7, 0x12, +- 0x7e, 0xea, 0xe3, 0x77, 0xe4, 0x53, 0x09, 0xb9, 0xc8, 0x53, 0x09, 0xbc, 0x1c, 0x35, 0x06, 0x4f, +- 0xb5, 0x12, 0x78, 0x77, 0xf4, 0xae, 0x6d, 0x86, 0xd4, 0x31, 0x4c, 0x09, 0xad, 0xfc, 0xd2, 0x34, +- 0x4c, 0x9a, 0x29, 0xe0, 0xd8, 0xdc, 0x53, 0x59, 0xbb, 0x32, 0xd1, 0xec, 0x58, 0x2a, 0x63, 0x97, +- 0x82, 0x47, 0x22, 0xa3, 0xb2, 0x87, 0x46, 0x46, 0x7d, 0x47, 0x24, 0x0e, 0x8d, 0xe6, 0x11, 0x4f, +- 0x9f, 0xf4, 0xa3, 0x27, 0x35, 0xb9, 0x4e, 0x21, 0x1a, 0x2d, 0xc6, 0x5e, 0xe6, 0xe4, 0x77, 0x32, +- 0xf0, 0x9c, 0x47, 0x99, 0xd8, 0xa1, 0x5e, 0x4f, 0x05, 0x79, 0x92, 0x19, 0x6a, 0xd3, 0x5e, 0x78, +- 0xf4, 0x70, 0xf6, 0x39, 0xec, 0xc7, 0x11, 0xfb, 0x37, 0x86, 0xfc, 0x9d, 0x0c, 0x94, 0xdb, 0x34, +- 0xf0, 0xec, 0xba, 0xdf, 0xdb, 0xd2, 0xc2, 0xf0, 0x5b, 0xfa, 0xfc, 0xa3, 0x87, 0xb3, 0xe5, 0xf5, +- 0x3e, 0x0c, 0xb1, 0x6f, 0x53, 0xc8, 0x7b, 0x99, 0xa4, 0x97, 0x2a, 0x52, 0x84, 0x51, 0x18, 0x49, +- 0x72, 0x6a, 0x81, 0x67, 0x05, 0xb4, 0x79, 0x70, 0xc4, 0x63, 0x15, 0xad, 0xc8, 0x85, 0x58, 0xca, +- 0x2b, 0x11, 0xb5, 0xdd, 0x8a, 0x69, 0x9d, 0xa0, 0x03, 0x7c, 0x37, 0x03, 0x93, 0x8e, 0xdb, 0xa0, +- 0x4a, 0x47, 0x92, 0x02, 0xf1, 0xd3, 0xc3, 0xc9, 0xc6, 0x38, 0xb7, 0x61, 0x90, 0x16, 0x62, 0x51, +- 0xdb, 0x75, 0x4c, 0x10, 0x46, 0xda, 0x40, 0x6e, 0xc3, 0x44, 0xe0, 0xb6, 0xa8, 0x27, 0xad, 0x3a, +- 0x42, 0x3c, 0x5e, 0x4e, 0x52, 0xf3, 0xb6, 0x34, 0x5a, 0xa8, 0x72, 0x86, 0x65, 0x3e, 0x9a, 0x74, +- 0x08, 0xed, 0xcd, 0x9a, 0x2f, 0x34, 0xc8, 0x97, 0x92, 0x48, 0x6f, 0xba, 0x8d, 0x13, 0x25, 0xce, +- 0x27, 0x0e, 0x9c, 0xd1, 0xf9, 0xfa, 0x85, 0x8e, 0xec, 0xcb, 0x24, 0x0f, 0x89, 0x9a, 0xea, 0x9a, +- 0x5b, 0xb7, 0x5a, 0x22, 0x91, 0x11, 0xd2, 0x1d, 0xea, 0xf1, 0x7c, 0x4a, 0xfa, 0x85, 0x83, 0xd5, +- 0x18, 0x25, 0xec, 0xa1, 0x4d, 0xae, 0xc1, 0xd9, 0x8e, 0x67, 0xbb, 0xbc, 0x09, 0x2d, 0xcb, 0x17, +- 0x79, 0x6d, 0x84, 0xa1, 0x52, 0x07, 0xba, 0x6d, 0xc6, 0x11, 0xb0, 0xb7, 0x8e, 0x38, 0x48, 0x8b, +- 0x42, 0xae, 0x11, 0x16, 0xd4, 0x41, 0x5a, 0x94, 0xa1, 0x86, 0x92, 0x15, 0x18, 0xb7, 0x76, 0x76, +- 0x6c, 0x87, 0x61, 0x8a, 0x77, 0xa6, 0x9e, 0x4f, 0xfa, 0xb4, 0xaa, 0xc4, 0x91, 0xb6, 0x68, 0xf9, +- 0x0b, 0x75, 0x5d, 0x95, 0xa1, 0xdf, 0xae, 0x9b, 0x6f, 0xfe, 0xf3, 0xb7, 0xa4, 0x62, 0x19, 0xfa, +- 0xa3, 0x18, 0x98, 0x50, 0x8b, 0xb5, 0xde, 0xa7, 0x41, 0x60, 0x3b, 0x4d, 0x5f, 0xbe, 0x11, 0xc5, +- 0xb9, 0xd6, 0x64, 0x19, 0x6a, 0x28, 0x3b, 0xd8, 0xf9, 0x81, 0xe5, 0x05, 0x55, 0xaf, 0xe9, 0xf3, +- 0x54, 0x05, 0xf2, 0x60, 0x57, 0x53, 0x85, 0x18, 0xc2, 0xc9, 0xc7, 0x61, 0xd2, 0x37, 0x72, 0x6f, +- 0x72, 0xcb, 0x5d, 0x49, 0x5e, 0x09, 0x1a, 0xe5, 0x18, 0xc1, 0x22, 0x73, 0x00, 0x6d, 0xeb, 0x81, +- 0xd4, 0x0e, 0xcb, 0xe7, 0xc4, 0xfe, 0xc5, 0xd4, 0xa5, 0x75, 0x5d, 0x8a, 0x06, 0xc6, 0xa5, 0x9f, +- 0x83, 0xb3, 0x3d, 0x4b, 0x65, 0xa0, 0x6d, 0xf9, 0xb7, 0xb3, 0x30, 0x13, 0x4b, 0x13, 0x7a, 0x94, +- 0x86, 0xfc, 0x39, 0x98, 0x14, 0xe6, 0x2a, 0x79, 0x36, 0xcc, 0x0e, 0x7c, 0x27, 0x5a, 0x35, 0xaa, +- 0x63, 0x84, 0x18, 0xb9, 0x1a, 0xeb, 0xb6, 0x5c, 0x34, 0xcf, 0xd2, 0x21, 0x5d, 0x27, 0x35, 0xe8, +- 0xfc, 0x88, 0x34, 0xe8, 0xca, 0x1c, 0x4c, 0xdc, 0xb8, 0x5a, 0x53, 0xe1, 0x6d, 0x61, 0x52, 0xff, +- 0x0c, 0x4f, 0xa4, 0xdc, 0x93, 0xd4, 0xbf, 0xf2, 0xad, 0x1c, 0x9c, 0x35, 0x2a, 0xc8, 0x17, 0x38, +- 0x7e, 0x01, 0x8a, 0x2d, 0x6b, 0x9b, 0xb6, 0x54, 0x96, 0xfd, 0x14, 0x07, 0xb8, 0x1e, 0xe2, 0x73, +- 0x6b, 0x9c, 0x72, 0x2c, 0x3e, 0x53, 0x14, 0xa2, 0x64, 0x4b, 0x76, 0x61, 0x6c, 0x5b, 0x66, 0x2f, +- 0xcf, 0x0e, 0x2b, 0x7b, 0x39, 0x37, 0xc0, 0xaa, 0x9c, 0xe5, 0x8a, 0x3c, 0xb7, 0x63, 0x7a, 0x9e, +- 0xeb, 0xdd, 0x54, 0xb9, 0xcb, 0xa5, 0x06, 0x2f, 0x1d, 0xac, 0x42, 0x3b, 0x66, 0x12, 0x12, 0x26, +- 0xd7, 0xbd, 0xf4, 0x33, 0x30, 0x61, 0x7c, 0xe5, 0x40, 0x53, 0xfd, 0x9f, 0xe7, 0x60, 0x5c, 0x65, +- 0xe0, 0x3d, 0x6a, 0x8e, 0xbf, 0x08, 0x05, 0xfe, 0xbe, 0xba, 0xb4, 0x11, 0xe9, 0x6b, 0x4d, 0xfe, +- 0xfe, 0x3a, 0x0a, 0x98, 0xa9, 0x2f, 0xe6, 0x8e, 0xd0, 0x17, 0x47, 0x3c, 0x39, 0xc9, 0x36, 0xe4, +- 0x7d, 0xcb, 0x6f, 0x49, 0x95, 0x28, 0x4d, 0x50, 0x6d, 0xb5, 0xb6, 0x66, 0xbe, 0xe9, 0xc6, 0x7e, +- 0x23, 0xa7, 0x4d, 0xbe, 0x9a, 0x81, 0xa9, 0xba, 0xeb, 0xf8, 0xdd, 0x36, 0xf5, 0xb8, 0xc5, 0x50, +- 0x6a, 0x39, 0x6b, 0x29, 0x43, 0x12, 0x17, 0x4d, 0x9a, 0xe2, 0x14, 0x12, 0x29, 0xc2, 0x28, 0x57, +- 0xfe, 0xb2, 0x74, 0x6f, 0x45, 0x32, 0x0f, 0x25, 0x6e, 0xbf, 0x34, 0xd2, 0xb3, 0x69, 0xef, 0x9a, +- 0x6b, 0x0a, 0x80, 0x21, 0x0e, 0x3b, 0x27, 0xb8, 0xad, 0x06, 0xd5, 0xaf, 0x03, 0xe9, 0x15, 0x73, +- 0x93, 0x97, 0xa2, 0x84, 0xb2, 0x7d, 0xd2, 0xa3, 0xdb, 0x56, 0xcb, 0x32, 0x74, 0x31, 0x39, 0xe0, +- 0x7a, 0x9f, 0xc4, 0x38, 0x02, 0xf6, 0xd6, 0xa9, 0xfc, 0xa7, 0x71, 0x38, 0x13, 0x0f, 0xc2, 0x3c, +- 0x6a, 0x22, 0xce, 0x43, 0xa9, 0x63, 0x79, 0x81, 0x6d, 0xbc, 0xc7, 0xa5, 0xbf, 0x6a, 0x53, 0x01, +- 0x30, 0xc4, 0x09, 0x67, 0x6e, 0xee, 0x90, 0x99, 0x9b, 0xfc, 0x9a, 0x41, 0xfe, 0xf4, 0x5f, 0x33, +- 0x90, 0xeb, 0xa2, 0x30, 0xaa, 0x75, 0x61, 0x7a, 0x6a, 0x16, 0x8f, 0xf4, 0xd4, 0x7c, 0xbf, 0xd7, +- 0xa9, 0xec, 0xd3, 0xc3, 0x8b, 0xb7, 0x1d, 0xec, 0xa2, 0x34, 0xb6, 0xd4, 0xc6, 0x9f, 0xc4, 0x52, +- 0x23, 0x9b, 0x70, 0xbe, 0x65, 0xb7, 0xa5, 0x67, 0x9c, 0xbf, 0x49, 0xbd, 0x1a, 0xad, 0xbb, 0x4e, +- 0x83, 0x1b, 0x5e, 0x73, 0xa1, 0xc3, 0xc2, 0x5a, 0x02, 0x0e, 0x26, 0xd6, 0x34, 0x65, 0x26, 0x1c, +- 0x21, 0x33, 0x95, 0x4c, 0x9b, 0x18, 0xa1, 0x4c, 0x3b, 0xf5, 0xfb, 0x97, 0xd0, 0x21, 0x79, 0xea, +- 0x30, 0x87, 0xe4, 0x74, 0x26, 0xcf, 0xbf, 0x09, 0x30, 0xc9, 0xc7, 0xfb, 0x98, 0x36, 0xcf, 0x63, +- 0xed, 0x76, 0x11, 0x49, 0x94, 0xe3, 0x6a, 0xfe, 0xe1, 0x92, 0x28, 0x6a, 0x4a, 0xcc, 0x9f, 0xba, +- 0x29, 0xf1, 0x2a, 0x4c, 0x7a, 0xe2, 0xf9, 0xb5, 0x46, 0xb5, 0xbe, 0xe7, 0xcb, 0xf7, 0x7a, 0x0c, +- 0xff, 0x80, 0x10, 0x86, 0x11, 0x4c, 0x26, 0x35, 0xea, 0x6e, 0x9b, 0x67, 0x3b, 0x8d, 0x4b, 0x8d, +- 0x45, 0x59, 0x8e, 0x1a, 0x83, 0xbc, 0x01, 0xd3, 0x3b, 0xad, 0xae, 0xbf, 0xbb, 0xc2, 0x68, 0x50, +- 0xa7, 0x2e, 0xde, 0x65, 0x29, 0x84, 0xde, 0x4d, 0x2b, 0x11, 0x28, 0xc6, 0xb0, 0x47, 0xfe, 0x46, +- 0x8b, 0x61, 0xd1, 0x2e, 0x9d, 0xa2, 0x45, 0xfb, 0x67, 0x61, 0x46, 0xcf, 0x05, 0xdb, 0x69, 0x2a, +- 0xa7, 0xbe, 0x92, 0x38, 0x0d, 0x6f, 0x46, 0x41, 0x18, 0xc7, 0x35, 0x05, 0xc5, 0xc4, 0x31, 0x05, +- 0xc5, 0xe4, 0x08, 0x05, 0xc5, 0x37, 0x32, 0x30, 0xed, 0xd7, 0x77, 0x69, 0xdb, 0x42, 0xda, 0xb4, +- 0xfd, 0xc0, 0x3b, 0x90, 0x97, 0x1f, 0x29, 0x82, 0xea, 0x6a, 0x11, 0x7a, 0x92, 0x31, 0x7f, 0xd0, +- 0x35, 0x0a, 0xc1, 0x18, 0x67, 0xf2, 0xa5, 0xd0, 0x0e, 0x3d, 0x9d, 0x36, 0xb9, 0x8c, 0x29, 0x27, +- 0x4e, 0x6c, 0x88, 0x9e, 0x79, 0x8a, 0x0c, 0xd1, 0x37, 0x01, 0xd6, 0xdc, 0xa6, 0x92, 0x8c, 0x55, +- 0x98, 0x51, 0x6f, 0xec, 0x8a, 0x1d, 0x4a, 0x44, 0x74, 0xe5, 0xc3, 0xeb, 0xe4, 0xd5, 0x28, 0x18, +- 0xe3, 0xf8, 0x95, 0xdf, 0x2f, 0xc2, 0x4c, 0x2c, 0xab, 0xc5, 0x50, 0x04, 0x2e, 0x93, 0x42, 0x2d, +- 0x9b, 0x3a, 0xc1, 0x6a, 0x43, 0x2a, 0x73, 0xa1, 0x14, 0x12, 0xe5, 0x4b, 0xa8, 0x31, 0x3e, 0x38, +- 0x2a, 0x9d, 0xa9, 0x72, 0x15, 0x8e, 0xfb, 0x40, 0x55, 0x71, 0x54, 0xc2, 0xef, 0xab, 0xbd, 0x2a, +- 0xdd, 0xdd, 0xa1, 0x25, 0x2f, 0x39, 0xd1, 0x9d, 0xe9, 0xe9, 0x3c, 0x25, 0xac, 0x83, 0x41, 0x4a, +- 0x23, 0x0b, 0x06, 0x49, 0xa7, 0xa3, 0x7c, 0x23, 0x07, 0xba, 0x9f, 0x98, 0x74, 0x9d, 0xb0, 0x1c, +- 0xc7, 0x0d, 0xa4, 0xe5, 0x36, 0x93, 0x56, 0xaa, 0x29, 0xca, 0x73, 0xd5, 0x90, 0x6a, 0x2c, 0x0f, +- 0x9a, 0x01, 0x41, 0x93, 0x39, 0xd9, 0xd7, 0x26, 0x1a, 0x71, 0x01, 0xbc, 0x31, 0x84, 0x66, 0x1c, +- 0xc3, 0x32, 0x73, 0xe9, 0x0d, 0x38, 0x13, 0x6f, 0xed, 0x20, 0x3d, 0x9a, 0xc6, 0x34, 0xf2, 0x27, +- 0x59, 0x18, 0xdf, 0xa8, 0x6e, 0xd5, 0xf8, 0x2d, 0x67, 0x03, 0x0a, 0xfc, 0xca, 0x53, 0xba, 0xe8, +- 0x0c, 0x65, 0xea, 0x70, 0xf3, 0x18, 0xff, 0x89, 0x82, 0x38, 0x59, 0x61, 0x22, 0x70, 0x8f, 0x3a, +- 0x83, 0x99, 0x0f, 0x4b, 0x42, 0x4a, 0xee, 0x51, 0x07, 0x45, 0x75, 0xb2, 0x08, 0x79, 0x87, 0x7d, +- 0xe7, 0x40, 0x8f, 0x40, 0x8a, 0x77, 0xa5, 0x98, 0xde, 0xc1, 0x2b, 0xf3, 0x87, 0x64, 0x3d, 0xda, +- 0xa0, 0x4e, 0x60, 0x5b, 0xad, 0xc1, 0x7c, 0xf9, 0xc4, 0x43, 0xb2, 0xba, 0x32, 0x1a, 0x84, 0x2a, +- 0x3f, 0xcc, 0xc0, 0x98, 0x7c, 0xca, 0x8a, 0xb4, 0xa0, 0xe8, 0x58, 0xdc, 0x61, 0x39, 0xb5, 0xfb, +- 0xe3, 0x06, 0xa7, 0xa3, 0xaf, 0x85, 0xf8, 0xea, 0x17, 0x65, 0x28, 0x79, 0x90, 0x5d, 0x28, 0x52, +- 0xf1, 0x88, 0x54, 0x76, 0x88, 0xaf, 0xfc, 0x0b, 0x3f, 0x48, 0xf1, 0x6c, 0x94, 0xa4, 0x5f, 0xf9, +- 0x51, 0x06, 0x20, 0x44, 0x39, 0x6a, 0xe3, 0xfb, 0x49, 0x28, 0xd5, 0x5b, 0x5d, 0x3f, 0xa0, 0x9e, +- 0x76, 0xca, 0x14, 0x4f, 0x40, 0xa8, 0x42, 0x0c, 0xe1, 0xe4, 0x55, 0x29, 0xc2, 0xc4, 0xe6, 0x57, +- 0x56, 0xd2, 0xe7, 0xf1, 0xc3, 0xd9, 0x49, 0x1e, 0x88, 0xa8, 0x4c, 0x2d, 0x22, 0x34, 0x2d, 0x6e, +- 0x96, 0xce, 0x0f, 0xd1, 0x2c, 0x5d, 0xf9, 0xbd, 0x22, 0x9c, 0x89, 0x27, 0x8d, 0x3a, 0xea, 0x5b, +- 0x8d, 0xc7, 0x96, 0xb2, 0x47, 0x3c, 0xb6, 0x94, 0xbc, 0x79, 0xe7, 0x9e, 0xec, 0xe6, 0x9d, 0x3f, +- 0xee, 0xe6, 0x3d, 0x32, 0xeb, 0x4d, 0xc4, 0x1e, 0x53, 0x4c, 0x6b, 0x8f, 0x89, 0x8f, 0xdf, 0x00, +- 0xbb, 0xf7, 0xdb, 0x72, 0x26, 0xa6, 0xbe, 0x57, 0x55, 0x42, 0xb6, 0x27, 0xb0, 0xf2, 0xd4, 0xf5, +- 0x83, 0x59, 0x28, 0xdc, 0xeb, 0xd2, 0x2e, 0x95, 0x4e, 0x74, 0x5c, 0xb0, 0xf2, 0xdc, 0x10, 0x28, +- 0xca, 0xd3, 0xed, 0xee, 0xdf, 0xc9, 0xc3, 0x04, 0xfb, 0xd6, 0x63, 0x1a, 0x20, 0x06, 0x58, 0x2a, +- 0xc6, 0x69, 0x36, 0x77, 0x8a, 0xa7, 0xd9, 0x27, 0x6d, 0xcc, 0x18, 0xf5, 0x52, 0x53, 0x33, 0xbc, +- 0x38, 0xaa, 0x19, 0x5e, 0xf9, 0x51, 0x01, 0xa6, 0xa3, 0xe9, 0x87, 0xc8, 0x27, 0x60, 0x62, 0xd7, +- 0xf5, 0x03, 0xe9, 0x18, 0x2b, 0x67, 0x87, 0x56, 0xd0, 0xae, 0x87, 0x20, 0x34, 0xf1, 0x8e, 0x7d, +- 0x39, 0x23, 0x5f, 0x18, 0x8e, 0x5f, 0xce, 0xc8, 0x57, 0x88, 0x51, 0xc1, 0xff, 0xea, 0xe8, 0x94, +- 0x3c, 0x25, 0xbe, 0xd2, 0x7b, 0x74, 0xba, 0x33, 0xac, 0xcc, 0x53, 0x1f, 0xe0, 0x93, 0x53, 0x3a, +- 0xc1, 0xf7, 0xab, 0x33, 0x30, 0x1d, 0xd5, 0xcf, 0xd8, 0xa8, 0x6a, 0x5f, 0xb1, 0x0c, 0xb7, 0x0c, +- 0x1a, 0x8f, 0xaa, 0xf4, 0xf8, 0x8b, 0x29, 0xa5, 0x27, 0x7b, 0x2c, 0xa5, 0x27, 0xee, 0x77, 0x94, +- 0x3b, 0x7d, 0xbf, 0xa3, 0x64, 0x07, 0xb7, 0xfc, 0x93, 0x74, 0x70, 0x7b, 0x5a, 0xbc, 0xc6, 0xbe, +- 0x17, 0x77, 0xa2, 0x2a, 0xa6, 0xcd, 0x0e, 0x12, 0x9d, 0x7a, 0xc3, 0x71, 0xa3, 0x1a, 0x1b, 0x92, +- 0x1b, 0x95, 0xe9, 0xa0, 0x36, 0x3e, 0x72, 0x07, 0xb5, 0x04, 0xa7, 0xad, 0xd2, 0x08, 0x9c, 0xb6, +- 0x2a, 0x50, 0x6c, 0x5b, 0x0f, 0xaa, 0x4d, 0x15, 0x5a, 0xca, 0x05, 0xca, 0x3a, 0x2f, 0x41, 0x09, +- 0x39, 0x75, 0xc7, 0xae, 0x64, 0xef, 0xa8, 0xc9, 0x13, 0x79, 0x47, 0x25, 0x3a, 0x89, 0x4d, 0xa5, +- 0x74, 0x12, 0x9b, 0x3e, 0xb6, 0x93, 0xd8, 0x4c, 0x0a, 0x27, 0xb1, 0x0f, 0xc1, 0x58, 0xdb, 0x7a, +- 0xb0, 0xee, 0x4b, 0xbf, 0xae, 0xbc, 0x70, 0x53, 0x59, 0x17, 0x45, 0xa8, 0x60, 0xac, 0x61, 0x6d, +- 0xeb, 0xc1, 0xc2, 0x41, 0x40, 0x7d, 0x1e, 0xd2, 0x29, 0xfd, 0xbf, 0xd6, 0x65, 0x19, 0x6a, 0xa8, +- 0x24, 0x58, 0xeb, 0x6e, 0xfb, 0xdc, 0x9b, 0x2b, 0x24, 0xc8, 0x8a, 0x50, 0xc1, 0x06, 0xf5, 0xe1, +- 0x22, 0x6b, 0x70, 0xde, 0xb3, 0x76, 0x82, 0xeb, 0xd4, 0xf2, 0x82, 0x6d, 0x6a, 0x05, 0xca, 0x4d, +- 0xe6, 0xbc, 0xde, 0x01, 0xce, 0x63, 0x02, 0x1c, 0x13, 0x6b, 0x91, 0x55, 0x38, 0xc7, 0xca, 0x97, +- 0x5b, 0x42, 0xb5, 0x50, 0xc4, 0x2e, 0x88, 0x00, 0xe4, 0x47, 0x0f, 0x67, 0xcf, 0x61, 0x2f, 0x18, +- 0x93, 0xea, 0x90, 0x4f, 0xc1, 0x19, 0x56, 0xbc, 0x46, 0x2d, 0x9f, 0x2a, 0x3a, 0x17, 0x85, 0x3f, +- 0x16, 0x9b, 0x89, 0x18, 0x83, 0x61, 0x0f, 0x36, 0x59, 0x84, 0xb3, 0xac, 0x6c, 0xd1, 0x6d, 0xb7, +- 0x6d, 0xfd, 0x5d, 0xcf, 0x8a, 0x58, 0x2a, 0xee, 0x36, 0x11, 0x07, 0x62, 0x2f, 0x7e, 0x7a, 0x1f, +- 0xb7, 0x6f, 0xe7, 0xe1, 0xcc, 0xcd, 0x0e, 0x75, 0xee, 0xee, 0xda, 0xfe, 0x9e, 0x3a, 0x91, 0x5c, +- 0x81, 0x3c, 0xd3, 0x29, 0xe3, 0x29, 0x16, 0x98, 0xd2, 0x89, 0x1c, 0x62, 0xde, 0x40, 0x65, 0x8f, +- 0xb8, 0x81, 0x9a, 0x87, 0x92, 0x63, 0xb5, 0xa9, 0xdf, 0xb1, 0xea, 0x3d, 0x6f, 0x0b, 0x6f, 0x28, +- 0x00, 0x86, 0x38, 0x04, 0xa1, 0xc4, 0xf6, 0xef, 0x13, 0xc4, 0x8e, 0x8a, 0x50, 0x32, 0x55, 0x17, +- 0x43, 0x32, 0xe4, 0x35, 0x00, 0x8b, 0x8f, 0x1f, 0x5f, 0xa3, 0x85, 0xe8, 0x43, 0x8e, 0x55, 0x0d, +- 0x41, 0x03, 0xcb, 0x3c, 0x4d, 0x15, 0x9f, 0xd8, 0x69, 0x6a, 0xec, 0xb4, 0x4f, 0x53, 0x95, 0xcf, +- 0xc0, 0xd9, 0x9e, 0xc8, 0x71, 0x76, 0xac, 0x10, 0x29, 0x1c, 0x32, 0xd1, 0x63, 0x45, 0x24, 0x71, +- 0xc3, 0x2c, 0x14, 0xf8, 0x28, 0xca, 0xc4, 0x1b, 0xfc, 0xd8, 0xcc, 0x47, 0x18, 0x45, 0x79, 0x05, +- 0x61, 0xd2, 0x4c, 0x9b, 0x77, 0x74, 0x3a, 0x3c, 0x9d, 0xec, 0x23, 0xdb, 0x2f, 0xd9, 0x47, 0xe5, +- 0xfb, 0x59, 0x38, 0x97, 0xa0, 0x98, 0xb1, 0x05, 0x2a, 0x9f, 0x50, 0x0a, 0x65, 0x73, 0x26, 0x5c, +- 0xa0, 0xb5, 0x18, 0x0c, 0x7b, 0xb0, 0xc9, 0x17, 0xd8, 0x9c, 0xa9, 0x53, 0xdf, 0x5f, 0x77, 0x1b, +- 0xaa, 0x05, 0x3f, 0x27, 0xe6, 0x8b, 0x2a, 0x7d, 0xfc, 0x70, 0xf6, 0xc3, 0x62, 0x66, 0xce, 0x5b, +- 0x1d, 0x7b, 0x9e, 0xcd, 0xcc, 0xf9, 0x7d, 0x43, 0x51, 0x0c, 0xee, 0xb8, 0xad, 0x6e, 0x9b, 0x86, +- 0x15, 0xd0, 0x20, 0x49, 0xde, 0x02, 0xd8, 0xe7, 0xf0, 0x9a, 0xfd, 0xae, 0x52, 0x4f, 0x0f, 0x7d, +- 0x17, 0x74, 0x4e, 0x3d, 0x2f, 0x38, 0x77, 0xab, 0x6b, 0x39, 0x01, 0x13, 0xf0, 0x5c, 0x78, 0xde, +- 0xd1, 0x54, 0xd0, 0xa0, 0x58, 0xf9, 0xf5, 0x22, 0x9c, 0xed, 0xc9, 0x1f, 0xce, 0x7d, 0x15, 0x74, +- 0xec, 0x77, 0xcc, 0x17, 0x2c, 0x31, 0xe2, 0xfb, 0x0d, 0x98, 0xe6, 0xc7, 0xc6, 0xcd, 0x58, 0xc4, +- 0xb8, 0xbe, 0xc3, 0xdf, 0x8a, 0x40, 0x31, 0x86, 0x7d, 0x3c, 0xaf, 0xab, 0x37, 0x60, 0xda, 0xef, +- 0x6e, 0x8b, 0x87, 0x7e, 0x45, 0x1a, 0x94, 0x7c, 0x94, 0x49, 0x2d, 0x02, 0xc5, 0x18, 0x36, 0x69, +- 0xc2, 0x99, 0xd0, 0xb8, 0x2c, 0xad, 0x9c, 0x85, 0x41, 0x64, 0x07, 0x9f, 0x15, 0x8b, 0x31, 0x12, +- 0xd8, 0x43, 0x94, 0x6c, 0xc3, 0x25, 0x11, 0xb9, 0x6d, 0x36, 0x28, 0x96, 0xb0, 0xab, 0x22, 0x1b, +- 0x7d, 0x69, 0xa9, 0x2f, 0x26, 0x1e, 0x42, 0x25, 0x72, 0xd6, 0x1d, 0x3b, 0xf2, 0xac, 0x1b, 0x89, +- 0x1a, 0x1f, 0x4f, 0x1b, 0x35, 0xde, 0x33, 0x61, 0x4e, 0x74, 0x1c, 0x2d, 0x3d, 0x05, 0xc7, 0xd1, +- 0xbf, 0x37, 0xc1, 0x96, 0x47, 0x2c, 0xdb, 0x32, 0x53, 0x5a, 0xf9, 0x8c, 0x14, 0x17, 0x6d, 0x52, +- 0x69, 0xe5, 0x53, 0xd5, 0x47, 0x09, 0x39, 0x46, 0x90, 0xb4, 0xb4, 0xe9, 0xe5, 0xfa, 0xd8, 0xf4, +- 0x3a, 0x70, 0x2e, 0x68, 0xf9, 0x5b, 0x5e, 0xd7, 0x0f, 0x16, 0xa9, 0x17, 0x9c, 0xc8, 0x2c, 0xcf, +- 0xf5, 0x95, 0xad, 0xb5, 0x5a, 0x9c, 0x0a, 0x26, 0x91, 0x66, 0xd3, 0x36, 0x68, 0xf9, 0xd5, 0x56, +- 0xcb, 0xbd, 0xaf, 0x32, 0xc6, 0x84, 0x66, 0x17, 0x69, 0x50, 0xd1, 0xd3, 0x76, 0x6b, 0xad, 0xd6, +- 0x07, 0x13, 0x0f, 0xa1, 0x42, 0xd6, 0xf9, 0x57, 0xdd, 0xb1, 0x5a, 0x76, 0xc3, 0x0a, 0x78, 0xc6, +- 0x29, 0x2e, 0xbb, 0xc5, 0x9a, 0xd0, 0xf9, 0x25, 0xb6, 0xd6, 0x6a, 0x71, 0x14, 0x4c, 0xaa, 0xa7, +- 0x6c, 0x38, 0x63, 0x23, 0xb4, 0xa0, 0x27, 0x98, 0xb6, 0xc6, 0x9f, 0xac, 0x69, 0xab, 0x34, 0xd8, +- 0x72, 0x87, 0xf4, 0xcb, 0x3d, 0xb6, 0x00, 0x06, 0x58, 0xee, 0x0d, 0x98, 0xd1, 0x1a, 0x96, 0x9c, +- 0xc1, 0x13, 0x03, 0xc7, 0xc2, 0x57, 0xa3, 0x14, 0x30, 0x4e, 0xf2, 0xf4, 0xdd, 0x10, 0x7f, 0x3b, +- 0x03, 0x67, 0x58, 0x23, 0xaa, 0xc1, 0x2e, 0x75, 0xde, 0xe5, 0x5a, 0x92, 0x7a, 0x64, 0xd5, 0x1a, +- 0x66, 0x47, 0x57, 0x63, 0x3c, 0x44, 0x87, 0xeb, 0xc3, 0x6c, 0x1c, 0x8c, 0x3d, 0x8d, 0x62, 0x9b, +- 0x5e, 0x58, 0x26, 0x47, 0x60, 0x7a, 0xe0, 0x4d, 0xaf, 0x1a, 0x23, 0x81, 0x3d, 0x44, 0x53, 0xc9, +- 0xd9, 0x4b, 0x8b, 0x70, 0x21, 0xf1, 0x53, 0x07, 0x12, 0xd6, 0xdf, 0x05, 0x98, 0x12, 0x5d, 0x38, +- 0x4c, 0xbf, 0xcd, 0xa8, 0xae, 0x9d, 0x3b, 0xf5, 0x9b, 0x0b, 0xe3, 0x88, 0x91, 0x3f, 0xc5, 0x23, +- 0x46, 0x9f, 0xed, 0xa7, 0xf0, 0xa4, 0xb6, 0x9f, 0xe2, 0x28, 0xb7, 0x9f, 0xb1, 0x74, 0xdb, 0xcf, +- 0xc8, 0x5c, 0x4f, 0x13, 0xa4, 0x67, 0x69, 0xf8, 0xd2, 0x33, 0x79, 0x93, 0x83, 0xd3, 0xdf, 0xe4, +- 0x7e, 0x2b, 0x49, 0xaa, 0x4e, 0xa4, 0x7d, 0xc5, 0x36, 0x22, 0x12, 0x46, 0x24, 0x51, 0x27, 0x47, +- 0x21, 0x51, 0x87, 0x22, 0x14, 0x7f, 0x29, 0x03, 0x25, 0xb4, 0x02, 0xca, 0x63, 0x0c, 0xc8, 0x6b, +- 0x90, 0xef, 0x3a, 0xb6, 0xb2, 0xda, 0x5c, 0x56, 0x5a, 0xe9, 0x6d, 0xc7, 0x0e, 0x1e, 0x3f, 0x9c, +- 0x9d, 0xd6, 0x88, 0x94, 0x95, 0x20, 0xc7, 0x25, 0x55, 0x98, 0xe1, 0xbe, 0xd6, 0x3e, 0x8f, 0x43, +- 0x60, 0x00, 0x19, 0xb2, 0xaf, 0x5d, 0x3c, 0x31, 0x0a, 0xc6, 0x38, 0x7e, 0xe5, 0x2b, 0x45, 0xf9, +- 0xbc, 0xc5, 0x10, 0x6e, 0x2f, 0x87, 0x9d, 0x3f, 0x74, 0x70, 0xe3, 0xd3, 0x25, 0xc8, 0x36, 0xb6, +- 0xb9, 0x22, 0x5e, 0x08, 0x13, 0x67, 0x2e, 0x2d, 0x60, 0xb6, 0xb1, 0x4d, 0x5e, 0x86, 0x71, 0x79, +- 0x2d, 0xaa, 0x92, 0x4b, 0x72, 0xb6, 0xf2, 0xce, 0xd4, 0x47, 0x0d, 0x1d, 0xf9, 0xf5, 0xe3, 0x70, +- 0x83, 0x71, 0xe2, 0xa3, 0xf7, 0x41, 0x76, 0xdd, 0x1c, 0x4c, 0x57, 0x7e, 0xd5, 0x48, 0x70, 0x0b, +- 0x51, 0x37, 0xe1, 0xde, 0xec, 0xb5, 0xe9, 0x4e, 0x93, 0xff, 0xb8, 0x08, 0x17, 0x93, 0x1f, 0x5e, +- 0xf9, 0xc0, 0x2c, 0x06, 0x31, 0xb7, 0x73, 0x89, 0x73, 0xfb, 0x43, 0x30, 0x26, 0x22, 0x86, 0x55, +- 0x5a, 0x2e, 0x6e, 0xbf, 0x17, 0xdf, 0xe2, 0xa3, 0x82, 0x91, 0x37, 0x81, 0x88, 0xbb, 0x81, 0x45, +- 0xb7, 0xeb, 0x04, 0x9b, 0xd4, 0x43, 0x6a, 0x35, 0x64, 0xf4, 0x88, 0xbe, 0x3e, 0x59, 0xef, 0xc1, +- 0xc0, 0x84, 0x5a, 0x3c, 0x91, 0x58, 0x4f, 0xc8, 0xa4, 0x99, 0x48, 0xec, 0xb0, 0xe8, 0xab, 0x51, +- 0x1f, 0x0e, 0xbf, 0xd9, 0x6b, 0x54, 0x79, 0x6b, 0xd8, 0x2f, 0xf2, 0x7c, 0x80, 0x2d, 0x2b, 0xa7, +- 0xb9, 0x72, 0xfe, 0x38, 0x0f, 0xe7, 0x12, 0x5e, 0x46, 0x8d, 0xca, 0xee, 0xcc, 0x31, 0x64, 0x77, +- 0x4b, 0x77, 0x52, 0xea, 0xbc, 0xc6, 0xaa, 0x3d, 0x87, 0xf4, 0xd0, 0x37, 0x33, 0x70, 0x9e, 0x07, +- 0xcc, 0xaa, 0x1b, 0x0f, 0x59, 0x45, 0x1a, 0x72, 0x5f, 0x3f, 0xcc, 0x90, 0xeb, 0xcf, 0xb1, 0x91, +- 0x65, 0xab, 0xf7, 0x5a, 0x02, 0x85, 0x30, 0x78, 0x30, 0x09, 0x8a, 0x89, 0x5c, 0xc9, 0x22, 0x80, +- 0x7e, 0x00, 0x46, 0xad, 0xe1, 0x17, 0xd9, 0xd1, 0x43, 0xbf, 0x10, 0xe3, 0x3f, 0xe6, 0xc1, 0xb8, +- 0x46, 0x47, 0x73, 0x83, 0x95, 0x51, 0x8d, 0x7c, 0xbd, 0xf7, 0x39, 0x8e, 0xcf, 0x0d, 0xf5, 0xb9, +- 0xdb, 0xe3, 0x4f, 0xf9, 0x74, 0x73, 0xea, 0x37, 0x73, 0x30, 0x1d, 0x1d, 0x43, 0xf2, 0x12, 0x14, +- 0x3b, 0x1e, 0xdd, 0xb1, 0x1f, 0xc8, 0xb9, 0x14, 0x3e, 0x2e, 0xcf, 0x4b, 0x51, 0x42, 0xc9, 0x3b, +- 0x31, 0x17, 0xf7, 0x85, 0x34, 0x91, 0x3b, 0xca, 0x11, 0xba, 0x4f, 0xc2, 0x81, 0x77, 0xf4, 0x7b, +- 0x44, 0xb9, 0xe1, 0xf3, 0x8a, 0xbe, 0x45, 0x44, 0x3e, 0x07, 0xa5, 0xba, 0x47, 0xad, 0x80, 0x36, +- 0x16, 0x0e, 0xa4, 0xa5, 0xf1, 0x27, 0x8e, 0x37, 0x47, 0xb7, 0xec, 0x36, 0x0d, 0x97, 0xde, 0xa2, +- 0x22, 0x82, 0x21, 0x3d, 0x7e, 0xbf, 0xb6, 0x13, 0x50, 0x8f, 0xa7, 0xfb, 0x90, 0xe6, 0xc4, 0xf0, +- 0x7e, 0x4d, 0x43, 0xd0, 0xc0, 0xaa, 0xfc, 0x61, 0x11, 0x20, 0x7c, 0xa7, 0x9a, 0x49, 0x1c, 0xea, +- 0x34, 0x3a, 0xae, 0xed, 0x28, 0x15, 0x56, 0xcf, 0x8e, 0x65, 0x59, 0x8e, 0x1a, 0x83, 0xec, 0x40, +- 0x51, 0x3e, 0x56, 0x9f, 0x4d, 0xeb, 0x2e, 0x51, 0xfb, 0xd8, 0x02, 0xa7, 0x24, 0x56, 0xb9, 0xf8, +- 0x1f, 0x25, 0x75, 0x36, 0x6b, 0x3c, 0xda, 0x0c, 0xd3, 0x18, 0xe8, 0xde, 0x45, 0x5e, 0x8a, 0x12, +- 0x1a, 0xc9, 0xd0, 0x9d, 0x3f, 0x32, 0x43, 0x37, 0x42, 0x49, 0xdc, 0x03, 0xdd, 0xa0, 0x07, 0x83, +- 0x1d, 0xbb, 0xc5, 0x15, 0xa7, 0xaa, 0x8b, 0x21, 0x19, 0x46, 0xd3, 0x57, 0xe8, 0x83, 0x65, 0xbe, +- 0x14, 0x89, 0x5a, 0x54, 0x31, 0x86, 0x64, 0x8c, 0x64, 0xbf, 0x63, 0x7d, 0x93, 0xfd, 0xee, 0xc4, +- 0x54, 0xc0, 0x54, 0x23, 0x71, 0x88, 0xbc, 0x7d, 0xaf, 0x37, 0x39, 0x2e, 0x0e, 0xe3, 0x81, 0xf4, +- 0x01, 0x76, 0xe1, 0xb7, 0x60, 0xaa, 0x6e, 0x2d, 0x52, 0x56, 0xd1, 0xae, 0x5b, 0x01, 0x95, 0xe7, +- 0xe8, 0x41, 0xd2, 0xbc, 0x2f, 0x56, 0x8d, 0xfa, 0x18, 0x25, 0x97, 0x4e, 0xe4, 0xdd, 0x80, 0x71, +- 0x35, 0x93, 0xc9, 0x0b, 0x46, 0xbd, 0xd0, 0x36, 0xc6, 0x06, 0x97, 0x13, 0x39, 0xfa, 0x56, 0xf5, +- 0xb3, 0x8c, 0xd8, 0x80, 0x82, 0xf3, 0x25, 0x28, 0xfa, 0xdd, 0x1d, 0x86, 0x17, 0x7b, 0x4f, 0xaa, +- 0xc6, 0x4b, 0x51, 0x42, 0x2b, 0xff, 0x33, 0x03, 0x10, 0x46, 0x93, 0xb2, 0x6d, 0xbe, 0x4d, 0xd9, +- 0xc9, 0xc9, 0xf6, 0xdb, 0xf1, 0x6d, 0x7e, 0x5d, 0x01, 0x30, 0xc4, 0x21, 0xb7, 0x01, 0x98, 0xe2, +- 0x71, 0x92, 0x0c, 0x3b, 0xfc, 0xb6, 0xf4, 0xb6, 0xae, 0x8c, 0x06, 0x21, 0x62, 0xc1, 0xb4, 0xd2, +- 0x94, 0x25, 0xe9, 0x81, 0xc2, 0x66, 0x78, 0x6c, 0xea, 0x66, 0x84, 0x00, 0xc6, 0x08, 0x56, 0xfe, +- 0xee, 0x18, 0xcc, 0xc4, 0x9e, 0xf5, 0x7b, 0xea, 0x1f, 0x77, 0x33, 0xdf, 0x10, 0xc9, 0x0d, 0xfb, +- 0x0d, 0x91, 0xfc, 0x30, 0x8e, 0x3d, 0xf1, 0x77, 0x6a, 0x0a, 0xc3, 0x7c, 0xa7, 0x66, 0x0d, 0xc6, +- 0x64, 0xc2, 0xe2, 0xc1, 0x64, 0x2e, 0x3f, 0x5e, 0xa9, 0x63, 0x9f, 0x22, 0x31, 0xe4, 0x88, 0xcc, +- 0xd8, 0x54, 0xfb, 0x20, 0x1f, 0xeb, 0x37, 0xe1, 0x7c, 0xc7, 0x6d, 0xb5, 0x54, 0x3c, 0xf1, 0x52, +- 0x57, 0x38, 0x46, 0xca, 0x00, 0x0c, 0xad, 0x0f, 0x6f, 0x26, 0xe0, 0x60, 0x62, 0xcd, 0x74, 0xb2, +- 0xf4, 0xdf, 0x14, 0x61, 0x3a, 0xfa, 0x04, 0xfd, 0x13, 0x79, 0x03, 0x8d, 0x5f, 0x52, 0x54, 0x3d, +- 0x27, 0xfe, 0x06, 0xda, 0x96, 0x2c, 0x47, 0x8d, 0x11, 0xd5, 0x28, 0x72, 0x23, 0xd0, 0x28, 0xf2, +- 0xc3, 0xd1, 0x28, 0x42, 0x7d, 0xaa, 0x70, 0xa8, 0x3e, 0xf5, 0x0a, 0x8c, 0x79, 0x6e, 0x8b, 0x56, +- 0x71, 0x43, 0x9a, 0x05, 0xf4, 0x6d, 0x06, 0x8a, 0x62, 0x54, 0xf0, 0x21, 0xfb, 0xe2, 0x47, 0x87, +- 0x7d, 0x80, 0x35, 0x73, 0x0d, 0xce, 0xee, 0xcb, 0x3b, 0x84, 0x9a, 0xdd, 0x74, 0xac, 0x20, 0x7c, +- 0xac, 0x45, 0x7b, 0x83, 0xde, 0x89, 0x23, 0x60, 0x6f, 0x9d, 0x27, 0x72, 0xd6, 0xd7, 0x9a, 0x37, +- 0x1c, 0xa5, 0x79, 0xa7, 0x5b, 0x58, 0xff, 0x64, 0x0c, 0xa6, 0x6b, 0xb7, 0x22, 0x0b, 0x2b, 0x32, +- 0x73, 0x33, 0x23, 0x98, 0xb9, 0xd9, 0x61, 0xcf, 0xdc, 0xc3, 0x4f, 0x02, 0x2f, 0xaa, 0xe0, 0xb1, +- 0x7c, 0xf4, 0xe2, 0xd1, 0x0c, 0x20, 0x23, 0x55, 0xb6, 0x87, 0x0b, 0x37, 0x4e, 0x95, 0x5a, 0xa1, +- 0xc0, 0xf3, 0x06, 0x19, 0x1b, 0x6f, 0x04, 0x8c, 0x71, 0xfc, 0x41, 0x56, 0xc8, 0x60, 0xfe, 0x44, +- 0x6f, 0xc0, 0x34, 0x6f, 0xa4, 0x74, 0x75, 0x5e, 0x6d, 0xc8, 0xfc, 0xf3, 0xda, 0x15, 0xeb, 0x96, +- 0x09, 0x5d, 0xc2, 0x18, 0x76, 0x74, 0x3d, 0x96, 0x52, 0xaf, 0xc7, 0x5b, 0x27, 0x5c, 0x8f, 0x2f, +- 0x40, 0xae, 0xd1, 0xba, 0x27, 0x1f, 0x4b, 0xd3, 0x3a, 0xf0, 0xd2, 0xda, 0x2d, 0x64, 0xe5, 0xc6, +- 0x2a, 0x9b, 0x38, 0xfd, 0x55, 0x36, 0x79, 0xe4, 0xf9, 0x96, 0x29, 0x2d, 0xd4, 0xf7, 0x6d, 0xd7, +- 0x11, 0x7e, 0xb0, 0x53, 0x83, 0x2b, 0x2d, 0x46, 0x75, 0x8c, 0x10, 0x4b, 0xb7, 0x84, 0xff, 0x55, +- 0x06, 0xce, 0x27, 0x65, 0x67, 0x39, 0xea, 0x42, 0xfe, 0x55, 0x18, 0x17, 0xa9, 0x5a, 0x56, 0x1b, +- 0xf2, 0x8e, 0x49, 0x7f, 0xbf, 0x20, 0xb7, 0xba, 0x84, 0x1a, 0x83, 0x50, 0x23, 0xbe, 0x79, 0x48, +- 0x71, 0xf6, 0xfa, 0x9c, 0x63, 0x04, 0xde, 0xfd, 0x4e, 0x06, 0x26, 0xcd, 0x6c, 0x2a, 0xc7, 0x78, +- 0x5d, 0x6e, 0x1f, 0x4a, 0xbc, 0x33, 0x56, 0x3c, 0xb7, 0x9d, 0x5e, 0xf1, 0xbe, 0xa3, 0x48, 0x89, +- 0xf9, 0x23, 0xe4, 0x8f, 0x2e, 0xc4, 0x90, 0x55, 0xe5, 0x17, 0x60, 0x5c, 0x47, 0xa1, 0x1c, 0x71, +- 0xbe, 0x9b, 0x87, 0x92, 0xdb, 0x91, 0xb1, 0x25, 0xf1, 0xc4, 0x78, 0x37, 0x15, 0x00, 0x43, 0x1c, +- 0x26, 0xb3, 0xc4, 0x68, 0xc7, 0x5c, 0x34, 0x23, 0x49, 0x3b, 0xff, 0x69, 0x16, 0x8a, 0x35, 0xea, +- 0xf8, 0xae, 0x47, 0xde, 0x36, 0x56, 0xb8, 0x10, 0xd9, 0x1f, 0x39, 0x9e, 0x29, 0x49, 0x84, 0x6e, +- 0xb0, 0xc9, 0x17, 0x9a, 0x87, 0xc2, 0x32, 0x63, 0xf5, 0xee, 0x40, 0xde, 0xef, 0xd0, 0x21, 0x84, +- 0xe8, 0x8b, 0x16, 0xd7, 0x3a, 0xb4, 0x1e, 0x8e, 0x26, 0xfb, 0x85, 0x9c, 0x3e, 0x71, 0xf4, 0x63, +- 0xe5, 0x62, 0xa6, 0xad, 0xa4, 0xe6, 0x74, 0xf8, 0x93, 0xe5, 0x7f, 0xcc, 0x0e, 0xbf, 0x1c, 0x71, +- 0xcd, 0xf6, 0x03, 0xf2, 0xf9, 0x9e, 0x8e, 0x9c, 0x3b, 0x5e, 0x47, 0xb2, 0xda, 0xbc, 0x1b, 0xf5, +- 0x22, 0x52, 0x25, 0x91, 0x38, 0x9f, 0x82, 0x1d, 0xd0, 0xb6, 0xb2, 0x64, 0x7e, 0x2a, 0xed, 0xb7, +- 0x85, 0x13, 0x63, 0x95, 0x91, 0x45, 0x41, 0xbd, 0xf2, 0x83, 0xa2, 0xfa, 0x26, 0xd6, 0xb1, 0xe4, +- 0xcb, 0x19, 0x98, 0x6c, 0xd0, 0x0e, 0x75, 0x1a, 0xd4, 0xa9, 0xdb, 0x54, 0x65, 0x2c, 0x59, 0x4d, +- 0x29, 0x60, 0x97, 0x14, 0x49, 0x23, 0x50, 0x6b, 0xc9, 0x60, 0x83, 0x11, 0xa6, 0xc4, 0x85, 0xf1, +- 0x40, 0xb8, 0x05, 0xa8, 0xcf, 0xaf, 0xa6, 0xf6, 0xad, 0x31, 0x34, 0x70, 0x49, 0x1a, 0x35, 0x13, +- 0xd2, 0x82, 0xf1, 0x20, 0x9a, 0xc2, 0x3e, 0x85, 0x25, 0x4c, 0x87, 0xcf, 0xf1, 0x43, 0xad, 0x0e, +- 0x97, 0xd3, 0x1c, 0xc8, 0x9b, 0x40, 0x64, 0x12, 0xd8, 0x15, 0xcb, 0x6e, 0xd1, 0x06, 0xba, 0x5d, +- 0xa7, 0x21, 0x2d, 0x8f, 0xfa, 0x22, 0x6e, 0xb9, 0x07, 0x03, 0x13, 0x6a, 0x91, 0xab, 0x30, 0xc9, +- 0xf9, 0x2f, 0x74, 0x7d, 0x23, 0x3c, 0x42, 0x77, 0xf2, 0xb2, 0x01, 0xc3, 0x08, 0x66, 0x24, 0xd5, +- 0x7f, 0xf1, 0xd0, 0x54, 0xff, 0x6b, 0x70, 0xde, 0xa3, 0xfb, 0x36, 0xdb, 0x83, 0xae, 0xdb, 0x7e, +- 0xe0, 0x7a, 0x07, 0xdc, 0x17, 0x41, 0xa6, 0x83, 0x13, 0x81, 0x3c, 0x09, 0x70, 0x4c, 0xac, 0x45, +- 0xbe, 0x97, 0x81, 0xa9, 0x96, 0xdb, 0x6c, 0xda, 0x4e, 0x53, 0x58, 0xb9, 0xe5, 0x15, 0xdd, 0xdd, +- 0x61, 0xc8, 0x89, 0xb9, 0x35, 0x93, 0xb2, 0x50, 0x34, 0xf4, 0xa5, 0x64, 0x04, 0x86, 0xd1, 0x46, +- 0x5c, 0xfa, 0x14, 0x90, 0xde, 0xba, 0x03, 0x6d, 0xae, 0x0f, 0xd8, 0x76, 0x14, 0x8a, 0x11, 0xb2, +- 0xab, 0xc5, 0x93, 0x90, 0x0e, 0x69, 0x96, 0xf0, 0xe1, 0x82, 0xe9, 0xbf, 0x66, 0x60, 0x4c, 0xc6, +- 0xbd, 0x45, 0xa2, 0x11, 0x33, 0x23, 0x8f, 0x46, 0x5c, 0x82, 0x42, 0xc7, 0xf5, 0x02, 0xb5, 0x4c, +- 0x67, 0x93, 0x75, 0x1c, 0xf1, 0xe6, 0x8f, 0xeb, 0x05, 0xa1, 0x10, 0x62, 0xbf, 0x7c, 0x14, 0x95, +- 0xd9, 0x9e, 0xa7, 0xb2, 0xa3, 0x6c, 0xc6, 0x3d, 0x3d, 0x54, 0x06, 0x95, 0xcd, 0x30, 0x83, 0xca, +- 0x66, 0xe5, 0x51, 0x1e, 0xce, 0xd4, 0x5a, 0x56, 0x7d, 0xcf, 0x3c, 0x8c, 0xbc, 0x05, 0x53, 0xbe, +- 0xdd, 0x74, 0x6c, 0xa7, 0x29, 0x8d, 0x45, 0x99, 0x81, 0x2d, 0xbc, 0x35, 0xb3, 0x3e, 0x46, 0xc9, +- 0x0d, 0x2d, 0xb3, 0x8f, 0x61, 0x8d, 0xc8, 0x9d, 0x8a, 0x35, 0x22, 0xe2, 0x71, 0x92, 0x4f, 0xeb, +- 0x71, 0x12, 0xef, 0xf7, 0x13, 0x99, 0xa6, 0x0a, 0x4f, 0x41, 0x8c, 0xc1, 0xcf, 0xc3, 0x04, 0xff, +- 0xd6, 0x1a, 0xdb, 0x98, 0xa2, 0xb7, 0xea, 0x99, 0xa3, 0x6e, 0xd5, 0x99, 0x2e, 0x6a, 0xd7, 0xb5, +- 0x06, 0xa7, 0xb5, 0x97, 0xd5, 0xba, 0xeb, 0x20, 0x87, 0x54, 0xfe, 0x59, 0x46, 0xd2, 0xdf, 0xda, +- 0xf5, 0xa8, 0xd5, 0x20, 0x35, 0xb8, 0xd0, 0xa6, 0xbe, 0x6f, 0x35, 0x69, 0xb5, 0xd9, 0xf4, 0x68, +- 0x93, 0x6b, 0x77, 0x37, 0xb4, 0xa6, 0xa8, 0xd3, 0x8a, 0xaf, 0x27, 0x21, 0x61, 0x72, 0x5d, 0xf2, +- 0x05, 0x78, 0x6e, 0xdb, 0x73, 0xad, 0x46, 0xdd, 0x62, 0x0a, 0x06, 0xc7, 0xd8, 0x72, 0xa5, 0xd3, +- 0x93, 0x4c, 0x0f, 0xfd, 0xe3, 0x92, 0xf0, 0x73, 0x0b, 0xfd, 0x10, 0xb1, 0x3f, 0x8d, 0xca, 0xff, +- 0xca, 0xc3, 0xa4, 0xf8, 0x0a, 0xe9, 0xda, 0x1b, 0x75, 0xcb, 0xcd, 0x9c, 0xba, 0x5b, 0xee, 0x6d, +- 0x00, 0x9f, 0xb7, 0x67, 0xf0, 0xa5, 0xca, 0x6f, 0x18, 0x6a, 0xba, 0x32, 0x1a, 0x84, 0x06, 0x49, +- 0xbb, 0xf1, 0x0a, 0x8c, 0xc9, 0xc1, 0x90, 0x66, 0x04, 0x8d, 0x2a, 0x7b, 0x0f, 0x15, 0x9c, 0x7c, +- 0x02, 0x26, 0xac, 0x20, 0xb0, 0xea, 0xbb, 0x6d, 0xf9, 0xea, 0x71, 0xc4, 0xbb, 0xa8, 0x1a, 0x82, +- 0xd0, 0xc4, 0xe3, 0x4f, 0xa6, 0xb7, 0xdc, 0xfa, 0x9e, 0xdf, 0xf3, 0x64, 0x3a, 0x2f, 0x45, 0x09, +- 0x25, 0x6d, 0x28, 0x06, 0x7c, 0x72, 0x49, 0x5f, 0x9b, 0xe5, 0x94, 0xab, 0x5e, 0xcc, 0xd4, 0x90, +- 0x9d, 0xf8, 0x8d, 0x92, 0x09, 0x63, 0xe7, 0xf3, 0xb5, 0x22, 0x2d, 0xcf, 0x69, 0xd9, 0x89, 0x85, +- 0x67, 0xec, 0x7a, 0xfc, 0x37, 0x4a, 0x26, 0x95, 0xff, 0x9e, 0x03, 0x52, 0x0b, 0x2c, 0xa7, 0x61, +- 0x79, 0x8d, 0x1b, 0x57, 0x75, 0x4a, 0x1e, 0x76, 0x2a, 0x10, 0xce, 0x1c, 0x42, 0xfe, 0xa7, 0x98, +- 0x7c, 0xea, 0x9a, 0x71, 0xcd, 0x15, 0xaf, 0x8d, 0x0a, 0x19, 0x23, 0xa4, 0x0e, 0x4a, 0x2e, 0x64, +- 0xa3, 0xf7, 0xc0, 0xf6, 0x91, 0x9e, 0x03, 0xdb, 0xe3, 0x87, 0xb3, 0x3f, 0x76, 0xa3, 0xbb, 0x4d, +- 0x3d, 0x87, 0x06, 0xd4, 0x57, 0xde, 0x0d, 0x89, 0xe7, 0xb9, 0x27, 0xed, 0xd7, 0xbe, 0x03, 0x53, +- 0x1d, 0x2b, 0xa8, 0xeb, 0x8c, 0x1c, 0x72, 0x12, 0x7f, 0x4a, 0x69, 0x51, 0x9b, 0x26, 0xf0, 0xf1, +- 0xc3, 0xd9, 0xff, 0x2f, 0x0c, 0xa2, 0xd4, 0x67, 0x9e, 0xf9, 0xce, 0x5e, 0x73, 0x3e, 0x38, 0xe8, +- 0x50, 0x7f, 0x8e, 0xa3, 0xf3, 0x7b, 0xb0, 0x28, 0x59, 0xf2, 0x1a, 0x40, 0xcb, 0xde, 0xa7, 0xe2, +- 0x04, 0x19, 0x77, 0x3b, 0x58, 0xd3, 0x10, 0x34, 0xb0, 0x2a, 0xbf, 0x98, 0x01, 0xa9, 0xfb, 0x90, +- 0xfb, 0x00, 0x75, 0xd7, 0x69, 0xd8, 0x66, 0x62, 0xc5, 0xc5, 0x54, 0xc9, 0x2f, 0x04, 0xad, 0xb0, +- 0x0d, 0xba, 0xc8, 0x47, 0x83, 0x55, 0x65, 0x1e, 0x26, 0x45, 0x13, 0xe4, 0xcb, 0x17, 0xb3, 0x50, +- 0xb0, 0x5a, 0x2d, 0xf7, 0x3e, 0x6f, 0x43, 0x41, 0xec, 0xf7, 0xdc, 0xcd, 0x1d, 0x45, 0x79, 0xe5, +- 0x2f, 0x0a, 0x70, 0x51, 0x86, 0xac, 0x5e, 0xf3, 0xec, 0xc6, 0x13, 0xbd, 0x98, 0x08, 0x9d, 0x02, +- 0xb2, 0x7d, 0x9d, 0x02, 0xc2, 0x5d, 0x3a, 0xf5, 0x6b, 0x5e, 0xc6, 0x67, 0x1f, 0x6e, 0x5d, 0xd3, +- 0xb7, 0x25, 0xf9, 0x23, 0x6f, 0x4b, 0x5e, 0xd2, 0xde, 0x23, 0xb1, 0x5b, 0x88, 0xbe, 0xde, 0x1f, +- 0xc5, 0x43, 0x6d, 0xbe, 0x91, 0x90, 0xf5, 0xb1, 0xe1, 0x84, 0xac, 0xbf, 0x04, 0x45, 0xab, 0x63, +- 0xdf, 0xc6, 0x35, 0x69, 0x7e, 0x0d, 0x5f, 0x71, 0xdf, 0x5c, 0xbd, 0x8d, 0x6b, 0x28, 0xa1, 0x51, +- 0x4f, 0xc5, 0x52, 0x5a, 0x4f, 0xc5, 0xe4, 0x49, 0x76, 0x5a, 0x6e, 0x5b, 0x75, 0x38, 0xdb, 0x33, +- 0xdc, 0x43, 0xf7, 0x3f, 0x78, 0x3f, 0xcf, 0xb8, 0x78, 0x76, 0x87, 0x3e, 0xd1, 0x65, 0xf4, 0x49, +- 0x98, 0x12, 0xfe, 0x53, 0x12, 0x22, 0x55, 0xa9, 0xd0, 0xfd, 0xd5, 0x04, 0x62, 0x14, 0x97, 0xac, +- 0xf2, 0xc9, 0x31, 0xf0, 0x5d, 0x1f, 0xc8, 0xf9, 0xc3, 0xb4, 0x3d, 0x49, 0x80, 0x7c, 0x14, 0x26, +- 0x78, 0xfb, 0x45, 0x6f, 0x4b, 0xcf, 0x41, 0x9e, 0xd6, 0x68, 0x39, 0x2c, 0x46, 0x13, 0x27, 0x1a, +- 0x82, 0x58, 0x48, 0x1b, 0x82, 0xd8, 0x33, 0x16, 0xa7, 0x35, 0xdb, 0xbe, 0x9c, 0x83, 0x92, 0xf6, +- 0xff, 0x25, 0x9f, 0x83, 0x49, 0xe1, 0x8d, 0x73, 0x92, 0x93, 0x1f, 0xb7, 0xb8, 0x0b, 0xdf, 0x1e, +- 0xe5, 0x26, 0x60, 0x12, 0xe3, 0xe1, 0xe9, 0x3c, 0x1b, 0xb5, 0xc1, 0x20, 0x3b, 0x78, 0x78, 0x7a, +- 0x8c, 0x04, 0xf6, 0x10, 0x25, 0x0d, 0x98, 0x11, 0x65, 0xa1, 0xbf, 0x43, 0x6e, 0xe0, 0xa8, 0xa2, +- 0xc5, 0x28, 0x05, 0x8c, 0x93, 0x24, 0x6f, 0x02, 0x51, 0xbe, 0x6c, 0xb5, 0x3d, 0xbb, 0xc3, 0x5f, +- 0x53, 0x3f, 0x88, 0x5b, 0x9f, 0x56, 0x7b, 0x30, 0x30, 0xa1, 0x56, 0xe5, 0xbb, 0xe3, 0xa0, 0x0d, +- 0x5c, 0xa7, 0x6c, 0x79, 0x48, 0x4e, 0x06, 0x94, 0x3d, 0x51, 0x32, 0xa0, 0x37, 0xa1, 0xa4, 0x93, +- 0x6d, 0xc9, 0x2e, 0x7f, 0xa1, 0xcf, 0x23, 0xca, 0x02, 0x49, 0x26, 0x77, 0x55, 0x3f, 0x31, 0xac, +- 0x4e, 0x96, 0x61, 0x4c, 0xa4, 0x71, 0x50, 0xd9, 0x14, 0x2f, 0x25, 0x51, 0x12, 0x59, 0x1f, 0x8c, +- 0xcc, 0x2b, 0xa2, 0x0a, 0xaa, 0xba, 0x49, 0x69, 0x9e, 0x0a, 0x23, 0x48, 0xf3, 0xf4, 0xad, 0xe4, +- 0x4c, 0x5d, 0x5b, 0xe9, 0xad, 0x9f, 0x1f, 0xac, 0x1c, 0x5d, 0x49, 0xa9, 0xaa, 0xc6, 0x4f, 0xfb, +- 0x0d, 0xc2, 0x52, 0xca, 0xf4, 0x52, 0x70, 0xec, 0xf4, 0x52, 0x13, 0x27, 0x4f, 0x2f, 0x95, 0x3e, +- 0x2d, 0x51, 0x0d, 0x60, 0xcb, 0x6e, 0x2b, 0xd7, 0xed, 0x17, 0xa1, 0xc0, 0x1f, 0x0f, 0x8c, 0x67, +- 0x9f, 0x11, 0x3e, 0xc5, 0x02, 0x46, 0xae, 0x40, 0xde, 0x0f, 0xdc, 0x4e, 0xdc, 0x5a, 0x52, 0x0b, +- 0xdc, 0x0e, 0x72, 0x48, 0xe5, 0xcb, 0x45, 0x18, 0x53, 0x27, 0x3c, 0xdf, 0xb0, 0xd6, 0xa7, 0x7e, +- 0x6e, 0x5f, 0x12, 0x3d, 0xd2, 0x68, 0x1f, 0x3d, 0x96, 0x65, 0x4f, 0xfd, 0x58, 0xb6, 0x07, 0xc5, +- 0x0e, 0x3f, 0x70, 0x48, 0x01, 0x75, 0x2d, 0x3d, 0x6f, 0x4e, 0x4e, 0xe8, 0x15, 0xe2, 0x7f, 0x94, +- 0x2c, 0xc8, 0xbb, 0x30, 0xe5, 0xd1, 0xc0, 0x3b, 0x88, 0x9c, 0x01, 0x87, 0x12, 0x74, 0xca, 0xcd, +- 0xac, 0x68, 0xd2, 0xc6, 0x28, 0x2b, 0xd2, 0x81, 0x92, 0xa7, 0xc2, 0x1d, 0xd3, 0xe7, 0x85, 0xd5, +- 0x91, 0x93, 0x42, 0x64, 0xeb, 0x9f, 0x18, 0x32, 0x11, 0x56, 0x98, 0x35, 0x6a, 0xf9, 0xc1, 0x4d, +- 0xf5, 0xc6, 0xed, 0xb8, 0x69, 0x85, 0xd1, 0x20, 0x34, 0xf1, 0xc8, 0x3d, 0x80, 0x46, 0xeb, 0x9e, +- 0xec, 0x4c, 0x79, 0x72, 0x18, 0xc2, 0x3d, 0x15, 0xb7, 0x42, 0x2d, 0x69, 0xc2, 0x68, 0x30, 0xa9, +- 0xfc, 0xb7, 0x0c, 0x9c, 0x89, 0xcf, 0x1c, 0xb2, 0x07, 0x39, 0xdf, 0x53, 0x59, 0xed, 0x37, 0x87, +- 0x37, 0x25, 0xe5, 0xad, 0x36, 0x8f, 0xad, 0xaa, 0x79, 0x75, 0x64, 0x5c, 0xd8, 0x4a, 0xd5, 0x4f, +- 0xcb, 0x19, 0x2b, 0x75, 0x89, 0xfa, 0x01, 0x72, 0x08, 0x59, 0x33, 0xed, 0x21, 0xc2, 0x56, 0x36, +- 0x97, 0x64, 0x0f, 0x79, 0x2e, 0xce, 0x2f, 0xc9, 0x1a, 0x52, 0xf9, 0x7a, 0x0e, 0x2e, 0x26, 0x37, +- 0x8c, 0xbc, 0x01, 0xd3, 0xfa, 0xd6, 0xf0, 0xc0, 0xc8, 0x11, 0xa5, 0x7d, 0x5d, 0x96, 0x22, 0x50, +- 0x8c, 0x61, 0x93, 0xd7, 0xb8, 0x05, 0x81, 0x6d, 0x83, 0xca, 0xd3, 0xa8, 0x14, 0x39, 0xfc, 0x4b, +- 0x08, 0x1a, 0x58, 0xa4, 0x0a, 0x33, 0xf2, 0x57, 0xe4, 0xc9, 0xeb, 0x52, 0xe8, 0xfb, 0xb3, 0x18, +- 0x05, 0x63, 0x1c, 0x9f, 0xbc, 0x02, 0x63, 0x4c, 0x81, 0x51, 0x7e, 0x79, 0x86, 0x79, 0x70, 0x49, +- 0x14, 0xa3, 0x82, 0x93, 0xab, 0x30, 0xc9, 0xfe, 0x8d, 0xa4, 0xf8, 0x34, 0x2e, 0xf7, 0x96, 0x0c, +- 0x18, 0x46, 0x30, 0xc3, 0x57, 0x3c, 0x8b, 0x61, 0x16, 0x6c, 0xd3, 0x21, 0x80, 0x7d, 0x7c, 0xd7, +- 0xa7, 0x68, 0xdd, 0x5f, 0x52, 0xef, 0x2a, 0x1b, 0xd6, 0x97, 0xdb, 0x1a, 0x82, 0x06, 0x56, 0xe5, +- 0x47, 0x19, 0x98, 0x8a, 0xc8, 0x0e, 0xb2, 0x03, 0xb9, 0xbd, 0xab, 0xea, 0x7e, 0xeb, 0xc6, 0x10, +- 0x9f, 0xfc, 0x14, 0xb3, 0xee, 0xc6, 0x55, 0x1f, 0x19, 0x03, 0xf2, 0x8e, 0xbe, 0x4a, 0xcb, 0xa6, +- 0xbe, 0xe9, 0x37, 0x6c, 0x37, 0xd2, 0x9e, 0x17, 0xbd, 0x4c, 0xfb, 0x17, 0xd3, 0x30, 0x13, 0xdb, +- 0x14, 0x8e, 0xe1, 0x59, 0xf2, 0x5a, 0xc4, 0x1c, 0xd5, 0x3b, 0x99, 0x12, 0x2c, 0x49, 0xa4, 0x29, +- 0x7a, 0x2f, 0x97, 0xf6, 0x09, 0xbc, 0x5e, 0x23, 0x68, 0xac, 0xfb, 0xbe, 0x9c, 0x81, 0x49, 0x46, +- 0xe9, 0xae, 0xeb, 0xed, 0xed, 0xb4, 0xdc, 0xfb, 0x52, 0x9c, 0xaf, 0xa7, 0xb1, 0x8c, 0x86, 0xd4, +- 0xf4, 0x05, 0x3b, 0x7f, 0x6b, 0xc0, 0x00, 0x60, 0x84, 0x29, 0xa9, 0x43, 0x7e, 0x37, 0x08, 0x3a, +- 0x52, 0xa6, 0xa7, 0x30, 0x0e, 0x5f, 0xdf, 0xda, 0xda, 0x54, 0x4c, 0x79, 0x36, 0x6e, 0x56, 0x80, +- 0x9c, 0x38, 0xb9, 0x0f, 0x25, 0xeb, 0xbe, 0xbf, 0x66, 0xb5, 0xb7, 0x1b, 0x96, 0xf4, 0xea, 0x4e, +- 0x63, 0x00, 0xbe, 0x5b, 0x13, 0xa4, 0x14, 0x3b, 0x61, 0xf2, 0x51, 0xa5, 0x18, 0xf2, 0x22, 0x1e, +- 0x14, 0xeb, 0x5d, 0x3f, 0x70, 0xdb, 0x72, 0x27, 0x48, 0xb1, 0x3f, 0x2f, 0x72, 0x3a, 0x8a, 0xa5, +- 0x08, 0x3d, 0x31, 0x8b, 0x50, 0x72, 0x22, 0x4d, 0x28, 0xec, 0x59, 0x3b, 0x7b, 0x2a, 0xed, 0xec, +- 0xca, 0x70, 0x5e, 0xcb, 0x12, 0xd2, 0x82, 0x97, 0xa0, 0xa0, 0xcf, 0x86, 0xce, 0xb1, 0x02, 0x5f, +- 0x3a, 0xb5, 0x2e, 0xa7, 0xcb, 0xa2, 0x1e, 0x19, 0x3a, 0x56, 0x80, 0x9c, 0x38, 0xfb, 0x1a, 0x7e, +- 0xe1, 0x22, 0x23, 0x73, 0x56, 0xd2, 0x5e, 0x56, 0x98, 0x5f, 0xc3, 0x4b, 0x50, 0xd0, 0x67, 0x73, +- 0xc4, 0x55, 0x69, 0x33, 0xa5, 0xaa, 0x9c, 0x62, 0x8e, 0xc4, 0x33, 0x70, 0x8a, 0x39, 0xa2, 0x4b, +- 0x31, 0xe4, 0x45, 0xbe, 0x00, 0xb9, 0x96, 0xdb, 0x4c, 0xff, 0x9e, 0x5b, 0xf8, 0xce, 0x97, 0x58, +- 0xe8, 0x6b, 0x6e, 0x13, 0x19, 0x65, 0xf2, 0x2b, 0x19, 0x98, 0xb6, 0xde, 0xed, 0x7a, 0xc2, 0x22, +- 0x73, 0xbd, 0xbb, 0xed, 0x4b, 0xe7, 0xc3, 0x9b, 0x29, 0xd6, 0x40, 0x84, 0x9e, 0xe2, 0xcb, 0x43, +- 0x66, 0xa2, 0x20, 0x8c, 0xb1, 0xe6, 0x2a, 0x2b, 0xcf, 0xf1, 0x21, 0x13, 0x1b, 0x5d, 0x1b, 0x52, +- 0xae, 0x10, 0xa9, 0xb2, 0xf2, 0x22, 0x94, 0x2c, 0xc8, 0xf7, 0x32, 0x7c, 0x6b, 0x56, 0x72, 0x96, +- 0xfa, 0x34, 0x90, 0xcf, 0xb7, 0xdd, 0x1a, 0xc2, 0xad, 0x80, 0x20, 0xb8, 0xe8, 0xd9, 0x01, 0xf5, +- 0x6c, 0x2b, 0xb2, 0xdb, 0x9b, 0x08, 0x18, 0x6f, 0x02, 0xf9, 0x76, 0x06, 0x66, 0x78, 0xb7, 0x48, +- 0x53, 0xc4, 0x42, 0x57, 0x64, 0xed, 0x4d, 0xa5, 0xa9, 0x55, 0xa3, 0x04, 0x55, 0xb7, 0x88, 0xac, +- 0x32, 0x51, 0x18, 0xc6, 0xb9, 0xb3, 0x65, 0x46, 0xdb, 0x96, 0xdd, 0xe2, 0x49, 0x81, 0x53, 0x2d, +- 0xb3, 0x65, 0x46, 0x26, 0xb2, 0xcc, 0x78, 0x09, 0x0a, 0xfa, 0x95, 0x3a, 0x4c, 0xdc, 0xc6, 0x35, +- 0x1d, 0x23, 0x7a, 0x74, 0xc2, 0xd0, 0xd7, 0x00, 0xf6, 0xb9, 0x5d, 0x69, 0x91, 0x7a, 0xea, 0xf1, +- 0x62, 0xbd, 0x87, 0xde, 0xd1, 0x10, 0x34, 0xb0, 0x2a, 0x7f, 0x96, 0x81, 0x99, 0x98, 0x1f, 0xa6, +- 0xf0, 0xbf, 0x55, 0x5e, 0xe0, 0x74, 0xe7, 0x04, 0xd6, 0xc0, 0x9a, 0x51, 0x1d, 0x23, 0xc4, 0x48, +- 0x93, 0x4f, 0xb3, 0x1d, 0xbb, 0xb9, 0x6e, 0x75, 0x24, 0x7d, 0xa1, 0x93, 0xbc, 0xdc, 0xc7, 0x62, +- 0xa4, 0x51, 0x63, 0x76, 0xba, 0x28, 0x11, 0x8c, 0x53, 0xad, 0x7c, 0x3f, 0x03, 0xf1, 0x08, 0x2e, +- 0x32, 0x0f, 0xa5, 0x86, 0xed, 0x71, 0x2a, 0x07, 0xf1, 0x80, 0xb3, 0x25, 0x05, 0xc0, 0x10, 0x47, +- 0x77, 0x7a, 0xf6, 0xb0, 0x4e, 0x67, 0x7f, 0x91, 0x36, 0xe9, 0x83, 0x8e, 0x54, 0x66, 0x8d, 0xb3, +- 0xa8, 0x82, 0xa0, 0x81, 0x55, 0xf9, 0xd7, 0x05, 0x98, 0x8e, 0xda, 0xc9, 0x07, 0x8c, 0x00, 0x7e, +- 0x09, 0x8a, 0x6d, 0x1a, 0xec, 0xba, 0x8d, 0xb8, 0xb9, 0x7f, 0x9d, 0x97, 0xa2, 0x84, 0xf2, 0xe6, +- 0xbb, 0x5e, 0x20, 0x9b, 0x15, 0x36, 0xdf, 0xf5, 0x02, 0xe4, 0x10, 0xe5, 0xb8, 0x9c, 0xef, 0xe3, +- 0xb8, 0xdc, 0x84, 0x33, 0x3e, 0xf5, 0xf6, 0xa9, 0x67, 0xd8, 0x6e, 0x07, 0x4f, 0x2d, 0x5a, 0x8b, +- 0x91, 0xc0, 0x1e, 0xa2, 0xa4, 0x01, 0x33, 0xa2, 0x2c, 0xb4, 0xdd, 0x16, 0x07, 0xb6, 0xdd, 0xd6, +- 0xa2, 0x14, 0x30, 0x4e, 0x72, 0xc8, 0xe1, 0x32, 0xd1, 0x21, 0x1c, 0xc0, 0x8f, 0xe7, 0x36, 0x80, +- 0xd5, 0x0d, 0x76, 0xe5, 0x77, 0x8e, 0x0f, 0xec, 0x63, 0x51, 0xd5, 0x95, 0xd1, 0x20, 0x44, 0x5e, +- 0x87, 0xe9, 0x30, 0x7d, 0x38, 0xcf, 0xab, 0x2b, 0xde, 0x63, 0xe6, 0x7b, 0xcd, 0x7a, 0x04, 0x82, +- 0x31, 0xcc, 0x94, 0xaf, 0xfa, 0x64, 0x81, 0xc8, 0xce, 0x30, 0xaf, 0x95, 0xbe, 0x96, 0x81, 0xe9, +- 0xfb, 0x91, 0x3e, 0x1a, 0xfa, 0xf5, 0x92, 0x3e, 0xab, 0x46, 0xcb, 0x31, 0xc6, 0xd7, 0xb8, 0x93, +- 0xcd, 0x9e, 0x8a, 0xe7, 0xd4, 0xc2, 0x5b, 0x3f, 0xf8, 0xe1, 0xe5, 0x67, 0xfe, 0xe8, 0x87, 0x97, +- 0x9f, 0xf9, 0xf3, 0x1f, 0x5e, 0x7e, 0xe6, 0xbd, 0x47, 0x97, 0x33, 0x3f, 0x78, 0x74, 0x39, 0xf3, +- 0x47, 0x8f, 0x2e, 0x67, 0xfe, 0xfc, 0xd1, 0xe5, 0xcc, 0x7f, 0x78, 0x74, 0x39, 0xf3, 0x9d, 0x1f, +- 0x5d, 0x7e, 0xe6, 0xb3, 0x57, 0xc3, 0x56, 0xcc, 0xab, 0x56, 0xf0, 0x7f, 0x3e, 0x2c, 0xb8, 0x72, +- 0x3f, 0x00, 0xd6, 0x8a, 0x79, 0xf9, 0x5b, 0xb5, 0xe2, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xda, +- 0x88, 0x9a, 0xd6, 0x5c, 0x1b, 0x01, 0x00, ++ // 13058 bytes of a gzipped FileDescriptorProto ++ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x6c, 0x24, 0xc9, ++ 0x75, 0xd8, 0xcd, 0x27, 0x39, 0x8f, 0x9f, 0x5b, 0xfb, 0x71, 0xbc, 0xf5, 0xdd, 0x72, 0x3d, 0x07, ++ 0x5d, 0xee, 0xec, 0x13, 0x29, 0xad, 0x24, 0x7b, 0x7d, 0x8a, 0xcf, 0x1a, 0x7e, 0xed, 0xf2, 0x96, ++ 0xe4, 0x72, 0xdf, 0x70, 0x77, 0xf5, 0xe5, 0xbb, 0x6b, 0xce, 0x14, 0x87, 0x7d, 0x9c, 0xe9, 0x9e, ++ 0xed, 0xee, 0xe1, 0x2e, 0x2f, 0x90, 0x7c, 0xb6, 0xa4, 0xb3, 0x24, 0x2b, 0x92, 0x2c, 0x08, 0x86, ++ 0x12, 0x38, 0x46, 0x0c, 0x23, 0xb1, 0x9d, 0xc4, 0x40, 0x10, 0x03, 0x4e, 0x7e, 0x06, 0x09, 0x92, ++ 0x08, 0x81, 0x03, 0xd8, 0x80, 0x1d, 0x1b, 0x49, 0xb0, 0x88, 0x56, 0x4e, 0x02, 0x04, 0x70, 0x3e, ++ 0x7e, 0x25, 0xd9, 0xfc, 0x09, 0xea, 0xb3, 0xab, 0x7b, 0x7a, 0x48, 0x0e, 0x7b, 0x86, 0x7b, 0x8b, ++ 0xe8, 0x17, 0x39, 0xf5, 0x5e, 0xbd, 0x57, 0x5d, 0x1f, 0xaf, 0x5e, 0xbd, 0x7a, 0xef, 0x15, 0x5c, ++ 0x6f, 0xd8, 0xc1, 0x6e, 0x67, 0x7b, 0xae, 0xe6, 0xb6, 0xe6, 0x2d, 0xaf, 0xe1, 0xb6, 0x3d, 0xf7, ++ 0x1d, 0xfe, 0xcf, 0x87, 0xe9, 0x3e, 0x75, 0x02, 0x7f, 0xbe, 0xbd, 0xd7, 0x98, 0xb7, 0xda, 0xb6, ++ 0x3f, 0x2f, 0x7f, 0xef, 0x7f, 0xd4, 0x6a, 0xb6, 0x77, 0xad, 0x8f, 0xce, 0x37, 0xa8, 0x43, 0x3d, ++ 0x2b, 0xa0, 0xf5, 0xb9, 0xb6, 0xe7, 0x06, 0x2e, 0xb9, 0x1a, 0x52, 0x9a, 0x53, 0x94, 0xf8, 0x3f, ++ 0x6f, 0x89, 0x9a, 0x73, 0xed, 0xbd, 0xc6, 0x1c, 0xa3, 0x34, 0x27, 0x7f, 0x2b, 0x4a, 0x17, 0x3f, ++ 0x6c, 0xb4, 0xa1, 0xe1, 0x36, 0xdc, 0x79, 0x4e, 0x70, 0xbb, 0xb3, 0xc3, 0x7f, 0xf1, 0x1f, 0xfc, ++ 0x3f, 0xc1, 0xe8, 0x62, 0x79, 0xef, 0xaa, 0x3f, 0x67, 0xbb, 0xac, 0x55, 0xf3, 0x35, 0xd7, 0xa3, ++ 0xf3, 0xfb, 0x5d, 0x8d, 0xb9, 0xf8, 0xf1, 0x10, 0xa7, 0x65, 0xd5, 0x76, 0x6d, 0x87, 0x7a, 0x07, ++ 0xea, 0x53, 0xe6, 0x3d, 0xea, 0xbb, 0x1d, 0xaf, 0x46, 0xfb, 0xaa, 0xe5, 0xcf, 0xb7, 0x68, 0x60, ++ 0x25, 0xf1, 0x9a, 0xef, 0x55, 0xcb, 0xeb, 0x38, 0x81, 0xdd, 0xea, 0x66, 0xf3, 0x53, 0x47, 0x55, ++ 0xf0, 0x6b, 0xbb, 0xb4, 0x65, 0xc5, 0xeb, 0x95, 0xff, 0x4f, 0x06, 0xce, 0x54, 0xd6, 0x6f, 0x6d, ++ 0x2e, 0xba, 0x8e, 0xdf, 0x69, 0xd1, 0x45, 0xd7, 0xd9, 0xb1, 0x1b, 0xe4, 0x13, 0x30, 0x56, 0x13, ++ 0x05, 0xde, 0x96, 0xd5, 0x98, 0xc9, 0x5c, 0xce, 0xbc, 0x5c, 0x5a, 0x38, 0xfb, 0xfd, 0x87, 0xb3, ++ 0xcf, 0x3c, 0x7a, 0x38, 0x3b, 0xb6, 0x18, 0x82, 0xd0, 0xc4, 0x23, 0xaf, 0xc0, 0x88, 0xd5, 0x09, ++ 0xdc, 0x4a, 0x6d, 0x6f, 0x26, 0x7b, 0x39, 0xf3, 0xf2, 0xe8, 0xc2, 0x94, 0xac, 0x32, 0x52, 0x11, ++ 0xc5, 0xa8, 0xe0, 0x64, 0x1e, 0x4a, 0xf4, 0x41, 0xad, 0xd9, 0xf1, 0xed, 0x7d, 0x3a, 0x93, 0xe3, ++ 0xc8, 0x67, 0x24, 0x72, 0x69, 0x59, 0x01, 0x30, 0xc4, 0x61, 0xb4, 0x1d, 0x77, 0xcd, 0xad, 0x59, ++ 0xcd, 0x99, 0x7c, 0x94, 0xf6, 0x86, 0x28, 0x46, 0x05, 0x27, 0x2f, 0x41, 0xd1, 0x71, 0xef, 0x5a, ++ 0x76, 0x30, 0x53, 0xe0, 0x98, 0x93, 0x12, 0xb3, 0xb8, 0xc1, 0x4b, 0x51, 0x42, 0xcb, 0xff, 0x75, ++ 0x0c, 0xa6, 0xd8, 0xb7, 0x2f, 0xb3, 0xb9, 0x53, 0xe5, 0xc3, 0x47, 0x5e, 0x80, 0x5c, 0xc7, 0x6b, ++ 0xca, 0x2f, 0x1e, 0x93, 0x15, 0x73, 0xb7, 0x71, 0x0d, 0x59, 0x39, 0xb9, 0x0a, 0xe3, 0xf4, 0x41, ++ 0x6d, 0xd7, 0x72, 0x1a, 0x74, 0xc3, 0x6a, 0x51, 0xfe, 0x99, 0xa5, 0x85, 0x73, 0x12, 0x6f, 0x7c, ++ 0xd9, 0x80, 0x61, 0x04, 0xd3, 0xac, 0xb9, 0x75, 0xd0, 0x16, 0xdf, 0x9c, 0x50, 0x93, 0xc1, 0x30, ++ 0x82, 0x49, 0xae, 0x00, 0x78, 0x6e, 0x27, 0xb0, 0x9d, 0xc6, 0x0d, 0x7a, 0xc0, 0x3f, 0xbe, 0xb4, ++ 0x40, 0x64, 0x3d, 0x40, 0x0d, 0x41, 0x03, 0x8b, 0xbc, 0x9f, 0x81, 0x33, 0x35, 0xd7, 0x71, 0x68, ++ 0x2d, 0xb0, 0x5d, 0x67, 0xc1, 0xaa, 0xed, 0xb9, 0x3b, 0x3b, 0xbc, 0x3b, 0xc6, 0xae, 0x54, 0xe6, ++ 0x4e, 0xba, 0xaa, 0xe6, 0x24, 0xa1, 0x85, 0xf3, 0x8f, 0x1e, 0xce, 0x9e, 0x59, 0x8c, 0xd3, 0xc7, ++ 0x6e, 0x96, 0xe4, 0x55, 0x18, 0x7d, 0xc7, 0x77, 0x9d, 0x05, 0xb7, 0x7e, 0x30, 0x53, 0xe4, 0xa3, ++ 0x31, 0x2d, 0x9b, 0x3e, 0xfa, 0x46, 0xf5, 0xe6, 0x06, 0x2b, 0x47, 0x8d, 0x41, 0xde, 0x84, 0x5c, ++ 0xd0, 0xf4, 0x67, 0x46, 0x78, 0x3b, 0x17, 0x4f, 0xde, 0xce, 0xad, 0xb5, 0xaa, 0x98, 0xc9, 0x0b, ++ 0x23, 0x6c, 0xf8, 0xb6, 0xd6, 0xaa, 0xc8, 0x08, 0x93, 0xaf, 0x64, 0x60, 0x94, 0x2d, 0xb9, 0xba, ++ 0x15, 0x58, 0x33, 0xa3, 0x97, 0x73, 0x2f, 0x8f, 0x5d, 0xb9, 0x7b, 0x72, 0x2e, 0xb1, 0xb9, 0x33, ++ 0xb7, 0x2e, 0x29, 0x2f, 0x3b, 0x81, 0x77, 0x10, 0x7e, 0xa7, 0x2a, 0x46, 0xcd, 0x9a, 0x7c, 0x27, ++ 0x03, 0x53, 0x6a, 0x8c, 0x97, 0x68, 0xad, 0x69, 0x79, 0x74, 0xa6, 0xc4, 0x3f, 0xba, 0x9a, 0xb2, ++ 0x39, 0x51, 0xa2, 0xb2, 0x13, 0xce, 0x3e, 0x7a, 0x38, 0x3b, 0x15, 0x03, 0x61, 0xbc, 0x01, 0x6c, ++ 0xce, 0x8c, 0xdf, 0xeb, 0xd0, 0x8e, 0x6e, 0x11, 0xf0, 0x16, 0x6d, 0xa6, 0x6b, 0xd1, 0x2d, 0x83, ++ 0xa2, 0x6c, 0xce, 0x34, 0x9b, 0xf0, 0x66, 0x39, 0x46, 0xf8, 0x92, 0x77, 0xa1, 0xc4, 0x7f, 0x2f, ++ 0xd8, 0x4e, 0x7d, 0x66, 0x8c, 0x37, 0x62, 0x7d, 0x00, 0x8d, 0x60, 0xe4, 0x64, 0x0b, 0x26, 0x98, ++ 0x98, 0xd1, 0x85, 0x18, 0xb2, 0x23, 0x1e, 0x8c, 0x48, 0x89, 0x36, 0x33, 0xce, 0x39, 0xdf, 0x48, ++ 0xc7, 0x39, 0x22, 0x57, 0x17, 0xc6, 0x98, 0xbc, 0x92, 0x45, 0xa8, 0x18, 0x11, 0x0b, 0xf2, 0x56, ++ 0x27, 0xd8, 0x9d, 0x99, 0x48, 0x3b, 0xed, 0x17, 0x2c, 0xdf, 0xae, 0x55, 0x3a, 0xc1, 0xee, 0xc2, ++ 0xe8, 0xa3, 0x87, 0xb3, 0x79, 0xf6, 0x1f, 0x72, 0xd2, 0x04, 0xa1, 0xd4, 0xf1, 0x9a, 0x55, 0x5a, ++ 0xf3, 0x68, 0x30, 0x33, 0xc9, 0xf9, 0x7c, 0x68, 0x4e, 0x6c, 0x19, 0x8c, 0xd4, 0x1c, 0xdb, 0xf3, ++ 0xe6, 0xf6, 0x3f, 0x3a, 0x27, 0x30, 0x6e, 0xd0, 0x83, 0x2a, 0x6d, 0xd2, 0x5a, 0xe0, 0x7a, 0xa2, ++ 0xab, 0x6e, 0xe3, 0x9a, 0x80, 0x60, 0x48, 0x86, 0xb8, 0x50, 0xdc, 0xb1, 0x9b, 0x01, 0xf5, 0x66, ++ 0xa6, 0xd2, 0xf6, 0x94, 0xb1, 0x8a, 0x56, 0x38, 0xc9, 0x05, 0x60, 0xf2, 0x5a, 0xfc, 0x8f, 0x92, ++ 0xcd, 0xc5, 0x4f, 0xc2, 0x44, 0x64, 0x89, 0x91, 0x69, 0xc8, 0xed, 0xd1, 0x03, 0x21, 0xac, 0x91, ++ 0xfd, 0x4b, 0xce, 0x41, 0x61, 0xdf, 0x6a, 0x76, 0xa4, 0x60, 0x46, 0xf1, 0xe3, 0xb5, 0xec, 0xd5, ++ 0x4c, 0xf9, 0x8f, 0x32, 0xf0, 0x5c, 0xcf, 0x15, 0xc2, 0x76, 0x97, 0x7a, 0xc7, 0xb3, 0xb6, 0x9b, ++ 0x94, 0x53, 0x33, 0x76, 0x97, 0x25, 0x51, 0x8c, 0x0a, 0xce, 0xc4, 0x31, 0xdb, 0xc4, 0x96, 0x68, ++ 0x93, 0x06, 0x54, 0xee, 0x73, 0x5a, 0x1c, 0x57, 0x34, 0x04, 0x0d, 0x2c, 0x26, 0x05, 0x6d, 0x27, ++ 0xa0, 0x9e, 0x63, 0x35, 0xe5, 0x66, 0xa7, 0xa5, 0xc3, 0xaa, 0x2c, 0x47, 0x8d, 0x61, 0xec, 0x5f, ++ 0xf9, 0x43, 0xf7, 0xaf, 0x9f, 0x85, 0xb3, 0x09, 0x93, 0xdb, 0xa8, 0x9e, 0x39, 0xb4, 0xfa, 0x6f, ++ 0x65, 0xe1, 0x42, 0xf2, 0x0a, 0x25, 0x97, 0x21, 0xef, 0xb0, 0xed, 0x4d, 0x6c, 0x83, 0xe3, 0x92, ++ 0x40, 0x9e, 0x6f, 0x6b, 0x1c, 0x62, 0x76, 0x58, 0xb6, 0xaf, 0x0e, 0xcb, 0x1d, 0xab, 0xc3, 0x22, ++ 0xea, 0x41, 0xfe, 0x18, 0xea, 0xc1, 0x31, 0xf7, 0x7c, 0x46, 0xd8, 0xf2, 0x1a, 0x9d, 0x16, 0x9b, ++ 0x7f, 0x7c, 0x43, 0x2a, 0x85, 0x84, 0x2b, 0x0a, 0x80, 0x21, 0x4e, 0xf9, 0x71, 0x1e, 0xa6, 0x2b, ++ 0x77, 0xab, 0x6b, 0x56, 0x6b, 0xbb, 0x6e, 0x6d, 0x79, 0x76, 0xa3, 0x41, 0x3d, 0xb6, 0x99, 0xef, ++ 0x74, 0x1c, 0xbe, 0xd1, 0x6d, 0x84, 0xfd, 0xa4, 0x37, 0xf3, 0x15, 0x03, 0x86, 0x11, 0x4c, 0xb6, ++ 0x10, 0xad, 0x5a, 0x8d, 0xfa, 0x3e, 0xdb, 0xcb, 0xb3, 0x7d, 0x2f, 0xc4, 0x8a, 0xaa, 0x8b, 0x21, ++ 0x19, 0x46, 0xd3, 0x57, 0xe8, 0xbc, 0x7f, 0xfb, 0xa3, 0xa9, 0x8b, 0x31, 0x24, 0xc3, 0xfa, 0xd3, ++ 0xa3, 0x0d, 0xdb, 0x75, 0xa4, 0xc2, 0xa1, 0xfb, 0x13, 0x79, 0x29, 0x4a, 0x28, 0xe9, 0xc0, 0x48, ++ 0xdb, 0x3a, 0x68, 0xba, 0x56, 0x7d, 0xa6, 0xc0, 0xf7, 0xd3, 0x37, 0x52, 0xec, 0xda, 0xa2, 0x77, ++ 0x37, 0x2d, 0xcf, 0x6a, 0x51, 0x26, 0x04, 0xf4, 0x9c, 0xda, 0x14, 0x2c, 0x50, 0xf1, 0x22, 0x5f, ++ 0x04, 0x68, 0x2b, 0x34, 0x36, 0x8e, 0x83, 0xe6, 0xac, 0xe7, 0xa7, 0x2e, 0xf2, 0xd1, 0xe0, 0x48, ++ 0x5e, 0x83, 0x49, 0xdb, 0xd9, 0x77, 0x6b, 0x16, 0x1b, 0x58, 0xae, 0xcf, 0x8d, 0x08, 0xbd, 0xec, ++ 0xd1, 0xc3, 0xd9, 0xc9, 0xd5, 0x08, 0x04, 0x63, 0x98, 0x6c, 0xe9, 0x78, 0x6e, 0x93, 0x56, 0x70, ++ 0x63, 0x66, 0x94, 0x57, 0xd2, 0x9f, 0x89, 0xa2, 0x18, 0x15, 0xbc, 0xfc, 0x0a, 0x14, 0x2b, 0x2d, ++ 0xb7, 0xe3, 0x04, 0x64, 0x56, 0x09, 0x36, 0x36, 0xd5, 0xc6, 0x17, 0x4a, 0x8f, 0x1e, 0xce, 0x16, ++ 0xee, 0xb0, 0x02, 0x29, 0xe3, 0xca, 0x7f, 0x99, 0x85, 0xb3, 0x15, 0xaf, 0xe1, 0xde, 0x75, 0xbd, ++ 0xbd, 0x9d, 0xa6, 0x7b, 0x5f, 0x4d, 0x55, 0x07, 0x8a, 0xe2, 0x64, 0xc2, 0x6b, 0xa6, 0xea, 0xa5, ++ 0x8a, 0x17, 0xd8, 0x3b, 0x56, 0x2d, 0x58, 0x93, 0x5f, 0x23, 0x84, 0xb4, 0x10, 0xdb, 0x28, 0xb9, ++ 0x90, 0xeb, 0x50, 0x72, 0xdb, 0xec, 0x88, 0xc1, 0xe6, 0x8e, 0x50, 0x8f, 0x7f, 0x42, 0x2d, 0xb0, ++ 0x9b, 0x0a, 0xf0, 0xf8, 0xe1, 0xec, 0x79, 0xb3, 0xb1, 0x1a, 0x80, 0x61, 0xe5, 0xd8, 0x18, 0xe7, ++ 0x4e, 0x7d, 0x8c, 0x9f, 0x87, 0xbc, 0xe5, 0x35, 0xfc, 0x99, 0xfc, 0xe5, 0xdc, 0xcb, 0x25, 0xb9, ++ 0xa3, 0x7a, 0x0d, 0x1f, 0x79, 0x69, 0xf9, 0xfd, 0x02, 0x4c, 0xc7, 0x3b, 0x84, 0x7c, 0x1e, 0xb2, ++ 0xfe, 0xc7, 0x64, 0x47, 0x2f, 0x9d, 0xbc, 0xa9, 0xd5, 0x8f, 0x29, 0xca, 0x0b, 0xc5, 0x47, 0x0f, ++ 0x67, 0xb3, 0xd5, 0x8f, 0x61, 0xd6, 0xff, 0x18, 0x29, 0x43, 0xd1, 0x76, 0x9a, 0xb6, 0xa3, 0x8e, ++ 0x1d, 0xbc, 0xfb, 0x57, 0x79, 0x09, 0x4a, 0x08, 0xa9, 0x43, 0x7e, 0xc7, 0x6e, 0x52, 0x29, 0x06, ++ 0x56, 0x4e, 0xde, 0x86, 0x15, 0xbb, 0x49, 0x75, 0x2b, 0xf8, 0xc7, 0xb3, 0x12, 0xe4, 0xd4, 0xc9, ++ 0xdb, 0xe2, 0x94, 0x94, 0xe7, 0x4c, 0x96, 0x4f, 0xce, 0xe4, 0x36, 0xae, 0x69, 0x1e, 0x23, 0x91, ++ 0x83, 0xd6, 0x6d, 0x28, 0xd5, 0xf8, 0x5e, 0xd4, 0xb2, 0xda, 0xf2, 0xdc, 0xf2, 0x72, 0x92, 0x4c, ++ 0x13, 0x1b, 0xd6, 0xba, 0xd5, 0xee, 0x12, 0x6b, 0x8b, 0xaa, 0x3a, 0x86, 0x94, 0x58, 0xc3, 0x1b, ++ 0x76, 0xc0, 0x05, 0x7f, 0xaa, 0x86, 0x5f, 0xb3, 0x83, 0x68, 0xc3, 0xaf, 0xd9, 0x01, 0x32, 0xd2, ++ 0xc4, 0x85, 0x51, 0x65, 0x0b, 0x90, 0xe7, 0x98, 0x14, 0x6c, 0x6e, 0x5c, 0xad, 0xa2, 0x24, 0xb6, ++ 0x30, 0xce, 0xb4, 0x05, 0xf5, 0x0b, 0x35, 0x93, 0xf2, 0xef, 0xe7, 0xe1, 0x7c, 0xe5, 0xdd, 0x8e, ++ 0x47, 0xb9, 0x12, 0x75, 0xbd, 0xb3, 0xed, 0xab, 0xa5, 0x7f, 0x19, 0xf2, 0x3b, 0xf7, 0xea, 0x4e, ++ 0x7c, 0x17, 0x5f, 0xb9, 0xb5, 0xb4, 0x81, 0x1c, 0xc2, 0x44, 0xd1, 0x6e, 0x67, 0xdb, 0x38, 0xc9, ++ 0x6a, 0x51, 0x74, 0x5d, 0x14, 0xa3, 0x82, 0x93, 0x36, 0x9c, 0xf5, 0x77, 0x2d, 0x8f, 0xd6, 0xf5, ++ 0x16, 0xc4, 0xab, 0xf5, 0xb5, 0xdd, 0x3c, 0xfb, 0xe8, 0xe1, 0xec, 0xd9, 0x6a, 0x37, 0x15, 0x4c, ++ 0x22, 0x4d, 0xea, 0x30, 0x15, 0x2b, 0x96, 0x13, 0xee, 0x98, 0xdc, 0xf8, 0xa9, 0x27, 0xc6, 0x0d, ++ 0xe3, 0x24, 0xff, 0x3f, 0xdd, 0xc0, 0xca, 0xef, 0x15, 0xe0, 0xb9, 0x70, 0xd6, 0xf8, 0xd7, 0x3b, ++ 0xdb, 0xa6, 0x15, 0xe4, 0xe8, 0x99, 0xd3, 0x63, 0x3a, 0x64, 0x4f, 0x75, 0x3a, 0xe4, 0x06, 0x3f, ++ 0x1d, 0x8c, 0x15, 0x91, 0x3f, 0x62, 0x45, 0x7c, 0xcb, 0x34, 0x26, 0x88, 0xb9, 0x63, 0xa5, 0xd8, ++ 0x5c, 0x7b, 0x0d, 0x46, 0x1f, 0x66, 0x85, 0xf0, 0x44, 0x56, 0x7c, 0x0a, 0x4e, 0x64, 0xbf, 0x56, ++ 0x84, 0xe7, 0xf9, 0x57, 0xf3, 0x03, 0x48, 0x35, 0x70, 0x3d, 0xab, 0x41, 0xcd, 0x59, 0xf8, 0x06, ++ 0x10, 0x5f, 0x94, 0x56, 0x6a, 0x35, 0xa6, 0x05, 0x19, 0xba, 0xf6, 0x45, 0xd9, 0x0d, 0xa4, 0xda, ++ 0x85, 0x81, 0x09, 0xb5, 0x48, 0x03, 0xa6, 0x43, 0xe3, 0x54, 0x35, 0xf0, 0x6c, 0xa7, 0xd1, 0xdf, ++ 0x64, 0x3d, 0xf7, 0xe8, 0xe1, 0xec, 0xf4, 0x62, 0x8c, 0x04, 0x76, 0x11, 0x65, 0x07, 0x0c, 0x6e, ++ 0x4d, 0xd0, 0xd2, 0xd1, 0x38, 0x60, 0xdc, 0x52, 0x00, 0x0c, 0x71, 0x22, 0x16, 0xb2, 0xfc, 0x91, ++ 0x16, 0xb2, 0x17, 0x20, 0x57, 0x6f, 0xde, 0x93, 0x87, 0x1c, 0x6d, 0x9f, 0x5c, 0x5a, 0xbb, 0x85, ++ 0xac, 0x9c, 0x7c, 0xc7, 0x9c, 0x93, 0x42, 0xaa, 0xd4, 0x53, 0xce, 0xc9, 0x1e, 0xa3, 0x73, 0xa2, ++ 0x69, 0x39, 0x72, 0x2a, 0xd3, 0x92, 0x7c, 0x12, 0x26, 0xea, 0xb4, 0xe6, 0xd6, 0xe9, 0x3a, 0xf5, ++ 0x7d, 0xab, 0x41, 0xb9, 0x9e, 0x3d, 0xba, 0x70, 0x5e, 0xb6, 0x71, 0x62, 0xc9, 0x04, 0x62, 0x14, ++ 0x97, 0x2c, 0xc2, 0x99, 0xfb, 0x96, 0x1d, 0x6c, 0xd9, 0x2d, 0xba, 0xea, 0x54, 0x69, 0xcd, 0x75, ++ 0xea, 0x3e, 0x37, 0xce, 0x15, 0x84, 0xd9, 0xf3, 0x6e, 0x1c, 0x88, 0xdd, 0xf8, 0xe9, 0x16, 0xc6, ++ 0x9f, 0x15, 0xe1, 0x22, 0xef, 0xfa, 0x2a, 0xf5, 0xf6, 0xed, 0x1a, 0x5d, 0xe8, 0xf8, 0xe6, 0xb2, ++ 0x48, 0x9a, 0xca, 0x99, 0xa1, 0x4f, 0xe5, 0xec, 0x31, 0xa6, 0xf2, 0x3c, 0x94, 0x02, 0xb7, 0x6d, ++ 0xd7, 0x92, 0xe6, 0xfe, 0x96, 0x02, 0x60, 0x88, 0x43, 0x96, 0x60, 0xda, 0xef, 0x6c, 0xfb, 0x35, ++ 0xcf, 0x6e, 0xeb, 0xb3, 0xb4, 0x10, 0xbb, 0x33, 0xb2, 0xde, 0x74, 0x35, 0x06, 0xc7, 0xae, 0x1a, ++ 0xca, 0x6a, 0x5c, 0x18, 0x96, 0xd5, 0xb8, 0x3f, 0x1b, 0xf6, 0xb7, 0xcd, 0x25, 0x38, 0xc2, 0x97, ++ 0xe0, 0x76, 0xca, 0x25, 0x98, 0x38, 0x0f, 0x4e, 0xb4, 0x00, 0x47, 0x4f, 0x67, 0x01, 0x7e, 0x06, ++ 0x9e, 0xdd, 0xe9, 0x34, 0x9b, 0x07, 0xb7, 0x3a, 0x56, 0xd3, 0xde, 0xb1, 0x69, 0x9d, 0x8d, 0x93, ++ 0xdf, 0xb6, 0x6a, 0xc2, 0xcc, 0x5d, 0x5a, 0x98, 0x95, 0xad, 0x7d, 0x76, 0x25, 0x19, 0x0d, 0x7b, ++ 0xd5, 0x4f, 0xb7, 0xb2, 0xde, 0x2b, 0xc0, 0x85, 0x58, 0x8f, 0x2a, 0x65, 0xf9, 0x47, 0xab, 0xea, ++ 0x94, 0x57, 0x95, 0xa1, 0x78, 0x17, 0x9f, 0x98, 0xe2, 0x3d, 0x72, 0xea, 0x8a, 0xf7, 0x5f, 0x66, ++ 0x61, 0x44, 0x5d, 0x8e, 0xdd, 0x83, 0xd1, 0x7a, 0x47, 0x9a, 0x4a, 0xc4, 0x5c, 0xbb, 0x76, 0xf2, ++ 0x96, 0xac, 0x3a, 0xc1, 0x4f, 0x7d, 0xfc, 0xa6, 0x27, 0x66, 0x99, 0x38, 0x2d, 0x2e, 0x49, 0xe2, ++ 0xa8, 0xd9, 0x90, 0x3a, 0x14, 0xd9, 0xa1, 0xd5, 0xf5, 0xa4, 0xf6, 0xf3, 0xa9, 0x14, 0xa2, 0x89, ++ 0x5b, 0xa6, 0xe4, 0xfa, 0xe7, 0x34, 0x51, 0xd2, 0x66, 0x5c, 0xde, 0xb1, 0x03, 0x26, 0x70, 0x72, ++ 0x83, 0xe4, 0xf2, 0x06, 0xa7, 0x89, 0x92, 0x36, 0x79, 0x11, 0x0a, 0x7e, 0x40, 0xdb, 0x3e, 0x9f, ++ 0xdc, 0x85, 0x85, 0x09, 0xd9, 0xf3, 0x85, 0x2a, 0x2b, 0x44, 0x01, 0x2b, 0xff, 0x5e, 0x06, 0x4a, ++ 0xfa, 0x5e, 0x84, 0xdc, 0x84, 0xd1, 0x8e, 0x4f, 0x3d, 0x6d, 0xdc, 0x3e, 0xf6, 0xea, 0xe6, 0xfd, ++ 0x79, 0x5b, 0x56, 0x45, 0x4d, 0x84, 0x11, 0x6c, 0x5b, 0xbe, 0x7f, 0xdf, 0xf5, 0xea, 0xfd, 0xe9, ++ 0x93, 0x9c, 0xe0, 0xa6, 0xac, 0x8a, 0x9a, 0x48, 0xf9, 0x4f, 0x33, 0x30, 0xb1, 0x60, 0x07, 0xdb, ++ 0x9d, 0xda, 0x1e, 0x0d, 0x78, 0x9b, 0x5b, 0x50, 0xd8, 0x66, 0x1f, 0x20, 0x1b, 0xbc, 0x96, 0xe2, ++ 0x7e, 0x48, 0xd1, 0x0d, 0x2f, 0x8a, 0xb8, 0x21, 0x91, 0xff, 0x44, 0xc1, 0x85, 0xdc, 0x06, 0x70, ++ 0xad, 0x4e, 0xb0, 0xbb, 0xe5, 0xee, 0x51, 0xa7, 0xbf, 0x6f, 0x9a, 0x64, 0xf3, 0xfe, 0x66, 0x45, ++ 0x55, 0x46, 0x83, 0x50, 0xf9, 0x0f, 0x32, 0x40, 0xba, 0xf9, 0x3f, 0x05, 0x03, 0xf2, 0xef, 0x46, ++ 0xe0, 0x9c, 0x6e, 0x78, 0xec, 0x78, 0x52, 0xe7, 0xb7, 0x15, 0xd7, 0x5d, 0x77, 0xef, 0xa6, 0xb3, ++ 0x62, 0x3b, 0xb6, 0xbf, 0x2b, 0xef, 0x5c, 0xf4, 0xf1, 0x64, 0xa9, 0x0b, 0x03, 0x13, 0x6a, 0x91, ++ 0xaf, 0x9b, 0x4a, 0x43, 0x96, 0x0b, 0xa5, 0xcf, 0x0f, 0x60, 0x9c, 0x4f, 0xaa, 0x2e, 0x8c, 0xdc, ++ 0xa7, 0xdb, 0xbb, 0xae, 0xbb, 0x27, 0x97, 0xef, 0xf5, 0x93, 0x37, 0xe5, 0xae, 0x20, 0xb4, 0xe8, ++ 0x3a, 0x01, 0x7d, 0x10, 0x88, 0x0b, 0x50, 0x59, 0x86, 0x8a, 0x0b, 0xa1, 0xf2, 0x02, 0x34, 0x9f, ++ 0x56, 0x06, 0x46, 0x16, 0x4e, 0xd7, 0x25, 0x68, 0x19, 0x8a, 0xa2, 0x02, 0x3f, 0xad, 0x4b, 0xfb, ++ 0xa9, 0x38, 0x72, 0xa3, 0x84, 0x90, 0x0f, 0x43, 0xc1, 0xbd, 0xef, 0xc8, 0x13, 0x74, 0x69, 0xe1, ++ 0x59, 0xd9, 0x4d, 0x53, 0x4b, 0xb4, 0xed, 0xd1, 0x9a, 0x15, 0xd0, 0xfa, 0x4d, 0x06, 0x46, 0x81, ++ 0x45, 0xfe, 0x2a, 0x00, 0x6b, 0x1d, 0xad, 0xf1, 0xbb, 0x17, 0x71, 0x07, 0xf0, 0xbc, 0xac, 0x73, ++ 0x2e, 0xac, 0xb3, 0xa9, 0x71, 0xd0, 0xc0, 0x27, 0xd7, 0x61, 0xd2, 0xa3, 0x6d, 0xd7, 0xb7, 0x03, ++ 0xd7, 0x3b, 0xa8, 0x36, 0x3b, 0x0d, 0x79, 0x21, 0x70, 0x59, 0x52, 0x98, 0x09, 0x29, 0x60, 0x04, ++ 0x0f, 0x63, 0xf5, 0xc8, 0x2f, 0x67, 0x60, 0x5c, 0x17, 0xd9, 0x94, 0x1d, 0x58, 0x72, 0xe9, 0xae, ++ 0xcd, 0x75, 0x57, 0x86, 0x9c, 0xc3, 0x0b, 0x2e, 0x34, 0x58, 0x61, 0x84, 0xb1, 0xa1, 0x6b, 0xc2, ++ 0x53, 0x60, 0x83, 0x78, 0x17, 0xce, 0x26, 0x7c, 0x28, 0xdb, 0x59, 0xc4, 0x2c, 0x10, 0xc6, 0x06, ++ 0xbd, 0xb3, 0x44, 0xc6, 0xfe, 0xf5, 0xae, 0xd1, 0x13, 0xda, 0xdc, 0x05, 0x89, 0x3d, 0x79, 0xf8, ++ 0x98, 0x95, 0xff, 0xd3, 0x18, 0x5c, 0xd4, 0xcc, 0x99, 0x42, 0x4a, 0x3d, 0x53, 0xbc, 0x18, 0xab, ++ 0x30, 0x73, 0x2a, 0xab, 0x30, 0x3a, 0x97, 0xb3, 0xa9, 0xe7, 0x72, 0xee, 0x84, 0x73, 0xf9, 0x65, ++ 0x18, 0x95, 0x74, 0xd5, 0xdd, 0x8b, 0x10, 0xcd, 0xb2, 0x0c, 0x35, 0x94, 0xfc, 0xf5, 0xf8, 0xac, ++ 0x17, 0x56, 0xb8, 0xea, 0x00, 0x66, 0xbd, 0x18, 0x8f, 0x3e, 0xe7, 0x7e, 0x28, 0x60, 0x8a, 0x3d, ++ 0x05, 0xcc, 0x1e, 0xbc, 0xe0, 0xef, 0xd9, 0xed, 0x05, 0xcf, 0x72, 0x6a, 0xbb, 0x48, 0x77, 0xfc, ++ 0x45, 0xee, 0x8e, 0x50, 0xbf, 0xe9, 0xdc, 0x6c, 0x53, 0x67, 0x13, 0xb9, 0x10, 0x19, 0x5d, 0xf8, ++ 0x90, 0x64, 0xf7, 0x42, 0xf5, 0x30, 0x64, 0x3c, 0x9c, 0x16, 0xb9, 0x06, 0x67, 0x5c, 0x47, 0x58, ++ 0x6d, 0x36, 0xa9, 0x27, 0xa0, 0xd2, 0x18, 0xf2, 0x9c, 0x64, 0x70, 0xe6, 0x66, 0x1c, 0x01, 0xbb, ++ 0xeb, 0x90, 0x4f, 0xc3, 0x98, 0xb8, 0x6f, 0x16, 0x5a, 0x41, 0xa9, 0x9f, 0x8d, 0x75, 0xea, 0xd1, ++ 0xc3, 0xd9, 0xb1, 0x4a, 0x58, 0x1b, 0x4d, 0x52, 0xe4, 0x4d, 0x98, 0x90, 0x13, 0x50, 0x7a, 0xa7, ++ 0x40, 0x3f, 0xb4, 0xcf, 0x3c, 0x7a, 0x38, 0x3b, 0x71, 0xd7, 0xac, 0x8f, 0x51, 0x72, 0xe4, 0x0e, ++ 0x5c, 0xd8, 0x56, 0x83, 0xea, 0xf3, 0x41, 0x5d, 0xb0, 0x7c, 0x7a, 0x1b, 0xd7, 0xb8, 0x67, 0x51, ++ 0x69, 0xe1, 0x92, 0xec, 0x87, 0x0b, 0xb1, 0xa1, 0x97, 0x58, 0xd8, 0xa3, 0x76, 0x8f, 0xdd, 0x7f, ++ 0xfc, 0x44, 0xbb, 0x7f, 0xc4, 0x64, 0x30, 0x91, 0xd6, 0x64, 0xd0, 0x5b, 0xa6, 0x9c, 0xc8, 0x64, ++ 0x30, 0x79, 0x3a, 0x26, 0x03, 0x79, 0xdc, 0x9c, 0x1a, 0xd6, 0x71, 0xf3, 0x93, 0x30, 0x51, 0xdb, ++ 0xa5, 0xb5, 0x3d, 0xee, 0x6f, 0xb3, 0x6f, 0x35, 0x67, 0xa6, 0xf9, 0xf0, 0x6b, 0x9b, 0xe0, 0xa2, ++ 0x09, 0xc4, 0x28, 0x6e, 0xba, 0x3d, 0xe6, 0x5b, 0x19, 0x78, 0xae, 0xa7, 0x5c, 0x21, 0x57, 0x22, ++ 0x52, 0x37, 0x13, 0xf5, 0xee, 0xec, 0x21, 0x6b, 0xd3, 0xee, 0x3c, 0x7f, 0x98, 0x85, 0xd2, 0x42, ++ 0xc7, 0x97, 0xce, 0x3e, 0xdb, 0x90, 0x77, 0xac, 0xc0, 0x4f, 0x7f, 0x6d, 0xbd, 0x51, 0xd9, 0x52, ++ 0x7d, 0xcf, 0x55, 0x2f, 0xf6, 0x1b, 0x39, 0x6d, 0xb2, 0x0f, 0xa5, 0x77, 0x68, 0xe0, 0x07, 0x1e, ++ 0xb5, 0x5a, 0x52, 0x2d, 0x5f, 0x3d, 0x39, 0xa3, 0x37, 0x68, 0x50, 0xe5, 0xa4, 0x4c, 0x77, 0x3e, ++ 0x5d, 0x88, 0x21, 0x2b, 0x52, 0x83, 0xc2, 0x9e, 0xb5, 0xb3, 0x67, 0x49, 0x45, 0x76, 0x21, 0xc5, ++ 0x55, 0x2c, 0x23, 0xb3, 0xd0, 0xf1, 0xc5, 0x89, 0x89, 0xff, 0x42, 0x41, 0xbb, 0xfc, 0xdd, 0x02, ++ 0x9c, 0x5d, 0xb4, 0x9a, 0xd4, 0xa9, 0x5b, 0x91, 0x1d, 0xfc, 0x55, 0x18, 0xf5, 0x6b, 0xbb, 0xb4, ++ 0xde, 0x69, 0xaa, 0x5b, 0x0b, 0xbd, 0xe2, 0xaa, 0xb2, 0x1c, 0x35, 0x86, 0xf6, 0x11, 0x63, 0x73, ++ 0x33, 0x1b, 0xc5, 0xd6, 0xd3, 0x52, 0x63, 0x90, 0xd7, 0x60, 0x52, 0x3a, 0x3f, 0xb9, 0xce, 0x92, ++ 0x15, 0x50, 0xe1, 0x20, 0x21, 0x1d, 0x50, 0x96, 0x23, 0x10, 0x8c, 0x61, 0x32, 0x4e, 0x81, 0xdd, ++ 0xa2, 0xef, 0xba, 0x8e, 0xb2, 0x0b, 0x69, 0x4e, 0x5b, 0xb2, 0x1c, 0x35, 0x06, 0xf9, 0x5a, 0xf7, ++ 0x35, 0xd7, 0xe7, 0x4e, 0xde, 0x8d, 0x09, 0xfd, 0xd4, 0x87, 0x54, 0xfa, 0x02, 0x8c, 0xb5, 0xa9, ++ 0xe7, 0xdb, 0x7e, 0x40, 0x9d, 0x1a, 0x95, 0xb7, 0x5c, 0x6f, 0xa4, 0x14, 0x4d, 0x9b, 0x21, 0x45, ++ 0xb1, 0x57, 0x19, 0x05, 0x68, 0xf2, 0x3b, 0x75, 0x3b, 0x6a, 0x3a, 0xb9, 0xf3, 0x00, 0xce, 0x2d, ++ 0x5a, 0x41, 0x6d, 0xb7, 0xd3, 0x16, 0xcb, 0x44, 0x99, 0x80, 0x5e, 0x81, 0x11, 0xea, 0x58, 0xdb, ++ 0x4d, 0x5a, 0x8f, 0xfb, 0x3a, 0x2e, 0x8b, 0x62, 0x54, 0x70, 0xf2, 0x09, 0x18, 0x6b, 0x59, 0x0f, ++ 0x94, 0x19, 0x49, 0x4e, 0x4b, 0x1d, 0x07, 0xb0, 0x1e, 0x82, 0xd0, 0xc4, 0x2b, 0xff, 0x59, 0x16, ++ 0x4a, 0x8b, 0xae, 0x53, 0xb7, 0x39, 0xbf, 0x8f, 0x42, 0x3e, 0x38, 0x68, 0xab, 0x25, 0xf0, 0x82, ++ 0xba, 0x4c, 0xde, 0x3a, 0x68, 0xd3, 0xc7, 0x4c, 0xf0, 0x2a, 0x44, 0xee, 0x2c, 0xc5, 0x51, 0xc9, ++ 0x1a, 0x14, 0xfd, 0xc0, 0x0a, 0x3a, 0xbe, 0x64, 0xf9, 0x71, 0xe5, 0x7d, 0x56, 0xe5, 0xa5, 0x8f, ++ 0x1f, 0xce, 0x26, 0x04, 0x6c, 0xcc, 0x69, 0x4a, 0x02, 0x0b, 0x25, 0x0d, 0xb2, 0x0f, 0xa4, 0x69, ++ 0xf9, 0xc1, 0x96, 0x67, 0x39, 0xbe, 0xe0, 0x64, 0x6b, 0xcf, 0x85, 0x9f, 0x30, 0xf4, 0x0c, 0x1d, ++ 0x38, 0x11, 0x0e, 0x1b, 0x9b, 0x79, 0x4c, 0xf3, 0x60, 0x35, 0xc2, 0x6d, 0x7d, 0xad, 0x8b, 0x1a, ++ 0x26, 0x70, 0x10, 0x3e, 0x74, 0x96, 0x9f, 0xe4, 0x43, 0xc7, 0x4a, 0x51, 0x42, 0xd9, 0x80, 0xb4, ++ 0xe4, 0x45, 0x55, 0x21, 0x7a, 0xe7, 0xac, 0xae, 0xa8, 0x14, 0xbc, 0xdc, 0x80, 0xf3, 0xfa, 0x2b, ++ 0x7d, 0xa4, 0x3e, 0x0d, 0x16, 0x0e, 0x38, 0xaf, 0xcb, 0x90, 0xaf, 0x79, 0x6e, 0xd7, 0x8d, 0xfd, ++ 0xa2, 0xe7, 0x3a, 0xc8, 0x21, 0x91, 0x55, 0x9f, 0x3d, 0x6a, 0xd5, 0x97, 0xbf, 0x99, 0x81, 0x67, ++ 0x63, 0x9c, 0x16, 0x3d, 0x3b, 0xa0, 0x9e, 0x6d, 0x11, 0x1f, 0x8a, 0xdb, 0x9c, 0xab, 0xdc, 0x32, ++ 0x6e, 0xa6, 0x10, 0x07, 0x49, 0x1f, 0x23, 0x96, 0x82, 0xf8, 0x1f, 0x25, 0xab, 0xf2, 0x17, 0xe1, ++ 0x9c, 0xf6, 0xf5, 0x31, 0x16, 0xe8, 0x31, 0x5c, 0x55, 0x97, 0x60, 0xba, 0xe6, 0x51, 0x2b, 0xa0, ++ 0xab, 0x3b, 0x1b, 0x6e, 0xb0, 0xfc, 0xc0, 0xf6, 0x03, 0xe9, 0xb3, 0xaa, 0xcd, 0xe1, 0x8b, 0x31, ++ 0x38, 0x76, 0xd5, 0x28, 0x7f, 0x27, 0xcf, 0xe7, 0x74, 0x60, 0xb1, 0x19, 0x42, 0x3e, 0x03, 0x25, ++ 0xe5, 0x80, 0xa3, 0x36, 0xce, 0x44, 0xf7, 0x24, 0xed, 0xaf, 0x43, 0xef, 0x75, 0x6c, 0x8f, 0x72, ++ 0x97, 0xd2, 0xd0, 0x7a, 0xaf, 0xa0, 0x3e, 0x86, 0xd4, 0xc8, 0x36, 0x4c, 0xd9, 0x2d, 0xab, 0x41, ++ 0x37, 0x3b, 0xcd, 0xe6, 0xa6, 0xdb, 0xb4, 0x6b, 0xea, 0x2c, 0x76, 0x55, 0xd9, 0x22, 0x56, 0xa3, ++ 0xe0, 0xc7, 0x0f, 0x67, 0x5f, 0x48, 0x58, 0x0d, 0x21, 0x02, 0xc6, 0x09, 0x32, 0x1e, 0x3e, 0xad, ++ 0x75, 0x3c, 0x3b, 0x38, 0x90, 0x67, 0x42, 0xb9, 0x1c, 0x5e, 0xec, 0xa1, 0x76, 0x9b, 0xa8, 0xd2, ++ 0x93, 0x22, 0x5a, 0x88, 0x71, 0x82, 0xe4, 0x33, 0x30, 0xbe, 0xef, 0x36, 0x3b, 0x2d, 0xba, 0xee, ++ 0x76, 0x1c, 0x79, 0x94, 0x1b, 0xbb, 0x32, 0x9b, 0xc4, 0xe0, 0x4e, 0x88, 0x17, 0x9e, 0xb3, 0x8c, ++ 0x42, 0x1f, 0x23, 0xa4, 0xc8, 0xcf, 0x40, 0x8e, 0x3a, 0xfb, 0x72, 0x33, 0xba, 0x98, 0x44, 0x71, ++ 0xd9, 0xd9, 0xbf, 0x63, 0x79, 0xe1, 0x05, 0xf9, 0xb2, 0xb3, 0x8f, 0xac, 0x0e, 0x59, 0x63, 0xc2, ++ 0x6f, 0x7f, 0xc5, 0x73, 0x5b, 0xf2, 0xd6, 0xe1, 0xc7, 0x7b, 0x54, 0x67, 0x28, 0x42, 0x3e, 0x9b, ++ 0xf2, 0x91, 0x17, 0xa3, 0x22, 0x51, 0xfe, 0x83, 0x2c, 0x9c, 0xd1, 0x93, 0x62, 0x8b, 0xb6, 0xda, ++ 0x4d, 0x2b, 0xa0, 0x3f, 0x9a, 0x1c, 0x47, 0x4e, 0x8e, 0xf2, 0x3f, 0x2c, 0xc0, 0xc4, 0x62, 0xc7, ++ 0x0f, 0xdc, 0x96, 0xba, 0x7f, 0x9b, 0x87, 0x92, 0x38, 0x60, 0xb1, 0xa3, 0x59, 0x26, 0x7a, 0xcb, ++ 0x55, 0x55, 0x00, 0x0c, 0x71, 0x98, 0x74, 0xe5, 0x54, 0x95, 0x03, 0xba, 0x96, 0xae, 0x9c, 0x39, ++ 0x45, 0x09, 0x25, 0xb7, 0x01, 0x6a, 0xd4, 0x0b, 0xe4, 0xe9, 0x32, 0xd7, 0xb7, 0x3d, 0x7b, 0x51, ++ 0x57, 0x46, 0x83, 0x10, 0x77, 0x4e, 0xe1, 0x6d, 0x61, 0x92, 0xe6, 0xe6, 0x3e, 0xf5, 0x3c, 0xbb, ++ 0xae, 0xd4, 0xa9, 0xd0, 0x39, 0xa5, 0x0b, 0x03, 0x13, 0x6a, 0x11, 0x1f, 0xf2, 0x7e, 0x9b, 0xd6, ++ 0xe4, 0x84, 0xbe, 0x95, 0x42, 0x9c, 0x9a, 0x5d, 0x3a, 0x57, 0x6d, 0xd3, 0x9a, 0xd0, 0xa9, 0xb4, ++ 0x58, 0x64, 0x45, 0xc8, 0x99, 0x3d, 0x71, 0x17, 0x6a, 0xe3, 0xfe, 0x6f, 0xe4, 0xf4, 0xee, 0xff, ++ 0x2e, 0xfe, 0x34, 0x94, 0x74, 0xbf, 0xf4, 0xa5, 0x4e, 0xfd, 0x65, 0x06, 0x60, 0xc9, 0x0a, 0x2c, ++ 0xa1, 0xa2, 0xb1, 0x7d, 0xa7, 0x6d, 0x05, 0xbb, 0xf1, 0x7d, 0x67, 0xd3, 0x0a, 0x76, 0x91, 0x43, ++ 0xc8, 0xab, 0x52, 0xef, 0xc9, 0x46, 0xae, 0x5e, 0x95, 0xde, 0xc3, 0x5d, 0x07, 0x0c, 0x95, 0x47, ++ 0x3b, 0x78, 0x0b, 0x3d, 0xbe, 0xcb, 0xc1, 0x9b, 0x7c, 0x0a, 0xa0, 0xe6, 0xb6, 0x58, 0x07, 0x06, ++ 0xae, 0x27, 0x27, 0x9a, 0x32, 0xae, 0xc1, 0xa2, 0x86, 0x3c, 0x8e, 0xfc, 0x42, 0xa3, 0x0e, 0xd7, ++ 0x00, 0xa4, 0x8c, 0x92, 0x8a, 0x46, 0xa8, 0x01, 0xc8, 0x72, 0xd4, 0x18, 0xe5, 0xbf, 0xc8, 0xc1, ++ 0xf8, 0x72, 0xcb, 0xb2, 0x9b, 0x6a, 0x85, 0x46, 0x27, 0x4c, 0xe6, 0xd4, 0x27, 0xcc, 0xab, 0xc6, ++ 0x55, 0x51, 0x4c, 0x81, 0x49, 0xb8, 0x07, 0xfa, 0x1c, 0x8c, 0xfb, 0xad, 0xa0, 0xad, 0x2e, 0x74, ++ 0xfa, 0x5b, 0xf8, 0x3c, 0x42, 0xad, 0xba, 0xbe, 0xb5, 0xa9, 0xef, 0x83, 0x22, 0xc4, 0xd8, 0xe0, ++ 0xef, 0xba, 0x7e, 0x20, 0x47, 0x41, 0x0f, 0xfe, 0x75, 0xd7, 0x0f, 0x90, 0x43, 0xf8, 0xf4, 0x70, ++ 0x3d, 0x11, 0x8d, 0x52, 0x30, 0xa6, 0x87, 0xeb, 0x05, 0xc8, 0x21, 0xe4, 0x02, 0x64, 0x03, 0x57, ++ 0x1a, 0x0a, 0xb9, 0x97, 0xf7, 0x96, 0x8b, 0xd9, 0xc0, 0xe5, 0xbe, 0x97, 0x6c, 0x7b, 0x1a, 0x89, ++ 0xf9, 0x5e, 0xb2, 0x8d, 0x87, 0x43, 0x98, 0xbe, 0xe8, 0x77, 0xb6, 0xdf, 0xa1, 0xb5, 0x20, 0x1e, ++ 0x40, 0x50, 0x15, 0xc5, 0xa8, 0xe0, 0x8c, 0xd8, 0xb6, 0x5b, 0x3f, 0x90, 0x5e, 0x17, 0x9a, 0x18, ++ 0x77, 0x59, 0xe1, 0x90, 0xf2, 0xdf, 0x18, 0x01, 0xb2, 0xdc, 0xe2, 0x17, 0xaa, 0xe6, 0xd9, 0xf5, ++ 0x25, 0x28, 0x6e, 0x7b, 0xee, 0x9e, 0x36, 0x81, 0x6b, 0xe9, 0xba, 0xc0, 0x4b, 0x51, 0x42, 0xc9, ++ 0x15, 0x80, 0xda, 0xae, 0xe5, 0x38, 0xb4, 0x19, 0x1a, 0x8d, 0xf5, 0x40, 0x2e, 0x6a, 0x08, 0x1a, ++ 0x58, 0x3c, 0xba, 0x58, 0xfc, 0x32, 0x5c, 0x1a, 0xc2, 0xe8, 0xe2, 0x10, 0x84, 0x26, 0x5e, 0xe4, ++ 0xaa, 0x30, 0x3f, 0xe8, 0xab, 0xc2, 0xc2, 0x00, 0xae, 0x0a, 0x7b, 0x44, 0xdd, 0x16, 0x9f, 0x6c, ++ 0xd4, 0xed, 0xc8, 0x71, 0xa3, 0x6e, 0x47, 0x87, 0x65, 0x7a, 0xfb, 0xaa, 0x69, 0x41, 0x10, 0x17, ++ 0x53, 0x9f, 0x4d, 0x71, 0x72, 0xee, 0x9a, 0xac, 0x27, 0x32, 0x6b, 0x3e, 0x0d, 0xb7, 0x53, 0xbf, ++ 0x91, 0x81, 0x02, 0x67, 0x43, 0x5a, 0x3c, 0x2c, 0x95, 0xeb, 0x62, 0x99, 0xb4, 0x91, 0x1d, 0x9c, ++ 0x62, 0xe4, 0x2a, 0x48, 0xa9, 0x69, 0x8a, 0x07, 0x79, 0x1e, 0xf2, 0xf2, 0x26, 0x3a, 0xf3, 0xf2, ++ 0xb8, 0x30, 0xe6, 0xb1, 0xad, 0x0f, 0x79, 0xe9, 0x6b, 0xa3, 0xdf, 0xfb, 0xdb, 0xb3, 0xcf, 0xbc, ++ 0xf7, 0x1f, 0x2e, 0x3f, 0x53, 0xfe, 0x7e, 0x16, 0x46, 0x39, 0xb9, 0x85, 0x8e, 0x4f, 0xde, 0x36, ++ 0x46, 0x59, 0x34, 0xf2, 0x23, 0xc7, 0x3b, 0x5c, 0xdf, 0xe4, 0xb2, 0x8a, 0x75, 0x53, 0x28, 0x3a, ++ 0xc2, 0x32, 0x63, 0xf4, 0x76, 0xa5, 0x9e, 0x94, 0x1d, 0x48, 0x17, 0x2c, 0x74, 0x7c, 0xa6, 0x09, ++ 0x24, 0x2a, 0x47, 0x6d, 0x6d, 0x80, 0x48, 0x7d, 0x03, 0xae, 0x79, 0x71, 0x7a, 0x86, 0x9a, 0x1a, ++ 0x31, 0x52, 0x94, 0xff, 0x34, 0x03, 0xe3, 0x0a, 0x75, 0xcd, 0xf6, 0x03, 0xf2, 0xf9, 0xae, 0xee, ++ 0x9c, 0x3b, 0x5e, 0x77, 0xb2, 0xda, 0xbc, 0x33, 0xf5, 0x42, 0x50, 0x25, 0x46, 0x57, 0x36, 0xa0, ++ 0x60, 0x07, 0xb4, 0xe5, 0x4b, 0x67, 0x83, 0x85, 0xf4, 0xdf, 0x17, 0xde, 0x92, 0xae, 0x32, 0xc2, ++ 0x28, 0xe8, 0x97, 0xff, 0x24, 0x17, 0x7e, 0x17, 0xeb, 0x60, 0xf2, 0x56, 0xc4, 0xdc, 0x5c, 0x49, ++ 0x67, 0x6e, 0x66, 0x7c, 0xe3, 0xb6, 0x66, 0xbf, 0xdb, 0xd6, 0xbc, 0x32, 0x00, 0x5b, 0x33, 0xff, ++ 0xc4, 0x27, 0x6a, 0x68, 0x66, 0x82, 0x74, 0x4a, 0xb3, 0x5c, 0x7e, 0xe0, 0x06, 0x76, 0x4d, 0xee, ++ 0x84, 0x03, 0x34, 0xa6, 0xf3, 0x03, 0x9c, 0x2e, 0x14, 0x5c, 0x30, 0xce, 0xb6, 0xfc, 0x5f, 0x32, ++ 0x30, 0x19, 0x9d, 0xd9, 0x64, 0x57, 0xaf, 0x99, 0x4c, 0x5a, 0xa7, 0xaf, 0xc3, 0xd7, 0x0a, 0xd9, ++ 0x83, 0xa2, 0x08, 0xe9, 0x92, 0xc3, 0x9b, 0x26, 0x64, 0x5e, 0x5d, 0x83, 0x84, 0xcc, 0xc4, 0x6f, ++ 0x94, 0x2c, 0xca, 0xff, 0x33, 0x2b, 0x27, 0xb0, 0x32, 0x6c, 0x5c, 0x84, 0xac, 0x5d, 0x97, 0x6a, ++ 0x11, 0xc8, 0x4a, 0xd9, 0xd5, 0x25, 0xcc, 0xda, 0x75, 0x7e, 0x28, 0x15, 0xb1, 0x5f, 0xd9, 0xa8, ++ 0xda, 0x14, 0x8b, 0x92, 0xfc, 0x04, 0x8c, 0x31, 0x39, 0xb3, 0x4f, 0x3d, 0xdf, 0x76, 0x9d, 0xb8, ++ 0x0a, 0xc4, 0xd6, 0xc9, 0x1d, 0x01, 0x42, 0x13, 0x8f, 0xa9, 0x73, 0xfc, 0x48, 0x11, 0xd3, 0x3b, ++ 0x8d, 0x63, 0x44, 0x05, 0xa6, 0xd8, 0xfa, 0xe6, 0x82, 0xdc, 0x09, 0x38, 0x72, 0x21, 0xe6, 0xc9, ++ 0x62, 0x05, 0xd6, 0xa2, 0x00, 0xf3, 0x7a, 0x71, 0x7c, 0x53, 0xbd, 0x2c, 0x1e, 0xa1, 0x5e, 0xae, ++ 0x41, 0x3e, 0xb0, 0x5b, 0x2a, 0xd0, 0xad, 0x1f, 0x5b, 0x6a, 0xd8, 0x76, 0xbb, 0xc5, 0xda, 0x6e, ++ 0xb7, 0xa8, 0xb1, 0xaf, 0x7c, 0x33, 0x0f, 0x53, 0xbc, 0xcf, 0x97, 0x68, 0x9b, 0x3a, 0x75, 0xea, ++ 0xd4, 0x0e, 0x8e, 0x61, 0xe8, 0xab, 0xc0, 0x14, 0x0d, 0x37, 0x65, 0xc3, 0xbf, 0x56, 0x7f, 0xfb, ++ 0x72, 0x14, 0x8c, 0x71, 0x7c, 0x1e, 0x77, 0xce, 0x8a, 0x92, 0x7c, 0x6d, 0x97, 0x15, 0x00, 0x43, ++ 0x1c, 0xb2, 0x0f, 0x23, 0x62, 0xa7, 0xf7, 0xe5, 0x4a, 0xbc, 0x99, 0x52, 0x92, 0x86, 0x5f, 0x2c, ++ 0xb5, 0x0a, 0xbe, 0x43, 0x8b, 0xff, 0x7d, 0x54, 0xcc, 0xc8, 0x2f, 0x66, 0xa0, 0x14, 0x78, 0x96, ++ 0xe3, 0xef, 0xb8, 0x5e, 0x4b, 0x6a, 0xaf, 0x5b, 0x03, 0x63, 0xbd, 0xa5, 0x28, 0x53, 0x19, 0x4c, ++ 0xa9, 0x0b, 0x30, 0xe4, 0x4a, 0x6c, 0xb8, 0x20, 0x9b, 0xb3, 0xe6, 0x36, 0xec, 0x9a, 0xd5, 0x14, ++ 0x61, 0xbc, 0xae, 0x72, 0x9e, 0xfa, 0xa8, 0xba, 0x5a, 0x5f, 0x49, 0xc4, 0x7a, 0xfc, 0x70, 0x76, ++ 0x2a, 0x56, 0x84, 0x3d, 0x08, 0x96, 0x7f, 0xb7, 0x00, 0xe7, 0x13, 0xbb, 0x87, 0x6c, 0xcb, 0x29, ++ 0x98, 0xfa, 0xf6, 0x92, 0x4d, 0x44, 0xd9, 0xe5, 0xa3, 0xd1, 0x89, 0x69, 0x6a, 0x5f, 0xd9, 0x53, ++ 0xd0, 0xbe, 0x76, 0xa4, 0xf6, 0x25, 0x42, 0x9e, 0x53, 0x7c, 0x52, 0x68, 0xae, 0x08, 0xd7, 0x4b, ++ 0xa8, 0xc7, 0x11, 0x1b, 0x0a, 0xf4, 0x41, 0xdb, 0x53, 0xa6, 0xd9, 0x14, 0x8c, 0x96, 0x1f, 0xb4, ++ 0x3d, 0xc9, 0x48, 0x6b, 0x01, 0xac, 0xcc, 0x47, 0xc1, 0x81, 0xbc, 0x0d, 0x67, 0x19, 0xcb, 0xf8, ++ 0x3c, 0x11, 0xa2, 0x69, 0x4e, 0x56, 0x39, 0xbb, 0xd4, 0x8d, 0x92, 0x34, 0x49, 0x92, 0x48, 0x31, ++ 0x0e, 0x8c, 0x55, 0xf2, 0x4c, 0xd4, 0x1c, 0x96, 0xbb, 0x51, 0x12, 0x39, 0x24, 0x90, 0xe2, 0xb2, ++ 0x9d, 0x7b, 0xc8, 0xcb, 0xa3, 0x79, 0x28, 0xdb, 0x79, 0x29, 0x4a, 0x68, 0xf9, 0x6d, 0xb8, 0xd8, ++ 0x7b, 0x39, 0xb1, 0xdd, 0xe3, 0x9d, 0x7b, 0xf1, 0xdd, 0xe3, 0x8d, 0x5b, 0x98, 0x7d, 0xe7, 0x9e, ++ 0xc1, 0x21, 0x7b, 0x28, 0x87, 0xf7, 0xb3, 0x30, 0x1d, 0xbf, 0xba, 0x24, 0x1d, 0x18, 0xa9, 0x89, ++ 0xeb, 0x3e, 0xb9, 0x16, 0x36, 0xd2, 0xdc, 0xd2, 0x76, 0xdf, 0x1b, 0xca, 0xc9, 0x2a, 0x20, 0xa8, ++ 0x78, 0x91, 0xbf, 0xa6, 0x02, 0xb5, 0xd7, 0xad, 0xb6, 0x5c, 0x1d, 0x1b, 0xa9, 0xee, 0x83, 0xba, ++ 0xae, 0x78, 0xcc, 0x70, 0xee, 0xf5, 0x30, 0x9c, 0x7b, 0xdd, 0x6a, 0x97, 0xff, 0x38, 0x0b, 0x63, ++ 0xa6, 0xd5, 0x62, 0xf8, 0x47, 0x90, 0xbd, 0xc8, 0x11, 0x64, 0x75, 0x20, 0xc7, 0xc7, 0x9e, 0xa7, ++ 0x10, 0x3f, 0x76, 0x0a, 0x19, 0xcc, 0x69, 0xf5, 0x88, 0x83, 0xc8, 0x35, 0x38, 0xd3, 0x75, 0xb4, ++ 0x25, 0x57, 0x00, 0xd8, 0x92, 0xa0, 0xbe, 0x6f, 0xeb, 0x4b, 0x46, 0xdd, 0x51, 0xcb, 0x1a, 0x82, ++ 0x06, 0x56, 0xf9, 0xdf, 0x67, 0xc0, 0xdc, 0x70, 0x4f, 0xe1, 0x50, 0xf3, 0x4e, 0xf4, 0x50, 0xb3, ++ 0x3c, 0x90, 0xee, 0xea, 0x71, 0xae, 0xf9, 0x95, 0xa5, 0xc8, 0xd7, 0xf1, 0xa3, 0xcd, 0x55, 0x18, ++ 0xa7, 0x52, 0x27, 0x4e, 0x4a, 0x0b, 0xb3, 0x6c, 0xc0, 0x30, 0x82, 0x49, 0x9a, 0x86, 0x69, 0x36, ++ 0x9b, 0xf6, 0x04, 0xa1, 0x8c, 0xb9, 0xc2, 0x4e, 0xd5, 0x6d, 0xda, 0x25, 0xbb, 0x30, 0xe2, 0x8b, ++ 0x00, 0x28, 0x39, 0xb1, 0x52, 0x9c, 0xc2, 0x54, 0x24, 0x15, 0x97, 0x0e, 0xf2, 0x07, 0x2a, 0xf2, ++ 0xe4, 0x00, 0x0a, 0x2d, 0xdb, 0xb1, 0x5d, 0xb9, 0xc5, 0x6c, 0x0d, 0x6c, 0xbd, 0xcc, 0xad, 0x33, ++ 0xb2, 0xc2, 0xe0, 0xa3, 0x07, 0x88, 0x97, 0xa1, 0xe0, 0xc8, 0x73, 0xbd, 0xd5, 0xa4, 0xb7, 0x89, ++ 0xbc, 0x59, 0xb9, 0x3b, 0x38, 0xf6, 0xda, 0x8f, 0x25, 0x6a, 0x72, 0x52, 0xc5, 0xa8, 0x59, 0x93, ++ 0x8e, 0xcc, 0xc8, 0x51, 0x4c, 0xeb, 0x9b, 0x1a, 0x6f, 0xc2, 0x8a, 0xdd, 0xa4, 0xb1, 0xeb, 0x1d, ++ 0x23, 0x45, 0x07, 0xfb, 0x7c, 0x23, 0x11, 0xc5, 0x80, 0x3f, 0x5f, 0x5d, 0x4e, 0xc6, 0x3e, 0xbf, ++ 0x3b, 0x3d, 0x05, 0x53, 0x54, 0xb5, 0x1f, 0xb3, 0xc8, 0xb8, 0x77, 0x67, 0x70, 0xcd, 0x90, 0x9e, ++ 0x9f, 0xa2, 0x15, 0xfa, 0x98, 0xd2, 0xe5, 0xd9, 0xdc, 0x81, 0xbc, 0xd5, 0xba, 0xd7, 0x96, 0xb6, ++ 0xc7, 0x01, 0x0e, 0x41, 0xa5, 0x75, 0xaf, 0x1d, 0x1b, 0x82, 0xca, 0xfa, 0xad, 0x4d, 0xe4, 0xec, ++ 0xd8, 0xe4, 0x17, 0x36, 0x01, 0x18, 0xf4, 0xe4, 0xe7, 0x56, 0x81, 0xd8, 0xe4, 0x8f, 0x58, 0x0a, ++ 0x3a, 0x90, 0x6f, 0xdd, 0x0b, 0x82, 0x99, 0xb1, 0x41, 0x7f, 0xf1, 0xfa, 0xbd, 0x20, 0x88, 0x7d, ++ 0xf1, 0xfa, 0xad, 0xad, 0x2d, 0xe4, 0xec, 0x18, 0x5b, 0x6e, 0xdb, 0x19, 0x1f, 0x34, 0xdb, 0x0d, ++ 0x2b, 0xf0, 0x63, 0x6c, 0x0d, 0x8b, 0xcf, 0x3d, 0xc8, 0xf9, 0x8e, 0x2f, 0x3d, 0x67, 0x71, 0x70, ++ 0x5c, 0xab, 0x8e, 0x64, 0xaa, 0xfd, 0x08, 0xaa, 0x1b, 0x55, 0x64, 0xbc, 0x38, 0xcb, 0x7b, 0xfe, ++ 0xcc, 0xe4, 0xc0, 0x59, 0xde, 0xeb, 0x62, 0x79, 0x8b, 0xb1, 0xbc, 0xe7, 0x93, 0x2f, 0x40, 0xb1, ++ 0xdd, 0xd9, 0xae, 0x76, 0xb6, 0x67, 0xa6, 0x38, 0xd7, 0xdb, 0x83, 0xe3, 0xba, 0xc9, 0xe9, 0x0a, ++ 0xc6, 0x5a, 0x2f, 0x10, 0x85, 0x28, 0x99, 0x32, 0xf6, 0x82, 0xdf, 0xcc, 0xf4, 0xa0, 0xd9, 0x5f, ++ 0xe3, 0x84, 0x62, 0xec, 0x45, 0x21, 0x4a, 0xa6, 0x92, 0x7d, 0xd3, 0xda, 0x9e, 0x39, 0x33, 0x04, ++ 0xf6, 0x4d, 0x2b, 0x81, 0x7d, 0xd3, 0x12, 0xec, 0x9b, 0xd6, 0x36, 0x9b, 0xd9, 0xbb, 0xf5, 0x1d, ++ 0x7f, 0x86, 0x0c, 0x7a, 0x66, 0x5f, 0xaf, 0xef, 0xc4, 0x67, 0xf6, 0xf5, 0xa5, 0x95, 0x2a, 0x72, ++ 0x76, 0x4c, 0x84, 0xf8, 0x4d, 0xab, 0xb6, 0x37, 0x73, 0x76, 0xd0, 0x22, 0xa4, 0xca, 0xc8, 0xc6, ++ 0x44, 0x08, 0x2f, 0x43, 0xc1, 0x91, 0xfc, 0x6a, 0x06, 0xc6, 0x64, 0x22, 0x8d, 0x6b, 0x9e, 0x5d, ++ 0x9f, 0x39, 0x97, 0xfa, 0xe2, 0x26, 0xde, 0x82, 0x90, 0xb8, 0x68, 0x47, 0x68, 0xff, 0x0a, 0x21, ++ 0x68, 0xb6, 0x81, 0xfc, 0xad, 0x0c, 0x4c, 0x5a, 0x91, 0x44, 0x29, 0x33, 0xe7, 0x79, 0xb3, 0x7e, ++ 0x7e, 0x80, 0x32, 0x3d, 0x9a, 0x88, 0x85, 0xb7, 0x4c, 0x3b, 0x56, 0x47, 0x81, 0x18, 0x6b, 0x0c, ++ 0x9b, 0xa4, 0x7e, 0xe0, 0xd9, 0x6d, 0x3a, 0x73, 0x61, 0xd0, 0x93, 0xb4, 0xca, 0xe9, 0xc6, 0x26, ++ 0xa9, 0x28, 0x44, 0xc9, 0x94, 0xef, 0xb5, 0x54, 0x5c, 0x8f, 0xcd, 0x3c, 0x3b, 0xe8, 0xbd, 0x56, ++ 0xdd, 0xbb, 0x45, 0xf7, 0x5a, 0x59, 0x8a, 0x8a, 0x2f, 0x9b, 0xb1, 0x1e, 0xad, 0xdb, 0xfe, 0xcc, ++ 0xcc, 0xa0, 0x67, 0x2c, 0x32, 0xb2, 0xb1, 0x19, 0xcb, 0xcb, 0x50, 0x70, 0x64, 0x32, 0xd9, 0xf1, ++ 0xef, 0xcd, 0x3c, 0x37, 0x68, 0x99, 0xbc, 0xe1, 0xdf, 0x8b, 0xc9, 0xe4, 0x8d, 0xea, 0x2d, 0x64, ++ 0xbc, 0x84, 0x4c, 0x6e, 0xfa, 0x96, 0x37, 0x73, 0x71, 0xf0, 0x32, 0x99, 0xd1, 0xed, 0x92, 0xc9, ++ 0xac, 0x10, 0x25, 0x53, 0x3e, 0xe0, 0x3c, 0xa3, 0xb7, 0x5d, 0x9b, 0xf9, 0xb1, 0x41, 0x0f, 0xf8, ++ 0x35, 0x41, 0x38, 0x36, 0xe0, 0xb2, 0x14, 0x15, 0x5f, 0xf2, 0x32, 0xd3, 0x33, 0xdb, 0x4d, 0xbb, ++ 0x66, 0xf9, 0x33, 0xcf, 0x0b, 0x6f, 0x07, 0xa1, 0x0a, 0x8a, 0x32, 0xd4, 0x50, 0xf2, 0x9b, 0x19, ++ 0x98, 0x8a, 0x45, 0xd3, 0xcc, 0xbc, 0xc0, 0x5b, 0xfd, 0xe6, 0xe0, 0x5a, 0xbd, 0x10, 0x65, 0x20, ++ 0x5a, 0xaf, 0x0d, 0xc0, 0xf1, 0x38, 0x8c, 0x78, 0x7b, 0xc8, 0xd7, 0x32, 0x50, 0xd2, 0x65, 0x33, ++ 0x97, 0x78, 0xeb, 0x3e, 0x3d, 0x84, 0xd6, 0x89, 0x76, 0x69, 0xdb, 0x72, 0x18, 0x84, 0x18, 0x72, ++ 0xe7, 0x12, 0x98, 0xcf, 0x6c, 0x71, 0x15, 0x33, 0x33, 0x3b, 0x68, 0x09, 0x8c, 0x21, 0xf1, 0x98, ++ 0x04, 0x36, 0x20, 0x68, 0xb6, 0x81, 0x8f, 0xa1, 0x15, 0xcd, 0xa0, 0x31, 0x73, 0x79, 0xd0, 0x63, ++ 0x18, 0x4f, 0x7a, 0x12, 0x1d, 0xc3, 0x18, 0x14, 0xe3, 0xed, 0x21, 0xbf, 0x9b, 0x81, 0x33, 0x56, ++ 0x3c, 0x75, 0xd1, 0xcc, 0x8f, 0xf3, 0x56, 0xbe, 0x3d, 0xe0, 0x56, 0x46, 0xb2, 0x23, 0xf1, 0x76, ++ 0xea, 0xc0, 0xba, 0x2e, 0x38, 0x76, 0xb7, 0x8a, 0xe9, 0x15, 0xfe, 0x4e, 0xd0, 0x9e, 0x29, 0x0f, ++ 0x5a, 0xaf, 0xa8, 0xee, 0x04, 0xf1, 0xa3, 0x49, 0x75, 0x65, 0x6b, 0x13, 0x39, 0x3b, 0xae, 0x4d, ++ 0x51, 0xcf, 0xb3, 0x83, 0x99, 0x17, 0x07, 0xae, 0x4d, 0x71, 0xba, 0x71, 0x6d, 0x8a, 0x17, 0xa2, ++ 0x64, 0x7a, 0xf1, 0x8b, 0x00, 0xe1, 0xf9, 0x3d, 0xc1, 0x25, 0xe2, 0xb3, 0xa6, 0x4b, 0xc4, 0x80, ++ 0x52, 0x69, 0x1a, 0x8e, 0x15, 0x17, 0xbf, 0x9e, 0x81, 0x89, 0xc8, 0x09, 0x3e, 0xa1, 0x0d, 0xb5, ++ 0x68, 0x1b, 0xd6, 0x07, 0x1a, 0xf3, 0x62, 0x36, 0xe6, 0x97, 0x32, 0x50, 0xd2, 0x67, 0xf9, 0x84, ++ 0x86, 0xbc, 0x15, 0x6d, 0xc8, 0x6a, 0xba, 0x9c, 0x9e, 0x3d, 0x1a, 0xc1, 0x7a, 0x24, 0x72, 0xa8, ++ 0x1f, 0x6a, 0x8f, 0x68, 0x4e, 0xc9, 0x8d, 0xf9, 0x6a, 0x06, 0xc6, 0xcd, 0xa3, 0x7d, 0x42, 0x5b, ++ 0xb6, 0xa3, 0x6d, 0x59, 0x4b, 0x1d, 0x1b, 0x7d, 0xc8, 0xe0, 0xe8, 0x53, 0xfe, 0x50, 0x07, 0x27, ++ 0xf6, 0x9a, 0x80, 0xd9, 0x88, 0x2f, 0x67, 0x00, 0xc2, 0x23, 0x7f, 0x42, 0x2b, 0xde, 0x8e, 0xb6, ++ 0xe2, 0x8d, 0x94, 0xde, 0x07, 0x87, 0xf4, 0x85, 0x3e, 0xff, 0x0f, 0xb5, 0x2f, 0xd6, 0x6f, 0x6d, ++ 0x6d, 0xf5, 0x68, 0xc4, 0x97, 0x32, 0x50, 0xd2, 0xd6, 0x80, 0xa1, 0x76, 0xc5, 0x46, 0x65, 0xab, ++ 0x2a, 0x54, 0xfb, 0xee, 0x56, 0xbc, 0x97, 0x81, 0x51, 0x65, 0x1d, 0x48, 0x68, 0xc4, 0x9b, 0xd1, ++ 0x46, 0xa4, 0xf0, 0x1e, 0xaa, 0x6e, 0x54, 0x7b, 0x74, 0x04, 0x6f, 0xc2, 0xbd, 0xd3, 0x68, 0xc2, ++ 0xad, 0x5e, 0x4d, 0x78, 0x3f, 0x03, 0x63, 0x86, 0xe9, 0x20, 0xa1, 0x15, 0x56, 0xb4, 0x15, 0x29, ++ 0x2e, 0x30, 0x24, 0x9f, 0xde, 0x0d, 0x31, 0x8c, 0x08, 0x43, 0x6d, 0x88, 0xe4, 0x73, 0x68, 0x43, ++ 0x94, 0x39, 0x61, 0xd8, 0x0d, 0x61, 0x7c, 0x7a, 0xaf, 0x55, 0x6d, 0x5a, 0x18, 0xea, 0x5a, 0xbd, ++ 0xbe, 0xb4, 0x52, 0x3d, 0x44, 0x6e, 0x85, 0x76, 0x86, 0xa1, 0x2e, 0x56, 0xc1, 0x26, 0xb9, 0x19, ++ 0xdf, 0xce, 0xc0, 0x74, 0xdc, 0xd8, 0x90, 0xd0, 0x98, 0x9d, 0x68, 0x63, 0x36, 0xd3, 0xb8, 0x2f, ++ 0x85, 0xcc, 0x92, 0x9b, 0xf4, 0x6b, 0x19, 0x38, 0x9b, 0x60, 0x68, 0x48, 0x68, 0x95, 0x1d, 0x6d, ++ 0x55, 0x75, 0x08, 0x19, 0x66, 0xe3, 0x13, 0xd8, 0x30, 0x35, 0x0c, 0x75, 0x02, 0x4b, 0x3e, 0xbd, ++ 0x75, 0x00, 0xd3, 0xe4, 0x30, 0x54, 0x1d, 0xa0, 0xdb, 0xa7, 0x38, 0x3e, 0x8d, 0x43, 0xe3, 0xc3, ++ 0x50, 0xa7, 0xb1, 0x60, 0xd3, 0x5b, 0xe0, 0x2b, 0x53, 0xc4, 0x50, 0x05, 0xfe, 0x46, 0xf5, 0xd6, ++ 0xa1, 0x02, 0x5f, 0xdb, 0x25, 0x86, 0x2c, 0xf0, 0x39, 0x9f, 0xde, 0xb3, 0xc3, 0xb4, 0x4f, 0x0c, ++ 0x75, 0x76, 0x28, 0x46, 0xc9, 0x4d, 0xf9, 0x5e, 0xc6, 0xc8, 0x0f, 0x66, 0x18, 0x1d, 0x12, 0x9a, ++ 0xf4, 0x4e, 0xb4, 0x49, 0x5b, 0xc3, 0xc8, 0xf1, 0x61, 0x36, 0xed, 0x1b, 0x19, 0x98, 0x8c, 0x5a, ++ 0x1c, 0x12, 0x1a, 0x55, 0x8f, 0x36, 0x6a, 0x63, 0xb0, 0x69, 0xc7, 0xe2, 0x72, 0x38, 0x6e, 0x72, ++ 0x18, 0xaa, 0x1c, 0x36, 0x99, 0xf5, 0x1e, 0xbc, 0x24, 0x6b, 0xc3, 0x50, 0x07, 0xaf, 0x77, 0x4e, ++ 0x57, 0xb3, 0x69, 0xbf, 0x9e, 0x91, 0xb9, 0x4a, 0xbb, 0x4c, 0x0c, 0x09, 0x8d, 0x6b, 0x46, 0x1b, ++ 0x77, 0x67, 0x38, 0x39, 0x9f, 0xe3, 0x0a, 0x86, 0xb6, 0x31, 0x0c, 0x55, 0xc1, 0xa8, 0xae, 0x6c, ++ 0x6d, 0x1e, 0xa6, 0x6e, 0x85, 0xf6, 0x86, 0xe1, 0xaa, 0x5b, 0x82, 0x4f, 0x62, 0x43, 0xca, 0x5f, ++ 0x88, 0x38, 0xcd, 0x9c, 0xb6, 0x43, 0x74, 0xf9, 0x37, 0x32, 0x00, 0xa1, 0x0f, 0x1e, 0xb9, 0x0c, ++ 0x79, 0xfa, 0xa0, 0xed, 0xc5, 0x5d, 0x65, 0x19, 0x06, 0x72, 0x08, 0x71, 0xa0, 0xb8, 0x63, 0xd3, ++ 0x66, 0x5d, 0xb9, 0xca, 0xa4, 0x70, 0x68, 0x94, 0x11, 0x96, 0x2b, 0x8c, 0x5c, 0xd8, 0x40, 0xfe, ++ 0xd3, 0x47, 0xc9, 0xa5, 0xfc, 0x11, 0x18, 0x37, 0x1f, 0x14, 0x39, 0x3a, 0x7a, 0xb2, 0xfc, 0x8f, ++ 0xf2, 0x30, 0x15, 0xb3, 0x57, 0x68, 0xef, 0xdc, 0xad, 0x30, 0x9d, 0x44, 0xd4, 0x3b, 0x97, 0x3b, ++ 0x34, 0x87, 0x38, 0xe4, 0x1b, 0x19, 0x98, 0xba, 0x6f, 0x05, 0xb5, 0x5d, 0x46, 0x78, 0xd1, 0x74, ++ 0x19, 0x4f, 0x31, 0x1f, 0xef, 0x46, 0x09, 0x86, 0x86, 0xc9, 0x18, 0x00, 0xe3, 0xac, 0xc9, 0x2b, ++ 0x30, 0xd2, 0x76, 0x9b, 0x4d, 0xdb, 0x69, 0xc8, 0x67, 0xb0, 0xc2, 0x30, 0x55, 0x51, 0x8c, 0x0a, ++ 0x1e, 0x7d, 0xa9, 0x30, 0x9f, 0xd6, 0x7d, 0x23, 0xd6, 0x91, 0x27, 0x0a, 0x98, 0x2a, 0x3c, 0x05, ++ 0x01, 0x53, 0xff, 0x2a, 0x0f, 0xa4, 0x7b, 0xb7, 0x3e, 0xea, 0x51, 0xcf, 0x97, 0x22, 0xe1, 0x04, ++ 0xa5, 0x5e, 0x91, 0x00, 0x22, 0x43, 0x8f, 0x8c, 0x39, 0xef, 0x7a, 0xc5, 0x4d, 0x94, 0xa3, 0xc6, ++ 0xe8, 0x33, 0xaf, 0xff, 0x57, 0xbb, 0xb3, 0xec, 0x7c, 0x76, 0x90, 0x1a, 0x4b, 0x1f, 0x43, 0x7e, ++ 0x9b, 0xbf, 0xd7, 0xb6, 0x2b, 0x03, 0xe6, 0x8b, 0x7d, 0x07, 0xcc, 0x57, 0x74, 0x65, 0x34, 0x08, ++ 0x9d, 0xfa, 0x2b, 0x00, 0xe9, 0x66, 0xd2, 0x9f, 0x16, 0xe1, 0x4c, 0x97, 0xc4, 0x3f, 0xfd, 0x9c, ++ 0x8c, 0xaf, 0xc2, 0x28, 0xfb, 0xbb, 0x91, 0x10, 0xf3, 0x7c, 0x5d, 0x96, 0xa3, 0xc6, 0x30, 0xf2, ++ 0x0f, 0xe6, 0x7a, 0xe6, 0x1f, 0xb4, 0x22, 0xb9, 0x56, 0x87, 0xf2, 0xd8, 0xe4, 0x27, 0x61, 0x42, ++ 0xd8, 0xf9, 0x55, 0xa6, 0xbd, 0x42, 0x34, 0xd5, 0xda, 0x35, 0x13, 0x88, 0x51, 0xdc, 0x1e, 0x79, ++ 0xf5, 0x8a, 0x27, 0xca, 0xab, 0xf7, 0xcb, 0xdd, 0xa9, 0xf8, 0x3f, 0x33, 0x40, 0x05, 0xa0, 0x8f, ++ 0x35, 0x65, 0xe6, 0xb4, 0x1c, 0x3d, 0x34, 0xa7, 0xe5, 0x3c, 0x94, 0x7c, 0xbf, 0x79, 0x87, 0x7a, ++ 0xf6, 0x8e, 0x08, 0xdb, 0x36, 0x5e, 0x3e, 0xac, 0x2a, 0x00, 0x86, 0x38, 0x4f, 0x59, 0x48, 0xeb, ++ 0xfb, 0x05, 0x6e, 0x20, 0xd3, 0x8a, 0xc0, 0x11, 0xa2, 0xf9, 0x75, 0x98, 0xac, 0x35, 0x5d, 0x87, ++ 0x2e, 0xd9, 0x1e, 0x97, 0x30, 0x07, 0xf1, 0x4c, 0x77, 0x8b, 0x11, 0x28, 0xc6, 0xb0, 0x49, 0x0d, ++ 0x0a, 0x35, 0x8f, 0xd6, 0xfd, 0xf4, 0x61, 0x79, 0xd7, 0xec, 0x60, 0x91, 0x51, 0x12, 0x61, 0x79, ++ 0xfc, 0x5f, 0x14, 0xb4, 0x79, 0xaa, 0x01, 0x7f, 0x97, 0xcb, 0x41, 0x2e, 0x32, 0xf3, 0xfd, 0xa7, ++ 0x1a, 0xa8, 0x5e, 0xd7, 0xd5, 0x31, 0x42, 0x8c, 0x49, 0x80, 0x1d, 0xbb, 0x49, 0x99, 0x16, 0x11, ++ 0x4f, 0xda, 0xb0, 0x22, 0xcb, 0x51, 0x63, 0x88, 0xb0, 0x7d, 0xcb, 0xa9, 0xed, 0xca, 0xc0, 0x07, ++ 0x23, 0x6c, 0x9f, 0xe7, 0x08, 0x95, 0x50, 0xd6, 0xed, 0x81, 0xd5, 0x90, 0x81, 0x0c, 0xba, 0xdb, ++ 0xb7, 0xac, 0x06, 0xb2, 0x72, 0x06, 0xf6, 0xe8, 0x8e, 0xcc, 0x2e, 0xa0, 0xc1, 0x48, 0x77, 0x90, ++ 0x95, 0x93, 0x16, 0x14, 0x3d, 0xda, 0x72, 0x03, 0xf5, 0x68, 0xf1, 0x6a, 0xaa, 0x6e, 0x45, 0x4e, ++ 0x4a, 0x2a, 0x53, 0x20, 0xf2, 0x63, 0xb1, 0x12, 0x94, 0x4c, 0x48, 0x15, 0xce, 0xab, 0x5d, 0x75, ++ 0xb5, 0xe1, 0xb8, 0x1e, 0xbd, 0xee, 0xfa, 0x3c, 0x5b, 0x22, 0xf0, 0xe5, 0xa1, 0x32, 0x8a, 0x9d, ++ 0x5f, 0x4d, 0x42, 0xc2, 0xe4, 0xba, 0xe5, 0x7f, 0x90, 0x81, 0x51, 0x35, 0xa6, 0x4f, 0x41, 0x16, ++ 0xf2, 0x5b, 0x30, 0x15, 0xeb, 0xaa, 0x63, 0x04, 0xc4, 0x3d, 0x0f, 0xf9, 0x8e, 0xd7, 0x14, 0x3a, ++ 0xbe, 0x7c, 0xc1, 0xf0, 0x36, 0xae, 0x55, 0x91, 0x97, 0x96, 0xff, 0x30, 0x03, 0x93, 0xc2, 0x98, ++ 0x5d, 0x69, 0xb7, 0x45, 0x3f, 0xdc, 0x06, 0x68, 0x7b, 0xf6, 0xbe, 0x15, 0x50, 0x95, 0x8c, 0xb2, ++ 0xbf, 0xad, 0x7f, 0x53, 0x57, 0x46, 0x83, 0x10, 0x79, 0x11, 0x0a, 0x56, 0xbb, 0xbd, 0xba, 0xc4, ++ 0xbb, 0x22, 0x17, 0x7a, 0xef, 0x54, 0x58, 0x21, 0x0a, 0x18, 0x5b, 0xea, 0xb6, 0xe3, 0x07, 0x56, ++ 0xb3, 0xc9, 0xc3, 0x4d, 0x56, 0x97, 0xf8, 0x9a, 0xcd, 0x85, 0x4b, 0x7d, 0x35, 0x02, 0xc5, 0x18, ++ 0x76, 0xf9, 0xef, 0x8f, 0xc1, 0x99, 0x2e, 0xdb, 0xbc, 0x11, 0xac, 0x99, 0xeb, 0x0a, 0xd6, 0x34, ++ 0x76, 0xf3, 0xec, 0xa9, 0xec, 0xe6, 0x3a, 0xb9, 0x78, 0xee, 0xb8, 0xc9, 0xc5, 0xc3, 0xc4, 0x9d, ++ 0x32, 0xe6, 0x33, 0x21, 0x21, 0x73, 0x98, 0xec, 0x13, 0x0d, 0xfc, 0x63, 0x65, 0x3b, 0xbf, 0x09, ++ 0xa3, 0x56, 0xdb, 0x16, 0x39, 0x7d, 0x8b, 0x7d, 0x4f, 0xd3, 0xca, 0xe6, 0xaa, 0x48, 0xe8, 0xab, ++ 0x89, 0x74, 0x67, 0xf3, 0x1d, 0x19, 0x6c, 0x36, 0x5f, 0x53, 0x05, 0x1f, 0x3d, 0x52, 0x05, 0x7f, ++ 0x09, 0x8a, 0x56, 0x2d, 0xb0, 0xf7, 0xa9, 0xdc, 0x48, 0xb5, 0x34, 0xac, 0xf0, 0x52, 0x94, 0x50, ++ 0x9e, 0x90, 0x24, 0x8c, 0x88, 0xe5, 0x62, 0xc5, 0x4c, 0x48, 0x62, 0x04, 0xcb, 0x9a, 0x78, 0x5c, ++ 0xcf, 0xe1, 0xf3, 0x25, 0x9a, 0x51, 0x38, 0xd4, 0x73, 0x4c, 0x20, 0x46, 0x71, 0x49, 0x05, 0xa6, ++ 0x44, 0xc1, 0xed, 0x36, 0x3b, 0x3e, 0xb3, 0xea, 0xe3, 0xd1, 0x59, 0x71, 0x2d, 0x0a, 0xc6, 0x38, ++ 0x7e, 0x0f, 0x55, 0x69, 0x22, 0xbd, 0xaa, 0x34, 0x99, 0x5a, 0x55, 0x8a, 0xaf, 0xc3, 0x3e, 0x54, ++ 0xa5, 0xaf, 0xc4, 0x93, 0x7a, 0x0b, 0x6f, 0xe7, 0x14, 0x6a, 0x0d, 0x5b, 0x54, 0x75, 0x33, 0x6d, ++ 0xf7, 0xb1, 0x92, 0x79, 0xff, 0x34, 0x4c, 0xb8, 0x5e, 0xc3, 0x72, 0xec, 0x77, 0xb9, 0x84, 0xf1, ++ 0xb9, 0xdb, 0x73, 0x49, 0xcc, 0xd1, 0x9b, 0x26, 0x00, 0xa3, 0x78, 0xa4, 0x03, 0xa5, 0x86, 0x12, ++ 0xab, 0x33, 0x67, 0xd2, 0x0a, 0x96, 0xa8, 0x84, 0x16, 0xb1, 0x70, 0xba, 0x0c, 0x43, 0x4e, 0x86, ++ 0x1e, 0x48, 0x9e, 0x02, 0x3d, 0xf0, 0xff, 0x8e, 0x70, 0x69, 0x1d, 0xbd, 0xc0, 0x3c, 0xfd, 0xf3, ++ 0xd5, 0xcf, 0x40, 0x49, 0x6a, 0xde, 0x72, 0x77, 0x2a, 0x2d, 0xfc, 0x98, 0x8e, 0x46, 0x8d, 0xa7, ++ 0xbc, 0x5f, 0x5d, 0xc2, 0x10, 0xfb, 0x58, 0x87, 0xad, 0x58, 0xda, 0xf4, 0xfc, 0xe0, 0xd2, 0xa6, ++ 0x57, 0xe1, 0xbc, 0x48, 0xd2, 0x5a, 0xad, 0xae, 0xf1, 0x83, 0x80, 0x2d, 0x9e, 0x20, 0x96, 0x2f, ++ 0x03, 0x6a, 0x9d, 0x68, 0x39, 0x09, 0x09, 0x93, 0xeb, 0x4a, 0x81, 0xd6, 0xb4, 0xb4, 0x40, 0x2b, ++ 0x76, 0x09, 0xb4, 0x10, 0x88, 0x51, 0xdc, 0x1e, 0xd2, 0x68, 0x34, 0xbd, 0x34, 0x2a, 0x0d, 0x40, ++ 0x1a, 0x45, 0xe7, 0xd9, 0x09, 0x0f, 0x6e, 0x70, 0xe8, 0xc1, 0xed, 0xd3, 0x30, 0x26, 0x9e, 0x4f, ++ 0x17, 0x63, 0x3d, 0xd6, 0xf7, 0x58, 0x57, 0xc3, 0xda, 0x68, 0x92, 0x32, 0x56, 0xf6, 0xf8, 0xe9, ++ 0xe4, 0x62, 0x2f, 0x43, 0xb1, 0xe1, 0xb9, 0x9d, 0xb6, 0x08, 0xa9, 0x91, 0x53, 0xfb, 0x1a, 0x2f, ++ 0x41, 0x09, 0x49, 0xb7, 0xfa, 0xbf, 0x59, 0x82, 0xa9, 0x98, 0xdf, 0x40, 0xa2, 0xad, 0x36, 0xf3, ++ 0xe4, 0x6c, 0xb5, 0x97, 0x23, 0xd9, 0xfb, 0x92, 0x52, 0x6d, 0x74, 0x65, 0x94, 0xcf, 0x1d, 0x3f, ++ 0xa3, 0x3c, 0xf9, 0x49, 0x28, 0x59, 0xf5, 0xba, 0x47, 0x7d, 0x9f, 0xaa, 0x57, 0x2e, 0xc4, 0x03, ++ 0xff, 0xaa, 0x10, 0x43, 0x38, 0xb7, 0x02, 0xd5, 0x77, 0x7c, 0x76, 0xce, 0x88, 0x9f, 0x01, 0x59, ++ 0x2f, 0xb2, 0x72, 0xd4, 0x18, 0xa4, 0x0e, 0x53, 0x7b, 0xde, 0xf6, 0xe2, 0xa2, 0x55, 0xdb, 0xa5, ++ 0x27, 0x31, 0xe2, 0xf1, 0x04, 0x30, 0x37, 0xa2, 0x14, 0x30, 0x4e, 0x52, 0x72, 0xb9, 0x41, 0x0f, ++ 0x02, 0x6b, 0xfb, 0x24, 0xba, 0x9e, 0xe2, 0x62, 0x52, 0xc0, 0x38, 0x49, 0xa6, 0x99, 0xed, 0x79, ++ 0xdb, 0xea, 0x80, 0x25, 0x0f, 0xa4, 0x5a, 0x33, 0xbb, 0x11, 0x82, 0xd0, 0xc4, 0x63, 0x1d, 0xb6, ++ 0xe7, 0x6d, 0x23, 0xb5, 0x9a, 0x2d, 0x99, 0xfa, 0x4e, 0x77, 0xd8, 0x0d, 0x59, 0x8e, 0x1a, 0x83, ++ 0xb4, 0x81, 0xb0, 0xaf, 0xe3, 0xe3, 0xae, 0xc3, 0xcc, 0xa5, 0x35, 0xe5, 0xf8, 0x8f, 0x8e, 0x5f, ++ 0x60, 0xf2, 0xed, 0x46, 0x17, 0x1d, 0x4c, 0xa0, 0x4d, 0x3e, 0x03, 0xcf, 0xee, 0x79, 0xdb, 0xf2, ++ 0x0a, 0x70, 0xd3, 0xb3, 0x9d, 0x9a, 0xdd, 0xb6, 0x44, 0x36, 0xbc, 0xb1, 0xe8, 0xfb, 0x88, 0x37, ++ 0x92, 0xd1, 0xb0, 0x57, 0xfd, 0xe8, 0xc5, 0xc1, 0x78, 0xda, 0x8b, 0x83, 0xd8, 0x22, 0x3d, 0xd1, ++ 0xc5, 0xc1, 0xc4, 0x53, 0xa0, 0x8e, 0x7c, 0x79, 0x04, 0xc6, 0xae, 0x6f, 0x6d, 0x6d, 0xaa, 0x5c, ++ 0x97, 0x47, 0x98, 0xa5, 0x8c, 0xdc, 0xa5, 0xd9, 0x53, 0x7c, 0xbb, 0x50, 0x26, 0xea, 0xcb, 0x0d, ++ 0x2b, 0x51, 0xdf, 0x4b, 0x50, 0x6c, 0xd1, 0x60, 0xd7, 0xad, 0xc7, 0x13, 0x96, 0xaf, 0xf3, 0x52, ++ 0x94, 0xd0, 0x58, 0x26, 0xd0, 0xc2, 0xa9, 0x67, 0x02, 0x7d, 0x05, 0x46, 0x02, 0xbb, 0x45, 0xdd, ++ 0x8e, 0x90, 0x6c, 0xb9, 0xb0, 0xcb, 0xb6, 0x44, 0x31, 0x2a, 0x38, 0x69, 0x43, 0x69, 0x5b, 0x19, ++ 0xaa, 0xa5, 0x80, 0x1a, 0x88, 0xcd, 0x9b, 0x0b, 0x6b, 0xfd, 0x13, 0x43, 0x26, 0xe4, 0x0b, 0x30, ++ 0xb2, 0x4b, 0xad, 0x3a, 0xeb, 0x99, 0xd1, 0xb4, 0x91, 0x48, 0xc6, 0x94, 0x9c, 0xbb, 0x2e, 0x88, ++ 0xc6, 0xc2, 0x71, 0x64, 0x29, 0x2a, 0x9e, 0xe4, 0x17, 0x60, 0x42, 0x9c, 0x7e, 0x25, 0x44, 0xaa, ++ 0x4f, 0x2b, 0x69, 0x22, 0xfc, 0x43, 0x72, 0xe2, 0xf8, 0x63, 0x96, 0xf8, 0x18, 0xe5, 0x77, 0xf1, ++ 0x35, 0x18, 0x37, 0x9b, 0xda, 0xef, 0x53, 0x29, 0x13, 0x91, 0x77, 0x2c, 0xc9, 0xcb, 0xc6, 0xe3, ++ 0x01, 0x39, 0x7d, 0x6e, 0x53, 0x49, 0x74, 0xcd, 0xed, 0x58, 0xbc, 0x9f, 0xf1, 0x53, 0x1f, 0xbf, ++ 0x23, 0xdf, 0xcf, 0xc8, 0x45, 0xde, 0xcf, 0xe0, 0xe5, 0xa8, 0x31, 0x78, 0xaa, 0x95, 0xc0, 0xbb, ++ 0xa3, 0x77, 0x6d, 0x33, 0xa4, 0x8e, 0x61, 0x4a, 0x68, 0xf9, 0x97, 0x26, 0x61, 0xdc, 0x4c, 0x01, ++ 0xc7, 0xe6, 0x9e, 0xca, 0xda, 0x95, 0x89, 0x66, 0xc7, 0x52, 0x19, 0xbb, 0x14, 0x3c, 0x12, 0x19, ++ 0x95, 0x3d, 0x34, 0x32, 0xea, 0xdb, 0x22, 0x71, 0x68, 0x34, 0x8f, 0x78, 0xfa, 0xa4, 0x1f, 0x5d, ++ 0xa9, 0xc9, 0x75, 0x0a, 0xd1, 0x68, 0x31, 0x76, 0x33, 0x27, 0xbf, 0x93, 0x81, 0xe7, 0x3c, 0xca, ++ 0xc4, 0x0e, 0xf5, 0xba, 0x2a, 0xc8, 0x93, 0xcc, 0x40, 0x9b, 0xf6, 0xc2, 0xa3, 0x87, 0xb3, 0xcf, ++ 0x61, 0x2f, 0x8e, 0xd8, 0xbb, 0x31, 0xe4, 0xef, 0x64, 0x60, 0xa6, 0x45, 0x03, 0xcf, 0xae, 0xf9, ++ 0xdd, 0x2d, 0x2d, 0x0c, 0xbe, 0xa5, 0xcf, 0x3f, 0x7a, 0x38, 0x3b, 0xb3, 0xde, 0x83, 0x21, 0xf6, ++ 0x6c, 0x0a, 0x79, 0x2f, 0x93, 0xf4, 0x7c, 0x49, 0x8a, 0x30, 0x0a, 0x23, 0x49, 0x4e, 0x35, 0xf0, ++ 0xac, 0x80, 0x36, 0x0e, 0x8e, 0x78, 0xc1, 0xa4, 0x19, 0xb9, 0x10, 0x4b, 0x79, 0x25, 0xa2, 0xb6, ++ 0x5b, 0x31, 0xad, 0x13, 0x74, 0x80, 0xef, 0x64, 0x60, 0xdc, 0x71, 0xeb, 0x54, 0xe9, 0x48, 0x52, ++ 0x20, 0x7e, 0x7a, 0x30, 0xd9, 0x18, 0xe7, 0x36, 0x0c, 0xd2, 0x42, 0x2c, 0x6a, 0xbb, 0x8e, 0x09, ++ 0xc2, 0x48, 0x1b, 0xc8, 0x6d, 0x18, 0x0b, 0xdc, 0x26, 0xf5, 0xa4, 0x55, 0x47, 0x88, 0xc7, 0x4b, ++ 0x49, 0x6a, 0xde, 0x96, 0x46, 0x0b, 0x55, 0xce, 0xb0, 0xcc, 0x47, 0x93, 0x0e, 0xa1, 0xdd, 0x59, ++ 0xf3, 0x85, 0x06, 0xf9, 0x52, 0x12, 0xe9, 0x4d, 0xb7, 0x7e, 0xb2, 0x57, 0x15, 0x1c, 0x98, 0xd6, ++ 0xf9, 0xfa, 0x85, 0x8e, 0xec, 0xcb, 0x24, 0x0f, 0x89, 0x9a, 0xea, 0x9a, 0x5b, 0xb3, 0x9a, 0x22, ++ 0x91, 0x11, 0xd2, 0x1d, 0xea, 0xf1, 0x7c, 0x4a, 0xfa, 0xd9, 0x8b, 0xd5, 0x18, 0x25, 0xec, 0xa2, ++ 0x4d, 0xae, 0xc1, 0x99, 0xb6, 0x67, 0xbb, 0xbc, 0x09, 0x4d, 0xcb, 0x17, 0x79, 0x6d, 0x84, 0xa1, ++ 0x52, 0x07, 0xba, 0x6d, 0xc6, 0x11, 0xb0, 0xbb, 0x8e, 0x38, 0x48, 0x8b, 0x42, 0xae, 0x11, 0x16, ++ 0xd4, 0x41, 0x5a, 0x94, 0xa1, 0x86, 0x92, 0x15, 0x18, 0xb5, 0x76, 0x76, 0x6c, 0x87, 0x61, 0x8a, ++ 0xc7, 0xc7, 0x9e, 0x4f, 0xfa, 0xb4, 0x8a, 0xc4, 0x91, 0xb6, 0x68, 0xf9, 0x0b, 0x75, 0x5d, 0x95, ++ 0xa1, 0xdf, 0xae, 0xd1, 0x4a, 0xad, 0xe6, 0x76, 0x64, 0x52, 0xbf, 0xa9, 0xee, 0x0c, 0xfd, 0x51, ++ 0x0c, 0x4c, 0xa8, 0xc5, 0x5a, 0xef, 0xd3, 0x20, 0xb0, 0x9d, 0x86, 0x2f, 0x1f, 0x0e, 0xe3, 0x5c, ++ 0xab, 0xb2, 0x0c, 0x35, 0x94, 0x1d, 0xec, 0xfc, 0xc0, 0xf2, 0x82, 0x8a, 0xd7, 0xf0, 0x79, 0xaa, ++ 0x02, 0x79, 0xb0, 0xab, 0xaa, 0x42, 0x0c, 0xe1, 0xe4, 0xe3, 0x30, 0xee, 0x1b, 0xb9, 0x37, 0xb9, ++ 0xe5, 0xae, 0x24, 0xaf, 0x04, 0x8d, 0x72, 0x8c, 0x60, 0x91, 0x39, 0x80, 0x96, 0xf5, 0x40, 0x6a, ++ 0x87, 0x33, 0x67, 0xc5, 0xfe, 0xc5, 0xd4, 0xa5, 0x75, 0x5d, 0x8a, 0x06, 0xc6, 0xc5, 0x9f, 0x83, ++ 0x33, 0x5d, 0x4b, 0xa5, 0xaf, 0x6d, 0xf9, 0xb7, 0xb3, 0x30, 0x15, 0x4b, 0x13, 0x7a, 0x94, 0x86, ++ 0xfc, 0x39, 0x18, 0x17, 0xe6, 0x2a, 0x79, 0x36, 0xcc, 0xf6, 0x7d, 0x27, 0x5a, 0x31, 0xaa, 0x63, ++ 0x84, 0x18, 0xb9, 0x1a, 0xeb, 0xb6, 0x5c, 0x34, 0xcf, 0xd2, 0x21, 0x5d, 0x27, 0x35, 0xe8, 0xfc, ++ 0x90, 0x34, 0xe8, 0xf2, 0x1c, 0x8c, 0xdd, 0xb8, 0x5a, 0x55, 0xe1, 0x6d, 0x61, 0x52, 0xff, 0x0c, ++ 0x4f, 0xa4, 0xdc, 0x95, 0xd4, 0xbf, 0xfc, 0xcd, 0x1c, 0x9c, 0x31, 0x2a, 0xc8, 0x17, 0x38, 0x7e, ++ 0x01, 0x8a, 0x4d, 0x6b, 0x9b, 0x36, 0x55, 0x96, 0xfd, 0x14, 0x07, 0xb8, 0x2e, 0xe2, 0x73, 0x6b, ++ 0x9c, 0x72, 0x2c, 0x3e, 0x53, 0x14, 0xa2, 0x64, 0x4b, 0x76, 0x61, 0x64, 0x5b, 0x66, 0x2f, 0xcf, ++ 0x0e, 0x2a, 0x7b, 0x39, 0x37, 0xc0, 0xaa, 0x9c, 0xe5, 0x8a, 0x3c, 0xb7, 0x63, 0x7a, 0x9e, 0xeb, ++ 0xdd, 0x54, 0xb9, 0xcb, 0xa5, 0x06, 0x2f, 0x1d, 0xac, 0x42, 0x3b, 0x66, 0x12, 0x12, 0x26, 0xd7, ++ 0xbd, 0xf8, 0x33, 0x30, 0x66, 0x7c, 0x65, 0x5f, 0x53, 0xfd, 0x5f, 0xe4, 0x60, 0x54, 0x65, 0xe0, ++ 0x3d, 0x6a, 0x8e, 0xbf, 0x08, 0x05, 0xfe, 0xe8, 0xbe, 0xb4, 0x11, 0xe9, 0x6b, 0x4d, 0xfe, 0x28, ++ 0x3f, 0x0a, 0x98, 0xa9, 0x2f, 0xe6, 0x8e, 0xd0, 0x17, 0x87, 0x3c, 0x39, 0xc9, 0x36, 0xe4, 0x7d, ++ 0xcb, 0x6f, 0x4a, 0x95, 0x28, 0x4d, 0x50, 0x6d, 0xa5, 0xba, 0x66, 0x3e, 0xf4, 0xc7, 0x7e, 0x23, ++ 0xa7, 0x4d, 0xbe, 0x92, 0x81, 0x89, 0x9a, 0xeb, 0xf8, 0x9d, 0x16, 0xf5, 0xb8, 0xc5, 0x50, 0x6a, ++ 0x39, 0x6b, 0x29, 0x43, 0x12, 0x17, 0x4d, 0x9a, 0xe2, 0x14, 0x12, 0x29, 0xc2, 0x28, 0x57, 0xfe, ++ 0xdc, 0x78, 0x77, 0x45, 0x32, 0x0f, 0x25, 0x6e, 0xbf, 0x34, 0xd2, 0xb3, 0x69, 0xef, 0x9a, 0x6b, ++ 0x0a, 0x80, 0x21, 0x0e, 0x3b, 0x27, 0xb8, 0xcd, 0x3a, 0xd5, 0x4f, 0x46, 0xe9, 0x15, 0x73, 0x93, ++ 0x97, 0xa2, 0x84, 0xb2, 0x7d, 0xd2, 0xa3, 0xdb, 0x56, 0xd3, 0x32, 0x74, 0x31, 0x39, 0xe0, 0x7a, ++ 0x9f, 0xc4, 0x38, 0x02, 0x76, 0xd7, 0x29, 0xff, 0xe7, 0x51, 0x98, 0x8e, 0x07, 0x61, 0x1e, 0x35, ++ 0x11, 0xe7, 0xa1, 0xd4, 0xb6, 0xbc, 0xc0, 0x36, 0x1e, 0x69, 0xd3, 0x5f, 0xb5, 0xa9, 0x00, 0x18, ++ 0xe2, 0x84, 0x33, 0x37, 0x77, 0xc8, 0xcc, 0x4d, 0x7e, 0xcd, 0x20, 0x7f, 0xfa, 0xaf, 0x19, 0xc8, ++ 0x75, 0x51, 0x18, 0xd6, 0xba, 0x30, 0x3d, 0x35, 0x8b, 0x47, 0x7a, 0x6a, 0xbe, 0xdf, 0xed, 0x54, ++ 0xf6, 0xe9, 0xc1, 0xc5, 0xdb, 0xf6, 0x77, 0x51, 0x1a, 0x5b, 0x6a, 0xa3, 0x4f, 0x62, 0xa9, 0x91, ++ 0x4d, 0x38, 0xd7, 0xb4, 0x5b, 0xd2, 0x33, 0xce, 0xdf, 0xa4, 0x5e, 0x95, 0xd6, 0x5c, 0xa7, 0xce, ++ 0x0d, 0xaf, 0xb9, 0xd0, 0x61, 0x61, 0x2d, 0x01, 0x07, 0x13, 0x6b, 0x9a, 0x32, 0x13, 0x8e, 0x90, ++ 0x99, 0x4a, 0xa6, 0x8d, 0x0d, 0x51, 0xa6, 0x9d, 0xfa, 0xfd, 0x4b, 0xe8, 0x90, 0x3c, 0x71, 0x98, ++ 0x43, 0x72, 0x3a, 0x93, 0xe7, 0xdf, 0x04, 0x18, 0xe7, 0xe3, 0x7d, 0x4c, 0x9b, 0xe7, 0xb1, 0x76, ++ 0xbb, 0x88, 0x24, 0xca, 0x71, 0x35, 0xff, 0x70, 0x49, 0x14, 0x35, 0x25, 0xe6, 0x4f, 0xdd, 0x94, ++ 0x78, 0x15, 0xc6, 0x3d, 0xf1, 0xfc, 0x5a, 0xbd, 0x52, 0xdb, 0xf3, 0xe5, 0x7b, 0x3d, 0x86, 0x7f, ++ 0x40, 0x08, 0xc3, 0x08, 0x26, 0x93, 0x1a, 0x35, 0xb7, 0xc5, 0xb3, 0x9d, 0xc6, 0xa5, 0xc6, 0xa2, ++ 0x2c, 0x47, 0x8d, 0x41, 0x5e, 0x87, 0xc9, 0x9d, 0x66, 0xc7, 0xdf, 0x5d, 0x61, 0x34, 0xa8, 0x53, ++ 0x13, 0xef, 0xb2, 0x14, 0x42, 0xef, 0xa6, 0x95, 0x08, 0x14, 0x63, 0xd8, 0x43, 0x7f, 0xa3, 0xc5, ++ 0xb0, 0x68, 0x97, 0x4e, 0xd1, 0xa2, 0xfd, 0xb3, 0x30, 0xa5, 0xe7, 0x82, 0xed, 0x34, 0x94, 0x53, ++ 0x5f, 0x49, 0x9c, 0x86, 0x37, 0xa3, 0x20, 0x8c, 0xe3, 0x9a, 0x82, 0x62, 0xec, 0x98, 0x82, 0x62, ++ 0x7c, 0x88, 0x82, 0xe2, 0xeb, 0x19, 0x98, 0xf4, 0x6b, 0xbb, 0xb4, 0x65, 0x21, 0x6d, 0xd8, 0x7e, ++ 0xe0, 0x1d, 0xc8, 0xcb, 0x8f, 0x14, 0x41, 0x75, 0xd5, 0x08, 0x3d, 0xc9, 0x98, 0xbf, 0xf2, 0x1b, ++ 0x85, 0x60, 0x8c, 0x33, 0xf9, 0x62, 0x68, 0x87, 0x9e, 0x4c, 0x9b, 0x5c, 0xc6, 0x94, 0x13, 0x27, ++ 0x36, 0x44, 0x4f, 0x3d, 0x45, 0x86, 0xe8, 0x9b, 0x00, 0x6b, 0x6e, 0x43, 0x49, 0xc6, 0x0a, 0x4c, ++ 0xa9, 0x87, 0x97, 0xc5, 0x0e, 0x25, 0x22, 0xba, 0xf2, 0xe1, 0x75, 0xf2, 0x6a, 0x14, 0x8c, 0x71, ++ 0xfc, 0xf2, 0xef, 0x17, 0x61, 0x2a, 0x96, 0xd5, 0x62, 0x20, 0x02, 0x97, 0x49, 0xa1, 0xa6, 0x4d, ++ 0x9d, 0x60, 0xb5, 0x2e, 0x95, 0xb9, 0x50, 0x0a, 0x89, 0xf2, 0x25, 0xd4, 0x18, 0x1f, 0x1c, 0x95, ++ 0xce, 0x54, 0xb9, 0x0a, 0xc7, 0x7d, 0xa0, 0xaa, 0x38, 0x2c, 0xe1, 0xf7, 0x95, 0x6e, 0x95, 0xee, ++ 0xee, 0xc0, 0x92, 0x97, 0x9c, 0xe8, 0xce, 0xf4, 0x74, 0xde, 0x97, 0xd6, 0xc1, 0x20, 0xa5, 0xa1, ++ 0x05, 0x83, 0xa4, 0xd3, 0x51, 0xbe, 0x9e, 0x03, 0xdd, 0x4f, 0x4c, 0xba, 0x8e, 0x59, 0x8e, 0xe3, ++ 0x06, 0xd2, 0x72, 0x9b, 0x49, 0x2b, 0xd5, 0x14, 0xe5, 0xb9, 0x4a, 0x48, 0x35, 0x96, 0x07, 0xcd, ++ 0x80, 0xa0, 0xc9, 0x9c, 0xec, 0x6b, 0x13, 0x8d, 0xb8, 0x00, 0xde, 0x18, 0x40, 0x33, 0x8e, 0x61, ++ 0x99, 0xb9, 0xf8, 0x3a, 0x4c, 0xc7, 0x5b, 0xdb, 0x4f, 0x8f, 0xa6, 0x31, 0x8d, 0xfc, 0x49, 0x16, ++ 0x46, 0x37, 0x2a, 0x5b, 0x55, 0x7e, 0xcb, 0x59, 0x87, 0x02, 0xbf, 0xf2, 0x94, 0x2e, 0x3a, 0x03, ++ 0x99, 0x3a, 0xdc, 0x3c, 0xc6, 0x7f, 0xa2, 0x20, 0x4e, 0x56, 0x98, 0x08, 0xdc, 0xa3, 0x4e, 0x7f, ++ 0xe6, 0xc3, 0x92, 0x90, 0x92, 0x7b, 0xd4, 0x41, 0x51, 0x9d, 0x2c, 0x42, 0xde, 0x61, 0xdf, 0xd9, ++ 0xd7, 0x23, 0x90, 0xe2, 0x5d, 0x29, 0xa6, 0x77, 0xf0, 0xca, 0xfc, 0x21, 0x59, 0x8f, 0xd6, 0xa9, ++ 0x13, 0xd8, 0x56, 0xb3, 0x3f, 0x5f, 0x3e, 0xf1, 0x90, 0xac, 0xae, 0x8c, 0x06, 0xa1, 0xf2, 0x0f, ++ 0x32, 0x30, 0x22, 0x9f, 0xb2, 0x22, 0x4d, 0x28, 0x3a, 0x16, 0x77, 0x58, 0x4e, 0xed, 0xfe, 0xb8, ++ 0xc1, 0xe9, 0xe8, 0x6b, 0x21, 0xbe, 0xfa, 0x45, 0x19, 0x4a, 0x1e, 0x64, 0x17, 0x8a, 0x54, 0x3c, ++ 0x22, 0x95, 0x3a, 0xcd, 0x1a, 0xfb, 0x00, 0x33, 0x82, 0x43, 0x3e, 0x1b, 0x25, 0xe9, 0x97, 0x7f, ++ 0x98, 0x01, 0x08, 0x51, 0x8e, 0xda, 0xf8, 0x7e, 0x12, 0x4a, 0xb5, 0x66, 0xc7, 0x0f, 0xa8, 0xa7, ++ 0x9d, 0x32, 0xc5, 0x13, 0x10, 0xaa, 0x10, 0x43, 0x38, 0x79, 0x55, 0x8a, 0x30, 0xb1, 0xf9, 0xcd, ++ 0x28, 0xe9, 0xf3, 0xf8, 0xe1, 0xec, 0x38, 0x0f, 0x44, 0x54, 0xa6, 0x16, 0x11, 0x9a, 0x16, 0x37, ++ 0x4b, 0xe7, 0x07, 0x68, 0x96, 0x2e, 0xff, 0x5e, 0x11, 0xa6, 0xe3, 0x49, 0xa3, 0x8e, 0xfa, 0x56, ++ 0xe3, 0xb1, 0xa5, 0xec, 0x11, 0x8f, 0x2d, 0x25, 0x6f, 0xde, 0xb9, 0x27, 0xbb, 0x79, 0xe7, 0x8f, ++ 0xbb, 0x79, 0x0f, 0xcd, 0x7a, 0x13, 0xb1, 0xc7, 0x14, 0xd3, 0xda, 0x63, 0xe2, 0xe3, 0xd7, 0xc7, ++ 0xee, 0xfd, 0xb6, 0x9c, 0x89, 0xa9, 0xef, 0x55, 0x95, 0x90, 0xed, 0x0a, 0xac, 0x3c, 0x75, 0xfd, ++ 0x60, 0x16, 0x0a, 0xf7, 0x3a, 0xb4, 0x43, 0xa5, 0x13, 0x1d, 0x17, 0xac, 0x3c, 0x37, 0x04, 0x8a, ++ 0xf2, 0x74, 0xbb, 0xfb, 0xb7, 0xf3, 0x30, 0xc6, 0xbe, 0xf5, 0x98, 0x06, 0x88, 0x3e, 0x96, 0x8a, ++ 0x71, 0x9a, 0xcd, 0x9d, 0xe2, 0x69, 0xf6, 0x49, 0x1b, 0x33, 0x86, 0xbd, 0xd4, 0xd4, 0x0c, 0x2f, ++ 0x0e, 0x6b, 0x86, 0x97, 0x7f, 0x58, 0x80, 0xc9, 0x68, 0xfa, 0x21, 0xf2, 0x09, 0x18, 0xdb, 0x75, ++ 0xfd, 0x40, 0x3a, 0xc6, 0xca, 0xd9, 0xa1, 0x15, 0xb4, 0xeb, 0x21, 0x08, 0x4d, 0xbc, 0x63, 0x5f, ++ 0xce, 0xc8, 0x17, 0x86, 0xe3, 0x97, 0x33, 0xf2, 0x15, 0x62, 0x54, 0xf0, 0x1f, 0x1d, 0x9d, 0x92, ++ 0xa7, 0xc4, 0x97, 0xbb, 0x8f, 0x4e, 0x77, 0x06, 0x95, 0x79, 0xea, 0x03, 0x7c, 0x72, 0x4a, 0x27, ++ 0xf8, 0x7e, 0x75, 0x0a, 0x26, 0xa3, 0xfa, 0x19, 0x1b, 0x55, 0xed, 0x2b, 0x96, 0xe1, 0x96, 0x41, ++ 0xe3, 0x51, 0x95, 0x2e, 0x7f, 0x31, 0xa5, 0xf4, 0x64, 0x8f, 0xa5, 0xf4, 0xc4, 0xfd, 0x8e, 0x72, ++ 0xa7, 0xef, 0x77, 0x94, 0xec, 0xe0, 0x96, 0x7f, 0x92, 0x0e, 0x6e, 0x4f, 0x8b, 0xd7, 0xd8, 0x77, ++ 0xe3, 0x4e, 0x54, 0xc5, 0xb4, 0xd9, 0x41, 0xa2, 0x53, 0x6f, 0x30, 0x6e, 0x54, 0x23, 0x03, 0x72, ++ 0xa3, 0x32, 0x1d, 0xd4, 0x46, 0x87, 0xee, 0xa0, 0x96, 0xe0, 0xb4, 0x55, 0x1a, 0x82, 0xd3, 0x56, ++ 0x19, 0x8a, 0x2d, 0xeb, 0x41, 0xa5, 0xa1, 0x42, 0x4b, 0xb9, 0x40, 0x59, 0xe7, 0x25, 0x28, 0x21, ++ 0xa7, 0xee, 0xd8, 0x95, 0xec, 0x1d, 0x35, 0x7e, 0x22, 0xef, 0xa8, 0x44, 0x27, 0xb1, 0x89, 0x94, ++ 0x4e, 0x62, 0x93, 0xc7, 0x76, 0x12, 0x9b, 0x4a, 0xe1, 0x24, 0xf6, 0x21, 0x18, 0x69, 0x59, 0x0f, ++ 0xd6, 0x7d, 0xe9, 0xd7, 0x95, 0x17, 0x6e, 0x2a, 0xeb, 0xa2, 0x08, 0x15, 0x8c, 0x35, 0xac, 0x65, ++ 0x3d, 0x58, 0x38, 0x08, 0xa8, 0xcf, 0x43, 0x3a, 0xa5, 0xff, 0xd7, 0xba, 0x2c, 0x43, 0x0d, 0x95, ++ 0x04, 0xab, 0x9d, 0x6d, 0x9f, 0x7b, 0x73, 0x85, 0x04, 0x59, 0x11, 0x2a, 0x58, 0xbf, 0x3e, 0x5c, ++ 0x64, 0x0d, 0xce, 0x79, 0xd6, 0x4e, 0x70, 0x9d, 0x5a, 0x5e, 0xb0, 0x4d, 0xad, 0x40, 0xb9, 0xc9, ++ 0x9c, 0xd3, 0x3b, 0xc0, 0x39, 0x4c, 0x80, 0x63, 0x62, 0x2d, 0xb2, 0x0a, 0x67, 0x59, 0xf9, 0x72, ++ 0x53, 0xa8, 0x16, 0x8a, 0xd8, 0x79, 0x11, 0x80, 0xfc, 0xe8, 0xe1, 0xec, 0x59, 0xec, 0x06, 0x63, ++ 0x52, 0x1d, 0xf2, 0x29, 0x98, 0x66, 0xc5, 0x6b, 0xd4, 0xf2, 0xa9, 0xa2, 0x73, 0x41, 0xf8, 0x63, ++ 0xb1, 0x99, 0x88, 0x31, 0x18, 0x76, 0x61, 0x93, 0x45, 0x38, 0xc3, 0xca, 0x16, 0xdd, 0x56, 0xcb, ++ 0xd6, 0xdf, 0xf5, 0xac, 0x88, 0xa5, 0xe2, 0x6e, 0x13, 0x71, 0x20, 0x76, 0xe3, 0xa7, 0xf7, 0x71, ++ 0xfb, 0x56, 0x1e, 0xa6, 0x6f, 0xb6, 0xa9, 0x73, 0x77, 0xd7, 0xf6, 0xf7, 0xd4, 0x89, 0xe4, 0x32, ++ 0xe4, 0x99, 0x4e, 0x19, 0x4f, 0xb1, 0xc0, 0x94, 0x4e, 0xe4, 0x10, 0xf3, 0x06, 0x2a, 0x7b, 0xc4, ++ 0x0d, 0xd4, 0x3c, 0x94, 0x1c, 0xab, 0x45, 0xfd, 0xb6, 0x55, 0xeb, 0x7a, 0x5b, 0x78, 0x43, 0x01, ++ 0x30, 0xc4, 0x21, 0x08, 0x25, 0xb6, 0x7f, 0x9f, 0x20, 0x76, 0x54, 0x84, 0x92, 0xa9, 0xba, 0x18, ++ 0x92, 0x21, 0x57, 0x00, 0x2c, 0x3e, 0x7e, 0x7c, 0x8d, 0x16, 0xa2, 0x0f, 0x39, 0x56, 0x34, 0x04, ++ 0x0d, 0x2c, 0xf3, 0x34, 0x55, 0x7c, 0x62, 0xa7, 0xa9, 0x91, 0xd3, 0x3e, 0x4d, 0x95, 0x3f, 0x03, ++ 0x67, 0xba, 0x22, 0xc7, 0xd9, 0xb1, 0x42, 0xa4, 0x70, 0xc8, 0x44, 0x8f, 0x15, 0x91, 0xc4, 0x0d, ++ 0xb3, 0x50, 0xe0, 0xa3, 0x28, 0x13, 0x6f, 0xf0, 0x63, 0x33, 0x1f, 0x61, 0x14, 0xe5, 0x65, 0x84, ++ 0x71, 0x33, 0x6d, 0xde, 0xd1, 0xe9, 0xf0, 0x74, 0xb2, 0x8f, 0x6c, 0xaf, 0x64, 0x1f, 0xe5, 0xef, ++ 0x65, 0xe1, 0x6c, 0x82, 0x62, 0xc6, 0x16, 0xa8, 0x7c, 0x42, 0x29, 0x94, 0xcd, 0x99, 0x70, 0x81, ++ 0x56, 0x63, 0x30, 0xec, 0xc2, 0x26, 0x6f, 0xb1, 0x39, 0x53, 0xa3, 0xbe, 0xbf, 0xee, 0xd6, 0x55, ++ 0x0b, 0x7e, 0x4e, 0xcc, 0x17, 0x55, 0xfa, 0xf8, 0xe1, 0xec, 0x87, 0xc5, 0xcc, 0x9c, 0xb7, 0xda, ++ 0xf6, 0x3c, 0x9b, 0x99, 0xf3, 0xfb, 0x86, 0xa2, 0x18, 0xdc, 0x71, 0x9b, 0x9d, 0x16, 0x0d, 0x2b, ++ 0xa0, 0x41, 0x92, 0xbc, 0x09, 0xb0, 0xcf, 0xe1, 0x55, 0xfb, 0x5d, 0xa5, 0x9e, 0x1e, 0xfa, 0x2e, ++ 0xe8, 0x9c, 0x7a, 0x5e, 0x70, 0xee, 0x56, 0xc7, 0x72, 0x02, 0x26, 0xe0, 0xb9, 0xf0, 0xbc, 0xa3, ++ 0xa9, 0xa0, 0x41, 0xb1, 0xfc, 0xeb, 0x45, 0x38, 0xd3, 0x95, 0x3f, 0x9c, 0xfb, 0x2a, 0xe8, 0xd8, ++ 0xef, 0x98, 0x2f, 0x58, 0x62, 0xc4, 0xf7, 0xeb, 0x30, 0xc9, 0x8f, 0x8d, 0x9b, 0xb1, 0x88, 0x71, ++ 0x7d, 0x87, 0xbf, 0x15, 0x81, 0x62, 0x0c, 0xfb, 0x78, 0x5e, 0x57, 0xaf, 0xc3, 0xa4, 0xdf, 0xd9, ++ 0x16, 0x0f, 0xfd, 0x8a, 0x34, 0x28, 0xf9, 0x28, 0x93, 0x6a, 0x04, 0x8a, 0x31, 0x6c, 0xd2, 0x80, ++ 0xe9, 0xd0, 0xb8, 0x2c, 0xad, 0x9c, 0x85, 0x7e, 0x64, 0x07, 0x9f, 0x15, 0x8b, 0x31, 0x12, 0xd8, ++ 0x45, 0x94, 0x6c, 0xc3, 0x45, 0x11, 0xb9, 0x6d, 0x36, 0x28, 0x96, 0xb0, 0xab, 0x2c, 0x1b, 0x7d, ++ 0x71, 0xa9, 0x27, 0x26, 0x1e, 0x42, 0x25, 0x72, 0xd6, 0x1d, 0x39, 0xf2, 0xac, 0x1b, 0x89, 0x1a, ++ 0x1f, 0x4d, 0x1b, 0x35, 0xde, 0x35, 0x61, 0x4e, 0x74, 0x1c, 0x2d, 0x3d, 0x05, 0xc7, 0xd1, 0xbf, ++ 0x37, 0xc6, 0x96, 0x47, 0x2c, 0xdb, 0x32, 0x53, 0x5a, 0xf9, 0x8c, 0x14, 0x17, 0x6d, 0x52, 0x69, ++ 0xe5, 0x53, 0xd5, 0x47, 0x09, 0x39, 0x46, 0x90, 0xb4, 0xb4, 0xe9, 0xe5, 0x7a, 0xd8, 0xf4, 0xda, ++ 0x70, 0x36, 0x68, 0xfa, 0x5b, 0x5e, 0xc7, 0x0f, 0x16, 0xa9, 0x17, 0x9c, 0xc8, 0x2c, 0xcf, 0xf5, ++ 0x95, 0xad, 0xb5, 0x6a, 0x9c, 0x0a, 0x26, 0x91, 0x66, 0xd3, 0x36, 0x68, 0xfa, 0x95, 0x66, 0xd3, ++ 0xbd, 0xaf, 0x32, 0xc6, 0x84, 0x66, 0x17, 0x69, 0x50, 0xd1, 0xd3, 0x76, 0x6b, 0xad, 0xda, 0x03, ++ 0x13, 0x0f, 0xa1, 0x42, 0xd6, 0xf9, 0x57, 0xdd, 0xb1, 0x9a, 0x76, 0xdd, 0x0a, 0x78, 0xc6, 0x29, ++ 0x2e, 0xbb, 0xc5, 0x9a, 0xd0, 0xf9, 0x25, 0xb6, 0xd6, 0xaa, 0x71, 0x14, 0x4c, 0xaa, 0xa7, 0x6c, ++ 0x38, 0x23, 0x43, 0xb4, 0xa0, 0x27, 0x98, 0xb6, 0x46, 0x9f, 0xac, 0x69, 0xab, 0xd4, 0xdf, 0x72, ++ 0x87, 0xf4, 0xcb, 0x3d, 0xb6, 0x00, 0xfa, 0x58, 0xee, 0x75, 0x98, 0xd2, 0x1a, 0x96, 0x9c, 0xc1, ++ 0x63, 0x7d, 0xc7, 0xc2, 0x57, 0xa2, 0x14, 0x30, 0x4e, 0xf2, 0xf4, 0xdd, 0x10, 0x7f, 0x3b, 0x03, ++ 0xd3, 0xac, 0x11, 0x95, 0x60, 0x97, 0x3a, 0xef, 0x72, 0x2d, 0x49, 0x3d, 0xb2, 0x6a, 0x0d, 0xb2, ++ 0xa3, 0x2b, 0x31, 0x1e, 0xa2, 0xc3, 0xf5, 0x61, 0x36, 0x0e, 0xc6, 0xae, 0x46, 0xb1, 0x4d, 0x2f, ++ 0x2c, 0x93, 0x23, 0x30, 0xd9, 0xf7, 0xa6, 0x57, 0x89, 0x91, 0xc0, 0x2e, 0xa2, 0xa9, 0xe4, 0xec, ++ 0xc5, 0x45, 0x38, 0x9f, 0xf8, 0xa9, 0x7d, 0x09, 0xeb, 0xef, 0x00, 0x4c, 0x88, 0x2e, 0x1c, 0xa4, ++ 0xdf, 0x66, 0x54, 0xd7, 0xce, 0x9d, 0xfa, 0xcd, 0x85, 0x71, 0xc4, 0xc8, 0x9f, 0xe2, 0x11, 0xa3, ++ 0xc7, 0xf6, 0x53, 0x78, 0x52, 0xdb, 0x4f, 0x71, 0x98, 0xdb, 0xcf, 0x48, 0xba, 0xed, 0x67, 0x68, ++ 0xae, 0xa7, 0x09, 0xd2, 0xb3, 0x34, 0x78, 0xe9, 0x99, 0xbc, 0xc9, 0xc1, 0xe9, 0x6f, 0x72, 0xbf, ++ 0x95, 0x24, 0x55, 0xc7, 0xd2, 0xbe, 0x62, 0x1b, 0x11, 0x09, 0x43, 0x92, 0xa8, 0xe3, 0xc3, 0x90, ++ 0xa8, 0x03, 0x11, 0x8a, 0xbf, 0x94, 0x81, 0x12, 0x5a, 0x01, 0xe5, 0x31, 0x06, 0xe4, 0x0a, 0xe4, ++ 0x3b, 0x8e, 0xad, 0xac, 0x36, 0x97, 0x94, 0x56, 0x7a, 0xdb, 0xb1, 0x83, 0xc7, 0x0f, 0x67, 0x27, ++ 0x35, 0x22, 0x65, 0x25, 0xc8, 0x71, 0x49, 0x05, 0xa6, 0xb8, 0xaf, 0xb5, 0xcf, 0xe3, 0x10, 0x18, ++ 0x40, 0x86, 0xec, 0x6b, 0x17, 0x4f, 0x8c, 0x82, 0x31, 0x8e, 0x5f, 0xfe, 0x72, 0x51, 0x3e, 0x6f, ++ 0x31, 0x80, 0xdb, 0xcb, 0x41, 0xe7, 0x0f, 0xed, 0xdf, 0xf8, 0x74, 0x11, 0xb2, 0xf5, 0x6d, 0xae, ++ 0x88, 0x17, 0xc2, 0xc4, 0x99, 0x4b, 0x0b, 0x98, 0xad, 0x6f, 0x93, 0x97, 0x61, 0x54, 0x5e, 0x8b, ++ 0xaa, 0xe4, 0x92, 0x9c, 0xad, 0xbc, 0x33, 0xf5, 0x51, 0x43, 0x87, 0x7e, 0xfd, 0x38, 0xd8, 0x60, ++ 0x9c, 0xf8, 0xe8, 0x7d, 0x90, 0x5d, 0x37, 0xfb, 0xd3, 0x95, 0x5f, 0x35, 0x12, 0xdc, 0x42, 0xd4, ++ 0x4d, 0xb8, 0x3b, 0x7b, 0x6d, 0xba, 0xd3, 0xe4, 0x3f, 0x2e, 0xc2, 0x85, 0xe4, 0x87, 0x57, 0x3e, ++ 0x30, 0x8b, 0x41, 0xcc, 0xed, 0x5c, 0xe2, 0xdc, 0xfe, 0x10, 0x8c, 0x88, 0x88, 0x61, 0x95, 0x96, ++ 0x8b, 0xdb, 0xef, 0xc5, 0xb7, 0xf8, 0xa8, 0x60, 0xe4, 0x0d, 0x20, 0xe2, 0x6e, 0x60, 0xd1, 0xed, ++ 0x38, 0xc1, 0x26, 0xf5, 0x90, 0x5a, 0x75, 0x19, 0x3d, 0xa2, 0xaf, 0x4f, 0xd6, 0xbb, 0x30, 0x30, ++ 0xa1, 0x16, 0x4f, 0x24, 0xd6, 0x15, 0x32, 0x69, 0x26, 0x12, 0x3b, 0x2c, 0xfa, 0x6a, 0xd8, 0x87, ++ 0xc3, 0x6f, 0x74, 0x1b, 0x55, 0xde, 0x1c, 0xf4, 0x8b, 0x3c, 0x1f, 0x60, 0xcb, 0xca, 0x69, 0xae, ++ 0x9c, 0x3f, 0xce, 0xc3, 0xd9, 0x84, 0x97, 0x51, 0xa3, 0xb2, 0x3b, 0x73, 0x0c, 0xd9, 0xdd, 0xd4, ++ 0x9d, 0x94, 0x3a, 0xaf, 0xb1, 0x6a, 0xcf, 0x21, 0x3d, 0xf4, 0x8d, 0x0c, 0x9c, 0xe3, 0x01, 0xb3, ++ 0xea, 0xc6, 0x43, 0x56, 0x91, 0x86, 0xdc, 0xd7, 0x0e, 0x33, 0xe4, 0xfa, 0x73, 0x6c, 0x64, 0xd9, ++ 0xea, 0xbd, 0x96, 0x40, 0x21, 0x0c, 0x1e, 0x4c, 0x82, 0x62, 0x22, 0x57, 0xb2, 0x08, 0xa0, 0x1f, ++ 0x80, 0x51, 0x6b, 0xf8, 0x45, 0x76, 0xf4, 0xd0, 0x2f, 0xc4, 0xf8, 0x8f, 0x79, 0x30, 0xae, 0xd1, ++ 0xd1, 0xdc, 0x60, 0x65, 0x54, 0x23, 0x5f, 0xeb, 0x7e, 0x8e, 0xe3, 0x73, 0x03, 0x7d, 0xee, 0xf6, ++ 0xf8, 0x53, 0x3e, 0xdd, 0x9c, 0xfa, 0xcd, 0x1c, 0x4c, 0x46, 0xc7, 0x90, 0xbc, 0x04, 0xc5, 0xb6, ++ 0x47, 0x77, 0xec, 0x07, 0x72, 0x2e, 0x85, 0x8f, 0xcb, 0xf3, 0x52, 0x94, 0x50, 0xf2, 0x4e, 0xcc, ++ 0xc5, 0x7d, 0x21, 0x4d, 0xe4, 0x8e, 0x72, 0x84, 0xee, 0x91, 0x70, 0xe0, 0x1d, 0xfd, 0x1e, 0x51, ++ 0x6e, 0xf0, 0xbc, 0xa2, 0x6f, 0x11, 0x91, 0xcf, 0x41, 0xa9, 0xe6, 0x51, 0x2b, 0xa0, 0xf5, 0x85, ++ 0x03, 0x69, 0x69, 0xfc, 0x89, 0xe3, 0xcd, 0xd1, 0x2d, 0xbb, 0x45, 0xc3, 0xa5, 0xb7, 0xa8, 0x88, ++ 0x60, 0x48, 0x8f, 0xdf, 0xaf, 0xed, 0x04, 0xd4, 0xe3, 0xe9, 0x3e, 0xa4, 0x39, 0x31, 0xbc, 0x5f, ++ 0xd3, 0x10, 0x34, 0xb0, 0xca, 0x7f, 0x58, 0x04, 0x08, 0xdf, 0xa9, 0x66, 0x12, 0x87, 0x3a, 0xf5, ++ 0xb6, 0x6b, 0x3b, 0x4a, 0x85, 0xd5, 0xb3, 0x63, 0x59, 0x96, 0xa3, 0xc6, 0x20, 0x3b, 0x50, 0x94, ++ 0x8f, 0xd5, 0x67, 0xd3, 0xba, 0x4b, 0x54, 0x3f, 0xb6, 0xc0, 0x29, 0x89, 0x55, 0x2e, 0xfe, 0x47, ++ 0x49, 0x9d, 0xcd, 0x1a, 0x8f, 0x36, 0xc2, 0x34, 0x06, 0xba, 0x77, 0x91, 0x97, 0xa2, 0x84, 0x46, ++ 0x32, 0x74, 0xe7, 0x8f, 0xcc, 0xd0, 0x8d, 0x50, 0x12, 0xf7, 0x40, 0x37, 0xe8, 0x41, 0x7f, 0xc7, ++ 0x6e, 0x71, 0xc5, 0xa9, 0xea, 0x62, 0x48, 0x86, 0xd1, 0xf4, 0x15, 0x7a, 0x7f, 0x99, 0x2f, 0x45, ++ 0xa2, 0x16, 0x55, 0x8c, 0x21, 0x19, 0x23, 0xd9, 0xef, 0x48, 0xcf, 0x64, 0xbf, 0x3b, 0x31, 0x15, ++ 0x30, 0xd5, 0x48, 0x1c, 0x22, 0x6f, 0xdf, 0xeb, 0x4e, 0x8e, 0x8b, 0x83, 0x78, 0x20, 0xbd, 0x8f, ++ 0x5d, 0xf8, 0x4d, 0x98, 0xa8, 0x59, 0x8b, 0x94, 0x55, 0xb4, 0x6b, 0x56, 0x40, 0xe5, 0x39, 0xba, ++ 0x9f, 0x34, 0xef, 0x8b, 0x15, 0xa3, 0x3e, 0x46, 0xc9, 0xa5, 0x13, 0x79, 0x37, 0x60, 0x54, 0xcd, ++ 0x64, 0xf2, 0x82, 0x51, 0x2f, 0xb4, 0x8d, 0xb1, 0xc1, 0xe5, 0x44, 0x8e, 0xbe, 0x55, 0xfd, 0x2c, ++ 0x23, 0xd6, 0xa7, 0xe0, 0x7c, 0x09, 0x8a, 0x7e, 0x67, 0x87, 0xe1, 0xc5, 0xde, 0x93, 0xaa, 0xf2, ++ 0x52, 0x94, 0xd0, 0xf2, 0xff, 0xca, 0x00, 0x84, 0xd1, 0xa4, 0x6c, 0x9b, 0x6f, 0x51, 0x76, 0x72, ++ 0xb2, 0xfd, 0x56, 0x7c, 0x9b, 0x5f, 0x57, 0x00, 0x0c, 0x71, 0xc8, 0x6d, 0x00, 0xa6, 0x78, 0x9c, ++ 0x24, 0xc3, 0x0e, 0xbf, 0x2d, 0xbd, 0xad, 0x2b, 0xa3, 0x41, 0x88, 0x58, 0x30, 0xa9, 0x34, 0x65, ++ 0x49, 0xba, 0xaf, 0xb0, 0x19, 0x1e, 0x9b, 0xba, 0x19, 0x21, 0x80, 0x31, 0x82, 0xe5, 0xbf, 0x3b, ++ 0x02, 0x53, 0xb1, 0x67, 0xfd, 0x9e, 0xfa, 0xc7, 0xdd, 0xcc, 0x37, 0x44, 0x72, 0x83, 0x7e, 0x43, ++ 0x24, 0x3f, 0x88, 0x63, 0x4f, 0xfc, 0x9d, 0x9a, 0xc2, 0x20, 0xdf, 0xa9, 0x59, 0x83, 0x11, 0x99, ++ 0xb0, 0xb8, 0x3f, 0x99, 0xcb, 0x8f, 0x57, 0xea, 0xd8, 0xa7, 0x48, 0x0c, 0x38, 0x22, 0x33, 0x36, ++ 0xd5, 0x3e, 0xc8, 0xc7, 0xfa, 0x4d, 0x38, 0xd7, 0x76, 0x9b, 0x4d, 0x15, 0x4f, 0xbc, 0xd4, 0x11, ++ 0x8e, 0x91, 0x32, 0x00, 0x43, 0xeb, 0xc3, 0x9b, 0x09, 0x38, 0x98, 0x58, 0x33, 0x9d, 0x2c, 0xfd, ++ 0xb7, 0x45, 0x98, 0x8c, 0x3e, 0x41, 0xff, 0x44, 0xde, 0x40, 0xe3, 0x97, 0x14, 0x15, 0xcf, 0x89, ++ 0xbf, 0x81, 0xb6, 0x25, 0xcb, 0x51, 0x63, 0x44, 0x35, 0x8a, 0xdc, 0x10, 0x34, 0x8a, 0xfc, 0x60, ++ 0x34, 0x8a, 0x50, 0x9f, 0x2a, 0x1c, 0xaa, 0x4f, 0xbd, 0x02, 0x23, 0x9e, 0xdb, 0xa4, 0x15, 0xdc, ++ 0x90, 0x66, 0x01, 0x7d, 0x9b, 0x81, 0xa2, 0x18, 0x15, 0x7c, 0xc0, 0xbe, 0xf8, 0xd1, 0x61, 0xef, ++ 0x63, 0xcd, 0x5c, 0x83, 0x33, 0xfb, 0xf2, 0x0e, 0xa1, 0x6a, 0x37, 0x1c, 0x2b, 0x08, 0x1f, 0x6b, ++ 0xd1, 0xde, 0xa0, 0x77, 0xe2, 0x08, 0xd8, 0x5d, 0xe7, 0x89, 0x9c, 0xf5, 0xb5, 0xe6, 0x0d, 0x47, ++ 0x69, 0xde, 0xe9, 0x16, 0xd6, 0x3f, 0x1d, 0x81, 0xc9, 0xea, 0xad, 0xc8, 0xc2, 0x8a, 0xcc, 0xdc, ++ 0xcc, 0x10, 0x66, 0x6e, 0x76, 0xd0, 0x33, 0xf7, 0xf0, 0x93, 0xc0, 0x8b, 0x2a, 0x78, 0x2c, 0x1f, ++ 0xbd, 0x78, 0x34, 0x03, 0xc8, 0x48, 0x85, 0xed, 0xe1, 0xc2, 0x8d, 0x53, 0xa5, 0x56, 0x28, 0xf0, ++ 0xbc, 0x41, 0xc6, 0xc6, 0x1b, 0x01, 0x63, 0x1c, 0xbf, 0x9f, 0x15, 0xd2, 0x9f, 0x3f, 0xd1, 0xeb, ++ 0x30, 0xc9, 0x1b, 0x29, 0x5d, 0x9d, 0x57, 0xeb, 0x32, 0xff, 0xbc, 0x76, 0xc5, 0xba, 0x65, 0x42, ++ 0x97, 0x30, 0x86, 0x1d, 0x5d, 0x8f, 0xa5, 0xd4, 0xeb, 0xf1, 0xd6, 0x09, 0xd7, 0xe3, 0x0b, 0x90, ++ 0xab, 0x37, 0xef, 0xc9, 0xc7, 0xd2, 0xb4, 0x0e, 0xbc, 0xb4, 0x76, 0x0b, 0x59, 0xb9, 0xb1, 0xca, ++ 0xc6, 0x4e, 0x7f, 0x95, 0x8d, 0x1f, 0x79, 0xbe, 0x65, 0x4a, 0x0b, 0xf5, 0x7d, 0xdb, 0x75, 0x84, ++ 0x1f, 0xec, 0x44, 0xff, 0x4a, 0x8b, 0x51, 0x1d, 0x23, 0xc4, 0xd2, 0x2d, 0xe1, 0x7f, 0x9d, 0x81, ++ 0x73, 0x49, 0xd9, 0x59, 0x8e, 0xba, 0x90, 0x7f, 0x15, 0x46, 0x45, 0xaa, 0x96, 0xd5, 0xba, 0xbc, ++ 0x63, 0xd2, 0xdf, 0x2f, 0xc8, 0xad, 0x2e, 0xa1, 0xc6, 0x20, 0xd4, 0x88, 0x6f, 0x1e, 0x50, 0x9c, ++ 0xbd, 0x3e, 0xe7, 0x18, 0x81, 0x77, 0xbf, 0x93, 0x81, 0x71, 0x33, 0x9b, 0xca, 0x31, 0x5e, 0x97, ++ 0xdb, 0x87, 0x12, 0xef, 0x8c, 0x15, 0xcf, 0x6d, 0xa5, 0x57, 0xbc, 0xef, 0x28, 0x52, 0x62, 0xfe, ++ 0x08, 0xf9, 0xa3, 0x0b, 0x31, 0x64, 0x55, 0xfe, 0x05, 0x18, 0xd5, 0x51, 0x28, 0x47, 0x9c, 0xef, ++ 0xe6, 0xa1, 0xe4, 0xb6, 0x65, 0x6c, 0x49, 0x3c, 0x31, 0xde, 0x4d, 0x05, 0xc0, 0x10, 0x87, 0xc9, ++ 0x2c, 0x31, 0xda, 0x31, 0x17, 0xcd, 0x48, 0xd2, 0xce, 0x7f, 0x96, 0x85, 0x62, 0x95, 0x3a, 0xbe, ++ 0xeb, 0x91, 0xb7, 0x8d, 0x15, 0x2e, 0x44, 0xf6, 0x47, 0x8e, 0x67, 0x4a, 0x12, 0xa1, 0x1b, 0x6c, ++ 0xf2, 0x85, 0xe6, 0xa1, 0xb0, 0xcc, 0x58, 0xbd, 0x3b, 0x90, 0xf7, 0xdb, 0x74, 0x00, 0x21, 0xfa, ++ 0xa2, 0xc5, 0xd5, 0x36, 0xad, 0x85, 0xa3, 0xc9, 0x7e, 0x21, 0xa7, 0x4f, 0x1c, 0xfd, 0x58, 0xb9, ++ 0x98, 0x69, 0x2b, 0xa9, 0x39, 0x1d, 0xfe, 0x64, 0xf9, 0x1f, 0xb3, 0xc3, 0x2f, 0x47, 0x5c, 0xb3, ++ 0xfd, 0x80, 0x7c, 0xbe, 0xab, 0x23, 0xe7, 0x8e, 0xd7, 0x91, 0xac, 0x36, 0xef, 0x46, 0xbd, 0x88, ++ 0x54, 0x49, 0x24, 0xce, 0xa7, 0x60, 0x07, 0xb4, 0xa5, 0x2c, 0x99, 0x9f, 0x4a, 0xfb, 0x6d, 0xe1, ++ 0xc4, 0x58, 0x65, 0x64, 0x51, 0x50, 0x2f, 0x7f, 0xbf, 0xa8, 0xbe, 0x89, 0x75, 0x2c, 0xf9, 0x52, ++ 0x06, 0xc6, 0xeb, 0xb4, 0x4d, 0x9d, 0x3a, 0x75, 0x6a, 0x36, 0x55, 0x19, 0x4b, 0x56, 0x53, 0x0a, ++ 0xd8, 0x25, 0x45, 0xd2, 0x08, 0xd4, 0x5a, 0x32, 0xd8, 0x60, 0x84, 0x29, 0x71, 0x61, 0x34, 0x10, ++ 0x6e, 0x01, 0xea, 0xf3, 0x2b, 0xa9, 0x7d, 0x6b, 0x0c, 0x0d, 0x5c, 0x92, 0x46, 0xcd, 0x84, 0x34, ++ 0x61, 0x34, 0x88, 0xa6, 0xb0, 0x4f, 0x61, 0x09, 0xd3, 0xe1, 0x73, 0xfc, 0x50, 0xab, 0xc3, 0xe5, ++ 0x34, 0x07, 0xf2, 0x06, 0x10, 0x99, 0x04, 0x76, 0xc5, 0xb2, 0x9b, 0xb4, 0x8e, 0x6e, 0xc7, 0xa9, ++ 0x4b, 0xcb, 0xa3, 0xbe, 0x88, 0x5b, 0xee, 0xc2, 0xc0, 0x84, 0x5a, 0xe4, 0x2a, 0x8c, 0x73, 0xfe, ++ 0x0b, 0x1d, 0xdf, 0x08, 0x8f, 0xd0, 0x9d, 0xbc, 0x6c, 0xc0, 0x30, 0x82, 0x19, 0x49, 0xf5, 0x5f, ++ 0x3c, 0x34, 0xd5, 0xff, 0x1a, 0x9c, 0xf3, 0xe8, 0xbe, 0xcd, 0xf6, 0xa0, 0xeb, 0xb6, 0x1f, 0xb8, ++ 0xde, 0x01, 0xf7, 0x45, 0x90, 0xe9, 0xe0, 0x44, 0x20, 0x4f, 0x02, 0x1c, 0x13, 0x6b, 0x91, 0xef, ++ 0x66, 0x60, 0xa2, 0xe9, 0x36, 0x1a, 0xb6, 0xd3, 0x10, 0x56, 0x6e, 0x79, 0x45, 0x77, 0x77, 0x10, ++ 0x72, 0x62, 0x6e, 0xcd, 0xa4, 0x2c, 0x14, 0x0d, 0x7d, 0x29, 0x19, 0x81, 0x61, 0xb4, 0x11, 0x17, ++ 0x3f, 0x05, 0xa4, 0xbb, 0x6e, 0x5f, 0x9b, 0xeb, 0x03, 0xb6, 0x1d, 0x85, 0x62, 0x84, 0xec, 0x6a, ++ 0xf1, 0x24, 0xa4, 0x43, 0x9a, 0x25, 0x7c, 0xb8, 0x60, 0xfa, 0x6f, 0x19, 0x18, 0x91, 0x71, 0x6f, ++ 0x91, 0x68, 0xc4, 0xcc, 0xd0, 0xa3, 0x11, 0x97, 0xa0, 0xd0, 0x76, 0xbd, 0x40, 0x2d, 0xd3, 0xd9, ++ 0x64, 0x1d, 0x47, 0xbc, 0xf9, 0xe3, 0x7a, 0x41, 0x28, 0x84, 0xd8, 0x2f, 0x1f, 0x45, 0x65, 0xb6, ++ 0xe7, 0xa9, 0xec, 0x28, 0x9b, 0x71, 0x4f, 0x0f, 0x95, 0x41, 0x65, 0x33, 0xcc, 0xa0, 0xb2, 0x59, ++ 0x7e, 0x94, 0x87, 0xe9, 0x6a, 0xd3, 0xaa, 0xed, 0x99, 0x87, 0x91, 0x37, 0x61, 0xc2, 0xb7, 0x1b, ++ 0x8e, 0xed, 0x34, 0xa4, 0xb1, 0x28, 0xd3, 0xb7, 0x85, 0xb7, 0x6a, 0xd6, 0xc7, 0x28, 0xb9, 0x81, ++ 0x65, 0xf6, 0x31, 0xac, 0x11, 0xb9, 0x53, 0xb1, 0x46, 0x44, 0x3c, 0x4e, 0xf2, 0x69, 0x3d, 0x4e, ++ 0xe2, 0xfd, 0x7e, 0x22, 0xd3, 0x54, 0xe1, 0x29, 0x88, 0x31, 0xf8, 0x79, 0x18, 0xe3, 0xdf, 0x5a, ++ 0x65, 0x1b, 0x53, 0xf4, 0x56, 0x3d, 0x73, 0xd4, 0xad, 0x3a, 0xd3, 0x45, 0xed, 0x9a, 0xd6, 0xe0, ++ 0xb4, 0xf6, 0xb2, 0x5a, 0x73, 0x1d, 0xe4, 0x90, 0xf2, 0x3f, 0xcf, 0x48, 0xfa, 0x5b, 0xbb, 0x1e, ++ 0xb5, 0xea, 0xa4, 0x0a, 0xe7, 0x5b, 0xd4, 0xf7, 0xad, 0x06, 0xad, 0x34, 0x1a, 0x1e, 0x6d, 0x70, ++ 0xed, 0xee, 0x86, 0xd6, 0x14, 0x75, 0x5a, 0xf1, 0xf5, 0x24, 0x24, 0x4c, 0xae, 0x4b, 0xde, 0x82, ++ 0xe7, 0xb6, 0x3d, 0xd7, 0xaa, 0xd7, 0x2c, 0xa6, 0x60, 0x70, 0x8c, 0x2d, 0x57, 0x3a, 0x3d, 0xc9, ++ 0xf4, 0xd0, 0x3f, 0x2e, 0x09, 0x3f, 0xb7, 0xd0, 0x0b, 0x11, 0x7b, 0xd3, 0x28, 0xff, 0xef, 0x3c, ++ 0x8c, 0x8b, 0xaf, 0x90, 0xae, 0xbd, 0x51, 0xb7, 0xdc, 0xcc, 0xa9, 0xbb, 0xe5, 0xde, 0x06, 0xf0, ++ 0x79, 0x7b, 0xfa, 0x5f, 0xaa, 0xfc, 0x86, 0xa1, 0xaa, 0x2b, 0xa3, 0x41, 0xa8, 0x9f, 0xb4, 0x1b, ++ 0xaf, 0xc0, 0x88, 0x1c, 0x0c, 0x69, 0x46, 0xd0, 0xa8, 0xb2, 0xf7, 0x50, 0xc1, 0xc9, 0x27, 0x60, ++ 0xcc, 0x0a, 0x02, 0xab, 0xb6, 0xdb, 0x92, 0xaf, 0x1e, 0x47, 0xbc, 0x8b, 0x2a, 0x21, 0x08, 0x4d, ++ 0x3c, 0xfe, 0x64, 0x7a, 0xd3, 0xad, 0xed, 0xf9, 0x5d, 0x4f, 0xa6, 0xf3, 0x52, 0x94, 0x50, 0xd2, ++ 0x82, 0x62, 0xc0, 0x27, 0x97, 0xf4, 0xb5, 0x59, 0x4e, 0xb9, 0xea, 0xc5, 0x4c, 0x0d, 0xd9, 0x89, ++ 0xdf, 0x28, 0x99, 0x30, 0x76, 0x3e, 0x5f, 0x2b, 0xd2, 0xf2, 0x9c, 0x96, 0x9d, 0x58, 0x78, 0xc6, ++ 0xae, 0xc7, 0x7f, 0xa3, 0x64, 0x52, 0xfe, 0x1f, 0x39, 0x20, 0xd5, 0xc0, 0x72, 0xea, 0x96, 0x57, ++ 0xbf, 0x71, 0x55, 0xa7, 0xe4, 0x61, 0xa7, 0x02, 0xe1, 0xcc, 0x21, 0xe4, 0x7f, 0x8a, 0xc9, 0xa7, ++ 0xae, 0x19, 0xd7, 0x5c, 0xf1, 0xda, 0xa8, 0x90, 0x31, 0x42, 0xea, 0xa0, 0xe4, 0x42, 0x36, 0xba, ++ 0x0f, 0x6c, 0x1f, 0xe9, 0x3a, 0xb0, 0x3d, 0x7e, 0x38, 0xfb, 0x63, 0x37, 0x3a, 0xdb, 0xd4, 0x73, ++ 0x68, 0x40, 0x7d, 0xe5, 0xdd, 0x90, 0x78, 0x9e, 0x7b, 0xd2, 0x7e, 0xed, 0x3b, 0x30, 0xd1, 0xb6, ++ 0x82, 0x9a, 0xce, 0xc8, 0x21, 0x27, 0xf1, 0xa7, 0x94, 0x16, 0xb5, 0x69, 0x02, 0x1f, 0x3f, 0x9c, ++ 0xfd, 0x2b, 0x61, 0x10, 0xa5, 0x3e, 0xf3, 0xcc, 0xb7, 0xf7, 0x1a, 0xf3, 0xc1, 0x41, 0x9b, 0xfa, ++ 0x73, 0x1c, 0x9d, 0xdf, 0x83, 0x45, 0xc9, 0x92, 0x2b, 0x00, 0x4d, 0x7b, 0x9f, 0x8a, 0x13, 0x64, ++ 0xdc, 0xed, 0x60, 0x4d, 0x43, 0xd0, 0xc0, 0x2a, 0xff, 0x62, 0x06, 0xa4, 0xee, 0x43, 0xee, 0x03, ++ 0xd4, 0x5c, 0xa7, 0x6e, 0x9b, 0x89, 0x15, 0x17, 0x53, 0x25, 0xbf, 0x10, 0xb4, 0xc2, 0x36, 0xe8, ++ 0x22, 0x1f, 0x0d, 0x56, 0xe5, 0x79, 0x18, 0x17, 0x4d, 0x90, 0x2f, 0x5f, 0xcc, 0x42, 0xc1, 0x6a, ++ 0x36, 0xdd, 0xfb, 0xbc, 0x0d, 0x05, 0xb1, 0xdf, 0x73, 0x37, 0x77, 0x14, 0xe5, 0xe5, 0xbf, 0x28, ++ 0xc0, 0x05, 0x19, 0xb2, 0x7a, 0xcd, 0xb3, 0xeb, 0x4f, 0xf4, 0x62, 0x22, 0x74, 0x0a, 0xc8, 0xf6, ++ 0x74, 0x0a, 0x08, 0x77, 0xe9, 0xd4, 0xaf, 0x79, 0x19, 0x9f, 0x7d, 0xb8, 0x75, 0x4d, 0xdf, 0x96, ++ 0xe4, 0x8f, 0xbc, 0x2d, 0x79, 0x49, 0x7b, 0x8f, 0xc4, 0x6e, 0x21, 0x7a, 0x7a, 0x7f, 0x14, 0x0f, ++ 0xb5, 0xf9, 0x46, 0x42, 0xd6, 0x47, 0x06, 0x13, 0xb2, 0xfe, 0x12, 0x14, 0xad, 0xb6, 0x7d, 0x1b, ++ 0xd7, 0xa4, 0xf9, 0x35, 0x7c, 0xc5, 0x7d, 0x73, 0xf5, 0x36, 0xae, 0xa1, 0x84, 0x46, 0x3d, 0x15, ++ 0x4b, 0x69, 0x3d, 0x15, 0x93, 0x27, 0xd9, 0x69, 0xb9, 0x6d, 0xd5, 0xe0, 0x4c, 0xd7, 0x70, 0x0f, ++ 0xdc, 0xff, 0xe0, 0xfd, 0x3c, 0xe3, 0xe2, 0xd9, 0x6d, 0xfa, 0x44, 0x97, 0xd1, 0x27, 0x61, 0x42, ++ 0xf8, 0x4f, 0x49, 0x88, 0x54, 0xa5, 0x42, 0xf7, 0x57, 0x13, 0x88, 0x51, 0x5c, 0xb2, 0xca, 0x27, ++ 0x47, 0xdf, 0x77, 0x7d, 0x20, 0xe7, 0x0f, 0xd3, 0xf6, 0x24, 0x01, 0xf2, 0x51, 0x18, 0xe3, 0xed, ++ 0x17, 0xbd, 0x2d, 0x3d, 0x07, 0x79, 0x5a, 0xa3, 0xe5, 0xb0, 0x18, 0x4d, 0x9c, 0x68, 0x08, 0x62, ++ 0x21, 0x6d, 0x08, 0x62, 0xd7, 0x58, 0x9c, 0xd6, 0x6c, 0xfb, 0x52, 0x0e, 0x4a, 0xda, 0xff, 0x97, ++ 0x7c, 0x0e, 0xc6, 0x85, 0x37, 0xce, 0x49, 0x4e, 0x7e, 0xdc, 0xe2, 0x2e, 0x7c, 0x7b, 0x94, 0x9b, ++ 0x80, 0x49, 0x8c, 0x87, 0xa7, 0xf3, 0x6c, 0xd4, 0x06, 0x83, 0x6c, 0xff, 0xe1, 0xe9, 0x31, 0x12, ++ 0xd8, 0x45, 0x94, 0xd4, 0x61, 0x4a, 0x94, 0x85, 0xfe, 0x0e, 0xb9, 0xbe, 0xa3, 0x8a, 0x16, 0xa3, ++ 0x14, 0x30, 0x4e, 0x92, 0xbc, 0x01, 0x44, 0xf9, 0xb2, 0x55, 0xf7, 0xec, 0x36, 0x7f, 0x4d, 0xfd, ++ 0x20, 0x6e, 0x7d, 0x5a, 0xed, 0xc2, 0xc0, 0x84, 0x5a, 0xe5, 0x7f, 0x32, 0x0a, 0xda, 0xc0, 0x75, ++ 0xca, 0x96, 0x87, 0xe4, 0x64, 0x40, 0xd9, 0x13, 0x25, 0x03, 0x6a, 0x43, 0x49, 0x27, 0xdb, 0x4a, ++ 0x7f, 0x6b, 0xa1, 0xf3, 0x61, 0xc9, 0x14, 0xb0, 0xea, 0x27, 0x86, 0x4c, 0xc8, 0x32, 0x8c, 0x88, ++ 0x64, 0x0f, 0x2a, 0xe7, 0xe2, 0xc5, 0xa4, 0x21, 0x16, 0xb9, 0x21, 0x8c, 0xfc, 0x2c, 0xa2, 0x0a, ++ 0xaa, 0xba, 0x49, 0xc9, 0xa0, 0x0a, 0x43, 0x48, 0x06, 0xf5, 0xcd, 0xe4, 0x7c, 0x5e, 0x5b, 0xe9, ++ 0x6d, 0xa4, 0x1f, 0xac, 0x4c, 0x5e, 0x49, 0x09, 0xad, 0x46, 0x4f, 0xfb, 0xa5, 0xc2, 0x52, 0xca, ++ 0x24, 0x54, 0x70, 0xec, 0x24, 0x54, 0x63, 0x27, 0x4f, 0x42, 0x95, 0x3e, 0x79, 0x51, 0x15, 0x60, ++ 0xcb, 0x6e, 0x29, 0x07, 0xef, 0x17, 0xa1, 0xc0, 0x9f, 0x18, 0x8c, 0xe7, 0xa8, 0x11, 0x9e, 0xc7, ++ 0x02, 0x46, 0x2e, 0x43, 0xde, 0x0f, 0xdc, 0x76, 0xdc, 0xa6, 0x52, 0x0d, 0xdc, 0x36, 0x72, 0x48, ++ 0xf9, 0x4b, 0x45, 0x18, 0x51, 0xe7, 0x40, 0xdf, 0xb0, 0xe9, 0xa7, 0x7e, 0x94, 0x5f, 0x12, 0x3d, ++ 0xd2, 0xb4, 0x1f, 0x3d, 0xbc, 0x65, 0x4f, 0xfd, 0xf0, 0xb6, 0x07, 0xc5, 0x36, 0x3f, 0x96, 0x48, ++ 0x31, 0x76, 0x2d, 0x3d, 0x6f, 0x4e, 0x4e, 0x68, 0x1f, 0xe2, 0x7f, 0x94, 0x2c, 0xc8, 0xbb, 0x30, ++ 0xe1, 0xd1, 0xc0, 0x3b, 0x88, 0x9c, 0x14, 0x07, 0x12, 0x9a, 0xca, 0x8d, 0xb1, 0x68, 0xd2, 0xc6, ++ 0x28, 0x2b, 0x26, 0xb2, 0x3d, 0x15, 0x14, 0x99, 0x3e, 0x7b, 0xac, 0x8e, 0xaf, 0x14, 0x22, 0x5b, ++ 0xff, 0xc4, 0x90, 0x89, 0xb0, 0xd5, 0xac, 0x51, 0xcb, 0x0f, 0x6e, 0xaa, 0x97, 0x70, 0x47, 0x4d, ++ 0x5b, 0x8d, 0x06, 0xa1, 0x89, 0x47, 0xee, 0x01, 0xd4, 0x9b, 0xf7, 0x64, 0x67, 0xca, 0xf3, 0xc5, ++ 0x00, 0x6e, 0xb3, 0xb8, 0xad, 0x6a, 0x49, 0x13, 0x46, 0x83, 0x49, 0xf9, 0xbf, 0x67, 0x60, 0x3a, ++ 0x3e, 0x73, 0xc8, 0x1e, 0xe4, 0x7c, 0x4f, 0xe5, 0xbe, 0xdf, 0x1c, 0xdc, 0x94, 0x94, 0x77, 0xdf, ++ 0x3c, 0x02, 0xab, 0xea, 0xd5, 0x90, 0x71, 0x61, 0x2b, 0x55, 0x3f, 0x40, 0x67, 0xac, 0xd4, 0x25, ++ 0xea, 0x07, 0xc8, 0x21, 0x64, 0xcd, 0xb4, 0x9a, 0x08, 0x8b, 0xda, 0x5c, 0x92, 0xd5, 0xe4, 0xb9, ++ 0x38, 0xbf, 0x24, 0x9b, 0x49, 0xf9, 0x6b, 0x39, 0xb8, 0x90, 0xdc, 0x30, 0xf2, 0x3a, 0x4c, 0xea, ++ 0xbb, 0xc5, 0x03, 0x23, 0x93, 0x94, 0xf6, 0x88, 0x59, 0x8a, 0x40, 0x31, 0x86, 0x4d, 0xae, 0x70, ++ 0x3b, 0x03, 0xdb, 0x06, 0x95, 0x3f, 0x52, 0x29, 0x62, 0x22, 0x90, 0x10, 0x34, 0xb0, 0x48, 0x05, ++ 0xa6, 0xe4, 0xaf, 0xc8, 0xc3, 0xd8, 0xa5, 0xd0, 0x43, 0x68, 0x31, 0x0a, 0xc6, 0x38, 0x3e, 0x79, ++ 0x05, 0x46, 0x98, 0x9a, 0xa3, 0xbc, 0xf7, 0x0c, 0x23, 0xe2, 0x92, 0x28, 0x46, 0x05, 0x27, 0x57, ++ 0x61, 0x9c, 0xfd, 0x1b, 0x49, 0x04, 0x6a, 0x5c, 0x01, 0x2e, 0x19, 0x30, 0x8c, 0x60, 0x86, 0x6f, ++ 0x7d, 0x16, 0xc3, 0x5c, 0xd9, 0xa6, 0xdb, 0x00, 0xfb, 0xf8, 0x8e, 0x4f, 0xd1, 0xba, 0xbf, 0xa4, ++ 0x5e, 0x5f, 0x36, 0x6c, 0x34, 0xb7, 0x35, 0x04, 0x0d, 0xac, 0xf2, 0x0f, 0x33, 0x30, 0x11, 0x91, ++ 0x1d, 0x64, 0x07, 0x72, 0x7b, 0x57, 0xd5, 0x2d, 0xd8, 0x8d, 0x01, 0x3e, 0x0c, 0x2a, 0x66, 0xdd, ++ 0x8d, 0xab, 0x3e, 0x32, 0x06, 0xe4, 0x1d, 0x7d, 0xe1, 0x96, 0x4d, 0xed, 0x0f, 0x60, 0x58, 0x78, ++ 0xa4, 0xd5, 0x2f, 0x7a, 0xe5, 0xf6, 0x2f, 0x27, 0x61, 0x2a, 0xb6, 0x29, 0x1c, 0xc3, 0xff, 0xe4, ++ 0x4a, 0xc4, 0x68, 0xd5, 0x3d, 0x99, 0x12, 0xec, 0x4d, 0xa4, 0x21, 0x7a, 0x2f, 0x97, 0xf6, 0xa1, ++ 0xbc, 0x6e, 0x53, 0x69, 0xac, 0xfb, 0xbe, 0x94, 0x81, 0x71, 0x46, 0xe9, 0xae, 0xeb, 0xed, 0xed, ++ 0x34, 0xdd, 0xfb, 0x52, 0x9c, 0xaf, 0xa7, 0xb1, 0x9f, 0x86, 0xd4, 0xf4, 0x35, 0x3c, 0x7f, 0x91, ++ 0xc0, 0x00, 0x60, 0x84, 0x29, 0xa9, 0x41, 0x7e, 0x37, 0x08, 0xda, 0x52, 0xa6, 0xa7, 0x30, 0x21, ++ 0x5f, 0xdf, 0xda, 0xda, 0x54, 0x4c, 0x79, 0xce, 0x6e, 0x56, 0x80, 0x9c, 0x38, 0xb9, 0x0f, 0x25, ++ 0xeb, 0xbe, 0xbf, 0x66, 0xb5, 0xb6, 0xeb, 0x96, 0xf4, 0xfd, 0x4e, 0x63, 0x26, 0xbe, 0x5b, 0x15, ++ 0xa4, 0x14, 0x3b, 0x61, 0x18, 0x52, 0xa5, 0x18, 0xf2, 0x22, 0x1e, 0x14, 0x6b, 0x1d, 0x3f, 0x70, ++ 0x5b, 0x72, 0x27, 0x48, 0xb1, 0x3f, 0x2f, 0x72, 0x3a, 0x8a, 0xa5, 0x08, 0x50, 0x31, 0x8b, 0x50, ++ 0x72, 0x22, 0x0d, 0x28, 0xec, 0x59, 0x3b, 0x7b, 0x2a, 0x39, 0xed, 0xca, 0x60, 0xde, 0xd4, 0x12, ++ 0xd2, 0x82, 0x97, 0xa0, 0xa0, 0xcf, 0x86, 0xce, 0xb1, 0x02, 0x5f, 0xba, 0xbe, 0x2e, 0xa7, 0xcb, ++ 0xb5, 0x1e, 0x19, 0x3a, 0x56, 0x80, 0x9c, 0x38, 0xfb, 0x1a, 0x7e, 0x2d, 0x23, 0xe3, 0x77, 0x56, ++ 0xd2, 0x5e, 0x69, 0x98, 0x5f, 0xc3, 0x4b, 0x50, 0xd0, 0x67, 0x73, 0xc4, 0x55, 0xc9, 0x35, 0xa5, ++ 0xaa, 0x9c, 0x62, 0x8e, 0xc4, 0xf3, 0x74, 0x8a, 0x39, 0xa2, 0x4b, 0x31, 0xe4, 0x45, 0xde, 0x82, ++ 0x5c, 0xd3, 0x6d, 0xa4, 0x7f, 0xf5, 0x2d, 0x7c, 0x0d, 0x4c, 0x2c, 0xf4, 0x35, 0xb7, 0x81, 0x8c, ++ 0x32, 0xf9, 0x95, 0x0c, 0x4c, 0x5a, 0xef, 0x76, 0x3c, 0x61, 0xb7, 0xb9, 0xde, 0xd9, 0xf6, 0xa5, ++ 0x8b, 0xe2, 0xcd, 0x14, 0x6b, 0x20, 0x42, 0x4f, 0xf1, 0xe5, 0x81, 0x35, 0x51, 0x10, 0xc6, 0x58, ++ 0x73, 0x95, 0x95, 0x67, 0x02, 0x91, 0xe9, 0x8f, 0xae, 0x0d, 0x28, 0xa3, 0x88, 0x54, 0x59, 0x79, ++ 0x11, 0x4a, 0x16, 0xe4, 0xbb, 0x19, 0xbe, 0x35, 0x2b, 0x39, 0x4b, 0x7d, 0x1a, 0xc8, 0x47, 0xde, ++ 0x6e, 0x0d, 0xe0, 0xee, 0x40, 0x10, 0x5c, 0xf4, 0xec, 0x80, 0x7a, 0xb6, 0x15, 0xd9, 0xed, 0x4d, ++ 0x04, 0x8c, 0x37, 0x81, 0x7c, 0x2b, 0x03, 0x53, 0xbc, 0x5b, 0xa4, 0xc1, 0x62, 0xa1, 0x23, 0x72, ++ 0xfb, 0xa6, 0xd2, 0xd4, 0x2a, 0x51, 0x82, 0xaa, 0x5b, 0x44, 0xee, 0x99, 0x28, 0x0c, 0xe3, 0xdc, ++ 0xd9, 0x32, 0xa3, 0x2d, 0xcb, 0x6e, 0xf2, 0xd4, 0xc1, 0xa9, 0x96, 0xd9, 0x32, 0x23, 0x13, 0x59, ++ 0x66, 0xbc, 0x04, 0x05, 0xfd, 0x72, 0x0d, 0xc6, 0x6e, 0xe3, 0x9a, 0x8e, 0x24, 0x3d, 0x3a, 0xad, ++ 0xe8, 0x15, 0x80, 0x7d, 0x6e, 0x7d, 0x5a, 0xa4, 0x9e, 0x7a, 0xe2, 0x58, 0xef, 0xa1, 0x77, 0x34, ++ 0x04, 0x0d, 0xac, 0xf2, 0x9f, 0x65, 0x60, 0x2a, 0xe6, 0xad, 0x29, 0xbc, 0x74, 0x95, 0xaf, 0x38, ++ 0xdd, 0x39, 0x81, 0xcd, 0xb0, 0x6a, 0x54, 0xc7, 0x08, 0x31, 0xd2, 0xe0, 0xd3, 0x6c, 0xc7, 0x6e, ++ 0xac, 0x5b, 0x6d, 0x49, 0x5f, 0xe8, 0x24, 0x89, 0x86, 0x84, 0x45, 0x03, 0x35, 0x66, 0xcd, 0x8b, ++ 0x12, 0xc1, 0x38, 0xd5, 0xf2, 0xf7, 0x32, 0x10, 0x8f, 0xf3, 0x22, 0xf3, 0x50, 0xaa, 0xdb, 0x1e, ++ 0xa7, 0x72, 0x10, 0x0f, 0x4b, 0x5b, 0x52, 0x00, 0x0c, 0x71, 0x74, 0xa7, 0x67, 0x0f, 0xeb, 0x74, ++ 0xf6, 0x17, 0x69, 0x83, 0x3e, 0x68, 0x4b, 0x65, 0xd6, 0x38, 0x8b, 0x2a, 0x08, 0x1a, 0x58, 0xe5, ++ 0x7f, 0x53, 0x80, 0xc9, 0xa8, 0x35, 0xbd, 0xcf, 0x38, 0xe1, 0x97, 0xa0, 0xd8, 0xa2, 0xc1, 0xae, ++ 0x5b, 0x8f, 0x5f, 0x0a, 0xac, 0xf3, 0x52, 0x94, 0x50, 0xde, 0x7c, 0xd7, 0x0b, 0x64, 0xb3, 0xc2, ++ 0xe6, 0xbb, 0x5e, 0x80, 0x1c, 0xa2, 0xdc, 0x9b, 0xf3, 0x3d, 0xdc, 0x9b, 0x1b, 0x30, 0xed, 0x53, ++ 0x6f, 0x9f, 0x7a, 0x86, 0x85, 0xb7, 0xff, 0x04, 0xa4, 0xd5, 0x18, 0x09, 0xec, 0x22, 0x4a, 0xea, ++ 0x30, 0x25, 0xca, 0x42, 0x0b, 0x6f, 0xb1, 0x6f, 0x0b, 0x6f, 0x35, 0x4a, 0x01, 0xe3, 0x24, 0x07, ++ 0x1c, 0x54, 0x13, 0x1d, 0xc2, 0x3e, 0xbc, 0x7d, 0x6e, 0x03, 0x58, 0x9d, 0x60, 0x57, 0x7e, 0xe7, ++ 0x68, 0xdf, 0x9e, 0x18, 0x15, 0x5d, 0x19, 0x0d, 0x42, 0xe4, 0x35, 0x98, 0x0c, 0x93, 0x8c, 0xf3, ++ 0xec, 0xbb, 0xe2, 0xd5, 0x66, 0xbe, 0xd7, 0xac, 0x47, 0x20, 0x18, 0xc3, 0x4c, 0xf9, 0xf6, 0x4f, ++ 0x16, 0x88, 0xec, 0x0c, 0xf3, 0xf2, 0xe9, 0xab, 0x19, 0x98, 0xbc, 0x1f, 0xe9, 0xa3, 0x81, 0x5f, ++ 0x42, 0xe9, 0xb3, 0x6a, 0xb4, 0x1c, 0x63, 0x7c, 0x8d, 0x9b, 0xdb, 0xec, 0xa9, 0xf8, 0x57, 0x2d, ++ 0xbc, 0xf9, 0xfd, 0x1f, 0x5c, 0x7a, 0xe6, 0x8f, 0x7e, 0x70, 0xe9, 0x99, 0x3f, 0xff, 0xc1, 0xa5, ++ 0x67, 0xde, 0x7b, 0x74, 0x29, 0xf3, 0xfd, 0x47, 0x97, 0x32, 0x7f, 0xf4, 0xe8, 0x52, 0xe6, 0xcf, ++ 0x1f, 0x5d, 0xca, 0xfc, 0xc7, 0x47, 0x97, 0x32, 0xdf, 0xfe, 0xe1, 0xa5, 0x67, 0x3e, 0x7b, 0x35, ++ 0x6c, 0xc5, 0xbc, 0x6a, 0x05, 0xff, 0xe7, 0xc3, 0x82, 0x2b, 0xf7, 0x16, 0x60, 0xad, 0x98, 0x97, ++ 0xbf, 0x55, 0x2b, 0xfe, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, 0xb2, 0xf6, 0x85, 0x97, 0x1d, ++ 0x01, 0x00, + } + + func (m *AMQPConsumeConfig) Marshal() (dAtA []byte, err error) { +@@ -6849,6 +6884,98 @@ func (m *ConfigMapPersistence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + return len(dAtA) - i, nil + } + ++func (m *Container) Marshal() (dAtA []byte, err error) { ++ size := m.Size() ++ dAtA = make([]byte, size) ++ n, err := m.MarshalToSizedBuffer(dAtA[:size]) ++ if err != nil { ++ return nil, err ++ } ++ return dAtA[:n], nil ++} ++ ++func (m *Container) MarshalTo(dAtA []byte) (int, error) { ++ size := m.Size() ++ return m.MarshalToSizedBuffer(dAtA[:size]) ++} ++ ++func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { ++ i := len(dAtA) ++ _ = i ++ var l int ++ _ = l ++ if len(m.EnvFrom) > 0 { ++ for iNdEx := len(m.EnvFrom) - 1; iNdEx >= 0; iNdEx-- { ++ { ++ size, err := m.EnvFrom[iNdEx].MarshalToSizedBuffer(dAtA[:i]) ++ if err != nil { ++ return 0, err ++ } ++ i -= size ++ i = encodeVarintGenerated(dAtA, i, uint64(size)) ++ } ++ i-- ++ dAtA[i] = 0x32 ++ } ++ } ++ if len(m.Env) > 0 { ++ for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { ++ { ++ size, err := m.Env[iNdEx].MarshalToSizedBuffer(dAtA[:i]) ++ if err != nil { ++ return 0, err ++ } ++ i -= size ++ i = encodeVarintGenerated(dAtA, i, uint64(size)) ++ } ++ i-- ++ dAtA[i] = 0x2a ++ } ++ } ++ if len(m.VolumeMounts) > 0 { ++ for iNdEx := len(m.VolumeMounts) - 1; iNdEx >= 0; iNdEx-- { ++ { ++ size, err := m.VolumeMounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) ++ if err != nil { ++ return 0, err ++ } ++ i -= size ++ i = encodeVarintGenerated(dAtA, i, uint64(size)) ++ } ++ i-- ++ dAtA[i] = 0x22 ++ } ++ } ++ if m.SecurityContext != nil { ++ { ++ size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) ++ if err != nil { ++ return 0, err ++ } ++ i -= size ++ i = encodeVarintGenerated(dAtA, i, uint64(size)) ++ } ++ i-- ++ dAtA[i] = 0x1a ++ } ++ i -= len(m.ImagePullPolicy) ++ copy(dAtA[i:], m.ImagePullPolicy) ++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.ImagePullPolicy))) ++ i-- ++ dAtA[i] = 0x12 ++ { ++ size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) ++ if err != nil { ++ return 0, err ++ } ++ i -= size ++ i = encodeVarintGenerated(dAtA, i, uint64(size)) ++ } ++ i-- ++ dAtA[i] = 0xa ++ return len(dAtA) - i, nil ++} ++ + func (m *ContainerTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) +@@ -16490,6 +16617,41 @@ func (m *ConfigMapPersistence) Size() (n int) { + return n + } + ++func (m *Container) Size() (n int) { ++ if m == nil { ++ return 0 ++ } ++ var l int ++ _ = l ++ l = m.Resources.Size() ++ n += 1 + l + sovGenerated(uint64(l)) ++ l = len(m.ImagePullPolicy) ++ n += 1 + l + sovGenerated(uint64(l)) ++ if m.SecurityContext != nil { ++ l = m.SecurityContext.Size() ++ n += 1 + l + sovGenerated(uint64(l)) ++ } ++ if len(m.VolumeMounts) > 0 { ++ for _, e := range m.VolumeMounts { ++ l = e.Size() ++ n += 1 + l + sovGenerated(uint64(l)) ++ } ++ } ++ if len(m.Env) > 0 { ++ for _, e := range m.Env { ++ l = e.Size() ++ n += 1 + l + sovGenerated(uint64(l)) ++ } ++ } ++ if len(m.EnvFrom) > 0 { ++ for _, e := range m.EnvFrom { ++ l = e.Size() ++ n += 1 + l + sovGenerated(uint64(l)) ++ } ++ } ++ return n ++} ++ + func (m *ContainerTemplate) Size() (n int) { + if m == nil { + return 0 +@@ -20190,6 +20352,36 @@ func (this *ConfigMapPersistence) String() string { + }, "") + return s + } ++func (this *Container) String() string { ++ if this == nil { ++ return "nil" ++ } ++ repeatedStringForVolumeMounts := "[]VolumeMount{" ++ for _, f := range this.VolumeMounts { ++ repeatedStringForVolumeMounts += fmt.Sprintf("%v", f) + "," ++ } ++ repeatedStringForVolumeMounts += "}" ++ repeatedStringForEnv := "[]EnvVar{" ++ for _, f := range this.Env { ++ repeatedStringForEnv += fmt.Sprintf("%v", f) + "," ++ } ++ repeatedStringForEnv += "}" ++ repeatedStringForEnvFrom := "[]EnvFromSource{" ++ for _, f := range this.EnvFrom { ++ repeatedStringForEnvFrom += fmt.Sprintf("%v", f) + "," ++ } ++ repeatedStringForEnvFrom += "}" ++ s := strings.Join([]string{`&Container{`, ++ `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "v1.ResourceRequirements", 1), `&`, ``, 1) + `,`, ++ `ImagePullPolicy:` + fmt.Sprintf("%v", this.ImagePullPolicy) + `,`, ++ `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "SecurityContext", "v1.SecurityContext", 1) + `,`, ++ `VolumeMounts:` + repeatedStringForVolumeMounts + `,`, ++ `Env:` + repeatedStringForEnv + `,`, ++ `EnvFrom:` + repeatedStringForEnvFrom + `,`, ++ `}`, ++ }, "") ++ return s ++} + func (this *ContainerTemplate) String() string { + if this == nil { + return "nil" +@@ -22366,7 +22558,7 @@ func (this *Template) String() string { + s := strings.Join([]string{`&Template{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, +- `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "Container", "v1.Container", 1) + `,`, ++ `Container:` + strings.Replace(this.Container.String(), "Container", "Container", 1) + `,`, + `Volumes:` + repeatedStringForVolumes + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, +@@ -29399,6 +29591,259 @@ func (m *ConfigMapPersistence) Unmarshal(dAtA []byte) error { + } + return nil + } ++func (m *Container) Unmarshal(dAtA []byte) error { ++ l := len(dAtA) ++ iNdEx := 0 ++ for iNdEx < l { ++ preIndex := iNdEx ++ var wire uint64 ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ wire |= uint64(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ fieldNum := int32(wire >> 3) ++ wireType := int(wire & 0x7) ++ if wireType == 4 { ++ return fmt.Errorf("proto: Container: wiretype end group for non-group") ++ } ++ if fieldNum <= 0 { ++ return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire) ++ } ++ switch fieldNum { ++ case 1: ++ if wireType != 2 { ++ return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) ++ } ++ var msglen int ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ msglen |= int(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ if msglen < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ postIndex := iNdEx + msglen ++ if postIndex < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if postIndex > l { ++ return io.ErrUnexpectedEOF ++ } ++ if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { ++ return err ++ } ++ iNdEx = postIndex ++ case 2: ++ if wireType != 2 { ++ return fmt.Errorf("proto: wrong wireType = %d for field ImagePullPolicy", wireType) ++ } ++ var stringLen uint64 ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ stringLen |= uint64(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ intStringLen := int(stringLen) ++ if intStringLen < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ postIndex := iNdEx + intStringLen ++ if postIndex < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if postIndex > l { ++ return io.ErrUnexpectedEOF ++ } ++ m.ImagePullPolicy = k8s_io_api_core_v1.PullPolicy(dAtA[iNdEx:postIndex]) ++ iNdEx = postIndex ++ case 3: ++ if wireType != 2 { ++ return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) ++ } ++ var msglen int ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ msglen |= int(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ if msglen < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ postIndex := iNdEx + msglen ++ if postIndex < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if postIndex > l { ++ return io.ErrUnexpectedEOF ++ } ++ if m.SecurityContext == nil { ++ m.SecurityContext = &v1.SecurityContext{} ++ } ++ if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { ++ return err ++ } ++ iNdEx = postIndex ++ case 4: ++ if wireType != 2 { ++ return fmt.Errorf("proto: wrong wireType = %d for field VolumeMounts", wireType) ++ } ++ var msglen int ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ msglen |= int(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ if msglen < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ postIndex := iNdEx + msglen ++ if postIndex < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if postIndex > l { ++ return io.ErrUnexpectedEOF ++ } ++ m.VolumeMounts = append(m.VolumeMounts, v1.VolumeMount{}) ++ if err := m.VolumeMounts[len(m.VolumeMounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { ++ return err ++ } ++ iNdEx = postIndex ++ case 5: ++ if wireType != 2 { ++ return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) ++ } ++ var msglen int ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ msglen |= int(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ if msglen < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ postIndex := iNdEx + msglen ++ if postIndex < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if postIndex > l { ++ return io.ErrUnexpectedEOF ++ } ++ m.Env = append(m.Env, v1.EnvVar{}) ++ if err := m.Env[len(m.Env)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { ++ return err ++ } ++ iNdEx = postIndex ++ case 6: ++ if wireType != 2 { ++ return fmt.Errorf("proto: wrong wireType = %d for field EnvFrom", wireType) ++ } ++ var msglen int ++ for shift := uint(0); ; shift += 7 { ++ if shift >= 64 { ++ return ErrIntOverflowGenerated ++ } ++ if iNdEx >= l { ++ return io.ErrUnexpectedEOF ++ } ++ b := dAtA[iNdEx] ++ iNdEx++ ++ msglen |= int(b&0x7F) << shift ++ if b < 0x80 { ++ break ++ } ++ } ++ if msglen < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ postIndex := iNdEx + msglen ++ if postIndex < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if postIndex > l { ++ return io.ErrUnexpectedEOF ++ } ++ m.EnvFrom = append(m.EnvFrom, v1.EnvFromSource{}) ++ if err := m.EnvFrom[len(m.EnvFrom)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { ++ return err ++ } ++ iNdEx = postIndex ++ default: ++ iNdEx = preIndex ++ skippy, err := skipGenerated(dAtA[iNdEx:]) ++ if err != nil { ++ return err ++ } ++ if (skippy < 0) || (iNdEx+skippy) < 0 { ++ return ErrInvalidLengthGenerated ++ } ++ if (iNdEx + skippy) > l { ++ return io.ErrUnexpectedEOF ++ } ++ iNdEx += skippy ++ } ++ } ++ ++ if iNdEx > l { ++ return io.ErrUnexpectedEOF ++ } ++ return nil ++} + func (m *ContainerTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 +@@ -57551,7 +57996,7 @@ func (m *Template) Unmarshal(dAtA []byte) error { + return io.ErrUnexpectedEOF + } + if m.Container == nil { +- m.Container = &v1.Container{} ++ m.Container = &Container{} + } + if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err +diff --git a/pkg/apis/events/v1alpha1/template.go b/pkg/apis/events/v1alpha1/template.go +index b772e611..70acab57 100644 +--- a/pkg/apis/events/v1alpha1/template.go ++++ b/pkg/apis/events/v1alpha1/template.go +@@ -1,6 +1,9 @@ + package v1alpha1 + +-import corev1 "k8s.io/api/core/v1" ++import ( ++ "dario.cat/mergo" ++ corev1 "k8s.io/api/core/v1" ++) + + // Template holds the information of a deployment template + type Template struct { +@@ -12,7 +15,7 @@ type Template struct { + ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,2,opt,name=serviceAccountName"` + // Container is the main container image to run in the sensor pod + // +optional +- Container *corev1.Container `json:"container,omitempty" protobuf:"bytes,3,opt,name=container"` ++ Container *Container `json:"container,omitempty" protobuf:"bytes,3,opt,name=container"` + // Volumes is a list of volumes that can be mounted by containers in a workflow. + // +patchStrategy=merge + // +patchMergeKey=name +@@ -59,3 +62,42 @@ type Template struct { + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty" protobuf:"bytes,11,opt,name=affinity"` + } ++ ++// Container defines customized spec for a container ++type Container struct { ++ // +optional ++ Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` ++ // +optional ++ ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,2,opt,name=imagePullPolicy,casttype=PullPolicy"` ++ // +optional ++ SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,3,opt,name=securityContext"` ++ // +optional ++ VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" protobuf:"bytes,4,rep,name=volumeMounts"` ++ // +optional ++ Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,5,rep,name=env"` ++ // +optional ++ EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,6,rep,name=envFrom"` ++} ++ ++// ApplyToContainer updates the Container with the values from the customized container ++func (c *Container) ApplyToContainer(cc *corev1.Container) { ++ if c == nil { ++ return ++ } ++ _ = mergo.Merge(&cc.Resources, c.Resources, mergo.WithOverride) ++ if cc.SecurityContext == nil { ++ cc.SecurityContext = c.SecurityContext ++ } ++ if cc.ImagePullPolicy == "" { ++ cc.ImagePullPolicy = c.ImagePullPolicy ++ } ++ if len(c.Env) > 0 { ++ cc.Env = append(cc.Env, c.Env...) ++ } ++ if len(c.EnvFrom) > 0 { ++ cc.EnvFrom = append(cc.EnvFrom, c.EnvFrom...) ++ } ++ if len(c.VolumeMounts) > 0 { ++ cc.VolumeMounts = append(cc.VolumeMounts, c.VolumeMounts...) ++ } ++} +diff --git a/pkg/apis/events/v1alpha1/template_test.go b/pkg/apis/events/v1alpha1/template_test.go +new file mode 100644 +index 00000000..8a049ac3 +--- /dev/null ++++ b/pkg/apis/events/v1alpha1/template_test.go +@@ -0,0 +1,61 @@ ++package v1alpha1 ++ ++import ( ++ "testing" ++ ++ "github.com/stretchr/testify/assert" ++ corev1 "k8s.io/api/core/v1" ++ resource "k8s.io/apimachinery/pkg/api/resource" ++) ++ ++var ( ++ testContainer = &Container{ ++ Resources: corev1.ResourceRequirements{ ++ Requests: corev1.ResourceList{ ++ "cpu": resource.MustParse("100m"), ++ }, ++ }, ++ } ++) ++ ++func Test_ApplyToContainer(t *testing.T) { ++ c := &corev1.Container{} ++ testContainer.ApplyToContainer(c) ++ assert.Equal(t, "", string(c.ImagePullPolicy)) ++ assert.Equal(t, testContainer.Resources, c.Resources) ++ c.Resources.Limits = corev1.ResourceList{ ++ "cpu": resource.MustParse("200m"), ++ } ++ testContainer.ApplyToContainer(c) ++ assert.Equal(t, resource.MustParse("200m"), *c.Resources.Limits.Cpu()) ++ c.Resources.Limits = corev1.ResourceList{ ++ "memory": resource.MustParse("32Mi"), ++ } ++ assert.Equal(t, resource.MustParse("32Mi"), *c.Resources.Limits.Memory()) ++ testContainer.ImagePullPolicy = corev1.PullAlways ++ testContainer.ApplyToContainer(c) ++ assert.Equal(t, corev1.PullAlways, c.ImagePullPolicy) ++ c.ImagePullPolicy = corev1.PullIfNotPresent ++ testContainer.ApplyToContainer(c) ++ assert.Equal(t, corev1.PullIfNotPresent, c.ImagePullPolicy) ++ testContainer.SecurityContext = &corev1.SecurityContext{} ++ testContainer.ApplyToContainer(c) ++ assert.NotNil(t, c.SecurityContext) ++ testContainer.Env = []corev1.EnvVar{{Name: "a", Value: "b"}} ++ testContainer.EnvFrom = []corev1.EnvFromSource{{Prefix: "a", ConfigMapRef: &corev1.ConfigMapEnvSource{LocalObjectReference: corev1.LocalObjectReference{Name: "b"}}}} ++ testContainer.ApplyToContainer(c) ++ envs := []string{} ++ for _, e := range c.Env { ++ envs = append(envs, e.Name) ++ } ++ assert.Contains(t, envs, "a") ++ envFroms := []string{} ++ for _, e := range c.EnvFrom { ++ envFroms = append(envFroms, e.Prefix) ++ } ++ assert.Contains(t, envFroms, "a") ++ testContainer.VolumeMounts = []corev1.VolumeMount{{Name: "test", MountPath: "/test"}} ++ testContainer.ApplyToContainer(c) ++ assert.Equal(t, 1, len(c.VolumeMounts)) ++ assert.Equal(t, "test", c.VolumeMounts[0].Name) ++} +diff --git a/pkg/apis/events/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/events/v1alpha1/zz_generated.deepcopy.go +index b2f7f5ab..eb57ae05 100644 +--- a/pkg/apis/events/v1alpha1/zz_generated.deepcopy.go ++++ b/pkg/apis/events/v1alpha1/zz_generated.deepcopy.go +@@ -909,6 +909,49 @@ func (in *ConfigMapPersistence) DeepCopy() *ConfigMapPersistence { + return out + } + ++// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. ++func (in *Container) DeepCopyInto(out *Container) { ++ *out = *in ++ in.Resources.DeepCopyInto(&out.Resources) ++ if in.SecurityContext != nil { ++ in, out := &in.SecurityContext, &out.SecurityContext ++ *out = new(v1.SecurityContext) ++ (*in).DeepCopyInto(*out) ++ } ++ if in.VolumeMounts != nil { ++ in, out := &in.VolumeMounts, &out.VolumeMounts ++ *out = make([]v1.VolumeMount, len(*in)) ++ for i := range *in { ++ (*in)[i].DeepCopyInto(&(*out)[i]) ++ } ++ } ++ if in.Env != nil { ++ in, out := &in.Env, &out.Env ++ *out = make([]v1.EnvVar, len(*in)) ++ for i := range *in { ++ (*in)[i].DeepCopyInto(&(*out)[i]) ++ } ++ } ++ if in.EnvFrom != nil { ++ in, out := &in.EnvFrom, &out.EnvFrom ++ *out = make([]v1.EnvFromSource, len(*in)) ++ for i := range *in { ++ (*in)[i].DeepCopyInto(&(*out)[i]) ++ } ++ } ++ return ++} ++ ++// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Container. ++func (in *Container) DeepCopy() *Container { ++ if in == nil { ++ return nil ++ } ++ out := new(Container) ++ in.DeepCopyInto(out) ++ return out ++} ++ + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. + func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate) { + *out = *in +@@ -4140,7 +4183,7 @@ func (in *Template) DeepCopyInto(out *Template) { + } + if in.Container != nil { + in, out := &in.Container, &out.Container +- *out = new(v1.Container) ++ *out = new(Container) + (*in).DeepCopyInto(*out) + } + if in.Volumes != nil { +diff --git a/pkg/apis/events/v1alpha1/zz_generated.defaults.go b/pkg/apis/events/v1alpha1/zz_generated.defaults.go +index e926479d..92f3da44 100644 +--- a/pkg/apis/events/v1alpha1/zz_generated.defaults.go ++++ b/pkg/apis/events/v1alpha1/zz_generated.defaults.go +@@ -39,38 +39,6 @@ func RegisterDefaults(scheme *runtime.Scheme) error { + + func SetObjectDefaults_EventSource(in *EventSource) { + if in.Spec.Template != nil { +- if in.Spec.Template.Container != nil { +- for i := range in.Spec.Template.Container.Ports { +- a := &in.Spec.Template.Container.Ports[i] +- if a.Protocol == "" { +- a.Protocol = "TCP" +- } +- } +- if in.Spec.Template.Container.LivenessProbe != nil { +- if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC != nil { +- if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service == nil { +- var ptrVar1 string = "" +- in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 +- } +- } +- } +- if in.Spec.Template.Container.ReadinessProbe != nil { +- if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC != nil { +- if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service == nil { +- var ptrVar1 string = "" +- in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 +- } +- } +- } +- if in.Spec.Template.Container.StartupProbe != nil { +- if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC != nil { +- if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service == nil { +- var ptrVar1 string = "" +- in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 +- } +- } +- } +- } + for i := range in.Spec.Template.Volumes { + a := &in.Spec.Template.Volumes[i] + if a.VolumeSource.ISCSI != nil { +@@ -136,38 +104,6 @@ func SetObjectDefaults_EventSourceList(in *EventSourceList) { + + func SetObjectDefaults_Sensor(in *Sensor) { + if in.Spec.Template != nil { +- if in.Spec.Template.Container != nil { +- for i := range in.Spec.Template.Container.Ports { +- a := &in.Spec.Template.Container.Ports[i] +- if a.Protocol == "" { +- a.Protocol = "TCP" +- } +- } +- if in.Spec.Template.Container.LivenessProbe != nil { +- if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC != nil { +- if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service == nil { +- var ptrVar1 string = "" +- in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 +- } +- } +- } +- if in.Spec.Template.Container.ReadinessProbe != nil { +- if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC != nil { +- if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service == nil { +- var ptrVar1 string = "" +- in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 +- } +- } +- } +- if in.Spec.Template.Container.StartupProbe != nil { +- if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC != nil { +- if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service == nil { +- var ptrVar1 string = "" +- in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 +- } +- } +- } +- } + for i := range in.Spec.Template.Volumes { + a := &in.Spec.Template.Volumes[i] + if a.VolumeSource.ISCSI != nil { +diff --git a/pkg/reconciler/eventsource/controller.go b/pkg/reconciler/eventsource/controller.go +index 88467611..aabf53c5 100644 +--- a/pkg/reconciler/eventsource/controller.go ++++ b/pkg/reconciler/eventsource/controller.go +@@ -13,7 +13,6 @@ import ( + "sigs.k8s.io/controller-runtime/pkg/reconcile" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" +- aev1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/shared/logging" + ) + +@@ -38,7 +37,7 @@ func NewReconciler(client client.Client, scheme *runtime.Scheme, eventSourceImag + } + + func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +- eventSource := &aev1.EventSource{} ++ eventSource := &v1alpha1.EventSource{} + if err := r.client.Get(ctx, req.NamespacedName, eventSource); err != nil { + if apierrors.IsNotFound(err) { + r.logger.Warnw("WARNING: eventsource not found", "request", req) +@@ -67,7 +66,7 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu + } + + // reconcile does the real logic +-func (r *reconciler) reconcile(ctx context.Context, eventSource *aev1.EventSource) error { ++func (r *reconciler) reconcile(ctx context.Context, eventSource *v1alpha1.EventSource) error { + log := logging.FromContext(ctx) + if !eventSource.DeletionTimestamp.IsZero() { + log.Info("deleting eventsource") +@@ -96,7 +95,7 @@ func (r *reconciler) reconcile(ctx context.Context, eventSource *aev1.EventSourc + return Reconcile(r.client, args, log) + } + +-func (r *reconciler) needsUpdate(old, new *aev1.EventSource) bool { ++func (r *reconciler) needsUpdate(old, new *v1alpha1.EventSource) bool { + if old == nil { + return true + } +diff --git a/pkg/reconciler/eventsource/resource.go b/pkg/reconciler/eventsource/resource.go +index decc44eb..5e7a487f 100644 +--- a/pkg/reconciler/eventsource/resource.go ++++ b/pkg/reconciler/eventsource/resource.go +@@ -8,10 +8,8 @@ import ( + "sort" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" +- aev1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + controllerscommon "github.com/argoproj/argo-events/pkg/reconciler/common" + sharedutil "github.com/argoproj/argo-events/pkg/shared/util" +- "github.com/imdario/mergo" + "go.uber.org/zap" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" +@@ -26,7 +24,7 @@ import ( + // AdaptorArgs are the args needed to create a sensor deployment + type AdaptorArgs struct { + Image string +- EventSource *aev1.EventSource ++ EventSource *v1alpha1.EventSource + Labels map[string]string + } + +@@ -34,7 +32,7 @@ type AdaptorArgs struct { + func Reconcile(client client.Client, args *AdaptorArgs, logger *zap.SugaredLogger) error { + ctx := context.Background() + eventSource := args.EventSource +- eventBus := &aev1.EventBus{} ++ eventBus := &v1alpha1.EventBus{} + eventBusName := v1alpha1.DefaultEventBusName + if len(eventSource.Spec.EventBusName) > 0 { + eventBusName = eventSource.Spec.EventBusName +@@ -161,12 +159,12 @@ func getDeployment(ctx context.Context, cl client.Client, args *AdaptorArgs) (*a + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") + } + +-func buildDeployment(args *AdaptorArgs, eventBus *aev1.EventBus) (*appv1.Deployment, error) { ++func buildDeployment(args *AdaptorArgs, eventBus *v1alpha1.EventBus) (*appv1.Deployment, error) { + deploymentSpec, err := buildDeploymentSpec(args) + if err != nil { + return nil, err + } +- eventSourceCopy := &aev1.EventSource{ ++ eventSourceCopy := &v1alpha1.EventSource{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.EventSource.Namespace, + Name: args.EventSource.Name, +@@ -340,7 +338,7 @@ func buildDeployment(args *AdaptorArgs, eventBus *aev1.EventBus) (*appv1.Deploym + }, + Spec: *deploymentSpec, + } +- if err := controllerscommon.SetObjectMeta(args.EventSource, deployment, aev1.EventSourceGroupVersionKind); err != nil { ++ if err := controllerscommon.SetObjectMeta(args.EventSource, deployment, v1alpha1.EventSourceGroupVersionKind); err != nil { + return nil, err + } + +@@ -356,10 +354,8 @@ func buildDeploymentSpec(args *AdaptorArgs) (*appv1.DeploymentSpec, error) { + {Name: "metrics", ContainerPort: v1alpha1.EventSourceMetricsPort}, + }, + } +- if args.EventSource.Spec.Template != nil && args.EventSource.Spec.Template.Container != nil { +- if err := mergo.Merge(&eventSourceContainer, args.EventSource.Spec.Template.Container, mergo.WithOverride); err != nil { +- return nil, err +- } ++ if x := args.EventSource.Spec.Template; x != nil && x.Container != nil { ++ x.Container.ApplyToContainer(&eventSourceContainer) + } + eventSourceContainer.Name = "main" + podTemplateLabels := make(map[string]string) +diff --git a/pkg/reconciler/sensor/resource.go b/pkg/reconciler/sensor/resource.go +index 40eee32b..8f320c33 100644 +--- a/pkg/reconciler/sensor/resource.go ++++ b/pkg/reconciler/sensor/resource.go +@@ -23,7 +23,6 @@ import ( + "fmt" + "sort" + +- "github.com/imdario/mergo" + "go.uber.org/zap" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" +@@ -317,10 +316,8 @@ func buildDeploymentSpec(args *AdaptorArgs) (*appv1.DeploymentSpec, error) { + {Name: "metrics", ContainerPort: v1alpha1.SensorMetricsPort}, + }, + } +- if args.Sensor.Spec.Template != nil && args.Sensor.Spec.Template.Container != nil { +- if err := mergo.Merge(&sensorContainer, args.Sensor.Spec.Template.Container, mergo.WithOverride); err != nil { +- return nil, err +- } ++ if x := args.Sensor.Spec.Template; x != nil && x.Container != nil { ++ x.Container.ApplyToContainer(&sensorContainer) + } + sensorContainer.Name = "main" + podTemplateLabels := make(map[string]string) +diff --git a/pkg/reconciler/sensor/resource_test.go b/pkg/reconciler/sensor/resource_test.go +index c228318c..ccc4c265 100644 +--- a/pkg/reconciler/sensor/resource_test.go ++++ b/pkg/reconciler/sensor/resource_test.go +@@ -52,7 +52,7 @@ var ( + Name: "test", + }, + }, +- Container: &corev1.Container{ ++ Container: &v1alpha1.Container{ + VolumeMounts: []corev1.VolumeMount{ + { + MountPath: "/test-data", +diff --git a/pkg/sensors/triggers/standard-k8s/standard-k8s.go b/pkg/sensors/triggers/standard-k8s/standard-k8s.go +index 11341292..aeeedc0c 100644 +--- a/pkg/sensors/triggers/standard-k8s/standard-k8s.go ++++ b/pkg/sensors/triggers/standard-k8s/standard-k8s.go +@@ -22,7 +22,7 @@ import ( + "strconv" + "time" + +- "github.com/imdario/mergo" ++ "dario.cat/mergo" + "go.uber.org/zap" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +diff --git a/pkg/webhook/validator/validator_test.go b/pkg/webhook/validator/validator_test.go +index dc3b7fa3..d75758c4 100644 +--- a/pkg/webhook/validator/validator_test.go ++++ b/pkg/webhook/validator/validator_test.go +@@ -94,7 +94,7 @@ func fakeSensor() *aev1.Sensor { + Name: "test", + }, + }, +- Container: &corev1.Container{ ++ Container: &aev1.Container{ + VolumeMounts: []corev1.VolumeMount{ + { + MountPath: "/test-data", diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/post_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..4ff4be4e2902a14434cf03880a3d492ffbb8164b --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/post_context.md @@ -0,0 +1,76513 @@ +# Patch-overlapping Go context after the fix + +## `pkg/apis/events/openapi/openapi_generated.go` (changed lines (61, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 7980, 8083)) + +```go +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +package openapi + +import ( + v1alpha1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + common "k8s.io/kube-openapi/pkg/common" + spec "k8s.io/kube-openapi/pkg/validation/spec" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPConsumeConfig": schema_pkg_apis_events_v1alpha1_AMQPConsumeConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPEventSource": schema_pkg_apis_events_v1alpha1_AMQPEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPExchangeDeclareConfig": schema_pkg_apis_events_v1alpha1_AMQPExchangeDeclareConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueBindConfig": schema_pkg_apis_events_v1alpha1_AMQPQueueBindConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueDeclareConfig": schema_pkg_apis_events_v1alpha1_AMQPQueueDeclareConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AWSLambdaTrigger": schema_pkg_apis_events_v1alpha1_AWSLambdaTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount": schema_pkg_apis_events_v1alpha1_Amount(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArgoWorkflowTrigger": schema_pkg_apis_events_v1alpha1_ArgoWorkflowTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation": schema_pkg_apis_events_v1alpha1_ArtifactLocation(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventHubsTrigger": schema_pkg_apis_events_v1alpha1_AzureEventHubsTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventsHubEventSource": schema_pkg_apis_events_v1alpha1_AzureEventsHubEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureQueueStorageEventSource": schema_pkg_apis_events_v1alpha1_AzureQueueStorageEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusEventSource": schema_pkg_apis_events_v1alpha1_AzureServiceBusEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusTrigger": schema_pkg_apis_events_v1alpha1_AzureServiceBusTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff": schema_pkg_apis_events_v1alpha1_Backoff(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth": schema_pkg_apis_events_v1alpha1_BasicAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketAuth": schema_pkg_apis_events_v1alpha1_BitbucketAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketBasicAuth": schema_pkg_apis_events_v1alpha1_BitbucketBasicAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketEventSource": schema_pkg_apis_events_v1alpha1_BitbucketEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketRepository": schema_pkg_apis_events_v1alpha1_BitbucketRepository(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerEventSource": schema_pkg_apis_events_v1alpha1_BitbucketServerEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerRepository": schema_pkg_apis_events_v1alpha1_BitbucketServerRepository(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BusConfig": schema_pkg_apis_events_v1alpha1_BusConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CalendarEventSource": schema_pkg_apis_events_v1alpha1_CalendarEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CatchupConfiguration": schema_pkg_apis_events_v1alpha1_CatchupConfiguration(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition": schema_pkg_apis_events_v1alpha1_Condition(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime": schema_pkg_apis_events_v1alpha1_ConditionsResetByTime(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria": schema_pkg_apis_events_v1alpha1_ConditionsResetCriteria(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence": schema_pkg_apis_events_v1alpha1_ConfigMapPersistence(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Container": schema_pkg_apis_events_v1alpha1_Container(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate": schema_pkg_apis_events_v1alpha1_ContainerTemplate(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger": schema_pkg_apis_events_v1alpha1_CustomTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter": schema_pkg_apis_events_v1alpha1_DataFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmailTrigger": schema_pkg_apis_events_v1alpha1_EmailTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmitterEventSource": schema_pkg_apis_events_v1alpha1_EmitterEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Event": schema_pkg_apis_events_v1alpha1_Event(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBus": schema_pkg_apis_events_v1alpha1_EventBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusList": schema_pkg_apis_events_v1alpha1_EventBusList(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusSpec": schema_pkg_apis_events_v1alpha1_EventBusSpec(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusStatus": schema_pkg_apis_events_v1alpha1_EventBusStatus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext": schema_pkg_apis_events_v1alpha1_EventContext(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependency": schema_pkg_apis_events_v1alpha1_EventDependency(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyFilter": schema_pkg_apis_events_v1alpha1_EventDependencyFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyTransformer": schema_pkg_apis_events_v1alpha1_EventDependencyTransformer(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventPersistence": schema_pkg_apis_events_v1alpha1_EventPersistence(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSource": schema_pkg_apis_events_v1alpha1_EventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter": schema_pkg_apis_events_v1alpha1_EventSourceFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceList": schema_pkg_apis_events_v1alpha1_EventSourceList(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceSpec": schema_pkg_apis_events_v1alpha1_EventSourceSpec(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceStatus": schema_pkg_apis_events_v1alpha1_EventSourceStatus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ExprFilter": schema_pkg_apis_events_v1alpha1_ExprFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileArtifact": schema_pkg_apis_events_v1alpha1_FileArtifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileEventSource": schema_pkg_apis_events_v1alpha1_FileEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GenericEventSource": schema_pkg_apis_events_v1alpha1_GenericEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GerritEventSource": schema_pkg_apis_events_v1alpha1_GerritEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitArtifact": schema_pkg_apis_events_v1alpha1_GitArtifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitCreds": schema_pkg_apis_events_v1alpha1_GitCreds(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitRemoteConfig": schema_pkg_apis_events_v1alpha1_GitRemoteConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubAppCreds": schema_pkg_apis_events_v1alpha1_GithubAppCreds(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubEventSource": schema_pkg_apis_events_v1alpha1_GithubEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitlabEventSource": schema_pkg_apis_events_v1alpha1_GitlabEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HDFSEventSource": schema_pkg_apis_events_v1alpha1_HDFSEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HTTPTrigger": schema_pkg_apis_events_v1alpha1_HTTPTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Int64OrString": schema_pkg_apis_events_v1alpha1_Int64OrString(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamBus": schema_pkg_apis_events_v1alpha1_JetStreamBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig": schema_pkg_apis_events_v1alpha1_JetStreamConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResource": schema_pkg_apis_events_v1alpha1_K8SResource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResourcePolicy": schema_pkg_apis_events_v1alpha1_K8SResourcePolicy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus": schema_pkg_apis_events_v1alpha1_KafkaBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup": schema_pkg_apis_events_v1alpha1_KafkaConsumerGroup(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaEventSource": schema_pkg_apis_events_v1alpha1_KafkaEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaTrigger": schema_pkg_apis_events_v1alpha1_KafkaTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.LogTrigger": schema_pkg_apis_events_v1alpha1_LogTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.MQTTEventSource": schema_pkg_apis_events_v1alpha1_MQTTEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata": schema_pkg_apis_events_v1alpha1_Metadata(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth": schema_pkg_apis_events_v1alpha1_NATSAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSBus": schema_pkg_apis_events_v1alpha1_NATSBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig": schema_pkg_apis_events_v1alpha1_NATSConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSEventsSource": schema_pkg_apis_events_v1alpha1_NATSEventsSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSTrigger": schema_pkg_apis_events_v1alpha1_NATSTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NSQEventSource": schema_pkg_apis_events_v1alpha1_NSQEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NativeStrategy": schema_pkg_apis_events_v1alpha1_NativeStrategy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OpenWhiskTrigger": schema_pkg_apis_events_v1alpha1_OpenWhiskTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OwnedRepositories": schema_pkg_apis_events_v1alpha1_OwnedRepositories(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PayloadField": schema_pkg_apis_events_v1alpha1_PayloadField(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy": schema_pkg_apis_events_v1alpha1_PersistenceStrategy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PubSubEventSource": schema_pkg_apis_events_v1alpha1_PubSubEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarEventSource": schema_pkg_apis_events_v1alpha1_PulsarEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarTrigger": schema_pkg_apis_events_v1alpha1_PulsarTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RateLimit": schema_pkg_apis_events_v1alpha1_RateLimit(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisEventSource": schema_pkg_apis_events_v1alpha1_RedisEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisStreamEventSource": schema_pkg_apis_events_v1alpha1_RedisStreamEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceEventSource": schema_pkg_apis_events_v1alpha1_ResourceEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceFilter": schema_pkg_apis_events_v1alpha1_ResourceFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact": schema_pkg_apis_events_v1alpha1_S3Artifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Bucket": schema_pkg_apis_events_v1alpha1_S3Bucket(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Filter": schema_pkg_apis_events_v1alpha1_S3Filter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig": schema_pkg_apis_events_v1alpha1_SASLConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SFTPEventSource": schema_pkg_apis_events_v1alpha1_SFTPEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SNSEventSource": schema_pkg_apis_events_v1alpha1_SNSEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SQSEventSource": schema_pkg_apis_events_v1alpha1_SQSEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SchemaRegistryConfig": schema_pkg_apis_events_v1alpha1_SchemaRegistryConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader": schema_pkg_apis_events_v1alpha1_SecureHeader(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector": schema_pkg_apis_events_v1alpha1_Selector(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Sensor": schema_pkg_apis_events_v1alpha1_Sensor(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorList": schema_pkg_apis_events_v1alpha1_SensorList(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorSpec": schema_pkg_apis_events_v1alpha1_SensorSpec(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorStatus": schema_pkg_apis_events_v1alpha1_SensorStatus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Service": schema_pkg_apis_events_v1alpha1_Service(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackEventSource": schema_pkg_apis_events_v1alpha1_SlackEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackSender": schema_pkg_apis_events_v1alpha1_SlackSender(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackThread": schema_pkg_apis_events_v1alpha1_SlackThread(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackTrigger": schema_pkg_apis_events_v1alpha1_SlackTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StandardK8STrigger": schema_pkg_apis_events_v1alpha1_StandardK8STrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Status": schema_pkg_apis_events_v1alpha1_Status(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StatusPolicy": schema_pkg_apis_events_v1alpha1_StatusPolicy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridEventSource": schema_pkg_apis_events_v1alpha1_StorageGridEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridFilter": schema_pkg_apis_events_v1alpha1_StorageGridFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StripeEventSource": schema_pkg_apis_events_v1alpha1_StripeEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig": schema_pkg_apis_events_v1alpha1_TLSConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template": schema_pkg_apis_events_v1alpha1_Template(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TimeFilter": schema_pkg_apis_events_v1alpha1_TimeFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger": schema_pkg_apis_events_v1alpha1_Trigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter": schema_pkg_apis_events_v1alpha1_TriggerParameter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameterSource": schema_pkg_apis_events_v1alpha1_TriggerParameterSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerPolicy": schema_pkg_apis_events_v1alpha1_TriggerPolicy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerTemplate": schema_pkg_apis_events_v1alpha1_TriggerTemplate(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.URLArtifact": schema_pkg_apis_events_v1alpha1_URLArtifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ValueFromSource": schema_pkg_apis_events_v1alpha1_ValueFromSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig": schema_pkg_apis_events_v1alpha1_WatchPathConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext": schema_pkg_apis_events_v1alpha1_WebhookContext(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookEventSource": schema_pkg_apis_events_v1alpha1_WebhookEventSource(ref), + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPConsumeConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPConsumeConfig holds the configuration to immediately starts delivering queued messages", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "consumerTag": { + SchemaProps: spec.SchemaProps{ + Description: "ConsumerTag is the identity of the consumer included in every delivery", + Type: []string{"string"}, + Format: "", + }, + }, + "autoAck": { + SchemaProps: spec.SchemaProps{ + Description: "AutoAck when true, the server will acknowledge deliveries to this consumer prior to writing the delivery to the network", + Type: []string{"boolean"}, + Format: "", + }, + }, + "exclusive": { + SchemaProps: spec.SchemaProps{ + Description: "Exclusive when true, the server will ensure that this is the sole consumer from this queue", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noLocal": { + SchemaProps: spec.SchemaProps{ + Description: "NoLocal flag is not supported by RabbitMQ", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait when true, do not wait for the server to confirm the request and immediately begin deliveries", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPEventSource refers to an event-source for AMQP stream events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL for rabbitmq service", + Type: []string{"string"}, + Format: "", + }, + }, + "exchangeName": { + SchemaProps: spec.SchemaProps{ + Description: "ExchangeName is the exchange name For more information, visit https://www.rabbitmq.com/tutorials/amqp-concepts.html", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "exchangeType": { + SchemaProps: spec.SchemaProps{ + Description: "ExchangeType is rabbitmq exchange type", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "routingKey": { + SchemaProps: spec.SchemaProps{ + Description: "Routing key for bindings", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the amqp client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "exchangeDeclare": { + SchemaProps: spec.SchemaProps{ + Description: "ExchangeDeclare holds the configuration for the exchange on the server For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.ExchangeDeclare", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPExchangeDeclareConfig"), + }, + }, + "queueDeclare": { + SchemaProps: spec.SchemaProps{ + Description: "QueueDeclare holds the configuration of a queue to hold messages and deliver to consumers. Declaring creates a queue if it doesn't already exist, or ensures that an existing queue matches the same parameters For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueDeclare", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueDeclareConfig"), + }, + }, + "queueBind": { + SchemaProps: spec.SchemaProps{ + Description: "QueueBind holds the configuration that binds an exchange to a queue so that publishings to the exchange will be routed to the queue when the publishing routing key matches the binding routing key For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueBind", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueBindConfig"), + }, + }, + "consume": { + SchemaProps: spec.SchemaProps{ + Description: "Consume holds the configuration to immediately starts delivering queued messages For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.Consume", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPConsumeConfig"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth hosts secret selectors for username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "urlSecret": { + SchemaProps: spec.SchemaProps{ + Description: "URLSecret is secret reference for rabbitmq service URL", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"exchangeName", "exchangeType", "routingKey"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPConsumeConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPExchangeDeclareConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueBindConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueDeclareConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPExchangeDeclareConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPExchangeDeclareConfig holds the configuration for the exchange on the server", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "durable": { + SchemaProps: spec.SchemaProps{ + Description: "Durable keeps the exchange also after the server restarts", + Type: []string{"boolean"}, + Format: "", + }, + }, + "autoDelete": { + SchemaProps: spec.SchemaProps{ + Description: "AutoDelete removes the exchange when no bindings are active", + Type: []string{"boolean"}, + Format: "", + }, + }, + "internal": { + SchemaProps: spec.SchemaProps{ + Description: "Internal when true does not accept publishings", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait when true does not wait for a confirmation from the server", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPQueueBindConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPQueueBindConfig holds the configuration that binds an exchange to a queue so that publishings to the exchange will be routed to the queue when the publishing routing key matches the binding routing key", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait false and the queue could not be bound, the channel will be closed with an error", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPQueueDeclareConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPQueueDeclareConfig holds the configuration of a queue to hold messages and deliver to consumers. Declaring creates a queue if it doesn't already exist, or ensures that an existing queue matches the same parameters", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the queue. If empty the server auto-generates a unique name for this queue", + Type: []string{"string"}, + Format: "", + }, + }, + "durable": { + SchemaProps: spec.SchemaProps{ + Description: "Durable keeps the queue also after the server restarts", + Type: []string{"boolean"}, + Format: "", + }, + }, + "autoDelete": { + SchemaProps: spec.SchemaProps{ + Description: "AutoDelete removes the queue when no consumers are active", + Type: []string{"boolean"}, + Format: "", + }, + }, + "exclusive": { + SchemaProps: spec.SchemaProps{ + Description: "Exclusive sets the queues to be accessible only by the connection that declares them and will be deleted wgen the connection closes", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait when true, the queue assumes to be declared on the server", + Type: []string{"boolean"}, + Format: "", + }, + }, + "arguments": { + SchemaProps: spec.SchemaProps{ + Description: "Arguments of a queue (also known as \"x-arguments\") used for optional features and plugins", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AWSLambdaTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AWSLambdaTrigger refers to specification of the trigger to invoke an AWS Lambda function", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "functionName": { + SchemaProps: spec.SchemaProps{ + Description: "FunctionName refers to the name of the function to invoke.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "accessKey": { + SchemaProps: spec.SchemaProps{ + Description: "AccessKey refers K8s secret containing aws access key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "SecretKey refers K8s secret containing aws secret key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "Region is AWS region", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "invocationType": { + SchemaProps: spec.SchemaProps{ + Description: "Choose from the following options.\n\n * RequestResponse (default) - Invoke the function synchronously. Keep\n the connection open until the function returns a response or times out.\n The API response includes the function response and additional data.\n\n * Event - Invoke the function asynchronously. Send events that fail multiple\n times to the function's dead-letter queue (if it's configured). The API\n response only includes a status code.\n\n * DryRun - Validate parameter values and verify that the user or role\n has permission to invoke the function.", + Type: []string{"string"}, + Format: "", + }, + }, + "roleARN": { + SchemaProps: spec.SchemaProps{ + Description: "RoleARN is the Amazon Resource Name (ARN) of the role to assume.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"functionName", "region", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Amount(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Amount represent a numeric amount.", + Type: v1alpha1.Amount{}.OpenAPISchemaType(), + Format: v1alpha1.Amount{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ArgoWorkflowTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ArgoWorkflowTrigger is the trigger for the Argo Workflow", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source of the K8s resource file(s)", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation"), + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation refers to the type of operation performed on the argo workflow resource. Default value is Submit.", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters to pass to resolved Argo Workflow object", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "args": { + SchemaProps: spec.SchemaProps{ + Description: "Args is the list of arguments to pass to the argo CLI", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ArtifactLocation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ArtifactLocation describes the source location for an external artifact", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "s3": { + SchemaProps: spec.SchemaProps{ + Description: "S3 compliant artifact", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact"), + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline artifact is embedded in sensor spec as a string", + Type: []string{"string"}, + Format: "", + }, + }, + "file": { + SchemaProps: spec.SchemaProps{ + Description: "File artifact is artifact stored in a file", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileArtifact"), + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to fetch the artifact from", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.URLArtifact"), + }, + }, + "configmap": { + SchemaProps: spec.SchemaProps{ + Description: "Configmap that stores the artifact", + Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), + }, + }, + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git repository hosting the artifact", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitArtifact"), + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "Resource is generic template for K8s resource", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResource"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileArtifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitArtifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.URLArtifact", "k8s.io/api/core/v1.ConfigMapKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureEventHubsTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureEventHubsTrigger refers to specification of the Azure Event Hubs Trigger", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "fqdn": { + SchemaProps: spec.SchemaProps{ + Description: "FQDN refers to the namespace dns of Azure Event Hubs to be used i.e. .servicebus.windows.net", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "hubName": { + SchemaProps: spec.SchemaProps{ + Description: "HubName refers to the Azure Event Hub to send events to", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sharedAccessKeyName": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKeyName refers to the name of the Shared Access Key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sharedAccessKey": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKey refers to a K8s secret containing the primary key for the", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"fqdn", "hubName", "sharedAccessKeyName", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureEventsHubEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureEventsHubEventSource describes the event source for azure events hub More info at https://docs.microsoft.com/en-us/azure/event-hubs/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "fqdn": { + SchemaProps: spec.SchemaProps{ + Description: "FQDN of the EventHubs namespace you created More info at https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sharedAccessKeyName": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKeyName is the name you chose for your application's SAS keys. If both this field and SharedAccessKey are not provided it will try to access via Azure AD with DefaultAzureCredential, FQDN and HubName.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sharedAccessKey": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKey is the generated value of the key. If both this field and SharedAccessKeyName are not provided it will try to access via Azure AD with DefaultAzureCredential, FQDN and HubName.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "hubName": { + SchemaProps: spec.SchemaProps{ + Description: "Event Hub path/name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"fqdn", "hubName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureQueueStorageEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureQueueStorageEventSource describes the event source for azure queue storage more info at https://learn.microsoft.com/en-us/azure/storage/queues/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storageAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "StorageAccountName is the name of the storage account where the queue is. This field is necessary to access via Azure AD (managed identity) and it is ignored if ConnectionString is set.", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionString": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionString is the connection string to access Azure Queue Storage. If this fields is not provided it will try to access via Azure AD with StorageAccountName.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "queueName": { + SchemaProps: spec.SchemaProps{ + Description: "QueueName is the name of the queue", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "dlq": { + SchemaProps: spec.SchemaProps{ + Description: "DLQ specifies if a dead-letter queue is configured for messages that can't be processed successfully. If set to true, messages with invalid payload won't be acknowledged to allow to forward them farther to the dead-letter queue. The default value is false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "decodeMessage": { + SchemaProps: spec.SchemaProps{ + Description: "DecodeMessage specifies if all the messages should be base64 decoded. If set to true the decoding is done before the evaluation of JSONBody", + Type: []string{"boolean"}, + Format: "", + }, + }, + "waitTimeInSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "WaitTimeInSeconds is the duration (in seconds) for which the event source waits between empty results from the queue. The default value is 3 seconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"queueName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureServiceBusEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureServiceBusEventSource describes the event source for azure service bus More info at https://docs.microsoft.com/en-us/azure/service-bus-messaging/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "connectionString": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionString is the connection string for the Azure Service Bus. If this fields is not provided it will try to access via Azure AD with DefaultAzureCredential and FullyQualifiedNamespace.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "queueName": { + SchemaProps: spec.SchemaProps{ + Description: "QueueName is the name of the Azure Service Bus Queue", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topicName": { + SchemaProps: spec.SchemaProps{ + Description: "TopicName is the name of the Azure Service Bus Topic", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subscriptionName": { + SchemaProps: spec.SchemaProps{ + Description: "SubscriptionName is the name of the Azure Service Bus Topic Subscription", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the service bus client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "fullyQualifiedNamespace": { + SchemaProps: spec.SchemaProps{ + Description: "FullyQualifiedNamespace is the Service Bus namespace name (ex: myservicebus.servicebus.windows.net). This field is necessary to access via Azure AD (managed identity) and it is ignored if ConnectionString is set.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"queueName", "topicName", "subscriptionName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureServiceBusTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "connectionString": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionString is the connection string for the Azure Service Bus", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "queueName": { + SchemaProps: spec.SchemaProps{ + Description: "QueueName is the name of the Azure Service Bus Queue", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topicName": { + SchemaProps: spec.SchemaProps{ + Description: "TopicName is the name of the Azure Service Bus Topic", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subscriptionName": { + SchemaProps: spec.SchemaProps{ + Description: "SubscriptionName is the name of the Azure Service Bus Topic Subscription", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the service bus client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"queueName", "topicName", "subscriptionName", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Backoff(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Backoff for an operation", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "duration": { + SchemaProps: spec.SchemaProps{ + Description: "The initial duration in nanoseconds or strings like \"1s\", \"3m\"", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Int64OrString"), + }, + }, + "factor": { + SchemaProps: spec.SchemaProps{ + Description: "Duration is multiplied by factor each iteration", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount"), + }, + }, + "jitter": { + SchemaProps: spec.SchemaProps{ + Description: "The amount of jitter applied each iteration", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount"), + }, + }, + "steps": { + SchemaProps: spec.SchemaProps{ + Description: "Exit with error after this many steps", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Int64OrString"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BasicAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BasicAuth contains the reference to K8s secrets that holds the username and password", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username refers to the Kubernetes secret that holds the username required for basic auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password refers to the Kubernetes secret that holds the password required for basic auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketAuth holds the different auth strategies for connecting to Bitbucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "basic": { + SchemaProps: spec.SchemaProps{ + Description: "Basic is BasicAuth auth strategy.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketBasicAuth"), + }, + }, + "oauthToken": { + SchemaProps: spec.SchemaProps{ + Description: "OAuthToken refers to the K8s secret that holds the OAuth Bearer token.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketBasicAuth", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketBasicAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketBasicAuth holds the information required to authenticate user via basic auth mechanism", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username refers to the K8s secret that holds the username.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password refers to the K8s secret that holds the password.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"username", "password"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketEventSource describes the event source for Bitbucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the defined Bitbucket hook once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will be passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook refers to the configuration required to run an http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth information required to connect to Bitbucket.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketAuth"), + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events this webhook is subscribed to.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedOwner is the owner of the repository. Deprecated: use Repositories instead. Will be unsupported in v1.9", + Type: []string{"string"}, + Format: "", + }, + }, + "projectKey": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedProjectKey is the key of the project to which the repository relates Deprecated: use Repositories instead. Will be unsupported in v1.9", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedRepositorySlug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL Deprecated: use Repositories instead. Will be unsupported in v1.9", + Type: []string{"string"}, + Format: "", + }, + }, + "repositories": { + SchemaProps: spec.SchemaProps{ + Description: "Repositories holds a list of repositories for which integration needs to set up", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketRepository"), + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"webhook", "auth", "events"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketRepository", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketRepository(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner is the owner of the repository", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "RepositorySlug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"owner", "repositorySlug"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketServerEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketServerEventSource refers to event-source related to Bitbucket Server events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration to run a http server.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "projectKey": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedProjectKey is the key of project for which integration needs to set up. Deprecated: use Repositories instead. Will be unsupported in v1.8.", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedRepositorySlug is the slug of the repository for which integration needs to set up. Deprecated: use Repositories instead. Will be unsupported in v1.8.", + Type: []string{"string"}, + Format: "", + }, + }, + "projects": { + SchemaProps: spec.SchemaProps{ + Description: "Projects holds a list of projects for which integration needs to set up, this will add the webhook to all repositories in the project.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "repositories": { + SchemaProps: spec.SchemaProps{ + Description: "Repositories holds a list of repositories for which integration needs to set up.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerRepository"), + }, + }, + }, + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events are bitbucket event to listen to. Refer https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "skipBranchRefsChangedOnOpenPR": { + SchemaProps: spec.SchemaProps{ + Description: "SkipBranchRefsChangedOnOpenPR bypasses the event repo:refs_changed for branches whenever there's an associated open pull request. This helps in optimizing the event handling process by avoiding unnecessary triggers for branch reference changes that are already part of a pull request under review.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "oneEventPerChange": { + SchemaProps: spec.SchemaProps{ + Description: "OneEventPerChange controls whether to process each change in a repo:refs_changed webhook event as a separate event. This setting is useful when multiple tags are pushed simultaneously for the same commit, and each tag needs to independently trigger an action, such as a distinct workflow in Argo Workflows. When enabled, the BitbucketServerEventSource publishes an individual BitbucketServerEventData for each change, ensuring independent processing of each tag or reference update in a single webhook event.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "accessToken": { + SchemaProps: spec.SchemaProps{ + Description: "AccessToken is reference to K8s secret which holds the bitbucket api access information.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "webhookSecret": { + SchemaProps: spec.SchemaProps{ + Description: "WebhookSecret is reference to K8s secret which holds the bitbucket webhook secret (for HMAC validation).", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "bitbucketserverBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "BitbucketServerBaseURL is the base URL for API requests to a custom endpoint.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the Bitbucket Server hook for the project once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the bitbucketserver client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "checkInterval": { + SchemaProps: spec.SchemaProps{ + Description: "CheckInterval is a duration in which to wait before checking that the webhooks exist, e.g. 1s, 30m, 2h... (defaults to 1m)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"bitbucketserverBaseURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerRepository", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketServerRepository(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "projectKey": { + SchemaProps: spec.SchemaProps{ + Description: "ProjectKey is the key of project for which integration needs to set up.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "RepositorySlug is the slug of the repository for which integration needs to set up.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"projectKey", "repositorySlug"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_BusConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BusConfig has the finalized configuration for EventBus", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nats": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig"), + }, + }, + "jetstream": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig"), + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_CalendarEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CalendarEventSource describes a time based dependency. One of the fields (schedule, interval, or recurrence) must be passed. Schedule takes precedence over interval; interval takes precedence over recurrence", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "schedule": { + SchemaProps: spec.SchemaProps{ + Description: "Schedule is a cron-like expression. For reference, see: https://en.wikipedia.org/wiki/Cron", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "interval": { + SchemaProps: spec.SchemaProps{ + Description: "Interval is a string that describes an interval duration, e.g. 1s, 30m, 2h...", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "exclusionDates": { + SchemaProps: spec.SchemaProps{ + Description: "ExclusionDates defines the list of DATE-TIME exceptions for recurring events.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "timezone": { + SchemaProps: spec.SchemaProps{ + Description: "Timezone in which to run the schedule", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "persistence": { + SchemaProps: spec.SchemaProps{ + Description: "Persistence hold the configuration for event persistence", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventPersistence"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventPersistence", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_CatchupConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Description: "Enabled enables to triggered the missed schedule when eventsource restarts", + Type: []string{"boolean"}, + Format: "", + }, + }, + "maxDuration": { + SchemaProps: spec.SchemaProps{ + Description: "MaxDuration holds max catchup duration", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Condition contains details about resource state", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Condition type.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Condition status, True, False or Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "Last time the condition transitioned from one status to another.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. For example, \"ImageNotFound\"", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "Human-readable message indicating details about last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ConditionsResetByTime(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "cron": { + SchemaProps: spec.SchemaProps{ + Description: "Cron is a cron-like expression. For reference, see: https://en.wikipedia.org/wiki/Cron", + Type: []string{"string"}, + Format: "", + }, + }, + "timezone": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ConditionsResetCriteria(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "byTime": { + SchemaProps: spec.SchemaProps{ + Description: "Schedule is a cron-like expression. For reference, see: https://en.wikipedia.org/wiki/Cron", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ConfigMapPersistence(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the configmap", + Type: []string{"string"}, + Format: "", + }, + }, + "createIfNotExist": { + SchemaProps: spec.SchemaProps{ + Description: "CreateIfNotExist will create configmap if it doesn't exists", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Container(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Container defines customized spec for a container", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resources": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "imagePullPolicy": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecurityContext"), + }, + }, + "volumeMounts": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.VolumeMount"), + }, + }, + }, + }, + }, + "env": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.EnvVar"), + }, + }, + }, + }, + }, + "envFrom": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.EnvFromSource"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeMount"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ContainerTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerTemplate defines customized spec for a container", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resources": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "imagePullPolicy": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecurityContext"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_CustomTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomTrigger refers to the specification of the custom trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "serverURL": { + SchemaProps: spec.SchemaProps{ + Description: "ServerURL is the url of the gRPC server that executes custom trigger", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "secure": { + SchemaProps: spec.SchemaProps{ + Description: "Secure refers to type of the connection between sensor to custom trigger gRPC", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "certSecret": { + SchemaProps: spec.SchemaProps{ + Description: "CertSecret refers to the secret that contains cert for secure connection between sensor and custom trigger gRPC server.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "serverNameOverride": { + SchemaProps: spec.SchemaProps{ + Description: "ServerNameOverride for the secure connection between sensor and custom trigger gRPC server.", + Type: []string{"string"}, + Format: "", + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "Spec is the custom trigger resource specification that custom trigger gRPC server knows how to interpret.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved custom trigger trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"serverURL", "secure", "spec", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_DataFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DataFilter describes constraints and filters for event data Regular Expressions are purposefully not a feature as they are overkill for our uses here See Rob Pike's Post: https://commandcenter.blogspot.com/2011/08/regular-expressions-in-lexing-and.html", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is the JSONPath of the event's (JSON decoded) data key Path is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type contains the JSON type of the data", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value is the allowed string values for this key Booleans are passed using strconv.ParseBool() Numbers are parsed using as float64 using strconv.ParseFloat() Strings are taken as is Nils this value is ignored", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "comparator": { + SchemaProps: spec.SchemaProps{ + Description: "Comparator compares the event data with a user given value. Can be \">=\", \">\", \"=\", \"!=\", \"<\", or \"<=\". Is optional, and if left blank treated as equality \"=\".", + Type: []string{"string"}, + Format: "", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is a go-template for extracting a string from the event's data. A Template is evaluated with provided path, type and value. The templating follows the standard go-template syntax as well as sprig's extra functions. See https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"path", "type", "value"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_EmailTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EmailTrigger refers to the specification of the email notification trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username refers to the username used to connect to the smtp server.", + Type: []string{"string"}, + Format: "", + }, + }, + "smtpPassword": { + SchemaProps: spec.SchemaProps{ + Description: "SMTPPassword refers to the Kubernetes secret that holds the smtp password used to connect to smtp server.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "host": { + SchemaProps: spec.SchemaProps{ + Description: "Host refers to the smtp host url to which email is send.", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port refers to the smtp server port to which email is send. Defaults to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "to": { + SchemaProps: spec.SchemaProps{ + Description: "To refers to the email addresses to which the emails are send.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "from": { + SchemaProps: spec.SchemaProps{ + Description: "From refers to the address from which the email is send from.", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Subject refers to the subject line for the email send.", + Type: []string{"string"}, + Format: "", + }, + }, + "body": { + SchemaProps: spec.SchemaProps{ + Description: "Body refers to the body/content of the email send.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EmitterEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EmitterEventSource describes the event source for emitter More info at https://emitter.io/develop/getting-started/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "broker": { + SchemaProps: spec.SchemaProps{ + Description: "Broker URI to connect to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "channelKey": { + SchemaProps: spec.SchemaProps{ + Description: "ChannelKey refers to the channel key", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "channelName": { + SchemaProps: spec.SchemaProps{ + Description: "ChannelName refers to the channel name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username to use to connect to broker", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password to use to connect to broker", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the emitter client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"broker", "channelKey", "channelName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Event represents the cloudevent received from an event source.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "context": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext"), + }, + }, + "data": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "byte", + }, + }, + }, + Required: []string{"data"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBus is the definition of a eventbus resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusStatus"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusSpec", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBusList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBusList is the list of eventbus resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBus"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBusSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBusSpec refers to specification of eventbus resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nats": { + SchemaProps: spec.SchemaProps{ + Description: "NATS eventbus", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSBus"), + }, + }, + "jetstream": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamBus"), + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka eventbus", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus"), + }, + }, + "jetstreamExotic": { + SchemaProps: spec.SchemaProps{ + Description: "Exotic JetStream", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamBus", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSBus"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBusStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBusStatus holds the status of the eventbus resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Config holds the fininalized configuration of EventBus", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BusConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BusConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventContext(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventContext holds the context of the cloudevent received from an event source.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Description: "ID of the event; must be non-empty and unique within the scope of the producer.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source - A URI describing the event producer.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "specversion": { + SchemaProps: spec.SchemaProps{ + Description: "SpecVersion - The version of the CloudEvents specification used by the event.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type - The type of the occurrence which has happened.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "datacontenttype": { + SchemaProps: spec.SchemaProps{ + Description: "DataContentType - A MIME (RFC2046) string describing the media type of `data`.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Subject - The subject of the event in the context of the event producer", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "time": { + SchemaProps: spec.SchemaProps{ + Description: "Time - A Timestamp when the event happened.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"id", "source", "specversion", "type", "datacontenttype", "subject", "time"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventDependency(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventDependency describes a dependency", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is a unique name of this dependency", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "eventSourceName": { + SchemaProps: spec.SchemaProps{ + Description: "EventSourceName is the name of EventSource that Sensor depends on", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "eventName": { + SchemaProps: spec.SchemaProps{ + Description: "EventName is the name of the event", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "filters": { + SchemaProps: spec.SchemaProps{ + Description: "Filters and rules governing toleration of success and constraints on the context and data of an event", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyFilter"), + }, + }, + "transform": { + SchemaProps: spec.SchemaProps{ + Description: "Transform transforms the event data", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyTransformer"), + }, + }, + "filtersLogicalOperator": { + SchemaProps: spec.SchemaProps{ + Description: "FiltersLogicalOperator defines how different filters are evaluated together. Available values: and (&&), or (||) Is optional and if left blank treated as and (&&).", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "eventSourceName", "eventName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyTransformer"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventDependencyFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventDependencyFilter defines filters and constraints for a event.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "time": { + SchemaProps: spec.SchemaProps{ + Description: "Time filter on the event with escalation", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TimeFilter"), + }, + }, + "context": { + SchemaProps: spec.SchemaProps{ + Description: "Context filter constraints", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext"), + }, + }, + "data": { + SchemaProps: spec.SchemaProps{ + Description: "Data filter constraints with escalation", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter"), + }, + }, + }, + }, + }, + "exprs": { + SchemaProps: spec.SchemaProps{ + Description: "Exprs contains the list of expressions evaluated against the event payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ExprFilter"), + }, + }, + }, + }, + }, + "dataLogicalOperator": { + SchemaProps: spec.SchemaProps{ + Description: "DataLogicalOperator defines how multiple Data filters (if defined) are evaluated together. Available values: and (&&), or (||) Is optional and if left blank treated as and (&&).", + Type: []string{"string"}, + Format: "", + }, + }, + "exprLogicalOperator": { + SchemaProps: spec.SchemaProps{ + Description: "ExprLogicalOperator defines how multiple Exprs filters (if defined) are evaluated together. Available values: and (&&), or (||) Is optional and if left blank treated as and (&&).", + Type: []string{"string"}, + Format: "", + }, + }, + "script": { + SchemaProps: spec.SchemaProps{ + Description: "Script refers to a Lua script evaluated to determine the validity of an event.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ExprFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TimeFilter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventDependencyTransformer(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventDependencyTransformer transforms the event", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "jq": { + SchemaProps: spec.SchemaProps{ + Description: "JQ holds the jq command applied for transformation", + Type: []string{"string"}, + Format: "", + }, + }, + "script": { + SchemaProps: spec.SchemaProps{ + Description: "Script refers to a Lua script used to transform the event", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_EventPersistence(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "catchup": { + SchemaProps: spec.SchemaProps{ + Description: "Catchup enables to triggered the missed schedule when eventsource restarts", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CatchupConfiguration"), + }, + }, + "configMap": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigMap holds configmap details for persistence", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CatchupConfiguration", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSource is the definition of a eventsource resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceStatus"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceSpec", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "expression": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSourceList is the list of eventsource resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSource"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSource", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSourceSpec refers to specification of event-source resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "eventBusName": { + SchemaProps: spec.SchemaProps{ + Description: "EventBusName references to a EventBus name. By default the value is \"default\"", + Type: []string{"string"}, + Format: "", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the pod specification for the event source", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template"), + }, + }, + "service": { + SchemaProps: spec.SchemaProps{ + Description: "Service is the specifications of the service to expose the event source", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Service"), + }, + }, + "minio": { + SchemaProps: spec.SchemaProps{ + Description: "Minio event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact"), + }, + }, + }, + }, + }, + "calendar": { + SchemaProps: spec.SchemaProps{ + Description: "Calendar event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CalendarEventSource"), + }, + }, + }, + }, + }, + "file": { + SchemaProps: spec.SchemaProps{ + Description: "File event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileEventSource"), + }, + }, + }, + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "Resource event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceEventSource"), + }, + }, + }, + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookEventSource"), + }, + }, + }, + }, + }, + "amqp": { + SchemaProps: spec.SchemaProps{ + Description: "AMQP event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPEventSource"), + }, + }, + }, + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaEventSource"), + }, + }, + }, + }, + }, + "mqtt": { + SchemaProps: spec.SchemaProps{ + Description: "MQTT event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.MQTTEventSource"), + }, + }, + }, + }, + }, + "nats": { + SchemaProps: spec.SchemaProps{ + Description: "NATS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSEventsSource"), + }, + }, + }, + }, + }, + "sns": { + SchemaProps: spec.SchemaProps{ + Description: "SNS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SNSEventSource"), + }, + }, + }, + }, + }, + "sqs": { + SchemaProps: spec.SchemaProps{ + Description: "SQS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SQSEventSource"), + }, + }, + }, + }, + }, + "pubSub": { + SchemaProps: spec.SchemaProps{ + Description: "PubSub event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PubSubEventSource"), + }, + }, + }, + }, + }, + "github": { + SchemaProps: spec.SchemaProps{ + Description: "Github event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubEventSource"), + }, + }, + }, + }, + }, + "gitlab": { + SchemaProps: spec.SchemaProps{ + Description: "Gitlab event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitlabEventSource"), + }, + }, + }, + }, + }, + "hdfs": { + SchemaProps: spec.SchemaProps{ + Description: "HDFS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HDFSEventSource"), + }, + }, + }, + }, + }, + "slack": { + SchemaProps: spec.SchemaProps{ + Description: "Slack event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackEventSource"), + }, + }, + }, + }, + }, + "storageGrid": { + SchemaProps: spec.SchemaProps{ + Description: "StorageGrid event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridEventSource"), + }, + }, + }, + }, + }, + "azureEventsHub": { + SchemaProps: spec.SchemaProps{ + Description: "AzureEventsHub event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventsHubEventSource"), + }, + }, + }, + }, + }, + "stripe": { + SchemaProps: spec.SchemaProps{ + Description: "Stripe event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StripeEventSource"), + }, + }, + }, + }, + }, + "emitter": { + SchemaProps: spec.SchemaProps{ + Description: "Emitter event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmitterEventSource"), + }, + }, + }, + }, + }, + "redis": { + SchemaProps: spec.SchemaProps{ + Description: "Redis event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisEventSource"), + }, + }, + }, + }, + }, + "nsq": { + SchemaProps: spec.SchemaProps{ + Description: "NSQ event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NSQEventSource"), + }, + }, + }, + }, + }, + "pulsar": { + SchemaProps: spec.SchemaProps{ + Description: "Pulsar event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarEventSource"), + }, + }, + }, + }, + }, + "generic": { + SchemaProps: spec.SchemaProps{ + Description: "Generic event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GenericEventSource"), + }, + }, + }, + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the event source deployment replicas", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "bitbucketserver": { + SchemaProps: spec.SchemaProps{ + Description: "Bitbucket Server event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerEventSource"), + }, + }, + }, + }, + }, + "bitbucket": { + SchemaProps: spec.SchemaProps{ + Description: "Bitbucket event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketEventSource"), + }, + }, + }, + }, + }, + "redisStream": { + SchemaProps: spec.SchemaProps{ + Description: "Redis stream source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisStreamEventSource"), + }, + }, + }, + }, + }, + "azureServiceBus": { + SchemaProps: spec.SchemaProps{ + Description: "Azure Service Bus event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusEventSource"), + }, + }, + }, + }, + }, + "azureQueueStorage": { + SchemaProps: spec.SchemaProps{ + Description: "AzureQueueStorage event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureQueueStorageEventSource"), + }, + }, + }, + }, + }, + "sftp": { + SchemaProps: spec.SchemaProps{ + Description: "SFTP event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SFTPEventSource"), + }, + }, + }, + }, + }, + "gerrit": { + SchemaProps: spec.SchemaProps{ + Description: "Gerrit event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GerritEventSource"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventsHubEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureQueueStorageEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CalendarEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmitterEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GenericEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GerritEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitlabEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HDFSEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.MQTTEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSEventsSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NSQEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PubSubEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisStreamEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SFTPEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SNSEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SQSEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Service", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StripeEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookEventSource"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSourceStatus holds the status of the event-source resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ExprFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "expr": { + SchemaProps: spec.SchemaProps{ + Description: "Expr refers to the expression that determines the outcome of the filter.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "fields": { + SchemaProps: spec.SchemaProps{ + Description: "Fields refers to set of keys that refer to the paths within event payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PayloadField"), + }, + }, + }, + }, + }, + }, + Required: []string{"expr", "fields"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PayloadField"}, + } +} + +func schema_pkg_apis_events_v1alpha1_FileArtifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FileArtifact contains information about an artifact in a filesystem", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_FileEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FileEventSource describes an event-source for file related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "eventType": { + SchemaProps: spec.SchemaProps{ + Description: "Type of file operations to watch Refer https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more information", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "watchPathConfig": { + SchemaProps: spec.SchemaProps{ + Description: "WatchPathConfig contains configuration about the file path to watch", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig"), + }, + }, + "polling": { + SchemaProps: spec.SchemaProps{ + Description: "Use polling instead of inotify", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"eventType", "watchPathConfig"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GenericEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GenericEventSource refers to a generic event source. It can be used to implement a custom event source.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL of the gRPC server that implements the event source.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Config is the event source configuration", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "insecure": { + SchemaProps: spec.SchemaProps{ + Description: "Insecure determines the type of connection.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authSecret": { + SchemaProps: spec.SchemaProps{ + Description: "AuthSecret holds a secret selector that contains a bearer token for authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"url", "config"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GerritEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GerritEventSource refers to event-source related to gerrit events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration to run a http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "hookName": { + SchemaProps: spec.SchemaProps{ + Description: "HookName is the name of the webhook", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events are gerrit event to listen to. Refer https://gerrit-review.googlesource.com/Documentation/cmd-stream-events.html#events", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth hosts secret selectors for username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "gerritBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "GerritBaseURL is the base URL for API requests to a custom endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the Gerrit hook for the project once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "projects": { + SchemaProps: spec.SchemaProps{ + Description: "List of project namespace paths like \"whynowy/test\".", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "sslVerify": { + SchemaProps: spec.SchemaProps{ + Description: "SslVerify to enable ssl verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"hookName", "events", "gerritBaseURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitArtifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitArtifact contains information about an artifact stored in git", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Git URL", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "cloneDirectory": { + SchemaProps: spec.SchemaProps{ + Description: "Directory to clone the repository. We clone complete directory because GitArtifact is not limited to any specific Git service providers. Hence we don't use any specific git provider client.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "creds": { + SchemaProps: spec.SchemaProps{ + Description: "Creds contain reference to git username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitCreds"), + }, + }, + "sshKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "SSHKeySecret refers to the secret that contains SSH key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filePath": { + SchemaProps: spec.SchemaProps{ + Description: "Path to file that contains trigger resource definition", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "branch": { + SchemaProps: spec.SchemaProps{ + Description: "Branch to use to pull trigger resource", + Type: []string{"string"}, + Format: "", + }, + }, + "tag": { + SchemaProps: spec.SchemaProps{ + Description: "Tag to use to pull trigger resource", + Type: []string{"string"}, + Format: "", + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Description: "Ref to use to pull trigger resource. Will result in a shallow clone and fetch.", + Type: []string{"string"}, + Format: "", + }, + }, + "remote": { + SchemaProps: spec.SchemaProps{ + Description: "Remote to manage set of tracked repositories. Defaults to \"origin\". Refer https://git-scm.com/docs/git-remote", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitRemoteConfig"), + }, + }, + "insecureIgnoreHostKey": { + SchemaProps: spec.SchemaProps{ + Description: "Whether to ignore host key", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"url", "cloneDirectory", "filePath"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitCreds", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitRemoteConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitCreds(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitCreds contain reference to git username and password", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitRemoteConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitRemoteConfig contains the configuration of a Git remote", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the remote to fetch from.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "urls": { + SchemaProps: spec.SchemaProps{ + Description: "URLs the URLs of a remote repository. It must be non-empty. Fetch will always use the first URL, while push will use all of them.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"name", "urls"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_GithubAppCreds(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "privateKey": { + SchemaProps: spec.SchemaProps{ + Description: "PrivateKey refers to a K8s secret containing the GitHub app private key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "appID": { + SchemaProps: spec.SchemaProps{ + Description: "AppID refers to the GitHub App ID for the application you created", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "installationID": { + SchemaProps: spec.SchemaProps{ + Description: "InstallationID refers to the Installation ID of the GitHub app you created and installed", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"privateKey", "appID", "installationID"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GithubEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GithubEventSource refers to event-source for github related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Description: "Id is the webhook's id Deprecated: This is not used at all, will be removed in v1.6", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook refers to the configuration required to run a http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedOwner refers to GitHub owner name i.e. argoproj Deprecated: use Repositories instead. Will be unsupported in v 1.6", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "repository": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedRepository refers to GitHub repo name i.e. argo-events Deprecated: use Repositories instead. Will be unsupported in v 1.6", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events refer to Github events to which the event source will subscribe", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "apiToken": { + SchemaProps: spec.SchemaProps{ + Description: "APIToken refers to a K8s secret containing github api token", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "webhookSecret": { + SchemaProps: spec.SchemaProps{ + Description: "WebhookSecret refers to K8s secret containing GitHub webhook secret https://developer.github.com/webhooks/securing/", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "insecure": { + SchemaProps: spec.SchemaProps{ + Description: "Insecure tls verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "active": { + SchemaProps: spec.SchemaProps{ + Description: "Active refers to status of the webhook for event deliveries. https://developer.github.com/webhooks/creating/#active", + Type: []string{"boolean"}, + Format: "", + }, + }, + "contentType": { + SchemaProps: spec.SchemaProps{ + Description: "ContentType of the event delivery", + Type: []string{"string"}, + Format: "", + }, + }, + "githubBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "GitHub base URL (for GitHub Enterprise)", + Type: []string{"string"}, + Format: "", + }, + }, + "githubUploadURL": { + SchemaProps: spec.SchemaProps{ + Description: "GitHub upload URL (for GitHub Enterprise)", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the GitHub hook for the repository once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "repositories": { + SchemaProps: spec.SchemaProps{ + Description: "Repositories holds the information of repositories, which uses repo owner as the key, and list of repo names as the value. Not required if Organizations is set.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OwnedRepositories"), + }, + }, + }, + }, + }, + "organizations": { + SchemaProps: spec.SchemaProps{ + Description: "Organizations holds the names of organizations (used for organization level webhooks). Not required if Repositories is set.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "githubApp": { + SchemaProps: spec.SchemaProps{ + Description: "GitHubApp holds the GitHub app credentials", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubAppCreds"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"events"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubAppCreds", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OwnedRepositories", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitlabEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitlabEventSource refers to event-source related to Gitlab events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration to run a http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "projectID": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedProjectID is the id of project for which integration needs to setup Deprecated: use Projects instead. Will be unsupported in v 1.7", + Type: []string{"string"}, + Format: "", + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events are gitlab event to listen to. Refer https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "accessToken": { + SchemaProps: spec.SchemaProps{ + Description: "AccessToken references to k8 secret which holds the gitlab api access information", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "enableSSLVerification": { + SchemaProps: spec.SchemaProps{ + Description: "EnableSSLVerification to enable ssl verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "gitlabBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "GitlabBaseURL is the base URL for API requests to a custom endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the GitLab hook for the project once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "projects": { + SchemaProps: spec.SchemaProps{ + Description: "List of project IDs or project namespace paths like \"whynowy/test\". If neither a project nor a group is defined, the EventSource will not manage webhooks.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "secretToken": { + SchemaProps: spec.SchemaProps{ + Description: "SecretToken references to k8 secret which holds the Secret Token used by webhook config", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "groups": { + SchemaProps: spec.SchemaProps{ + Description: "List of group IDs or group name like \"test\". Group level hook available in Premium and Ultimate Gitlab.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"events", "gitlabBaseURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_HDFSEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HDFSEventSource refers to event-source for HDFS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "directory": { + SchemaProps: spec.SchemaProps{ + Description: "Directory to watch for events", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + "pathRegexp": { + SchemaProps: spec.SchemaProps{ + Description: "PathRegexp is regexp of relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of file operations to watch", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "checkInterval": { + SchemaProps: spec.SchemaProps{ + Description: "CheckInterval is a string that describes an interval duration to check the directory state, e.g. 1s, 30m, 2h... (defaults to 1m)", + Type: []string{"string"}, + Format: "", + }, + }, + "addresses": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "hdfsUser": { + SchemaProps: spec.SchemaProps{ + Description: "HDFSUser is the user to access HDFS file system. It is ignored if either ccache or keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "krbCCacheSecret": { + SchemaProps: spec.SchemaProps{ + Description: "KrbCCacheSecret is the secret selector for Kerberos ccache Either ccache or keytab can be set to use Kerberos.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "krbKeytabSecret": { + SchemaProps: spec.SchemaProps{ + Description: "KrbKeytabSecret is the secret selector for Kerberos keytab Either ccache or keytab can be set to use Kerberos.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "krbUsername": { + SchemaProps: spec.SchemaProps{ + Description: "KrbUsername is the Kerberos username used with Kerberos keytab It must be set if keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "krbRealm": { + SchemaProps: spec.SchemaProps{ + Description: "KrbRealm is the Kerberos realm used with Kerberos keytab It must be set if keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "krbConfigConfigMap": { + SchemaProps: spec.SchemaProps{ + Description: "KrbConfig is the configmap selector for Kerberos config as string It must be set if either ccache or keytab is used.", + Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), + }, + }, + "krbServicePrincipalName": { + SchemaProps: spec.SchemaProps{ + Description: "KrbServicePrincipalName is the principal name of Kerberos service It must be set if either ccache or keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"directory", "type", "addresses"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_HTTPTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HTTPTrigger is the trigger for the HTTP request", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL refers to the URL to send HTTP request to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the HTTP client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "method": { + SchemaProps: spec.SchemaProps{ + Description: "Method refers to the type of the HTTP request. Refer https://golang.org/src/net/http/method.go for more info. Default value is POST.", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the HTTP trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "timeout": { + SchemaProps: spec.SchemaProps{ + Description: "Timeout refers to the HTTP request timeout in seconds. Default value is 60 seconds.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "basicAuth": { + SchemaProps: spec.SchemaProps{ + Description: "BasicAuth configuration for the http request.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "headers": { + SchemaProps: spec.SchemaProps{ + Description: "Headers for the HTTP request.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "secureHeaders": { + SchemaProps: spec.SchemaProps{ + Description: "Secure Headers stored in Kubernetes Secrets for the HTTP requests.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader"), + }, + }, + }, + }, + }, + }, + Required: []string{"url", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Int64OrString(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: v1alpha1.Int64OrString{}.OpenAPISchemaType(), + Format: v1alpha1.Int64OrString{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_JetStreamBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JetStreamBus holds the JetStream EventBus information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream version, such as \"2.7.3\"", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream StatefulSet size", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "containerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ContainerTemplate contains customized spec for Nats JetStream container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "reloaderContainerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ReloaderContainerTemplate contains customized spec for config reloader container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "metricsContainerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "MetricsContainerTemplate contains customized spec for metrics container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "persistence": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, indicates the Redis pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "The priority value. Various system components use this field to find the priority of the Redis pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "The pod's scheduling constraints More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName to apply to the StatefulSet", + Type: []string{"string"}, + Format: "", + }, + }, + "settings": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream configuration, if not specified, global settings in controller-config will be used. See https://docs.nats.io/running-a-nats-service/configuration#jetstream. Only configure \"max_memory_store\" or \"max_file_store\", do not set \"store_dir\" as it has been hardcoded.", + Type: []string{"string"}, + Format: "", + }, + }, + "startArgs": { + SchemaProps: spec.SchemaProps{ + Description: "Optional arguments to start nats-server. For example, \"-D\" to enable debugging output, \"-DV\" to enable debugging and tracing. Check https://docs.nats.io/ for all the available arguments.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "streamConfig": { + SchemaProps: spec.SchemaProps{ + Description: "Optional configuration for the streams to be created in this JetStream service, if specified, it will be merged with the default configuration in controller-config. It accepts a YAML format configuration, available fields include, \"maxBytes\", \"maxMsgs\", \"maxAge\" (e.g. 72h), \"replicas\" (1, 3, 5), \"duplicates\" (e.g. 5m), \"retention\" (e.g.\u00a00: Limits (default), 1: Interest, 2: WorkQueue), \"Discard\" (e.g.\u00a00: DiscardOld (default), 1: DiscardNew).", + Type: []string{"string"}, + Format: "", + }, + }, + "maxPayload": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of bytes in a message payload, 0 means unlimited. Defaults to 1MB", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + } +} + +func schema_pkg_apis_events_v1alpha1_JetStreamConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream (Nats) URL", + Type: []string{"string"}, + Format: "", + }, + }, + "accessSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Secret for auth", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "streamConfig": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "SSL/TLS settings for the NATS client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_K8SResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "K8SResource represent arbitrary structured data.", + Type: v1alpha1.K8SResource{}.OpenAPISchemaType(), + Format: v1alpha1.K8SResource{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_K8SResourcePolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "K8SResourcePolicy refers to the policy used to check the state of K8s based triggers using labels", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "Labels required to identify whether a resource is in success state", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "backoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff before checking resource state", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "errorOnBackoffTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "ErrorOnBackoffTimeout determines whether sensor should transition to error state if the trigger policy is unable to determine the state of the resource", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"backoff", "errorOnBackoffTimeout"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"}, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KafkaBus holds the KafkaBus EventBus information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to kafka cluster, multiple URLs separated by comma", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic name, defaults to {namespace_name}-{eventbus_name}", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka version, sarama defaults to the oldest supported stable version", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the kafka client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "sasl": { + SchemaProps: spec.SchemaProps{ + Description: "SASL configuration for the kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig"), + }, + }, + "consumerGroup": { + SchemaProps: spec.SchemaProps{ + Description: "Consumer group for kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaConsumerGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "groupName": { + SchemaProps: spec.SchemaProps{ + Description: "The name for the consumer group to use", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "oldest": { + SchemaProps: spec.SchemaProps{ + Description: "When starting up a new group do we want to start from the oldest event (true) or the newest event (false), defaults to false", + Type: []string{"boolean"}, + Format: "", + }, + }, + "rebalanceStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "Rebalance strategy can be one of: sticky, roundrobin, range. Range is the default.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"groupName"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KafkaEventSource refers to event-source for Kafka related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to kafka cluster, multiple URLs separated by comma", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "partition": { + SchemaProps: spec.SchemaProps{ + Description: "Partition name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the kafka client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "consumerGroup": { + SchemaProps: spec.SchemaProps{ + Description: "Consumer group for kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup"), + }, + }, + "limitEventsPerSecond": { + SchemaProps: spec.SchemaProps{ + Description: "Sets a limit on how many events get read from kafka per second.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Specify what kafka version is being connected to enables certain features in sarama, defaults to 1.0.0", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sasl": { + SchemaProps: spec.SchemaProps{ + Description: "SASL configuration for the kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Yaml format Sarama config for Kafka connection. It follows the struct of sarama.Config. See https://github.com/IBM/sarama/blob/main/config.go e.g.\n\nconsumer:\n fetch:\n min: 1\nnet:\n MaxOpenRequests: 5", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"url", "topic"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KafkaTrigger refers to the specification of the Kafka trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL of the Kafka broker, multiple URLs separated by comma.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the topic. More info at https://kafka.apache.org/documentation/#intro_topics", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "partition": { + SchemaProps: spec.SchemaProps{ + Description: "DEPRECATED", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved Kafka trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "requiredAcks": { + SchemaProps: spec.SchemaProps{ + Description: "RequiredAcks used in producer to tell the broker how many replica acknowledgements Defaults to 1 (Only wait for the leader to ack).", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "compress": { + SchemaProps: spec.SchemaProps{ + Description: "Compress determines whether to compress message or not. Defaults to false. If set to true, compresses message using snappy compression.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "flushFrequency": { + SchemaProps: spec.SchemaProps{ + Description: "FlushFrequency refers to the frequency in milliseconds to flush batches. Defaults to 500 milliseconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the Kafka producer.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "partitioningKey": { + SchemaProps: spec.SchemaProps{ + Description: "The partitioning key for the messages put on the Kafka topic.", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Specify what kafka version is being connected to enables certain features in sarama, defaults to 1.0.0", + Type: []string{"string"}, + Format: "", + }, + }, + "sasl": { + SchemaProps: spec.SchemaProps{ + Description: "SASL configuration for the kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig"), + }, + }, + "schemaRegistry": { + SchemaProps: spec.SchemaProps{ + Description: "Schema Registry configuration to producer message with avro format", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SchemaRegistryConfig"), + }, + }, + "headers": { + SchemaProps: spec.SchemaProps{ + Description: "Headers for the Kafka Messages.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "secureHeaders": { + SchemaProps: spec.SchemaProps{ + Description: "Secure Headers stored in Kubernetes Secrets for the Kafka messages.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader"), + }, + }, + }, + }, + }, + }, + Required: []string{"url", "topic", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SchemaRegistryConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_LogTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "intervalSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "Only print messages every interval. Useful to prevent logging too much data for busy events.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_MQTTEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MQTTEventSource refers to event-source for MQTT related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to connect to broker", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "clientId": { + SchemaProps: spec.SchemaProps{ + Description: "ClientID is the id of the client", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionBackoff holds backoff applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the mqtt client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth hosts secret selectors for username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + }, + Required: []string{"url", "topic", "clientId"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Metadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the annotations and labels of an event source pod", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "annotations": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "labels": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSAuth refers to the auth info for NATS EventSource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "basic": { + SchemaProps: spec.SchemaProps{ + Description: "Baisc auth with username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "token": { + SchemaProps: spec.SchemaProps{ + Description: "Token used to connect", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "nkey": { + SchemaProps: spec.SchemaProps{ + Description: "NKey used to connect", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "credential": { + SchemaProps: spec.SchemaProps{ + Description: "credential used to connect", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSBus holds the NATS eventbus information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "native": { + SchemaProps: spec.SchemaProps{ + Description: "Native means to bring up a native NATS service", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NativeStrategy"), + }, + }, + "exotic": { + SchemaProps: spec.SchemaProps{ + Description: "Exotic holds an exotic NATS config", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NativeStrategy"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSConfig holds the config of NATS", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "NATS streaming url", + Type: []string{"string"}, + Format: "", + }, + }, + "clusterID": { + SchemaProps: spec.SchemaProps{ + Description: "Cluster ID for nats streaming", + Type: []string{"string"}, + Format: "", + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth strategy, default to AuthStrategyNone", + Type: []string{"string"}, + Format: "", + }, + }, + "accessSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Secret for auth", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSEventsSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSEventsSource refers to event-source for NATS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to connect to NATS cluster", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Subject holds the name of the subject onto which messages are published", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionBackoff holds backoff applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the nats client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth information", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "queue": { + SchemaProps: spec.SchemaProps{ + Description: "Queue is the name of the queue group to subscribe as if specified. Uses QueueSubscribe logic to subscribe as queue group. If the queue is empty, uses default Subscribe logic.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"url", "subject"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSTrigger refers to the specification of the NATS trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL of the NATS cluster.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the subject to put message on.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the NATS producer.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "AuthInformation", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth"), + }, + }, + }, + Required: []string{"url", "subject", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NSQEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NSQEventSource describes the event source for NSQ PubSub More info at https://godoc.org/github.com/nsqio/go-nsq", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostAddress": { + SchemaProps: spec.SchemaProps{ + Description: "HostAddress is the address of the host for NSQ lookup", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic to subscribe to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "channel": { + SchemaProps: spec.SchemaProps{ + Description: "Channel used for subscription", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the nsq client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"hostAddress", "topic", "channel"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NativeStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NativeStrategy indicates to install a native NATS service", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Size is the NATS StatefulSet size", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "persistence": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy"), + }, + }, + "containerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ContainerTemplate contains customized spec for NATS container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "metricsContainerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "MetricsContainerTemplate contains customized spec for metrics container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "maxAge": { + SchemaProps: spec.SchemaProps{ + Description: "Max Age of existing messages, i.e. \"72h\", “4h35m”", + Type: []string{"string"}, + Format: "", + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName to apply to NATS StatefulSet", + Type: []string{"string"}, + Format: "", + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, indicates the EventSource pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "The priority value. Various system components use this field to find the priority of the EventSource pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "The pod's scheduling constraints More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + "maxMsgs": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of messages per channel, 0 means unlimited. Defaults to 1000000", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "maxBytes": { + SchemaProps: spec.SchemaProps{ + Description: "Total size of messages per channel, 0 means unlimited. Defaults to 1GB", + Type: []string{"string"}, + Format: "", + }, + }, + "maxSubs": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of subscriptions per channel, 0 means unlimited. Defaults to 1000", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "maxPayload": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of bytes in a message payload, 0 means unlimited. Defaults to 1MB", + Type: []string{"string"}, + Format: "", + }, + }, + "raftHeartbeatTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time in follower state without a leader before attempting an election, i.e. \"72h\", “4h35m”. Defaults to 2s", + Type: []string{"string"}, + Format: "", + }, + }, + "raftElectionTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time in candidate state without a leader before attempting an election, i.e. \"72h\", “4h35m”. Defaults to 2s", + Type: []string{"string"}, + Format: "", + }, + }, + "raftLeaseTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies how long a leader waits without being able to contact a quorum of nodes before stepping down as leader, i.e. \"72h\", “4h35m”. Defaults to 1s", + Type: []string{"string"}, + Format: "", + }, + }, + "raftCommitTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time without an Apply() operation before sending an heartbeat to ensure timely commit, i.e. \"72h\", “4h35m”. Defaults to 100ms", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + } +} + +func schema_pkg_apis_events_v1alpha1_OpenWhiskTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "OpenWhiskTrigger refers to the specification of the OpenWhisk trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "host": { + SchemaProps: spec.SchemaProps{ + Description: "Host URL of the OpenWhisk.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version for the API. Defaults to v1.", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace for the action. Defaults to \"_\".", + Type: []string{"string"}, + Format: "", + }, + }, + "authToken": { + SchemaProps: spec.SchemaProps{ + Description: "AuthToken for authentication.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "actionName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the action/function.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"host", "actionName", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_OwnedRepositories(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Organization or user name", + Type: []string{"string"}, + Format: "", + }, + }, + "names": { + SchemaProps: spec.SchemaProps{ + Description: "Repository names", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_PayloadField(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PayloadField binds a value at path within the event payload against a name.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is the JSONPath of the event's (JSON decoded) data key Path is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name acts as key that holds the value at the path.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"path", "name"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_PersistenceStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PersistenceStrategy defines the strategy of persistence", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storageClassName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", + Type: []string{"string"}, + Format: "", + }, + }, + "accessMode": { + SchemaProps: spec.SchemaProps{ + Description: "Available access modes such as ReadWriteOnce, ReadWriteMany https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes", + Type: []string{"string"}, + Format: "", + }, + }, + "volumeSize": { + SchemaProps: spec.SchemaProps{ + Description: "Volume size, e.g. 10Gi", + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + +func schema_pkg_apis_events_v1alpha1_PubSubEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PubSubEventSource refers to event-source for GCP PubSub related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "projectID": { + SchemaProps: spec.SchemaProps{ + Description: "ProjectID is GCP project ID for the subscription. Required if you run Argo Events outside of GKE/GCE. (otherwise, the default value is its project)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topicProjectID": { + SchemaProps: spec.SchemaProps{ + Description: "TopicProjectID is GCP project ID for the topic. By default, it is same as ProjectID.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic to which the subscription should belongs. Required if you want the eventsource to create a new subscription. If you specify this field along with an existing subscription, it will be verified whether it actually belongs to the specified topic.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subscriptionID": { + SchemaProps: spec.SchemaProps{ + Description: "SubscriptionID is ID of subscription. Required if you use existing subscription. The default value will be auto generated hash based on this eventsource setting, so the subscription might be recreated every time you update the setting, which has a possibility of event loss.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "credentialSecret": { + SchemaProps: spec.SchemaProps{ + Description: "CredentialSecret references to the secret that contains JSON credentials to access GCP. If it is missing, it implicitly uses Workload Identity to access. https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "deleteSubscriptionOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteSubscriptionOnFinish determines whether to delete the GCP PubSub subscription once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_PulsarEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PulsarEventSource describes the event source for Apache Pulsar", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "topics": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the topics to subscribe to.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of the subscription. Only \"exclusive\" and \"shared\" is supported. Defaults to exclusive.", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Configure the service URL for the Pulsar service.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "tlsTrustCertsSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Trusted TLS certificate secret.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "tlsAllowInsecureConnection": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client accept untrusted TLS certificate from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tlsValidateHostname": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client verify the validity of the host name from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the pulsar client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authTokenSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication token for the pulsar client. Either token or athenz can be set to use auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "authAthenzParams": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz parameters for the pulsar client. Refer https://github.com/apache/pulsar-client-go/blob/master/pulsar/auth/athenz.go Either token or athenz can be set to use auth.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authAthenzSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz privateKey secret for the pulsar client. AuthAthenzSecret must be set if AuthAthenzParams is used.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"topics", "url"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_PulsarTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PulsarTrigger refers to the specification of the Pulsar trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Configure the service URL for the Pulsar service.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the topic. See https://pulsar.apache.org/docs/en/concepts-messaging/", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved Kafka trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "tlsTrustCertsSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Trusted TLS certificate secret.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "tlsAllowInsecureConnection": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client accept untrusted TLS certificate from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tlsValidateHostname": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client verify the validity of the host name from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the pulsar client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "authTokenSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication token for the pulsar client. Either token or athenz can be set to use auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "authAthenzParams": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz parameters for the pulsar client. Refer https://github.com/apache/pulsar-client-go/blob/master/pulsar/auth/athenz.go Either token or athenz can be set to use auth.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authAthenzSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz privateKey secret for the pulsar client. AuthAthenzSecret must be set if AuthAthenzParams is used.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"url", "topic", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_RateLimit(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unit": { + SchemaProps: spec.SchemaProps{ + Description: "Defaults to Second", + Type: []string{"string"}, + Format: "", + }, + }, + "requestsPerUnit": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_RedisEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RedisEventSource describes an event source for the Redis PubSub. More info at https://godoc.org/github.com/go-redis/redis#example-PubSub", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostAddress": { + SchemaProps: spec.SchemaProps{ + Description: "HostAddress refers to the address of the Redis host/server", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace to use to retrieve the password from. It should only be specified if password is declared", + Type: []string{"string"}, + Format: "", + }, + }, + "db": { + SchemaProps: spec.SchemaProps{ + Description: "DB to use. If not specified, default DB 0 will be used.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "channels": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the redis client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username required for ACL style authentication if any.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"hostAddress", "channels"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_RedisStreamEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RedisStreamEventSource describes an event source for Redis streams (https://redis.io/topics/streams-intro)", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostAddress": { + SchemaProps: spec.SchemaProps{ + Description: "HostAddress refers to the address of the Redis host/server (master instance)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "db": { + SchemaProps: spec.SchemaProps{ + Description: "DB to use. If not specified, default DB 0 will be used.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "streams": { + SchemaProps: spec.SchemaProps{ + Description: "Streams to look for entries. XREADGROUP is used on all streams using a single consumer group.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "maxMsgCountPerRead": { + SchemaProps: spec.SchemaProps{ + Description: "MaxMsgCountPerRead holds the maximum number of messages per stream that will be read in each XREADGROUP of all streams Example: if there are 2 streams and MaxMsgCountPerRead=10, then each XREADGROUP may read upto a total of 20 messages. Same as COUNT option in XREADGROUP(https://redis.io/topics/streams-intro). Defaults to 10", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "consumerGroup": { + SchemaProps: spec.SchemaProps{ + Description: "ConsumerGroup refers to the Redis stream consumer group that will be created on all redis streams. Messages are read through this group. Defaults to 'argo-events-cg'", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the redis client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username required for ACL style authentication if any.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"hostAddress", "streams"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ResourceEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceEventSource refers to a event-source for K8s resource related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace where resource is deployed", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter is applied on the metadata of the resource If you apply filter, then the internal event informer will only monitor objects that pass the filter.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceFilter"), + }, + }, + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "eventTypes": { + SchemaProps: spec.SchemaProps{ + Description: "EventTypes is the list of event type to watch. Possible values are - ADD, UPDATE and DELETE.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"namespace", "group", "version", "resource", "eventTypes"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceFilter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ResourceFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceFilter contains K8s ObjectMeta information to further filter resource event objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "prefix": { + SchemaProps: spec.SchemaProps{ + Description: "Prefix filter is applied on the resource name.", + Type: []string{"string"}, + Format: "", + }, + }, + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "Labels provide listing options to K8s API to watch resource/s. Refer https://kubernetes.io/docs/concepts/overview/working-with-objects/label-selectors/ for more info. Unlike K8s field selector, multiple values are passed as comma separated values instead of list of values. Eg: value: value1,value2. Same as K8s label selector, operator \"=\", \"==\", \"!=\", \"exists\", \"!\", \"notin\", \"in\", \"gt\" and \"lt\" are supported", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector"), + }, + }, + }, + }, + }, + "fields": { + SchemaProps: spec.SchemaProps{ + Description: "Fields provide field filters similar to K8s field selector (see https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/). Unlike K8s field selector, it supports arbitrary fileds like \"spec.serviceAccountName\", and the value could be a string or a regex. Same as K8s field selector, operator \"=\", \"==\" and \"!=\" are supported.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector"), + }, + }, + }, + }, + }, + "createdBy": { + SchemaProps: spec.SchemaProps{ + Description: "If resource is created before the specified time then the event is treated as valid.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "afterStart": { + SchemaProps: spec.SchemaProps{ + Description: "If the resource is created after the start time then the event is treated as valid.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_events_v1alpha1_S3Artifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "S3Artifact contains information about an S3 connection and bucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "bucket": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Bucket"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "insecure": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "accessKey": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Filter"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "caCertificate": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"endpoint", "bucket", "accessKey", "secretKey"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Bucket", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Filter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_S3Bucket(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "S3Bucket contains information to describe an S3 Bucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_S3Filter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "S3Filter represents filters to apply to bucket notifications for specifying constraints on objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "prefix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "suffix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"prefix", "suffix"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_SASLConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SASLConfig refers to SASL configuration for a client", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "mechanism": { + SchemaProps: spec.SchemaProps{ + Description: "SASLMechanism is the name of the enabled SASL mechanism. Possible values: OAUTHBEARER, PLAIN (defaults to PLAIN).", + Type: []string{"string"}, + Format: "", + }, + }, + "userSecret": { + SchemaProps: spec.SchemaProps{ + Description: "User is the authentication identity (authcid) to present for SASL/PLAIN or SASL/SCRAM authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "passwordSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Password for SASL/PLAIN authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SFTPEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SFTPEventSource describes an event-source for sftp related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "eventType": { + SchemaProps: spec.SchemaProps{ + Description: "Type of file operations to watch Refer https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more information", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "watchPathConfig": { + SchemaProps: spec.SchemaProps{ + Description: "WatchPathConfig contains configuration about the file path to watch", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig"), + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sshKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "SSHKeySecret refers to the secret that contains SSH key. Key needs to contain private key and public key.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "address": { + SchemaProps: spec.SchemaProps{ + Description: "Address sftp address.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "pollIntervalDuration": { + SchemaProps: spec.SchemaProps{ + Description: "PollIntervalDuration the interval at which to poll the SFTP server defaults to 10 seconds", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"eventType", "watchPathConfig"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SNSEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SNSEventSource refers to event-source for AWS SNS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook configuration for http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "topicArn": { + SchemaProps: spec.SchemaProps{ + Description: "TopicArn", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "accessKey": { + SchemaProps: spec.SchemaProps{ + Description: "AccessKey refers K8s secret containing aws access key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "SecretKey refers K8s secret containing aws secret key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "Region is AWS region", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "roleARN": { + SchemaProps: spec.SchemaProps{ + Description: "RoleARN is the Amazon Resource Name (ARN) of the role to assume.", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "validateSignature": { + SchemaProps: spec.SchemaProps{ + Description: "ValidateSignature is boolean that can be set to true for SNS signature verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "Endpoint configures connection to a specific SNS endpoint instead of Amazons servers", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"topicArn", "region"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SQSEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SQSEventSource refers to event-source for AWS SQS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "accessKey": { + SchemaProps: spec.SchemaProps{ + Description: "AccessKey refers K8s secret containing aws access key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "SecretKey refers K8s secret containing aws secret key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "Region is AWS region", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "queue": { + SchemaProps: spec.SchemaProps{ + Description: "Queue is AWS SQS queue to listen to for messages", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "waitTimeSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "WaitTimeSeconds is The duration (in seconds) for which the call waits for a message to arrive in the queue before returning.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "roleARN": { + SchemaProps: spec.SchemaProps{ + Description: "RoleARN is the Amazon Resource Name (ARN) of the role to assume.", + Type: []string{"string"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "queueAccountId": { + SchemaProps: spec.SchemaProps{ + Description: "QueueAccountID is the ID of the account that created the queue to monitor", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "dlq": { + SchemaProps: spec.SchemaProps{ + Description: "DLQ specifies if a dead-letter queue is configured for messages that can't be processed successfully. If set to true, messages with invalid payload won't be acknowledged to allow to forward them farther to the dead-letter queue. The default value is false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "Endpoint configures connection to a specific SQS endpoint instead of Amazons servers", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sessionToken": { + SchemaProps: spec.SchemaProps{ + Description: "SessionToken refers to K8s secret containing AWS temporary credentials(STS) session token", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"region", "queue", "waitTimeSeconds"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SchemaRegistryConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SchemaRegistryConfig refers to configuration for a client", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Schema Registry URL.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "schemaId": { + SchemaProps: spec.SchemaProps{ + Description: "Schema ID", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "SchemaRegistry - basic authentication", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + }, + Required: []string{"url", "schemaId"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SecureHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SecureHeader refers to HTTP Headers with auth tokens as values", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "valueFrom": { + SchemaProps: spec.SchemaProps{ + Description: "Values can be read from either secrets or configmaps", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ValueFromSource"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ValueFromSource"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Selector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Selector represents conditional operation to select K8s objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "Key name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Supported operations like ==, != etc. Defaults to ==. Refer https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors for more info.", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"key", "value"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Sensor(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Sensor is the definition of a sensor resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorStatus"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorSpec", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SensorList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SensorList is the list of Sensor resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Sensor"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Sensor", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SensorSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SensorSpec represents desired sensor state", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dependencies": { + SchemaProps: spec.SchemaProps{ + Description: "Dependencies is a list of the events that this sensor is dependent on.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependency"), + }, + }, + }, + }, + }, + "triggers": { + SchemaProps: spec.SchemaProps{ + Description: "Triggers is a list of the things that this sensor evokes. These are the outputs from this sensor.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger"), + }, + }, + }, + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the pod specification for the sensor", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template"), + }, + }, + "errorOnFailedRound": { + SchemaProps: spec.SchemaProps{ + Description: "ErrorOnFailedRound if set to true, marks sensor state as `error` if the previous trigger round fails. Once sensor state is set to `error`, no further triggers will be processed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "eventBusName": { + SchemaProps: spec.SchemaProps{ + Description: "EventBusName references to a EventBus name. By default the value is \"default\"", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the sensor deployment replicas", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "revisionHistoryLimit": { + SchemaProps: spec.SchemaProps{ + Description: "RevisionHistoryLimit specifies how many old deployment revisions to retain", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "loggingFields": { + SchemaProps: spec.SchemaProps{ + Description: "LoggingFields add additional key-value pairs when logging happens", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"dependencies", "triggers"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependency", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SensorStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SensorStatus contains information about the status of a sensor.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Service(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Service holds the service information eventsource exposes", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels default={annotations: {}, labels: {}}", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "ports": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "port", + "protocol", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "port", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "The list of ports that are exposed by this ClusterIP service.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ServicePort"), + }, + }, + }, + }, + }, + "clusterIP": { + SchemaProps: spec.SchemaProps{ + Description: "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "k8s.io/api/core/v1.ServicePort"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SlackEventSource refers to event-source for Slack related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "signingSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Slack App signing secret", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "token": { + SchemaProps: spec.SchemaProps{ + Description: "Token for URL verification handshake", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration for a REST endpoint", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackSender(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username is the Slack application's username", + Type: []string{"string"}, + Format: "", + }, + }, + "icon": { + SchemaProps: spec.SchemaProps{ + Description: "Icon is the Slack application's icon, e.g. :robot_face: or https://example.com/image.png", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackThread(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "messageAggregationKey": { + SchemaProps: spec.SchemaProps{ + Description: "MessageAggregationKey allows to aggregate the messages to a thread by some key.", + Type: []string{"string"}, + Format: "", + }, + }, + "broadcastMessageToChannel": { + SchemaProps: spec.SchemaProps{ + Description: "BroadcastMessageToChannel allows to also broadcast the message from the thread to the channel", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SlackTrigger refers to the specification of the slack notification trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "slackToken": { + SchemaProps: spec.SchemaProps{ + Description: "SlackToken refers to the Kubernetes secret that holds the slack token required to send messages.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "channel": { + SchemaProps: spec.SchemaProps{ + Description: "Channel refers to which Slack channel to send Slack message.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "Message refers to the message to send to the Slack channel.", + Type: []string{"string"}, + Format: "", + }, + }, + "attachments": { + SchemaProps: spec.SchemaProps{ + Description: "Attachments is a JSON format string that represents an array of Slack attachments according to the attachments API: https://api.slack.com/reference/messaging/attachments .", + Type: []string{"string"}, + Format: "", + }, + }, + "blocks": { + SchemaProps: spec.SchemaProps{ + Description: "Blocks is a JSON format string that represents an array of Slack blocks according to the blocks API: https://api.slack.com/reference/block-kit/blocks .", + Type: []string{"string"}, + Format: "", + }, + }, + "thread": { + SchemaProps: spec.SchemaProps{ + Description: "Thread refers to additional options for sending messages to a Slack thread.", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackThread"), + }, + }, + "sender": { + SchemaProps: spec.SchemaProps{ + Description: "Sender refers to additional configuration of the Slack application that sends the message.", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackSender"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackSender", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackThread", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_StandardK8STrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StandardK8STrigger is the standard Kubernetes resource trigger", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source of the K8s resource file(s)", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation"), + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation refers to the type of operation performed on the k8s resource. Default value is Create.", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved K8s trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "patchStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "PatchStrategy controls the K8s object patching strategy when the trigger operation is specified as patch. possible values: \"application/json-patch+json\" \"application/merge-patch+json\" \"application/strategic-merge-patch+json\" \"application/apply-patch+yaml\". Defaults to \"application/merge-patch+json\"", + Type: []string{"string"}, + Format: "", + }, + }, + "liveObject": { + SchemaProps: spec.SchemaProps{ + Description: "LiveObject specifies whether the resource should be directly fetched from K8s instead of being marshaled from the resource artifact. If set to true, the resource artifact must contain the information required to uniquely identify the resource in the cluster, that is, you must specify \"apiVersion\", \"kind\" as well as \"name\" and \"namespace\" meta data. Only valid for operation type `update`", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Status is a common structure which can be used for Status field.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_StatusPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StatusPolicy refers to the policy used to check the state of the trigger using response status", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "allow": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + }, + Required: []string{"allow"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_StorageGridEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StorageGridEventSource refers to event-source for StorageGrid related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration for a REST endpoint", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter on object key which caused the notification.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridFilter"), + }, + }, + "topicArn": { + SchemaProps: spec.SchemaProps{ + Description: "TopicArn", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "bucket": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the bucket to register notifications for.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "S3 region. Defaults to us-east-1", + Type: []string{"string"}, + Format: "", + }, + }, + "authToken": { + SchemaProps: spec.SchemaProps{ + Description: "Auth token for storagegrid api", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "apiURL": { + SchemaProps: spec.SchemaProps{ + Description: "APIURL is the url of the storagegrid api.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"topicArn", "bucket", "authToken", "apiURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_StorageGridFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StorageGridFilter represents filters to apply to bucket notifications for specifying constraints on objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "prefix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "suffix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"prefix", "suffix"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_StripeEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StripeEventSource describes the event source for stripe webhook notifications More info at https://stripe.com/docs/webhooks", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration for a REST endpoint", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "createWebhook": { + SchemaProps: spec.SchemaProps{ + Description: "CreateWebhook if specified creates a new webhook programmatically.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "apiKey": { + SchemaProps: spec.SchemaProps{ + Description: "APIKey refers to K8s secret that holds Stripe API key. Used only if CreateWebhook is enabled.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "eventFilter": { + SchemaProps: spec.SchemaProps{ + Description: "EventFilter describes the type of events to listen to. If not specified, all types of events will be processed. More info at https://stripe.com/docs/api/events/list", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TLSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TLSConfig refers to TLS configuration for a client.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "caCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "CACertSecret refers to the secret that contains the CA cert", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "clientCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ClientCertSecret refers to the secret that contains the client cert", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "clientKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "ClientKeySecret refers to the secret that contains the client key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "insecureSkipVerify": { + SchemaProps: spec.SchemaProps{ + Description: "If true, skips creation of TLSConfig with certs and creates an empty TLSConfig. (Defaults to false)", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Template(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Template holds the information of a deployment template", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName is the name of the ServiceAccount to use to run sensor pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", + Type: []string{"string"}, + Format: "", + }, + }, + "container": { + SchemaProps: spec.SchemaProps{ + Description: "Container is the main container image to run in the sensor pod", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Container"), + }, + }, + "volumes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Volumes is a list of volumes that can be mounted by containers in a workflow.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Volume"), + }, + }, + }, + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, indicates the EventSource pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "The priority value. Various system components use this field to find the priority of the EventSource pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's scheduling constraints", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Container", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/api/core/v1.Volume"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TimeFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TimeFilter describes a window in time. It filters out events that occur outside the time limits. In other words, only events that occur after Start and before Stop will pass this filter.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "start": { + SchemaProps: spec.SchemaProps{ + Description: "Start is the beginning of a time window in UTC. Before this time, events for this dependency are ignored. Format is hh:mm:ss.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "stop": { + SchemaProps: spec.SchemaProps{ + Description: "Stop is the end of a time window in UTC. After or equal to this time, events for this dependency are ignored and Format is hh:mm:ss. If it is smaller than Start, it is treated as next day of Start (e.g.: 22:00:00-01:00:00 means 22:00:00-25:00:00).", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"start", "stop"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Trigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Trigger is an action taken, output produced, an event created, a message sent", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template describes the trigger specification.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerTemplate"), + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters applied to the trigger template definition", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "policy": { + SchemaProps: spec.SchemaProps{ + Description: "Policy to configure backoff and execution criteria for the trigger", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerPolicy"), + }, + }, + "retryStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "Retry strategy, defaults to no retry", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "rateLimit": { + SchemaProps: spec.SchemaProps{ + Description: "Rate limit, default unit is Second", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RateLimit"), + }, + }, + "atLeastOnce": { + SchemaProps: spec.SchemaProps{ + Description: "AtLeastOnce determines the trigger execution semantics. Defaults to false. Trigger execution will use at-most-once semantics. If set to true, Trigger execution will switch to at-least-once semantics.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "dlqTrigger": { + SchemaProps: spec.SchemaProps{ + Description: "If the trigger fails, it will retry up to the configured number of retries. If the maximum retries are reached and the trigger is set to execute atLeastOnce, the dead letter queue (DLQ) trigger will be invoked if specified. Invoking the dead letter queue trigger helps prevent data loss.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RateLimit", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerPolicy", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerTemplate"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerParameter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerParameter indicates a passed parameter to a service template", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "src": { + SchemaProps: spec.SchemaProps{ + Description: "Src contains a source reference to the value of the parameter from a dependency", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameterSource"), + }, + }, + "dest": { + SchemaProps: spec.SchemaProps{ + Description: "Dest is the JSONPath of a resource key. A path is a series of keys separated by a dot. The colon character can be escaped with '.' The -1 key can be used to append a value to an existing array. See https://github.com/tidwall/sjson#path-syntax for more information about how this is used.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation is what to do with the existing value at Dest, whether to 'prepend', 'overwrite', or 'append' it.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"dest"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameterSource"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerParameterSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerParameterSource defines the source for a parameter from a event event", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dependencyName": { + SchemaProps: spec.SchemaProps{ + Description: "DependencyName refers to the name of the dependency. The event which is stored for this dependency is used as payload for the parameterization. Make sure to refer to one of the dependencies you have defined under Dependencies list.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "contextKey": { + SchemaProps: spec.SchemaProps{ + Description: "ContextKey is the JSONPath of the event's (JSON decoded) context key ContextKey is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Type: []string{"string"}, + Format: "", + }, + }, + "contextTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ContextTemplate is a go-template for extracting a string from the event's context. If a ContextTemplate is provided with a ContextKey, the template will be evaluated first and fallback to the ContextKey. The templating follows the standard go-template syntax as well as sprig's extra functions. See https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/", + Type: []string{"string"}, + Format: "", + }, + }, + "dataKey": { + SchemaProps: spec.SchemaProps{ + Description: "DataKey is the JSONPath of the event's (JSON decoded) data key DataKey is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Type: []string{"string"}, + Format: "", + }, + }, + "dataTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "DataTemplate is a go-template for extracting a string from the event's data. If a DataTemplate is provided with a DataKey, the template will be evaluated first and fallback to the DataKey. The templating follows the standard go-template syntax as well as sprig's extra functions. See https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value is the default literal value to use for this parameter source This is only used if the DataKey is invalid. If the DataKey is invalid and this is not defined, this param source will produce an error.", + Type: []string{"string"}, + Format: "", + }, + }, + "useRawData": { + SchemaProps: spec.SchemaProps{ + Description: "UseRawData indicates if the value in an event at data key should be used without converting to string. When true, a number, boolean, json or string parameter may be extracted. When the field is unspecified, or explicitly false, the behavior is to turn the extracted field into a string. (e.g. when set to true, the parameter 123 will resolve to the numerical type, but when false, or not provided, the string \"123\" will be resolved)", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"dependencyName"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerPolicy dictates the policy for the trigger retries", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "k8s": { + SchemaProps: spec.SchemaProps{ + Description: "K8SResourcePolicy refers to the policy used to check the state of K8s based triggers using using labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResourcePolicy"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status refers to the policy used to check the state of the trigger using response status", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StatusPolicy"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResourcePolicy", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StatusPolicy"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerTemplate is the template that describes trigger specification.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is a unique name of the action to take.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions is the conditions to execute the trigger. For example: \"(dep01 || dep02) && dep04\"", + Type: []string{"string"}, + Format: "", + }, + }, + "k8s": { + SchemaProps: spec.SchemaProps{ + Description: "StandardK8STrigger refers to the trigger designed to create or update a generic Kubernetes resource.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StandardK8STrigger"), + }, + }, + "argoWorkflow": { + SchemaProps: spec.SchemaProps{ + Description: "ArgoWorkflow refers to the trigger that can perform various operations on an Argo workflow.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArgoWorkflowTrigger"), + }, + }, + "http": { + SchemaProps: spec.SchemaProps{ + Description: "HTTP refers to the trigger designed to dispatch a HTTP request with on-the-fly constructable payload.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HTTPTrigger"), + }, + }, + "awsLambda": { + SchemaProps: spec.SchemaProps{ + Description: "AWSLambda refers to the trigger designed to invoke AWS Lambda function with with on-the-fly constructable payload.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AWSLambdaTrigger"), + }, + }, + "custom": { + SchemaProps: spec.SchemaProps{ + Description: "CustomTrigger refers to the trigger designed to connect to a gRPC trigger server and execute a custom trigger.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger"), + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka refers to the trigger designed to place messages on Kafka topic.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaTrigger"), + }, + }, + "nats": { + SchemaProps: spec.SchemaProps{ + Description: "NATS refers to the trigger designed to place message on NATS subject.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSTrigger"), + }, + }, + "slack": { + SchemaProps: spec.SchemaProps{ + Description: "Slack refers to the trigger designed to send slack notification message.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackTrigger"), + }, + }, + "openWhisk": { + SchemaProps: spec.SchemaProps{ + Description: "OpenWhisk refers to the trigger designed to invoke OpenWhisk action.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OpenWhiskTrigger"), + }, + }, + "log": { + SchemaProps: spec.SchemaProps{ + Description: "Log refers to the trigger designed to invoke log the event.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.LogTrigger"), + }, + }, + "azureEventHubs": { + SchemaProps: spec.SchemaProps{ + Description: "AzureEventHubs refers to the trigger send an event to an Azure Event Hub.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventHubsTrigger"), + }, + }, + "pulsar": { + SchemaProps: spec.SchemaProps{ + Description: "Pulsar refers to the trigger designed to place messages on Pulsar topic.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarTrigger"), + }, + }, + "conditionsReset": { + SchemaProps: spec.SchemaProps{ + Description: "Criteria to reset the conditons", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria"), + }, + }, + }, + }, + }, + "azureServiceBus": { + SchemaProps: spec.SchemaProps{ + Description: "AzureServiceBus refers to the trigger designed to place messages on Azure Service Bus", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusTrigger"), + }, + }, + "email": { + SchemaProps: spec.SchemaProps{ + Description: "Email refers to the trigger designed to send an email notification", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmailTrigger"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AWSLambdaTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArgoWorkflowTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventHubsTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmailTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HTTPTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.LogTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OpenWhiskTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StandardK8STrigger"}, + } +} + +func schema_pkg_apis_events_v1alpha1_URLArtifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "URLArtifact contains information about an artifact at an http endpoint.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is the complete URL", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "verifyCert": { + SchemaProps: spec.SchemaProps{ + Description: "VerifyCert decides whether the connection is secure or not", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"path"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ValueFromSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ValueFromSource allows you to reference keys from either a Configmap or Secret", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretKeyRef": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "configMapKeyRef": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_WatchPathConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "directory": { + SchemaProps: spec.SchemaProps{ + Description: "Directory to watch for events", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + "pathRegexp": { + SchemaProps: spec.SchemaProps{ + Description: "PathRegexp is regexp of relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"directory"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_WebhookContext(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WebhookContext holds a general purpose REST API context", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "REST API endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "method": { + SchemaProps: spec.SchemaProps{ + Description: "Method is HTTP request method that indicates the desired action to be performed for a given resource. See RFC7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port on which HTTP server is listening for incoming events.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL is the url of the server.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "serverCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerCertPath refers the file that contains the cert.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "serverKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerKeyPath refers the file that contains private key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authSecret": { + SchemaProps: spec.SchemaProps{ + Description: "AuthSecret holds a secret selector that contains a bearer token for authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "maxPayloadSize": { + SchemaProps: spec.SchemaProps{ + Description: "MaxPayloadSize is the maximum webhook payload size that the server will accept. Requests exceeding that limit will be rejected with \"request too large\" response. Default value: 1048576 (1MB).", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"endpoint", "method", "port", "url"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_WebhookEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CalendarEventSource describes an HTTP based EventSource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "REST API endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "method": { + SchemaProps: spec.SchemaProps{ + Description: "Method is HTTP request method that indicates the desired action to be performed for a given resource. See RFC7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port on which HTTP server is listening for incoming events.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL is the url of the server.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "serverCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerCertPath refers the file that contains the cert.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "serverKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerKeyPath refers the file that contains private key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authSecret": { + SchemaProps: spec.SchemaProps{ + Description: "AuthSecret holds a secret selector that contains a bearer token for authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "maxPayloadSize": { + SchemaProps: spec.SchemaProps{ + Description: "MaxPayloadSize is the maximum webhook payload size that the server will accept. Requests exceeding that limit will be rejected with \"request too large\" response. Default value: 1048576 (1MB).", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"endpoint", "method", "port", "url"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} +``` + +## `pkg/apis/events/v1alpha1/container_template.go` (changed lines (7, 8, 9, 10, 11, 12)) + +```go +package v1alpha1 + +import corev1 "k8s.io/api/core/v1" + +// ContainerTemplate defines customized spec for a container +type ContainerTemplate struct { + // +optional + Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` + // +optional + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,2,opt,name=imagePullPolicy,casttype=PullPolicy"` + // +optional + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,3,opt,name=securityContext"` +} +``` + +## `pkg/apis/events/v1alpha1/generated.pb.go` (changed lines (864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 895, 923, 951, 979, 1007, 1035, 1063, 1091, 1119, 1147, 1175, 1203, 1231, 1259, 1287, 1315, 1343, 1371, 1399, 1427, 1455, 1483, 1511, 1539, 1567, 1595, 1623, 1651, 1679, 1707, 1735, 1763, 1791, 1819, 1847, 1875, 1903, 1931, 1959, 1987, 2015, 2043, 2071, 2099, 2127, 2155, 2183, 2211, 2239, 2267, 2295, 2323, 2351, 2379, 2407, 2435, 2463, 2491, 2519, 2547, 2575, 2603, 2631, 2659, 2687, 2715, 2743, 2771, 2799, 2827, 2855, 2883, 2911, 2939, 2967, 2995, 3023, 3051, 3079, 3107, 3135, 3163, 3191, 3219, 3247, 3275, 3303, 3331, 3359, 3387, 3415, 3443, 3471, 3499, 3527, 3555, 3583, 3611, 3639, 3667, 3695, 3723, 3785, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4756, 4757, 4758, 4759, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 6887, 6888, 6889, 6890, 6891, 6892, 6893, 6894, 6895, 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6954, 6955, 6956, 6957, 6958, 6959, 6960, 6961, 6962, 6963, 6964, 6965, 6966, 6967, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 16620, 16621, 16622, 16623, 16624, 16625, 16626, 16627, 16628, 16629, 16630, 16631, 16632, 16633, 16634, 16635, 16636, 16637, 16638, 16639, 16640, 16641, 16642, 16643, 16644, 16645, 16646, 16647, 16648, 16649, 16650, 16651, 16652, 16653, 16654, 20355, 20356, 20357, 20358, 20359, 20360, 20361, 20362, 20363, 20364, 20365, 20366, 20367, 20368, 20369, 20370, 20371, 20372, 20373, 20374, 20375, 20376, 20377, 20378, 20379, 20380, 20381, 20382, 20383, 20384, 22561, 29594, 29595, 29596, 29597, 29598, 29599, 29600, 29601, 29602, 29603, 29604, 29605, 29606, 29607, 29608, 29609, 29610, 29611, 29612, 29613, 29614, 29615, 29616, 29617, 29618, 29619, 29620, 29621, 29622, 29623, 29624, 29625, 29626, 29627, 29628, 29629, 29630, 29631, 29632, 29633, 29634, 29635, 29636, 29637, 29638, 29639, 29640, 29641, 29642, 29643, 29644, 29645, 29646, 29647, 29648, 29649, 29650, 29651, 29652, 29653, 29654, 29655, 29656, 29657, 29658, 29659, 29660, 29661, 29662, 29663, 29664, 29665, 29666, 29667, 29668, 29669, 29670, 29671, 29672, 29673, 29674, 29675, 29676, 29677, 29678, 29679, 29680, 29681, 29682, 29683, 29684, 29685, 29686, 29687, 29688, 29689, 29690, 29691, 29692, 29693, 29694, 29695, 29696, 29697, 29698, 29699, 29700, 29701, 29702, 29703, 29704, 29705, 29706, 29707, 29708, 29709, 29710, 29711, 29712, 29713, 29714, 29715, 29716, 29717, 29718, 29719, 29720, 29721, 29722, 29723, 29724, 29725, 29726, 29727, 29728, 29729, 29730, 29731, 29732, 29733, 29734, 29735, 29736, 29737, 29738, 29739, 29740, 29741, 29742, 29743, 29744, 29745, 29746, 29747, 29748, 29749, 29750, 29751, 29752, 29753, 29754, 29755, 29756, 29757, 29758, 29759, 29760, 29761, 29762, 29763, 29764, 29765, 29766, 29767, 29768, 29769, 29770, 29771, 29772, 29773, 29774, 29775, 29776, 29777, 29778, 29779, 29780, 29781, 29782, 29783, 29784, 29785, 29786, 29787, 29788, 29789, 29790, 29791, 29792, 29793, 29794, 29795, 29796, 29797, 29798, 29799, 29800, 29801, 29802, 29803, 29804, 29805, 29806, 29807, 29808, 29809, 29810, 29811, 29812, 29813, 29814, 29815, 29816, 29817, 29818, 29819, 29820, 29821, 29822, 29823, 29824, 29825, 29826, 29827, 29828, 29829, 29830, 29831, 29832, 29833, 29834, 29835, 29836, 29837, 29838, 29839, 29840, 29841, 29842, 29843, 29844, 29845, 29846, 57999)) + +```go +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: github.com/argoproj/argo-events/pkg/apis/events/v1alpha1/generated.proto + +package v1alpha1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + k8s_io_api_core_v1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func (m *AMQPConsumeConfig) Reset() { *m = AMQPConsumeConfig{} } +func (*AMQPConsumeConfig) ProtoMessage() {} +func (*AMQPConsumeConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{0} +} +func (m *AMQPConsumeConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPConsumeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPConsumeConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPConsumeConfig.Merge(m, src) +} +func (m *AMQPConsumeConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPConsumeConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPConsumeConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPConsumeConfig proto.InternalMessageInfo + +func (m *AMQPEventSource) Reset() { *m = AMQPEventSource{} } +func (*AMQPEventSource) ProtoMessage() {} +func (*AMQPEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{1} +} +func (m *AMQPEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPEventSource.Merge(m, src) +} +func (m *AMQPEventSource) XXX_Size() int { + return m.Size() +} +func (m *AMQPEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPEventSource proto.InternalMessageInfo + +func (m *AMQPExchangeDeclareConfig) Reset() { *m = AMQPExchangeDeclareConfig{} } +func (*AMQPExchangeDeclareConfig) ProtoMessage() {} +func (*AMQPExchangeDeclareConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{2} +} +func (m *AMQPExchangeDeclareConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPExchangeDeclareConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPExchangeDeclareConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPExchangeDeclareConfig.Merge(m, src) +} +func (m *AMQPExchangeDeclareConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPExchangeDeclareConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPExchangeDeclareConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPExchangeDeclareConfig proto.InternalMessageInfo + +func (m *AMQPQueueBindConfig) Reset() { *m = AMQPQueueBindConfig{} } +func (*AMQPQueueBindConfig) ProtoMessage() {} +func (*AMQPQueueBindConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{3} +} +func (m *AMQPQueueBindConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPQueueBindConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPQueueBindConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPQueueBindConfig.Merge(m, src) +} +func (m *AMQPQueueBindConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPQueueBindConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPQueueBindConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPQueueBindConfig proto.InternalMessageInfo + +func (m *AMQPQueueDeclareConfig) Reset() { *m = AMQPQueueDeclareConfig{} } +func (*AMQPQueueDeclareConfig) ProtoMessage() {} +func (*AMQPQueueDeclareConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{4} +} +func (m *AMQPQueueDeclareConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPQueueDeclareConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPQueueDeclareConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPQueueDeclareConfig.Merge(m, src) +} +func (m *AMQPQueueDeclareConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPQueueDeclareConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPQueueDeclareConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPQueueDeclareConfig proto.InternalMessageInfo + +func (m *AWSLambdaTrigger) Reset() { *m = AWSLambdaTrigger{} } +func (*AWSLambdaTrigger) ProtoMessage() {} +func (*AWSLambdaTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{5} +} +func (m *AWSLambdaTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AWSLambdaTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AWSLambdaTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_AWSLambdaTrigger.Merge(m, src) +} +func (m *AWSLambdaTrigger) XXX_Size() int { + return m.Size() +} +func (m *AWSLambdaTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_AWSLambdaTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_AWSLambdaTrigger proto.InternalMessageInfo + +func (m *Amount) Reset() { *m = Amount{} } +func (*Amount) ProtoMessage() {} +func (*Amount) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{6} +} +func (m *Amount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Amount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Amount) XXX_Merge(src proto.Message) { + xxx_messageInfo_Amount.Merge(m, src) +} +func (m *Amount) XXX_Size() int { + return m.Size() +} +func (m *Amount) XXX_DiscardUnknown() { + xxx_messageInfo_Amount.DiscardUnknown(m) +} + +var xxx_messageInfo_Amount proto.InternalMessageInfo + +func (m *ArgoWorkflowTrigger) Reset() { *m = ArgoWorkflowTrigger{} } +func (*ArgoWorkflowTrigger) ProtoMessage() {} +func (*ArgoWorkflowTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{7} +} +func (m *ArgoWorkflowTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArgoWorkflowTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ArgoWorkflowTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArgoWorkflowTrigger.Merge(m, src) +} +func (m *ArgoWorkflowTrigger) XXX_Size() int { + return m.Size() +} +func (m *ArgoWorkflowTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_ArgoWorkflowTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_ArgoWorkflowTrigger proto.InternalMessageInfo + +func (m *ArtifactLocation) Reset() { *m = ArtifactLocation{} } +func (*ArtifactLocation) ProtoMessage() {} +func (*ArtifactLocation) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{8} +} +func (m *ArtifactLocation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArtifactLocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ArtifactLocation) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArtifactLocation.Merge(m, src) +} +func (m *ArtifactLocation) XXX_Size() int { + return m.Size() +} +func (m *ArtifactLocation) XXX_DiscardUnknown() { + xxx_messageInfo_ArtifactLocation.DiscardUnknown(m) +} + +var xxx_messageInfo_ArtifactLocation proto.InternalMessageInfo + +func (m *AzureEventHubsTrigger) Reset() { *m = AzureEventHubsTrigger{} } +func (*AzureEventHubsTrigger) ProtoMessage() {} +func (*AzureEventHubsTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{9} +} +func (m *AzureEventHubsTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureEventHubsTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureEventHubsTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureEventHubsTrigger.Merge(m, src) +} +func (m *AzureEventHubsTrigger) XXX_Size() int { + return m.Size() +} +func (m *AzureEventHubsTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_AzureEventHubsTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureEventHubsTrigger proto.InternalMessageInfo + +func (m *AzureEventsHubEventSource) Reset() { *m = AzureEventsHubEventSource{} } +func (*AzureEventsHubEventSource) ProtoMessage() {} +func (*AzureEventsHubEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{10} +} +func (m *AzureEventsHubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureEventsHubEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureEventsHubEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureEventsHubEventSource.Merge(m, src) +} +func (m *AzureEventsHubEventSource) XXX_Size() int { + return m.Size() +} +func (m *AzureEventsHubEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AzureEventsHubEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureEventsHubEventSource proto.InternalMessageInfo + +func (m *AzureQueueStorageEventSource) Reset() { *m = AzureQueueStorageEventSource{} } +func (*AzureQueueStorageEventSource) ProtoMessage() {} +func (*AzureQueueStorageEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{11} +} +func (m *AzureQueueStorageEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureQueueStorageEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureQueueStorageEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureQueueStorageEventSource.Merge(m, src) +} +func (m *AzureQueueStorageEventSource) XXX_Size() int { + return m.Size() +} +func (m *AzureQueueStorageEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AzureQueueStorageEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureQueueStorageEventSource proto.InternalMessageInfo + +func (m *AzureServiceBusEventSource) Reset() { *m = AzureServiceBusEventSource{} } +func (*AzureServiceBusEventSource) ProtoMessage() {} +func (*AzureServiceBusEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{12} +} +func (m *AzureServiceBusEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureServiceBusEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureServiceBusEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureServiceBusEventSource.Merge(m, src) +} +func (m *AzureServiceBusEventSource) XXX_Size() int { + return m.Size() +} +func (m *AzureServiceBusEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AzureServiceBusEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureServiceBusEventSource proto.InternalMessageInfo + +func (m *AzureServiceBusTrigger) Reset() { *m = AzureServiceBusTrigger{} } +func (*AzureServiceBusTrigger) ProtoMessage() {} +func (*AzureServiceBusTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{13} +} +func (m *AzureServiceBusTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureServiceBusTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureServiceBusTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureServiceBusTrigger.Merge(m, src) +} +func (m *AzureServiceBusTrigger) XXX_Size() int { + return m.Size() +} +func (m *AzureServiceBusTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_AzureServiceBusTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureServiceBusTrigger proto.InternalMessageInfo + +func (m *Backoff) Reset() { *m = Backoff{} } +func (*Backoff) ProtoMessage() {} +func (*Backoff) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{14} +} +func (m *Backoff) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Backoff) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Backoff) XXX_Merge(src proto.Message) { + xxx_messageInfo_Backoff.Merge(m, src) +} +func (m *Backoff) XXX_Size() int { + return m.Size() +} +func (m *Backoff) XXX_DiscardUnknown() { + xxx_messageInfo_Backoff.DiscardUnknown(m) +} + +var xxx_messageInfo_Backoff proto.InternalMessageInfo + +func (m *BasicAuth) Reset() { *m = BasicAuth{} } +func (*BasicAuth) ProtoMessage() {} +func (*BasicAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{15} +} +func (m *BasicAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasicAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BasicAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicAuth.Merge(m, src) +} +func (m *BasicAuth) XXX_Size() int { + return m.Size() +} +func (m *BasicAuth) XXX_DiscardUnknown() { + xxx_messageInfo_BasicAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_BasicAuth proto.InternalMessageInfo + +func (m *BitbucketAuth) Reset() { *m = BitbucketAuth{} } +func (*BitbucketAuth) ProtoMessage() {} +func (*BitbucketAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{16} +} +func (m *BitbucketAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketAuth.Merge(m, src) +} +func (m *BitbucketAuth) XXX_Size() int { + return m.Size() +} +func (m *BitbucketAuth) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketAuth proto.InternalMessageInfo + +func (m *BitbucketBasicAuth) Reset() { *m = BitbucketBasicAuth{} } +func (*BitbucketBasicAuth) ProtoMessage() {} +func (*BitbucketBasicAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{17} +} +func (m *BitbucketBasicAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketBasicAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketBasicAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketBasicAuth.Merge(m, src) +} +func (m *BitbucketBasicAuth) XXX_Size() int { + return m.Size() +} +func (m *BitbucketBasicAuth) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketBasicAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketBasicAuth proto.InternalMessageInfo + +func (m *BitbucketEventSource) Reset() { *m = BitbucketEventSource{} } +func (*BitbucketEventSource) ProtoMessage() {} +func (*BitbucketEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{18} +} +func (m *BitbucketEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketEventSource.Merge(m, src) +} +func (m *BitbucketEventSource) XXX_Size() int { + return m.Size() +} +func (m *BitbucketEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketEventSource proto.InternalMessageInfo + +func (m *BitbucketRepository) Reset() { *m = BitbucketRepository{} } +func (*BitbucketRepository) ProtoMessage() {} +func (*BitbucketRepository) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{19} +} +func (m *BitbucketRepository) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketRepository) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketRepository) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketRepository.Merge(m, src) +} +func (m *BitbucketRepository) XXX_Size() int { + return m.Size() +} +func (m *BitbucketRepository) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketRepository.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketRepository proto.InternalMessageInfo + +func (m *BitbucketServerEventSource) Reset() { *m = BitbucketServerEventSource{} } +func (*BitbucketServerEventSource) ProtoMessage() {} +func (*BitbucketServerEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{20} +} +func (m *BitbucketServerEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketServerEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketServerEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketServerEventSource.Merge(m, src) +} +func (m *BitbucketServerEventSource) XXX_Size() int { + return m.Size() +} +func (m *BitbucketServerEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketServerEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketServerEventSource proto.InternalMessageInfo + +func (m *BitbucketServerRepository) Reset() { *m = BitbucketServerRepository{} } +func (*BitbucketServerRepository) ProtoMessage() {} +func (*BitbucketServerRepository) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{21} +} +func (m *BitbucketServerRepository) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketServerRepository) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketServerRepository) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketServerRepository.Merge(m, src) +} +func (m *BitbucketServerRepository) XXX_Size() int { + return m.Size() +} +func (m *BitbucketServerRepository) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketServerRepository.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketServerRepository proto.InternalMessageInfo + +func (m *BusConfig) Reset() { *m = BusConfig{} } +func (*BusConfig) ProtoMessage() {} +func (*BusConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{22} +} +func (m *BusConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BusConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BusConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_BusConfig.Merge(m, src) +} +func (m *BusConfig) XXX_Size() int { + return m.Size() +} +func (m *BusConfig) XXX_DiscardUnknown() { + xxx_messageInfo_BusConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_BusConfig proto.InternalMessageInfo + +func (m *CalendarEventSource) Reset() { *m = CalendarEventSource{} } +func (*CalendarEventSource) ProtoMessage() {} +func (*CalendarEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{23} +} +func (m *CalendarEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CalendarEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CalendarEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_CalendarEventSource.Merge(m, src) +} +func (m *CalendarEventSource) XXX_Size() int { + return m.Size() +} +func (m *CalendarEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_CalendarEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_CalendarEventSource proto.InternalMessageInfo + +func (m *CatchupConfiguration) Reset() { *m = CatchupConfiguration{} } +func (*CatchupConfiguration) ProtoMessage() {} +func (*CatchupConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{24} +} +func (m *CatchupConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CatchupConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CatchupConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_CatchupConfiguration.Merge(m, src) +} +func (m *CatchupConfiguration) XXX_Size() int { + return m.Size() +} +func (m *CatchupConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_CatchupConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_CatchupConfiguration proto.InternalMessageInfo + +func (m *Condition) Reset() { *m = Condition{} } +func (*Condition) ProtoMessage() {} +func (*Condition) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{25} +} +func (m *Condition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Condition) XXX_Merge(src proto.Message) { + xxx_messageInfo_Condition.Merge(m, src) +} +func (m *Condition) XXX_Size() int { + return m.Size() +} +func (m *Condition) XXX_DiscardUnknown() { + xxx_messageInfo_Condition.DiscardUnknown(m) +} + +var xxx_messageInfo_Condition proto.InternalMessageInfo + +func (m *ConditionsResetByTime) Reset() { *m = ConditionsResetByTime{} } +func (*ConditionsResetByTime) ProtoMessage() {} +func (*ConditionsResetByTime) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{26} +} +func (m *ConditionsResetByTime) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConditionsResetByTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConditionsResetByTime) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConditionsResetByTime.Merge(m, src) +} +func (m *ConditionsResetByTime) XXX_Size() int { + return m.Size() +} +func (m *ConditionsResetByTime) XXX_DiscardUnknown() { + xxx_messageInfo_ConditionsResetByTime.DiscardUnknown(m) +} + +var xxx_messageInfo_ConditionsResetByTime proto.InternalMessageInfo + +func (m *ConditionsResetCriteria) Reset() { *m = ConditionsResetCriteria{} } +func (*ConditionsResetCriteria) ProtoMessage() {} +func (*ConditionsResetCriteria) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{27} +} +func (m *ConditionsResetCriteria) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConditionsResetCriteria) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConditionsResetCriteria) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConditionsResetCriteria.Merge(m, src) +} +func (m *ConditionsResetCriteria) XXX_Size() int { + return m.Size() +} +func (m *ConditionsResetCriteria) XXX_DiscardUnknown() { + xxx_messageInfo_ConditionsResetCriteria.DiscardUnknown(m) +} + +var xxx_messageInfo_ConditionsResetCriteria proto.InternalMessageInfo + +func (m *ConfigMapPersistence) Reset() { *m = ConfigMapPersistence{} } +func (*ConfigMapPersistence) ProtoMessage() {} +func (*ConfigMapPersistence) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{28} +} +func (m *ConfigMapPersistence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigMapPersistence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConfigMapPersistence) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigMapPersistence.Merge(m, src) +} +func (m *ConfigMapPersistence) XXX_Size() int { + return m.Size() +} +func (m *ConfigMapPersistence) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigMapPersistence.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigMapPersistence proto.InternalMessageInfo + +func (m *Container) Reset() { *m = Container{} } +func (*Container) ProtoMessage() {} +func (*Container) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{29} +} +func (m *Container) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Container) XXX_Merge(src proto.Message) { + xxx_messageInfo_Container.Merge(m, src) +} +func (m *Container) XXX_Size() int { + return m.Size() +} +func (m *Container) XXX_DiscardUnknown() { + xxx_messageInfo_Container.DiscardUnknown(m) +} + +var xxx_messageInfo_Container proto.InternalMessageInfo + +func (m *ContainerTemplate) Reset() { *m = ContainerTemplate{} } +func (*ContainerTemplate) ProtoMessage() {} +func (*ContainerTemplate) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{30} +} +func (m *ContainerTemplate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContainerTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ContainerTemplate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContainerTemplate.Merge(m, src) +} +func (m *ContainerTemplate) XXX_Size() int { + return m.Size() +} +func (m *ContainerTemplate) XXX_DiscardUnknown() { + xxx_messageInfo_ContainerTemplate.DiscardUnknown(m) +} + +var xxx_messageInfo_ContainerTemplate proto.InternalMessageInfo + +func (m *CustomTrigger) Reset() { *m = CustomTrigger{} } +func (*CustomTrigger) ProtoMessage() {} +func (*CustomTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{31} +} +func (m *CustomTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CustomTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CustomTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_CustomTrigger.Merge(m, src) +} +func (m *CustomTrigger) XXX_Size() int { + return m.Size() +} +func (m *CustomTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_CustomTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_CustomTrigger proto.InternalMessageInfo + +func (m *DataFilter) Reset() { *m = DataFilter{} } +func (*DataFilter) ProtoMessage() {} +func (*DataFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{32} +} +func (m *DataFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DataFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DataFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_DataFilter.Merge(m, src) +} +func (m *DataFilter) XXX_Size() int { + return m.Size() +} +func (m *DataFilter) XXX_DiscardUnknown() { + xxx_messageInfo_DataFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_DataFilter proto.InternalMessageInfo + +func (m *EmailTrigger) Reset() { *m = EmailTrigger{} } +func (*EmailTrigger) ProtoMessage() {} +func (*EmailTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{33} +} +func (m *EmailTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmailTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EmailTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmailTrigger.Merge(m, src) +} +func (m *EmailTrigger) XXX_Size() int { + return m.Size() +} +func (m *EmailTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_EmailTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_EmailTrigger proto.InternalMessageInfo + +func (m *EmitterEventSource) Reset() { *m = EmitterEventSource{} } +func (*EmitterEventSource) ProtoMessage() {} +func (*EmitterEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{34} +} +func (m *EmitterEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmitterEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EmitterEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmitterEventSource.Merge(m, src) +} +func (m *EmitterEventSource) XXX_Size() int { + return m.Size() +} +func (m *EmitterEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_EmitterEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_EmitterEventSource proto.InternalMessageInfo + +func (m *Event) Reset() { *m = Event{} } +func (*Event) ProtoMessage() {} +func (*Event) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{35} +} +func (m *Event) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Event) XXX_Merge(src proto.Message) { + xxx_messageInfo_Event.Merge(m, src) +} +func (m *Event) XXX_Size() int { + return m.Size() +} +func (m *Event) XXX_DiscardUnknown() { + xxx_messageInfo_Event.DiscardUnknown(m) +} + +var xxx_messageInfo_Event proto.InternalMessageInfo + +func (m *EventBus) Reset() { *m = EventBus{} } +func (*EventBus) ProtoMessage() {} +func (*EventBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{36} +} +func (m *EventBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBus.Merge(m, src) +} +func (m *EventBus) XXX_Size() int { + return m.Size() +} +func (m *EventBus) XXX_DiscardUnknown() { + xxx_messageInfo_EventBus.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBus proto.InternalMessageInfo + +func (m *EventBusList) Reset() { *m = EventBusList{} } +func (*EventBusList) ProtoMessage() {} +func (*EventBusList) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{37} +} +func (m *EventBusList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBusList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBusList) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBusList.Merge(m, src) +} +func (m *EventBusList) XXX_Size() int { + return m.Size() +} +func (m *EventBusList) XXX_DiscardUnknown() { + xxx_messageInfo_EventBusList.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBusList proto.InternalMessageInfo + +func (m *EventBusSpec) Reset() { *m = EventBusSpec{} } +func (*EventBusSpec) ProtoMessage() {} +func (*EventBusSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{38} +} +func (m *EventBusSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBusSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBusSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBusSpec.Merge(m, src) +} +func (m *EventBusSpec) XXX_Size() int { + return m.Size() +} +func (m *EventBusSpec) XXX_DiscardUnknown() { + xxx_messageInfo_EventBusSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBusSpec proto.InternalMessageInfo + +func (m *EventBusStatus) Reset() { *m = EventBusStatus{} } +func (*EventBusStatus) ProtoMessage() {} +func (*EventBusStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{39} +} +func (m *EventBusStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBusStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBusStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBusStatus.Merge(m, src) +} +func (m *EventBusStatus) XXX_Size() int { + return m.Size() +} +func (m *EventBusStatus) XXX_DiscardUnknown() { + xxx_messageInfo_EventBusStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBusStatus proto.InternalMessageInfo + +func (m *EventContext) Reset() { *m = EventContext{} } +func (*EventContext) ProtoMessage() {} +func (*EventContext) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{40} +} +func (m *EventContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventContext.Merge(m, src) +} +func (m *EventContext) XXX_Size() int { + return m.Size() +} +func (m *EventContext) XXX_DiscardUnknown() { + xxx_messageInfo_EventContext.DiscardUnknown(m) +} + +var xxx_messageInfo_EventContext proto.InternalMessageInfo + +func (m *EventDependency) Reset() { *m = EventDependency{} } +func (*EventDependency) ProtoMessage() {} +func (*EventDependency) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{41} +} +func (m *EventDependency) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDependency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventDependency) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDependency.Merge(m, src) +} +func (m *EventDependency) XXX_Size() int { + return m.Size() +} +func (m *EventDependency) XXX_DiscardUnknown() { + xxx_messageInfo_EventDependency.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDependency proto.InternalMessageInfo + +func (m *EventDependencyFilter) Reset() { *m = EventDependencyFilter{} } +func (*EventDependencyFilter) ProtoMessage() {} +func (*EventDependencyFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{42} +} +func (m *EventDependencyFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDependencyFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventDependencyFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDependencyFilter.Merge(m, src) +} +func (m *EventDependencyFilter) XXX_Size() int { + return m.Size() +} +func (m *EventDependencyFilter) XXX_DiscardUnknown() { + xxx_messageInfo_EventDependencyFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDependencyFilter proto.InternalMessageInfo + +func (m *EventDependencyTransformer) Reset() { *m = EventDependencyTransformer{} } +func (*EventDependencyTransformer) ProtoMessage() {} +func (*EventDependencyTransformer) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{43} +} +func (m *EventDependencyTransformer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDependencyTransformer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventDependencyTransformer) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDependencyTransformer.Merge(m, src) +} +func (m *EventDependencyTransformer) XXX_Size() int { + return m.Size() +} +func (m *EventDependencyTransformer) XXX_DiscardUnknown() { + xxx_messageInfo_EventDependencyTransformer.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDependencyTransformer proto.InternalMessageInfo + +func (m *EventPersistence) Reset() { *m = EventPersistence{} } +func (*EventPersistence) ProtoMessage() {} +func (*EventPersistence) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{44} +} +func (m *EventPersistence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventPersistence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventPersistence) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventPersistence.Merge(m, src) +} +func (m *EventPersistence) XXX_Size() int { + return m.Size() +} +func (m *EventPersistence) XXX_DiscardUnknown() { + xxx_messageInfo_EventPersistence.DiscardUnknown(m) +} + +var xxx_messageInfo_EventPersistence proto.InternalMessageInfo + +func (m *EventSource) Reset() { *m = EventSource{} } +func (*EventSource) ProtoMessage() {} +func (*EventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{45} +} +func (m *EventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSource.Merge(m, src) +} +func (m *EventSource) XXX_Size() int { + return m.Size() +} +func (m *EventSource) XXX_DiscardUnknown() { + xxx_messageInfo_EventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSource proto.InternalMessageInfo + +func (m *EventSourceFilter) Reset() { *m = EventSourceFilter{} } +func (*EventSourceFilter) ProtoMessage() {} +func (*EventSourceFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{46} +} +func (m *EventSourceFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceFilter.Merge(m, src) +} +func (m *EventSourceFilter) XXX_Size() int { + return m.Size() +} +func (m *EventSourceFilter) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceFilter proto.InternalMessageInfo + +func (m *EventSourceList) Reset() { *m = EventSourceList{} } +func (*EventSourceList) ProtoMessage() {} +func (*EventSourceList) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{47} +} +func (m *EventSourceList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceList) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceList.Merge(m, src) +} +func (m *EventSourceList) XXX_Size() int { + return m.Size() +} +func (m *EventSourceList) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceList.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceList proto.InternalMessageInfo + +func (m *EventSourceSpec) Reset() { *m = EventSourceSpec{} } +func (*EventSourceSpec) ProtoMessage() {} +func (*EventSourceSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{48} +} +func (m *EventSourceSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceSpec.Merge(m, src) +} +func (m *EventSourceSpec) XXX_Size() int { + return m.Size() +} +func (m *EventSourceSpec) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceSpec proto.InternalMessageInfo + +func (m *EventSourceStatus) Reset() { *m = EventSourceStatus{} } +func (*EventSourceStatus) ProtoMessage() {} +func (*EventSourceStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{49} +} +func (m *EventSourceStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceStatus.Merge(m, src) +} +func (m *EventSourceStatus) XXX_Size() int { + return m.Size() +} +func (m *EventSourceStatus) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceStatus proto.InternalMessageInfo + +func (m *ExprFilter) Reset() { *m = ExprFilter{} } +func (*ExprFilter) ProtoMessage() {} +func (*ExprFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{50} +} +func (m *ExprFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExprFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ExprFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExprFilter.Merge(m, src) +} +func (m *ExprFilter) XXX_Size() int { + return m.Size() +} +func (m *ExprFilter) XXX_DiscardUnknown() { + xxx_messageInfo_ExprFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_ExprFilter proto.InternalMessageInfo + +func (m *FileArtifact) Reset() { *m = FileArtifact{} } +func (*FileArtifact) ProtoMessage() {} +func (*FileArtifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{51} +} +func (m *FileArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileArtifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FileArtifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileArtifact.Merge(m, src) +} +func (m *FileArtifact) XXX_Size() int { + return m.Size() +} +func (m *FileArtifact) XXX_DiscardUnknown() { + xxx_messageInfo_FileArtifact.DiscardUnknown(m) +} + +var xxx_messageInfo_FileArtifact proto.InternalMessageInfo + +func (m *FileEventSource) Reset() { *m = FileEventSource{} } +func (*FileEventSource) ProtoMessage() {} +func (*FileEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{52} +} +func (m *FileEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FileEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileEventSource.Merge(m, src) +} +func (m *FileEventSource) XXX_Size() int { + return m.Size() +} +func (m *FileEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_FileEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_FileEventSource proto.InternalMessageInfo + +func (m *GenericEventSource) Reset() { *m = GenericEventSource{} } +func (*GenericEventSource) ProtoMessage() {} +func (*GenericEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{53} +} +func (m *GenericEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenericEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenericEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenericEventSource.Merge(m, src) +} +func (m *GenericEventSource) XXX_Size() int { + return m.Size() +} +func (m *GenericEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GenericEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GenericEventSource proto.InternalMessageInfo + +func (m *GerritEventSource) Reset() { *m = GerritEventSource{} } +func (*GerritEventSource) ProtoMessage() {} +func (*GerritEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{54} +} +func (m *GerritEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GerritEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GerritEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GerritEventSource.Merge(m, src) +} +func (m *GerritEventSource) XXX_Size() int { + return m.Size() +} +func (m *GerritEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GerritEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GerritEventSource proto.InternalMessageInfo + +func (m *GitArtifact) Reset() { *m = GitArtifact{} } +func (*GitArtifact) ProtoMessage() {} +func (*GitArtifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{55} +} +func (m *GitArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitArtifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitArtifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitArtifact.Merge(m, src) +} +func (m *GitArtifact) XXX_Size() int { + return m.Size() +} +func (m *GitArtifact) XXX_DiscardUnknown() { + xxx_messageInfo_GitArtifact.DiscardUnknown(m) +} + +var xxx_messageInfo_GitArtifact proto.InternalMessageInfo + +func (m *GitCreds) Reset() { *m = GitCreds{} } +func (*GitCreds) ProtoMessage() {} +func (*GitCreds) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{56} +} +func (m *GitCreds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitCreds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitCreds) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitCreds.Merge(m, src) +} +func (m *GitCreds) XXX_Size() int { + return m.Size() +} +func (m *GitCreds) XXX_DiscardUnknown() { + xxx_messageInfo_GitCreds.DiscardUnknown(m) +} + +var xxx_messageInfo_GitCreds proto.InternalMessageInfo + +func (m *GitRemoteConfig) Reset() { *m = GitRemoteConfig{} } +func (*GitRemoteConfig) ProtoMessage() {} +func (*GitRemoteConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{57} +} +func (m *GitRemoteConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitRemoteConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitRemoteConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitRemoteConfig.Merge(m, src) +} +func (m *GitRemoteConfig) XXX_Size() int { + return m.Size() +} +func (m *GitRemoteConfig) XXX_DiscardUnknown() { + xxx_messageInfo_GitRemoteConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_GitRemoteConfig proto.InternalMessageInfo + +func (m *GithubAppCreds) Reset() { *m = GithubAppCreds{} } +func (*GithubAppCreds) ProtoMessage() {} +func (*GithubAppCreds) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{58} +} +func (m *GithubAppCreds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GithubAppCreds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GithubAppCreds) XXX_Merge(src proto.Message) { + xxx_messageInfo_GithubAppCreds.Merge(m, src) +} +func (m *GithubAppCreds) XXX_Size() int { + return m.Size() +} +func (m *GithubAppCreds) XXX_DiscardUnknown() { + xxx_messageInfo_GithubAppCreds.DiscardUnknown(m) +} + +var xxx_messageInfo_GithubAppCreds proto.InternalMessageInfo + +func (m *GithubEventSource) Reset() { *m = GithubEventSource{} } +func (*GithubEventSource) ProtoMessage() {} +func (*GithubEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{59} +} +func (m *GithubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GithubEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GithubEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GithubEventSource.Merge(m, src) +} +func (m *GithubEventSource) XXX_Size() int { + return m.Size() +} +func (m *GithubEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GithubEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GithubEventSource proto.InternalMessageInfo + +func (m *GitlabEventSource) Reset() { *m = GitlabEventSource{} } +func (*GitlabEventSource) ProtoMessage() {} +func (*GitlabEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{60} +} +func (m *GitlabEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitlabEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitlabEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitlabEventSource.Merge(m, src) +} +func (m *GitlabEventSource) XXX_Size() int { + return m.Size() +} +func (m *GitlabEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GitlabEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GitlabEventSource proto.InternalMessageInfo + +func (m *HDFSEventSource) Reset() { *m = HDFSEventSource{} } +func (*HDFSEventSource) ProtoMessage() {} +func (*HDFSEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{61} +} +func (m *HDFSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HDFSEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HDFSEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_HDFSEventSource.Merge(m, src) +} +func (m *HDFSEventSource) XXX_Size() int { + return m.Size() +} +func (m *HDFSEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_HDFSEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_HDFSEventSource proto.InternalMessageInfo + +func (m *HTTPTrigger) Reset() { *m = HTTPTrigger{} } +func (*HTTPTrigger) ProtoMessage() {} +func (*HTTPTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{62} +} +func (m *HTTPTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HTTPTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPTrigger.Merge(m, src) +} +func (m *HTTPTrigger) XXX_Size() int { + return m.Size() +} +func (m *HTTPTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPTrigger proto.InternalMessageInfo + +func (m *Int64OrString) Reset() { *m = Int64OrString{} } +func (*Int64OrString) ProtoMessage() {} +func (*Int64OrString) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{63} +} +func (m *Int64OrString) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Int64OrString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Int64OrString) XXX_Merge(src proto.Message) { + xxx_messageInfo_Int64OrString.Merge(m, src) +} +func (m *Int64OrString) XXX_Size() int { + return m.Size() +} +func (m *Int64OrString) XXX_DiscardUnknown() { + xxx_messageInfo_Int64OrString.DiscardUnknown(m) +} + +var xxx_messageInfo_Int64OrString proto.InternalMessageInfo + +func (m *JetStreamBus) Reset() { *m = JetStreamBus{} } +func (*JetStreamBus) ProtoMessage() {} +func (*JetStreamBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{64} +} +func (m *JetStreamBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JetStreamBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *JetStreamBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_JetStreamBus.Merge(m, src) +} +func (m *JetStreamBus) XXX_Size() int { + return m.Size() +} +func (m *JetStreamBus) XXX_DiscardUnknown() { + xxx_messageInfo_JetStreamBus.DiscardUnknown(m) +} + +var xxx_messageInfo_JetStreamBus proto.InternalMessageInfo + +func (m *JetStreamConfig) Reset() { *m = JetStreamConfig{} } +func (*JetStreamConfig) ProtoMessage() {} +func (*JetStreamConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{65} +} +func (m *JetStreamConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JetStreamConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *JetStreamConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_JetStreamConfig.Merge(m, src) +} +func (m *JetStreamConfig) XXX_Size() int { + return m.Size() +} +func (m *JetStreamConfig) XXX_DiscardUnknown() { + xxx_messageInfo_JetStreamConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_JetStreamConfig proto.InternalMessageInfo + +func (m *K8SResource) Reset() { *m = K8SResource{} } +func (*K8SResource) ProtoMessage() {} +func (*K8SResource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{66} +} +func (m *K8SResource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *K8SResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *K8SResource) XXX_Merge(src proto.Message) { + xxx_messageInfo_K8SResource.Merge(m, src) +} +func (m *K8SResource) XXX_Size() int { + return m.Size() +} +func (m *K8SResource) XXX_DiscardUnknown() { + xxx_messageInfo_K8SResource.DiscardUnknown(m) +} + +var xxx_messageInfo_K8SResource proto.InternalMessageInfo + +func (m *K8SResourcePolicy) Reset() { *m = K8SResourcePolicy{} } +func (*K8SResourcePolicy) ProtoMessage() {} +func (*K8SResourcePolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{67} +} +func (m *K8SResourcePolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *K8SResourcePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *K8SResourcePolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_K8SResourcePolicy.Merge(m, src) +} +func (m *K8SResourcePolicy) XXX_Size() int { + return m.Size() +} +func (m *K8SResourcePolicy) XXX_DiscardUnknown() { + xxx_messageInfo_K8SResourcePolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_K8SResourcePolicy proto.InternalMessageInfo + +func (m *KafkaBus) Reset() { *m = KafkaBus{} } +func (*KafkaBus) ProtoMessage() {} +func (*KafkaBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{68} +} +func (m *KafkaBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaBus.Merge(m, src) +} +func (m *KafkaBus) XXX_Size() int { + return m.Size() +} +func (m *KafkaBus) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaBus.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaBus proto.InternalMessageInfo + +func (m *KafkaConsumerGroup) Reset() { *m = KafkaConsumerGroup{} } +func (*KafkaConsumerGroup) ProtoMessage() {} +func (*KafkaConsumerGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{69} +} +func (m *KafkaConsumerGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaConsumerGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaConsumerGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaConsumerGroup.Merge(m, src) +} +func (m *KafkaConsumerGroup) XXX_Size() int { + return m.Size() +} +func (m *KafkaConsumerGroup) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaConsumerGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaConsumerGroup proto.InternalMessageInfo + +func (m *KafkaEventSource) Reset() { *m = KafkaEventSource{} } +func (*KafkaEventSource) ProtoMessage() {} +func (*KafkaEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{70} +} +func (m *KafkaEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaEventSource.Merge(m, src) +} +func (m *KafkaEventSource) XXX_Size() int { + return m.Size() +} +func (m *KafkaEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaEventSource proto.InternalMessageInfo + +func (m *KafkaTrigger) Reset() { *m = KafkaTrigger{} } +func (*KafkaTrigger) ProtoMessage() {} +func (*KafkaTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{71} +} +func (m *KafkaTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaTrigger.Merge(m, src) +} +func (m *KafkaTrigger) XXX_Size() int { + return m.Size() +} +func (m *KafkaTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaTrigger proto.InternalMessageInfo + +func (m *LogTrigger) Reset() { *m = LogTrigger{} } +func (*LogTrigger) ProtoMessage() {} +func (*LogTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{72} +} +func (m *LogTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LogTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LogTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogTrigger.Merge(m, src) +} +func (m *LogTrigger) XXX_Size() int { + return m.Size() +} +func (m *LogTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_LogTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_LogTrigger proto.InternalMessageInfo + +func (m *MQTTEventSource) Reset() { *m = MQTTEventSource{} } +func (*MQTTEventSource) ProtoMessage() {} +func (*MQTTEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{73} +} +func (m *MQTTEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MQTTEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MQTTEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_MQTTEventSource.Merge(m, src) +} +func (m *MQTTEventSource) XXX_Size() int { + return m.Size() +} +func (m *MQTTEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_MQTTEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_MQTTEventSource proto.InternalMessageInfo + +func (m *Metadata) Reset() { *m = Metadata{} } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{74} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *NATSAuth) Reset() { *m = NATSAuth{} } +func (*NATSAuth) ProtoMessage() {} +func (*NATSAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{75} +} +func (m *NATSAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSAuth.Merge(m, src) +} +func (m *NATSAuth) XXX_Size() int { + return m.Size() +} +func (m *NATSAuth) XXX_DiscardUnknown() { + xxx_messageInfo_NATSAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSAuth proto.InternalMessageInfo + +func (m *NATSBus) Reset() { *m = NATSBus{} } +func (*NATSBus) ProtoMessage() {} +func (*NATSBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{76} +} +func (m *NATSBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSBus.Merge(m, src) +} +func (m *NATSBus) XXX_Size() int { + return m.Size() +} +func (m *NATSBus) XXX_DiscardUnknown() { + xxx_messageInfo_NATSBus.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSBus proto.InternalMessageInfo + +func (m *NATSConfig) Reset() { *m = NATSConfig{} } +func (*NATSConfig) ProtoMessage() {} +func (*NATSConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{77} +} +func (m *NATSConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSConfig.Merge(m, src) +} +func (m *NATSConfig) XXX_Size() int { + return m.Size() +} +func (m *NATSConfig) XXX_DiscardUnknown() { + xxx_messageInfo_NATSConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSConfig proto.InternalMessageInfo + +func (m *NATSEventsSource) Reset() { *m = NATSEventsSource{} } +func (*NATSEventsSource) ProtoMessage() {} +func (*NATSEventsSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{78} +} +func (m *NATSEventsSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSEventsSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSEventsSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSEventsSource.Merge(m, src) +} +func (m *NATSEventsSource) XXX_Size() int { + return m.Size() +} +func (m *NATSEventsSource) XXX_DiscardUnknown() { + xxx_messageInfo_NATSEventsSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSEventsSource proto.InternalMessageInfo + +func (m *NATSTrigger) Reset() { *m = NATSTrigger{} } +func (*NATSTrigger) ProtoMessage() {} +func (*NATSTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{79} +} +func (m *NATSTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSTrigger.Merge(m, src) +} +func (m *NATSTrigger) XXX_Size() int { + return m.Size() +} +func (m *NATSTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_NATSTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSTrigger proto.InternalMessageInfo + +func (m *NSQEventSource) Reset() { *m = NSQEventSource{} } +func (*NSQEventSource) ProtoMessage() {} +func (*NSQEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{80} +} +func (m *NSQEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NSQEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NSQEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NSQEventSource.Merge(m, src) +} +func (m *NSQEventSource) XXX_Size() int { + return m.Size() +} +func (m *NSQEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_NSQEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NSQEventSource proto.InternalMessageInfo + +func (m *NativeStrategy) Reset() { *m = NativeStrategy{} } +func (*NativeStrategy) ProtoMessage() {} +func (*NativeStrategy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{81} +} +func (m *NativeStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NativeStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NativeStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_NativeStrategy.Merge(m, src) +} +func (m *NativeStrategy) XXX_Size() int { + return m.Size() +} +func (m *NativeStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_NativeStrategy.DiscardUnknown(m) +} + +var xxx_messageInfo_NativeStrategy proto.InternalMessageInfo + +func (m *OpenWhiskTrigger) Reset() { *m = OpenWhiskTrigger{} } +func (*OpenWhiskTrigger) ProtoMessage() {} +func (*OpenWhiskTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{82} +} +func (m *OpenWhiskTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OpenWhiskTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OpenWhiskTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_OpenWhiskTrigger.Merge(m, src) +} +func (m *OpenWhiskTrigger) XXX_Size() int { + return m.Size() +} +func (m *OpenWhiskTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_OpenWhiskTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_OpenWhiskTrigger proto.InternalMessageInfo + +func (m *OwnedRepositories) Reset() { *m = OwnedRepositories{} } +func (*OwnedRepositories) ProtoMessage() {} +func (*OwnedRepositories) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{83} +} +func (m *OwnedRepositories) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OwnedRepositories) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OwnedRepositories) XXX_Merge(src proto.Message) { + xxx_messageInfo_OwnedRepositories.Merge(m, src) +} +func (m *OwnedRepositories) XXX_Size() int { + return m.Size() +} +func (m *OwnedRepositories) XXX_DiscardUnknown() { + xxx_messageInfo_OwnedRepositories.DiscardUnknown(m) +} + +var xxx_messageInfo_OwnedRepositories proto.InternalMessageInfo + +func (m *PayloadField) Reset() { *m = PayloadField{} } +func (*PayloadField) ProtoMessage() {} +func (*PayloadField) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{84} +} +func (m *PayloadField) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PayloadField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PayloadField) XXX_Merge(src proto.Message) { + xxx_messageInfo_PayloadField.Merge(m, src) +} +func (m *PayloadField) XXX_Size() int { + return m.Size() +} +func (m *PayloadField) XXX_DiscardUnknown() { + xxx_messageInfo_PayloadField.DiscardUnknown(m) +} + +var xxx_messageInfo_PayloadField proto.InternalMessageInfo + +func (m *PersistenceStrategy) Reset() { *m = PersistenceStrategy{} } +func (*PersistenceStrategy) ProtoMessage() {} +func (*PersistenceStrategy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{85} +} +func (m *PersistenceStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PersistenceStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PersistenceStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_PersistenceStrategy.Merge(m, src) +} +func (m *PersistenceStrategy) XXX_Size() int { + return m.Size() +} +func (m *PersistenceStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_PersistenceStrategy.DiscardUnknown(m) +} + +var xxx_messageInfo_PersistenceStrategy proto.InternalMessageInfo + +func (m *PubSubEventSource) Reset() { *m = PubSubEventSource{} } +func (*PubSubEventSource) ProtoMessage() {} +func (*PubSubEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{86} +} +func (m *PubSubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubSubEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PubSubEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubSubEventSource.Merge(m, src) +} +func (m *PubSubEventSource) XXX_Size() int { + return m.Size() +} +func (m *PubSubEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_PubSubEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PubSubEventSource proto.InternalMessageInfo + +func (m *PulsarEventSource) Reset() { *m = PulsarEventSource{} } +func (*PulsarEventSource) ProtoMessage() {} +func (*PulsarEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{87} +} +func (m *PulsarEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PulsarEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PulsarEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PulsarEventSource.Merge(m, src) +} +func (m *PulsarEventSource) XXX_Size() int { + return m.Size() +} +func (m *PulsarEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_PulsarEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PulsarEventSource proto.InternalMessageInfo + +func (m *PulsarTrigger) Reset() { *m = PulsarTrigger{} } +func (*PulsarTrigger) ProtoMessage() {} +func (*PulsarTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{88} +} +func (m *PulsarTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PulsarTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PulsarTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_PulsarTrigger.Merge(m, src) +} +func (m *PulsarTrigger) XXX_Size() int { + return m.Size() +} +func (m *PulsarTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_PulsarTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_PulsarTrigger proto.InternalMessageInfo + +func (m *RateLimit) Reset() { *m = RateLimit{} } +func (*RateLimit) ProtoMessage() {} +func (*RateLimit) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{89} +} +func (m *RateLimit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RateLimit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit.Merge(m, src) +} +func (m *RateLimit) XXX_Size() int { + return m.Size() +} +func (m *RateLimit) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit.DiscardUnknown(m) +} + +var xxx_messageInfo_RateLimit proto.InternalMessageInfo + +func (m *RedisEventSource) Reset() { *m = RedisEventSource{} } +func (*RedisEventSource) ProtoMessage() {} +func (*RedisEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{90} +} +func (m *RedisEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RedisEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RedisEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedisEventSource.Merge(m, src) +} +func (m *RedisEventSource) XXX_Size() int { + return m.Size() +} +func (m *RedisEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_RedisEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_RedisEventSource proto.InternalMessageInfo + +func (m *RedisStreamEventSource) Reset() { *m = RedisStreamEventSource{} } +func (*RedisStreamEventSource) ProtoMessage() {} +func (*RedisStreamEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{91} +} +func (m *RedisStreamEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RedisStreamEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RedisStreamEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedisStreamEventSource.Merge(m, src) +} +func (m *RedisStreamEventSource) XXX_Size() int { + return m.Size() +} +func (m *RedisStreamEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_RedisStreamEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_RedisStreamEventSource proto.InternalMessageInfo + +func (m *ResourceEventSource) Reset() { *m = ResourceEventSource{} } +func (*ResourceEventSource) ProtoMessage() {} +func (*ResourceEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{92} +} +func (m *ResourceEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ResourceEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceEventSource.Merge(m, src) +} +func (m *ResourceEventSource) XXX_Size() int { + return m.Size() +} +func (m *ResourceEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceEventSource proto.InternalMessageInfo + +func (m *ResourceFilter) Reset() { *m = ResourceFilter{} } +func (*ResourceFilter) ProtoMessage() {} +func (*ResourceFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{93} +} +func (m *ResourceFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ResourceFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceFilter.Merge(m, src) +} +func (m *ResourceFilter) XXX_Size() int { + return m.Size() +} +func (m *ResourceFilter) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceFilter proto.InternalMessageInfo + +func (m *S3Artifact) Reset() { *m = S3Artifact{} } +func (*S3Artifact) ProtoMessage() {} +func (*S3Artifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{94} +} +func (m *S3Artifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *S3Artifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *S3Artifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_S3Artifact.Merge(m, src) +} +func (m *S3Artifact) XXX_Size() int { + return m.Size() +} +func (m *S3Artifact) XXX_DiscardUnknown() { + xxx_messageInfo_S3Artifact.DiscardUnknown(m) +} + +var xxx_messageInfo_S3Artifact proto.InternalMessageInfo + +func (m *S3Bucket) Reset() { *m = S3Bucket{} } +func (*S3Bucket) ProtoMessage() {} +func (*S3Bucket) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{95} +} +func (m *S3Bucket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *S3Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *S3Bucket) XXX_Merge(src proto.Message) { + xxx_messageInfo_S3Bucket.Merge(m, src) +} +func (m *S3Bucket) XXX_Size() int { + return m.Size() +} +func (m *S3Bucket) XXX_DiscardUnknown() { + xxx_messageInfo_S3Bucket.DiscardUnknown(m) +} + +var xxx_messageInfo_S3Bucket proto.InternalMessageInfo + +func (m *S3Filter) Reset() { *m = S3Filter{} } +func (*S3Filter) ProtoMessage() {} +func (*S3Filter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{96} +} +func (m *S3Filter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *S3Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *S3Filter) XXX_Merge(src proto.Message) { + xxx_messageInfo_S3Filter.Merge(m, src) +} +func (m *S3Filter) XXX_Size() int { + return m.Size() +} +func (m *S3Filter) XXX_DiscardUnknown() { + xxx_messageInfo_S3Filter.DiscardUnknown(m) +} + +var xxx_messageInfo_S3Filter proto.InternalMessageInfo + +func (m *SASLConfig) Reset() { *m = SASLConfig{} } +func (*SASLConfig) ProtoMessage() {} +func (*SASLConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{97} +} +func (m *SASLConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SASLConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SASLConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_SASLConfig.Merge(m, src) +} +func (m *SASLConfig) XXX_Size() int { + return m.Size() +} +func (m *SASLConfig) XXX_DiscardUnknown() { + xxx_messageInfo_SASLConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_SASLConfig proto.InternalMessageInfo + +func (m *SFTPEventSource) Reset() { *m = SFTPEventSource{} } +func (*SFTPEventSource) ProtoMessage() {} +func (*SFTPEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{98} +} +func (m *SFTPEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SFTPEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SFTPEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SFTPEventSource.Merge(m, src) +} +func (m *SFTPEventSource) XXX_Size() int { + return m.Size() +} +func (m *SFTPEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SFTPEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SFTPEventSource proto.InternalMessageInfo + +func (m *SNSEventSource) Reset() { *m = SNSEventSource{} } +func (*SNSEventSource) ProtoMessage() {} +func (*SNSEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{99} +} +func (m *SNSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SNSEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SNSEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SNSEventSource.Merge(m, src) +} +func (m *SNSEventSource) XXX_Size() int { + return m.Size() +} +func (m *SNSEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SNSEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SNSEventSource proto.InternalMessageInfo + +func (m *SQSEventSource) Reset() { *m = SQSEventSource{} } +func (*SQSEventSource) ProtoMessage() {} +func (*SQSEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{100} +} +func (m *SQSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SQSEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SQSEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SQSEventSource.Merge(m, src) +} +func (m *SQSEventSource) XXX_Size() int { + return m.Size() +} +func (m *SQSEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SQSEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SQSEventSource proto.InternalMessageInfo + +func (m *SchemaRegistryConfig) Reset() { *m = SchemaRegistryConfig{} } +func (*SchemaRegistryConfig) ProtoMessage() {} +func (*SchemaRegistryConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{101} +} +func (m *SchemaRegistryConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SchemaRegistryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SchemaRegistryConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_SchemaRegistryConfig.Merge(m, src) +} +func (m *SchemaRegistryConfig) XXX_Size() int { + return m.Size() +} +func (m *SchemaRegistryConfig) XXX_DiscardUnknown() { + xxx_messageInfo_SchemaRegistryConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_SchemaRegistryConfig proto.InternalMessageInfo + +func (m *SecureHeader) Reset() { *m = SecureHeader{} } +func (*SecureHeader) ProtoMessage() {} +func (*SecureHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{102} +} +func (m *SecureHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SecureHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SecureHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecureHeader.Merge(m, src) +} +func (m *SecureHeader) XXX_Size() int { + return m.Size() +} +func (m *SecureHeader) XXX_DiscardUnknown() { + xxx_messageInfo_SecureHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_SecureHeader proto.InternalMessageInfo + +func (m *Selector) Reset() { *m = Selector{} } +func (*Selector) ProtoMessage() {} +func (*Selector) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{103} +} +func (m *Selector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Selector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Selector) XXX_Merge(src proto.Message) { + xxx_messageInfo_Selector.Merge(m, src) +} +func (m *Selector) XXX_Size() int { + return m.Size() +} +func (m *Selector) XXX_DiscardUnknown() { + xxx_messageInfo_Selector.DiscardUnknown(m) +} + +var xxx_messageInfo_Selector proto.InternalMessageInfo + +func (m *Sensor) Reset() { *m = Sensor{} } +func (*Sensor) ProtoMessage() {} +func (*Sensor) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{104} +} +func (m *Sensor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sensor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Sensor) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sensor.Merge(m, src) +} +func (m *Sensor) XXX_Size() int { + return m.Size() +} +func (m *Sensor) XXX_DiscardUnknown() { + xxx_messageInfo_Sensor.DiscardUnknown(m) +} + +var xxx_messageInfo_Sensor proto.InternalMessageInfo + +func (m *SensorList) Reset() { *m = SensorList{} } +func (*SensorList) ProtoMessage() {} +func (*SensorList) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{105} +} +func (m *SensorList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SensorList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SensorList) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorList.Merge(m, src) +} +func (m *SensorList) XXX_Size() int { + return m.Size() +} +func (m *SensorList) XXX_DiscardUnknown() { + xxx_messageInfo_SensorList.DiscardUnknown(m) +} + +var xxx_messageInfo_SensorList proto.InternalMessageInfo + +func (m *SensorSpec) Reset() { *m = SensorSpec{} } +func (*SensorSpec) ProtoMessage() {} +func (*SensorSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{106} +} +func (m *SensorSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SensorSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SensorSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorSpec.Merge(m, src) +} +func (m *SensorSpec) XXX_Size() int { + return m.Size() +} +func (m *SensorSpec) XXX_DiscardUnknown() { + xxx_messageInfo_SensorSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_SensorSpec proto.InternalMessageInfo + +func (m *SensorStatus) Reset() { *m = SensorStatus{} } +func (*SensorStatus) ProtoMessage() {} +func (*SensorStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{107} +} +func (m *SensorStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SensorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SensorStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorStatus.Merge(m, src) +} +func (m *SensorStatus) XXX_Size() int { + return m.Size() +} +func (m *SensorStatus) XXX_DiscardUnknown() { + xxx_messageInfo_SensorStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_SensorStatus proto.InternalMessageInfo + +func (m *Service) Reset() { *m = Service{} } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{108} +} +func (m *Service) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_Service.Merge(m, src) +} +func (m *Service) XXX_Size() int { + return m.Size() +} +func (m *Service) XXX_DiscardUnknown() { + xxx_messageInfo_Service.DiscardUnknown(m) +} + +var xxx_messageInfo_Service proto.InternalMessageInfo + +func (m *SlackEventSource) Reset() { *m = SlackEventSource{} } +func (*SlackEventSource) ProtoMessage() {} +func (*SlackEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{109} +} +func (m *SlackEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackEventSource.Merge(m, src) +} +func (m *SlackEventSource) XXX_Size() int { + return m.Size() +} +func (m *SlackEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SlackEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackEventSource proto.InternalMessageInfo + +func (m *SlackSender) Reset() { *m = SlackSender{} } +func (*SlackSender) ProtoMessage() {} +func (*SlackSender) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{110} +} +func (m *SlackSender) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackSender) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackSender) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackSender.Merge(m, src) +} +func (m *SlackSender) XXX_Size() int { + return m.Size() +} +func (m *SlackSender) XXX_DiscardUnknown() { + xxx_messageInfo_SlackSender.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackSender proto.InternalMessageInfo + +func (m *SlackThread) Reset() { *m = SlackThread{} } +func (*SlackThread) ProtoMessage() {} +func (*SlackThread) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{111} +} +func (m *SlackThread) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackThread) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackThread) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackThread.Merge(m, src) +} +func (m *SlackThread) XXX_Size() int { + return m.Size() +} +func (m *SlackThread) XXX_DiscardUnknown() { + xxx_messageInfo_SlackThread.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackThread proto.InternalMessageInfo + +func (m *SlackTrigger) Reset() { *m = SlackTrigger{} } +func (*SlackTrigger) ProtoMessage() {} +func (*SlackTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{112} +} +func (m *SlackTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackTrigger.Merge(m, src) +} +func (m *SlackTrigger) XXX_Size() int { + return m.Size() +} +func (m *SlackTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_SlackTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackTrigger proto.InternalMessageInfo + +func (m *StandardK8STrigger) Reset() { *m = StandardK8STrigger{} } +func (*StandardK8STrigger) ProtoMessage() {} +func (*StandardK8STrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{113} +} +func (m *StandardK8STrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StandardK8STrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StandardK8STrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_StandardK8STrigger.Merge(m, src) +} +func (m *StandardK8STrigger) XXX_Size() int { + return m.Size() +} +func (m *StandardK8STrigger) XXX_DiscardUnknown() { + xxx_messageInfo_StandardK8STrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_StandardK8STrigger proto.InternalMessageInfo + +func (m *Status) Reset() { *m = Status{} } +func (*Status) ProtoMessage() {} +func (*Status) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{114} +} +func (m *Status) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Status) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status.Merge(m, src) +} +func (m *Status) XXX_Size() int { + return m.Size() +} +func (m *Status) XXX_DiscardUnknown() { + xxx_messageInfo_Status.DiscardUnknown(m) +} + +var xxx_messageInfo_Status proto.InternalMessageInfo + +func (m *StatusPolicy) Reset() { *m = StatusPolicy{} } +func (*StatusPolicy) ProtoMessage() {} +func (*StatusPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{115} +} +func (m *StatusPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StatusPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusPolicy.Merge(m, src) +} +func (m *StatusPolicy) XXX_Size() int { + return m.Size() +} +func (m *StatusPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_StatusPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusPolicy proto.InternalMessageInfo + +func (m *StorageGridEventSource) Reset() { *m = StorageGridEventSource{} } +func (*StorageGridEventSource) ProtoMessage() {} +func (*StorageGridEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{116} +} +func (m *StorageGridEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StorageGridEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StorageGridEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_StorageGridEventSource.Merge(m, src) +} +func (m *StorageGridEventSource) XXX_Size() int { + return m.Size() +} +func (m *StorageGridEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_StorageGridEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_StorageGridEventSource proto.InternalMessageInfo + +func (m *StorageGridFilter) Reset() { *m = StorageGridFilter{} } +func (*StorageGridFilter) ProtoMessage() {} +func (*StorageGridFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{117} +} +func (m *StorageGridFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StorageGridFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StorageGridFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_StorageGridFilter.Merge(m, src) +} +func (m *StorageGridFilter) XXX_Size() int { + return m.Size() +} +func (m *StorageGridFilter) XXX_DiscardUnknown() { + xxx_messageInfo_StorageGridFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_StorageGridFilter proto.InternalMessageInfo + +func (m *StripeEventSource) Reset() { *m = StripeEventSource{} } +func (*StripeEventSource) ProtoMessage() {} +func (*StripeEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{118} +} +func (m *StripeEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StripeEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StripeEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_StripeEventSource.Merge(m, src) +} +func (m *StripeEventSource) XXX_Size() int { + return m.Size() +} +func (m *StripeEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_StripeEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_StripeEventSource proto.InternalMessageInfo + +func (m *TLSConfig) Reset() { *m = TLSConfig{} } +func (*TLSConfig) ProtoMessage() {} +func (*TLSConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{119} +} +func (m *TLSConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TLSConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TLSConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_TLSConfig.Merge(m, src) +} +func (m *TLSConfig) XXX_Size() int { + return m.Size() +} +func (m *TLSConfig) XXX_DiscardUnknown() { + xxx_messageInfo_TLSConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_TLSConfig proto.InternalMessageInfo + +func (m *Template) Reset() { *m = Template{} } +func (*Template) ProtoMessage() {} +func (*Template) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{120} +} +func (m *Template) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Template) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Template) XXX_Merge(src proto.Message) { + xxx_messageInfo_Template.Merge(m, src) +} +func (m *Template) XXX_Size() int { + return m.Size() +} +func (m *Template) XXX_DiscardUnknown() { + xxx_messageInfo_Template.DiscardUnknown(m) +} + +var xxx_messageInfo_Template proto.InternalMessageInfo + +func (m *TimeFilter) Reset() { *m = TimeFilter{} } +func (*TimeFilter) ProtoMessage() {} +func (*TimeFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{121} +} +func (m *TimeFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TimeFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TimeFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeFilter.Merge(m, src) +} +func (m *TimeFilter) XXX_Size() int { + return m.Size() +} +func (m *TimeFilter) XXX_DiscardUnknown() { + xxx_messageInfo_TimeFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeFilter proto.InternalMessageInfo + +func (m *Trigger) Reset() { *m = Trigger{} } +func (*Trigger) ProtoMessage() {} +func (*Trigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{122} +} +func (m *Trigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Trigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Trigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_Trigger.Merge(m, src) +} +func (m *Trigger) XXX_Size() int { + return m.Size() +} +func (m *Trigger) XXX_DiscardUnknown() { + xxx_messageInfo_Trigger.DiscardUnknown(m) +} + +var xxx_messageInfo_Trigger proto.InternalMessageInfo + +func (m *TriggerParameter) Reset() { *m = TriggerParameter{} } +func (*TriggerParameter) ProtoMessage() {} +func (*TriggerParameter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{123} +} +func (m *TriggerParameter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerParameter) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerParameter.Merge(m, src) +} +func (m *TriggerParameter) XXX_Size() int { + return m.Size() +} +func (m *TriggerParameter) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerParameter.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerParameter proto.InternalMessageInfo + +func (m *TriggerParameterSource) Reset() { *m = TriggerParameterSource{} } +func (*TriggerParameterSource) ProtoMessage() {} +func (*TriggerParameterSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{124} +} +func (m *TriggerParameterSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerParameterSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerParameterSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerParameterSource.Merge(m, src) +} +func (m *TriggerParameterSource) XXX_Size() int { + return m.Size() +} +func (m *TriggerParameterSource) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerParameterSource.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerParameterSource proto.InternalMessageInfo + +func (m *TriggerPolicy) Reset() { *m = TriggerPolicy{} } +func (*TriggerPolicy) ProtoMessage() {} +func (*TriggerPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{125} +} +func (m *TriggerPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerPolicy.Merge(m, src) +} +func (m *TriggerPolicy) XXX_Size() int { + return m.Size() +} +func (m *TriggerPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerPolicy proto.InternalMessageInfo + +func (m *TriggerTemplate) Reset() { *m = TriggerTemplate{} } +func (*TriggerTemplate) ProtoMessage() {} +func (*TriggerTemplate) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{126} +} +func (m *TriggerTemplate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerTemplate) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerTemplate.Merge(m, src) +} +func (m *TriggerTemplate) XXX_Size() int { + return m.Size() +} +func (m *TriggerTemplate) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerTemplate.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerTemplate proto.InternalMessageInfo + +func (m *URLArtifact) Reset() { *m = URLArtifact{} } +func (*URLArtifact) ProtoMessage() {} +func (*URLArtifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{127} +} +func (m *URLArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *URLArtifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *URLArtifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLArtifact.Merge(m, src) +} +func (m *URLArtifact) XXX_Size() int { + return m.Size() +} +func (m *URLArtifact) XXX_DiscardUnknown() { + xxx_messageInfo_URLArtifact.DiscardUnknown(m) +} + +var xxx_messageInfo_URLArtifact proto.InternalMessageInfo + +func (m *ValueFromSource) Reset() { *m = ValueFromSource{} } +func (*ValueFromSource) ProtoMessage() {} +func (*ValueFromSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{128} +} +func (m *ValueFromSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValueFromSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValueFromSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValueFromSource.Merge(m, src) +} +func (m *ValueFromSource) XXX_Size() int { + return m.Size() +} +func (m *ValueFromSource) XXX_DiscardUnknown() { + xxx_messageInfo_ValueFromSource.DiscardUnknown(m) +} + +var xxx_messageInfo_ValueFromSource proto.InternalMessageInfo + +func (m *WatchPathConfig) Reset() { *m = WatchPathConfig{} } +func (*WatchPathConfig) ProtoMessage() {} +func (*WatchPathConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{129} +} +func (m *WatchPathConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchPathConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WatchPathConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchPathConfig.Merge(m, src) +} +func (m *WatchPathConfig) XXX_Size() int { + return m.Size() +} +func (m *WatchPathConfig) XXX_DiscardUnknown() { + xxx_messageInfo_WatchPathConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_WatchPathConfig proto.InternalMessageInfo + +func (m *WebhookContext) Reset() { *m = WebhookContext{} } +func (*WebhookContext) ProtoMessage() {} +func (*WebhookContext) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{130} +} +func (m *WebhookContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WebhookContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WebhookContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebhookContext.Merge(m, src) +} +func (m *WebhookContext) XXX_Size() int { + return m.Size() +} +func (m *WebhookContext) XXX_DiscardUnknown() { + xxx_messageInfo_WebhookContext.DiscardUnknown(m) +} + +var xxx_messageInfo_WebhookContext proto.InternalMessageInfo + +func (m *WebhookEventSource) Reset() { *m = WebhookEventSource{} } +func (*WebhookEventSource) ProtoMessage() {} +func (*WebhookEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{131} +} +func (m *WebhookEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WebhookEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WebhookEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebhookEventSource.Merge(m, src) +} +func (m *WebhookEventSource) XXX_Size() int { + return m.Size() +} +func (m *WebhookEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_WebhookEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_WebhookEventSource proto.InternalMessageInfo + +func init() { + proto.RegisterType((*AMQPConsumeConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPConsumeConfig") + proto.RegisterType((*AMQPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPEventSource.MetadataEntry") + proto.RegisterType((*AMQPExchangeDeclareConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPExchangeDeclareConfig") + proto.RegisterType((*AMQPQueueBindConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPQueueBindConfig") + proto.RegisterType((*AMQPQueueDeclareConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPQueueDeclareConfig") + proto.RegisterType((*AWSLambdaTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AWSLambdaTrigger") + proto.RegisterType((*Amount)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Amount") + proto.RegisterType((*ArgoWorkflowTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ArgoWorkflowTrigger") + proto.RegisterType((*ArtifactLocation)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ArtifactLocation") + proto.RegisterType((*AzureEventHubsTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureEventHubsTrigger") + proto.RegisterType((*AzureEventsHubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureEventsHubEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureEventsHubEventSource.MetadataEntry") + proto.RegisterType((*AzureQueueStorageEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureQueueStorageEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureQueueStorageEventSource.MetadataEntry") + proto.RegisterType((*AzureServiceBusEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureServiceBusEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureServiceBusEventSource.MetadataEntry") + proto.RegisterType((*AzureServiceBusTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureServiceBusTrigger") + proto.RegisterType((*Backoff)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Backoff") + proto.RegisterType((*BasicAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BasicAuth") + proto.RegisterType((*BitbucketAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketAuth") + proto.RegisterType((*BitbucketBasicAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketBasicAuth") + proto.RegisterType((*BitbucketEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketEventSource.MetadataEntry") + proto.RegisterType((*BitbucketRepository)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketRepository") + proto.RegisterType((*BitbucketServerEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketServerEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketServerEventSource.MetadataEntry") + proto.RegisterType((*BitbucketServerRepository)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketServerRepository") + proto.RegisterType((*BusConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BusConfig") + proto.RegisterType((*CalendarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CalendarEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CalendarEventSource.MetadataEntry") + proto.RegisterType((*CatchupConfiguration)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CatchupConfiguration") + proto.RegisterType((*Condition)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Condition") + proto.RegisterType((*ConditionsResetByTime)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConditionsResetByTime") + proto.RegisterType((*ConditionsResetCriteria)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConditionsResetCriteria") + proto.RegisterType((*ConfigMapPersistence)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConfigMapPersistence") + proto.RegisterType((*Container)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Container") + proto.RegisterType((*ContainerTemplate)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ContainerTemplate") + proto.RegisterType((*CustomTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CustomTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CustomTrigger.SpecEntry") + proto.RegisterType((*DataFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.DataFilter") + proto.RegisterType((*EmailTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EmailTrigger") + proto.RegisterType((*EmitterEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EmitterEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EmitterEventSource.MetadataEntry") + proto.RegisterType((*Event)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Event") + proto.RegisterType((*EventBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBus") + proto.RegisterType((*EventBusList)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBusList") + proto.RegisterType((*EventBusSpec)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBusSpec") + proto.RegisterType((*EventBusStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBusStatus") + proto.RegisterType((*EventContext)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventContext") + proto.RegisterType((*EventDependency)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventDependency") + proto.RegisterType((*EventDependencyFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventDependencyFilter") + proto.RegisterType((*EventDependencyTransformer)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventDependencyTransformer") + proto.RegisterType((*EventPersistence)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventPersistence") + proto.RegisterType((*EventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSource") + proto.RegisterType((*EventSourceFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceFilter") + proto.RegisterType((*EventSourceList)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceList") + proto.RegisterType((*EventSourceSpec)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec") + proto.RegisterMapType((map[string]AMQPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AmqpEntry") + proto.RegisterMapType((map[string]AzureEventsHubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AzureEventsHubEntry") + proto.RegisterMapType((map[string]AzureQueueStorageEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AzureQueueStorageEntry") + proto.RegisterMapType((map[string]AzureServiceBusEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AzureServiceBusEntry") + proto.RegisterMapType((map[string]BitbucketEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.BitbucketEntry") + proto.RegisterMapType((map[string]BitbucketServerEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.BitbucketserverEntry") + proto.RegisterMapType((map[string]CalendarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.CalendarEntry") + proto.RegisterMapType((map[string]EmitterEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.EmitterEntry") + proto.RegisterMapType((map[string]FileEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.FileEntry") + proto.RegisterMapType((map[string]GenericEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GenericEntry") + proto.RegisterMapType((map[string]GerritEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GerritEntry") + proto.RegisterMapType((map[string]GithubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GithubEntry") + proto.RegisterMapType((map[string]GitlabEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GitlabEntry") + proto.RegisterMapType((map[string]HDFSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.HdfsEntry") + proto.RegisterMapType((map[string]KafkaEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.KafkaEntry") + proto.RegisterMapType((map[string]S3Artifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.MinioEntry") + proto.RegisterMapType((map[string]MQTTEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.MqttEntry") + proto.RegisterMapType((map[string]NATSEventsSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.NatsEntry") + proto.RegisterMapType((map[string]NSQEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.NsqEntry") + proto.RegisterMapType((map[string]PubSubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.PubSubEntry") + proto.RegisterMapType((map[string]PulsarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.PulsarEntry") + proto.RegisterMapType((map[string]RedisEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.RedisEntry") + proto.RegisterMapType((map[string]RedisStreamEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.RedisStreamEntry") + proto.RegisterMapType((map[string]ResourceEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.ResourceEntry") + proto.RegisterMapType((map[string]SFTPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SftpEntry") + proto.RegisterMapType((map[string]SlackEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SlackEntry") + proto.RegisterMapType((map[string]SNSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SnsEntry") + proto.RegisterMapType((map[string]SQSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SqsEntry") + proto.RegisterMapType((map[string]StorageGridEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.StorageGridEntry") + proto.RegisterMapType((map[string]StripeEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.StripeEntry") + proto.RegisterMapType((map[string]WebhookEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.WebhookEntry") + proto.RegisterType((*EventSourceStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceStatus") + proto.RegisterType((*ExprFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ExprFilter") + proto.RegisterType((*FileArtifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.FileArtifact") + proto.RegisterType((*FileEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.FileEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.FileEventSource.MetadataEntry") + proto.RegisterType((*GenericEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GenericEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GenericEventSource.MetadataEntry") + proto.RegisterType((*GerritEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GerritEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GerritEventSource.MetadataEntry") + proto.RegisterType((*GitArtifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitArtifact") + proto.RegisterType((*GitCreds)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitCreds") + proto.RegisterType((*GitRemoteConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitRemoteConfig") + proto.RegisterType((*GithubAppCreds)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GithubAppCreds") + proto.RegisterType((*GithubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GithubEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GithubEventSource.MetadataEntry") + proto.RegisterType((*GitlabEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitlabEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitlabEventSource.MetadataEntry") + proto.RegisterType((*HDFSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HDFSEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HDFSEventSource.MetadataEntry") + proto.RegisterType((*HTTPTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HTTPTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HTTPTrigger.HeadersEntry") + proto.RegisterType((*Int64OrString)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Int64OrString") + proto.RegisterType((*JetStreamBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.JetStreamBus") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.JetStreamBus.NodeSelectorEntry") + proto.RegisterType((*JetStreamConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.JetStreamConfig") + proto.RegisterType((*K8SResource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.K8SResource") + proto.RegisterType((*K8SResourcePolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.K8SResourcePolicy") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.K8SResourcePolicy.LabelsEntry") + proto.RegisterType((*KafkaBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaBus") + proto.RegisterType((*KafkaConsumerGroup)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaConsumerGroup") + proto.RegisterType((*KafkaEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaEventSource.MetadataEntry") + proto.RegisterType((*KafkaTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaTrigger.HeadersEntry") + proto.RegisterType((*LogTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.LogTrigger") + proto.RegisterType((*MQTTEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.MQTTEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.MQTTEventSource.MetadataEntry") + proto.RegisterType((*Metadata)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Metadata") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Metadata.AnnotationsEntry") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Metadata.LabelsEntry") + proto.RegisterType((*NATSAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSAuth") + proto.RegisterType((*NATSBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSBus") + proto.RegisterType((*NATSConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSConfig") + proto.RegisterType((*NATSEventsSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSEventsSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSEventsSource.MetadataEntry") + proto.RegisterType((*NATSTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSTrigger") + proto.RegisterType((*NSQEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NSQEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NSQEventSource.MetadataEntry") + proto.RegisterType((*NativeStrategy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NativeStrategy") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NativeStrategy.NodeSelectorEntry") + proto.RegisterType((*OpenWhiskTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.OpenWhiskTrigger") + proto.RegisterType((*OwnedRepositories)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.OwnedRepositories") + proto.RegisterType((*PayloadField)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PayloadField") + proto.RegisterType((*PersistenceStrategy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PersistenceStrategy") + proto.RegisterType((*PubSubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PubSubEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PubSubEventSource.MetadataEntry") + proto.RegisterType((*PulsarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarEventSource.AuthAthenzParamsEntry") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarEventSource.MetadataEntry") + proto.RegisterType((*PulsarTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarTrigger.AuthAthenzParamsEntry") + proto.RegisterType((*RateLimit)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RateLimit") + proto.RegisterType((*RedisEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisEventSource.MetadataEntry") + proto.RegisterType((*RedisStreamEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisStreamEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisStreamEventSource.MetadataEntry") + proto.RegisterType((*ResourceEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ResourceEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ResourceEventSource.MetadataEntry") + proto.RegisterType((*ResourceFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ResourceFilter") + proto.RegisterType((*S3Artifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Artifact") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Artifact.MetadataEntry") + proto.RegisterType((*S3Bucket)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Bucket") + proto.RegisterType((*S3Filter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Filter") + proto.RegisterType((*SASLConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SASLConfig") + proto.RegisterType((*SFTPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SFTPEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SFTPEventSource.MetadataEntry") + proto.RegisterType((*SNSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SNSEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SNSEventSource.MetadataEntry") + proto.RegisterType((*SQSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SQSEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SQSEventSource.MetadataEntry") + proto.RegisterType((*SchemaRegistryConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SchemaRegistryConfig") + proto.RegisterType((*SecureHeader)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SecureHeader") + proto.RegisterType((*Selector)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Selector") + proto.RegisterType((*Sensor)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Sensor") + proto.RegisterType((*SensorList)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorList") + proto.RegisterType((*SensorSpec)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorSpec") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorSpec.LoggingFieldsEntry") + proto.RegisterType((*SensorStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorStatus") + proto.RegisterType((*Service)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Service") + proto.RegisterType((*SlackEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackEventSource.MetadataEntry") + proto.RegisterType((*SlackSender)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackSender") + proto.RegisterType((*SlackThread)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackThread") + proto.RegisterType((*SlackTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackTrigger") + proto.RegisterType((*StandardK8STrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StandardK8STrigger") + proto.RegisterType((*Status)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Status") + proto.RegisterType((*StatusPolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StatusPolicy") + proto.RegisterType((*StorageGridEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StorageGridEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StorageGridEventSource.MetadataEntry") + proto.RegisterType((*StorageGridFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StorageGridFilter") + proto.RegisterType((*StripeEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StripeEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StripeEventSource.MetadataEntry") + proto.RegisterType((*TLSConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TLSConfig") + proto.RegisterType((*Template)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Template") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Template.NodeSelectorEntry") + proto.RegisterType((*TimeFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TimeFilter") + proto.RegisterType((*Trigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Trigger") + proto.RegisterType((*TriggerParameter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerParameter") + proto.RegisterType((*TriggerParameterSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerParameterSource") + proto.RegisterType((*TriggerPolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerPolicy") + proto.RegisterType((*TriggerTemplate)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerTemplate") + proto.RegisterType((*URLArtifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.URLArtifact") + proto.RegisterType((*ValueFromSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ValueFromSource") + proto.RegisterType((*WatchPathConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WatchPathConfig") + proto.RegisterType((*WebhookContext)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WebhookContext") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WebhookContext.MetadataEntry") + proto.RegisterType((*WebhookEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WebhookEventSource") +} + +func init() { + proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1/generated.proto", fileDescriptor_e864cc3344a263b9) +} + +var fileDescriptor_e864cc3344a263b9 = []byte{ + // 13058 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x6c, 0x24, 0xc9, + 0x75, 0xd8, 0xcd, 0x27, 0x39, 0x8f, 0x9f, 0x5b, 0xfb, 0x71, 0xbc, 0xf5, 0xdd, 0x72, 0x3d, 0x07, + 0x5d, 0xee, 0xec, 0x13, 0x29, 0xad, 0x24, 0x7b, 0x7d, 0x8a, 0xcf, 0x1a, 0x7e, 0xed, 0xf2, 0x96, + 0xe4, 0x72, 0xdf, 0x70, 0x77, 0xf5, 0xe5, 0xbb, 0x6b, 0xce, 0x14, 0x87, 0x7d, 0x9c, 0xe9, 0x9e, + 0xed, 0xee, 0xe1, 0x2e, 0x2f, 0x90, 0x7c, 0xb6, 0xa4, 0xb3, 0x24, 0x2b, 0x92, 0x2c, 0x08, 0x86, + 0x12, 0x38, 0x46, 0x0c, 0x23, 0xb1, 0x9d, 0xc4, 0x40, 0x10, 0x03, 0x4e, 0x7e, 0x06, 0x09, 0x92, + 0x08, 0x81, 0x03, 0xd8, 0x80, 0x1d, 0x1b, 0x49, 0xb0, 0x88, 0x56, 0x4e, 0x02, 0x04, 0x70, 0x3e, + 0x7e, 0x25, 0xd9, 0xfc, 0x09, 0xea, 0xb3, 0xab, 0x7b, 0x7a, 0x48, 0x0e, 0x7b, 0x86, 0x7b, 0x8b, + 0xe8, 0x17, 0x39, 0xf5, 0x5e, 0xbd, 0x57, 0x5d, 0x1f, 0xaf, 0x5e, 0xbd, 0x7a, 0xef, 0x15, 0x5c, + 0x6f, 0xd8, 0xc1, 0x6e, 0x67, 0x7b, 0xae, 0xe6, 0xb6, 0xe6, 0x2d, 0xaf, 0xe1, 0xb6, 0x3d, 0xf7, + 0x1d, 0xfe, 0xcf, 0x87, 0xe9, 0x3e, 0x75, 0x02, 0x7f, 0xbe, 0xbd, 0xd7, 0x98, 0xb7, 0xda, 0xb6, + 0x3f, 0x2f, 0x7f, 0xef, 0x7f, 0xd4, 0x6a, 0xb6, 0x77, 0xad, 0x8f, 0xce, 0x37, 0xa8, 0x43, 0x3d, + 0x2b, 0xa0, 0xf5, 0xb9, 0xb6, 0xe7, 0x06, 0x2e, 0xb9, 0x1a, 0x52, 0x9a, 0x53, 0x94, 0xf8, 0x3f, + 0x6f, 0x89, 0x9a, 0x73, 0xed, 0xbd, 0xc6, 0x1c, 0xa3, 0x34, 0x27, 0x7f, 0x2b, 0x4a, 0x17, 0x3f, + 0x6c, 0xb4, 0xa1, 0xe1, 0x36, 0xdc, 0x79, 0x4e, 0x70, 0xbb, 0xb3, 0xc3, 0x7f, 0xf1, 0x1f, 0xfc, + 0x3f, 0xc1, 0xe8, 0x62, 0x79, 0xef, 0xaa, 0x3f, 0x67, 0xbb, 0xac, 0x55, 0xf3, 0x35, 0xd7, 0xa3, + 0xf3, 0xfb, 0x5d, 0x8d, 0xb9, 0xf8, 0xf1, 0x10, 0xa7, 0x65, 0xd5, 0x76, 0x6d, 0x87, 0x7a, 0x07, + 0xea, 0x53, 0xe6, 0x3d, 0xea, 0xbb, 0x1d, 0xaf, 0x46, 0xfb, 0xaa, 0xe5, 0xcf, 0xb7, 0x68, 0x60, + 0x25, 0xf1, 0x9a, 0xef, 0x55, 0xcb, 0xeb, 0x38, 0x81, 0xdd, 0xea, 0x66, 0xf3, 0x53, 0x47, 0x55, + 0xf0, 0x6b, 0xbb, 0xb4, 0x65, 0xc5, 0xeb, 0x95, 0xff, 0x4f, 0x06, 0xce, 0x54, 0xd6, 0x6f, 0x6d, + 0x2e, 0xba, 0x8e, 0xdf, 0x69, 0xd1, 0x45, 0xd7, 0xd9, 0xb1, 0x1b, 0xe4, 0x13, 0x30, 0x56, 0x13, + 0x05, 0xde, 0x96, 0xd5, 0x98, 0xc9, 0x5c, 0xce, 0xbc, 0x5c, 0x5a, 0x38, 0xfb, 0xfd, 0x87, 0xb3, + 0xcf, 0x3c, 0x7a, 0x38, 0x3b, 0xb6, 0x18, 0x82, 0xd0, 0xc4, 0x23, 0xaf, 0xc0, 0x88, 0xd5, 0x09, + 0xdc, 0x4a, 0x6d, 0x6f, 0x26, 0x7b, 0x39, 0xf3, 0xf2, 0xe8, 0xc2, 0x94, 0xac, 0x32, 0x52, 0x11, + 0xc5, 0xa8, 0xe0, 0x64, 0x1e, 0x4a, 0xf4, 0x41, 0xad, 0xd9, 0xf1, 0xed, 0x7d, 0x3a, 0x93, 0xe3, + 0xc8, 0x67, 0x24, 0x72, 0x69, 0x59, 0x01, 0x30, 0xc4, 0x61, 0xb4, 0x1d, 0x77, 0xcd, 0xad, 0x59, + 0xcd, 0x99, 0x7c, 0x94, 0xf6, 0x86, 0x28, 0x46, 0x05, 0x27, 0x2f, 0x41, 0xd1, 0x71, 0xef, 0x5a, + 0x76, 0x30, 0x53, 0xe0, 0x98, 0x93, 0x12, 0xb3, 0xb8, 0xc1, 0x4b, 0x51, 0x42, 0xcb, 0xff, 0x75, + 0x0c, 0xa6, 0xd8, 0xb7, 0x2f, 0xb3, 0xb9, 0x53, 0xe5, 0xc3, 0x47, 0x5e, 0x80, 0x5c, 0xc7, 0x6b, + 0xca, 0x2f, 0x1e, 0x93, 0x15, 0x73, 0xb7, 0x71, 0x0d, 0x59, 0x39, 0xb9, 0x0a, 0xe3, 0xf4, 0x41, + 0x6d, 0xd7, 0x72, 0x1a, 0x74, 0xc3, 0x6a, 0x51, 0xfe, 0x99, 0xa5, 0x85, 0x73, 0x12, 0x6f, 0x7c, + 0xd9, 0x80, 0x61, 0x04, 0xd3, 0xac, 0xb9, 0x75, 0xd0, 0x16, 0xdf, 0x9c, 0x50, 0x93, 0xc1, 0x30, + 0x82, 0x49, 0xae, 0x00, 0x78, 0x6e, 0x27, 0xb0, 0x9d, 0xc6, 0x0d, 0x7a, 0xc0, 0x3f, 0xbe, 0xb4, + 0x40, 0x64, 0x3d, 0x40, 0x0d, 0x41, 0x03, 0x8b, 0xbc, 0x9f, 0x81, 0x33, 0x35, 0xd7, 0x71, 0x68, + 0x2d, 0xb0, 0x5d, 0x67, 0xc1, 0xaa, 0xed, 0xb9, 0x3b, 0x3b, 0xbc, 0x3b, 0xc6, 0xae, 0x54, 0xe6, + 0x4e, 0xba, 0xaa, 0xe6, 0x24, 0xa1, 0x85, 0xf3, 0x8f, 0x1e, 0xce, 0x9e, 0x59, 0x8c, 0xd3, 0xc7, + 0x6e, 0x96, 0xe4, 0x55, 0x18, 0x7d, 0xc7, 0x77, 0x9d, 0x05, 0xb7, 0x7e, 0x30, 0x53, 0xe4, 0xa3, + 0x31, 0x2d, 0x9b, 0x3e, 0xfa, 0x46, 0xf5, 0xe6, 0x06, 0x2b, 0x47, 0x8d, 0x41, 0xde, 0x84, 0x5c, + 0xd0, 0xf4, 0x67, 0x46, 0x78, 0x3b, 0x17, 0x4f, 0xde, 0xce, 0xad, 0xb5, 0xaa, 0x98, 0xc9, 0x0b, + 0x23, 0x6c, 0xf8, 0xb6, 0xd6, 0xaa, 0xc8, 0x08, 0x93, 0xaf, 0x64, 0x60, 0x94, 0x2d, 0xb9, 0xba, + 0x15, 0x58, 0x33, 0xa3, 0x97, 0x73, 0x2f, 0x8f, 0x5d, 0xb9, 0x7b, 0x72, 0x2e, 0xb1, 0xb9, 0x33, + 0xb7, 0x2e, 0x29, 0x2f, 0x3b, 0x81, 0x77, 0x10, 0x7e, 0xa7, 0x2a, 0x46, 0xcd, 0x9a, 0x7c, 0x27, + 0x03, 0x53, 0x6a, 0x8c, 0x97, 0x68, 0xad, 0x69, 0x79, 0x74, 0xa6, 0xc4, 0x3f, 0xba, 0x9a, 0xb2, + 0x39, 0x51, 0xa2, 0xb2, 0x13, 0xce, 0x3e, 0x7a, 0x38, 0x3b, 0x15, 0x03, 0x61, 0xbc, 0x01, 0x6c, + 0xce, 0x8c, 0xdf, 0xeb, 0xd0, 0x8e, 0x6e, 0x11, 0xf0, 0x16, 0x6d, 0xa6, 0x6b, 0xd1, 0x2d, 0x83, + 0xa2, 0x6c, 0xce, 0x34, 0x9b, 0xf0, 0x66, 0x39, 0x46, 0xf8, 0x92, 0x77, 0xa1, 0xc4, 0x7f, 0x2f, + 0xd8, 0x4e, 0x7d, 0x66, 0x8c, 0x37, 0x62, 0x7d, 0x00, 0x8d, 0x60, 0xe4, 0x64, 0x0b, 0x26, 0x98, + 0x98, 0xd1, 0x85, 0x18, 0xb2, 0x23, 0x1e, 0x8c, 0x48, 0x89, 0x36, 0x33, 0xce, 0x39, 0xdf, 0x48, + 0xc7, 0x39, 0x22, 0x57, 0x17, 0xc6, 0x98, 0xbc, 0x92, 0x45, 0xa8, 0x18, 0x11, 0x0b, 0xf2, 0x56, + 0x27, 0xd8, 0x9d, 0x99, 0x48, 0x3b, 0xed, 0x17, 0x2c, 0xdf, 0xae, 0x55, 0x3a, 0xc1, 0xee, 0xc2, + 0xe8, 0xa3, 0x87, 0xb3, 0x79, 0xf6, 0x1f, 0x72, 0xd2, 0x04, 0xa1, 0xd4, 0xf1, 0x9a, 0x55, 0x5a, + 0xf3, 0x68, 0x30, 0x33, 0xc9, 0xf9, 0x7c, 0x68, 0x4e, 0x6c, 0x19, 0x8c, 0xd4, 0x1c, 0xdb, 0xf3, + 0xe6, 0xf6, 0x3f, 0x3a, 0x27, 0x30, 0x6e, 0xd0, 0x83, 0x2a, 0x6d, 0xd2, 0x5a, 0xe0, 0x7a, 0xa2, + 0xab, 0x6e, 0xe3, 0x9a, 0x80, 0x60, 0x48, 0x86, 0xb8, 0x50, 0xdc, 0xb1, 0x9b, 0x01, 0xf5, 0x66, + 0xa6, 0xd2, 0xf6, 0x94, 0xb1, 0x8a, 0x56, 0x38, 0xc9, 0x05, 0x60, 0xf2, 0x5a, 0xfc, 0x8f, 0x92, + 0xcd, 0xc5, 0x4f, 0xc2, 0x44, 0x64, 0x89, 0x91, 0x69, 0xc8, 0xed, 0xd1, 0x03, 0x21, 0xac, 0x91, + 0xfd, 0x4b, 0xce, 0x41, 0x61, 0xdf, 0x6a, 0x76, 0xa4, 0x60, 0x46, 0xf1, 0xe3, 0xb5, 0xec, 0xd5, + 0x4c, 0xf9, 0x8f, 0x32, 0xf0, 0x5c, 0xcf, 0x15, 0xc2, 0x76, 0x97, 0x7a, 0xc7, 0xb3, 0xb6, 0x9b, + 0x94, 0x53, 0x33, 0x76, 0x97, 0x25, 0x51, 0x8c, 0x0a, 0xce, 0xc4, 0x31, 0xdb, 0xc4, 0x96, 0x68, + 0x93, 0x06, 0x54, 0xee, 0x73, 0x5a, 0x1c, 0x57, 0x34, 0x04, 0x0d, 0x2c, 0x26, 0x05, 0x6d, 0x27, + 0xa0, 0x9e, 0x63, 0x35, 0xe5, 0x66, 0xa7, 0xa5, 0xc3, 0xaa, 0x2c, 0x47, 0x8d, 0x61, 0xec, 0x5f, + 0xf9, 0x43, 0xf7, 0xaf, 0x9f, 0x85, 0xb3, 0x09, 0x93, 0xdb, 0xa8, 0x9e, 0x39, 0xb4, 0xfa, 0x6f, + 0x65, 0xe1, 0x42, 0xf2, 0x0a, 0x25, 0x97, 0x21, 0xef, 0xb0, 0xed, 0x4d, 0x6c, 0x83, 0xe3, 0x92, + 0x40, 0x9e, 0x6f, 0x6b, 0x1c, 0x62, 0x76, 0x58, 0xb6, 0xaf, 0x0e, 0xcb, 0x1d, 0xab, 0xc3, 0x22, + 0xea, 0x41, 0xfe, 0x18, 0xea, 0xc1, 0x31, 0xf7, 0x7c, 0x46, 0xd8, 0xf2, 0x1a, 0x9d, 0x16, 0x9b, + 0x7f, 0x7c, 0x43, 0x2a, 0x85, 0x84, 0x2b, 0x0a, 0x80, 0x21, 0x4e, 0xf9, 0x71, 0x1e, 0xa6, 0x2b, + 0x77, 0xab, 0x6b, 0x56, 0x6b, 0xbb, 0x6e, 0x6d, 0x79, 0x76, 0xa3, 0x41, 0x3d, 0xb6, 0x99, 0xef, + 0x74, 0x1c, 0xbe, 0xd1, 0x6d, 0x84, 0xfd, 0xa4, 0x37, 0xf3, 0x15, 0x03, 0x86, 0x11, 0x4c, 0xb6, + 0x10, 0xad, 0x5a, 0x8d, 0xfa, 0x3e, 0xdb, 0xcb, 0xb3, 0x7d, 0x2f, 0xc4, 0x8a, 0xaa, 0x8b, 0x21, + 0x19, 0x46, 0xd3, 0x57, 0xe8, 0xbc, 0x7f, 0xfb, 0xa3, 0xa9, 0x8b, 0x31, 0x24, 0xc3, 0xfa, 0xd3, + 0xa3, 0x0d, 0xdb, 0x75, 0xa4, 0xc2, 0xa1, 0xfb, 0x13, 0x79, 0x29, 0x4a, 0x28, 0xe9, 0xc0, 0x48, + 0xdb, 0x3a, 0x68, 0xba, 0x56, 0x7d, 0xa6, 0xc0, 0xf7, 0xd3, 0x37, 0x52, 0xec, 0xda, 0xa2, 0x77, + 0x37, 0x2d, 0xcf, 0x6a, 0x51, 0x26, 0x04, 0xf4, 0x9c, 0xda, 0x14, 0x2c, 0x50, 0xf1, 0x22, 0x5f, + 0x04, 0x68, 0x2b, 0x34, 0x36, 0x8e, 0x83, 0xe6, 0xac, 0xe7, 0xa7, 0x2e, 0xf2, 0xd1, 0xe0, 0x48, + 0x5e, 0x83, 0x49, 0xdb, 0xd9, 0x77, 0x6b, 0x16, 0x1b, 0x58, 0xae, 0xcf, 0x8d, 0x08, 0xbd, 0xec, + 0xd1, 0xc3, 0xd9, 0xc9, 0xd5, 0x08, 0x04, 0x63, 0x98, 0x6c, 0xe9, 0x78, 0x6e, 0x93, 0x56, 0x70, + 0x63, 0x66, 0x94, 0x57, 0xd2, 0x9f, 0x89, 0xa2, 0x18, 0x15, 0xbc, 0xfc, 0x0a, 0x14, 0x2b, 0x2d, + 0xb7, 0xe3, 0x04, 0x64, 0x56, 0x09, 0x36, 0x36, 0xd5, 0xc6, 0x17, 0x4a, 0x8f, 0x1e, 0xce, 0x16, + 0xee, 0xb0, 0x02, 0x29, 0xe3, 0xca, 0x7f, 0x99, 0x85, 0xb3, 0x15, 0xaf, 0xe1, 0xde, 0x75, 0xbd, + 0xbd, 0x9d, 0xa6, 0x7b, 0x5f, 0x4d, 0x55, 0x07, 0x8a, 0xe2, 0x64, 0xc2, 0x6b, 0xa6, 0xea, 0xa5, + 0x8a, 0x17, 0xd8, 0x3b, 0x56, 0x2d, 0x58, 0x93, 0x5f, 0x23, 0x84, 0xb4, 0x10, 0xdb, 0x28, 0xb9, + 0x90, 0xeb, 0x50, 0x72, 0xdb, 0xec, 0x88, 0xc1, 0xe6, 0x8e, 0x50, 0x8f, 0x7f, 0x42, 0x2d, 0xb0, + 0x9b, 0x0a, 0xf0, 0xf8, 0xe1, 0xec, 0x79, 0xb3, 0xb1, 0x1a, 0x80, 0x61, 0xe5, 0xd8, 0x18, 0xe7, + 0x4e, 0x7d, 0x8c, 0x9f, 0x87, 0xbc, 0xe5, 0x35, 0xfc, 0x99, 0xfc, 0xe5, 0xdc, 0xcb, 0x25, 0xb9, + 0xa3, 0x7a, 0x0d, 0x1f, 0x79, 0x69, 0xf9, 0xfd, 0x02, 0x4c, 0xc7, 0x3b, 0x84, 0x7c, 0x1e, 0xb2, + 0xfe, 0xc7, 0x64, 0x47, 0x2f, 0x9d, 0xbc, 0xa9, 0xd5, 0x8f, 0x29, 0xca, 0x0b, 0xc5, 0x47, 0x0f, + 0x67, 0xb3, 0xd5, 0x8f, 0x61, 0xd6, 0xff, 0x18, 0x29, 0x43, 0xd1, 0x76, 0x9a, 0xb6, 0xa3, 0x8e, + 0x1d, 0xbc, 0xfb, 0x57, 0x79, 0x09, 0x4a, 0x08, 0xa9, 0x43, 0x7e, 0xc7, 0x6e, 0x52, 0x29, 0x06, + 0x56, 0x4e, 0xde, 0x86, 0x15, 0xbb, 0x49, 0x75, 0x2b, 0xf8, 0xc7, 0xb3, 0x12, 0xe4, 0xd4, 0xc9, + 0xdb, 0xe2, 0x94, 0x94, 0xe7, 0x4c, 0x96, 0x4f, 0xce, 0xe4, 0x36, 0xae, 0x69, 0x1e, 0x23, 0x91, + 0x83, 0xd6, 0x6d, 0x28, 0xd5, 0xf8, 0x5e, 0xd4, 0xb2, 0xda, 0xf2, 0xdc, 0xf2, 0x72, 0x92, 0x4c, + 0x13, 0x1b, 0xd6, 0xba, 0xd5, 0xee, 0x12, 0x6b, 0x8b, 0xaa, 0x3a, 0x86, 0x94, 0x58, 0xc3, 0x1b, + 0x76, 0xc0, 0x05, 0x7f, 0xaa, 0x86, 0x5f, 0xb3, 0x83, 0x68, 0xc3, 0xaf, 0xd9, 0x01, 0x32, 0xd2, + 0xc4, 0x85, 0x51, 0x65, 0x0b, 0x90, 0xe7, 0x98, 0x14, 0x6c, 0x6e, 0x5c, 0xad, 0xa2, 0x24, 0xb6, + 0x30, 0xce, 0xb4, 0x05, 0xf5, 0x0b, 0x35, 0x93, 0xf2, 0xef, 0xe7, 0xe1, 0x7c, 0xe5, 0xdd, 0x8e, + 0x47, 0xb9, 0x12, 0x75, 0xbd, 0xb3, 0xed, 0xab, 0xa5, 0x7f, 0x19, 0xf2, 0x3b, 0xf7, 0xea, 0x4e, + 0x7c, 0x17, 0x5f, 0xb9, 0xb5, 0xb4, 0x81, 0x1c, 0xc2, 0x44, 0xd1, 0x6e, 0x67, 0xdb, 0x38, 0xc9, + 0x6a, 0x51, 0x74, 0x5d, 0x14, 0xa3, 0x82, 0x93, 0x36, 0x9c, 0xf5, 0x77, 0x2d, 0x8f, 0xd6, 0xf5, + 0x16, 0xc4, 0xab, 0xf5, 0xb5, 0xdd, 0x3c, 0xfb, 0xe8, 0xe1, 0xec, 0xd9, 0x6a, 0x37, 0x15, 0x4c, + 0x22, 0x4d, 0xea, 0x30, 0x15, 0x2b, 0x96, 0x13, 0xee, 0x98, 0xdc, 0xf8, 0xa9, 0x27, 0xc6, 0x0d, + 0xe3, 0x24, 0xff, 0x3f, 0xdd, 0xc0, 0xca, 0xef, 0x15, 0xe0, 0xb9, 0x70, 0xd6, 0xf8, 0xd7, 0x3b, + 0xdb, 0xa6, 0x15, 0xe4, 0xe8, 0x99, 0xd3, 0x63, 0x3a, 0x64, 0x4f, 0x75, 0x3a, 0xe4, 0x06, 0x3f, + 0x1d, 0x8c, 0x15, 0x91, 0x3f, 0x62, 0x45, 0x7c, 0xcb, 0x34, 0x26, 0x88, 0xb9, 0x63, 0xa5, 0xd8, + 0x5c, 0x7b, 0x0d, 0x46, 0x1f, 0x66, 0x85, 0xf0, 0x44, 0x56, 0x7c, 0x0a, 0x4e, 0x64, 0xbf, 0x56, + 0x84, 0xe7, 0xf9, 0x57, 0xf3, 0x03, 0x48, 0x35, 0x70, 0x3d, 0xab, 0x41, 0xcd, 0x59, 0xf8, 0x06, + 0x10, 0x5f, 0x94, 0x56, 0x6a, 0x35, 0xa6, 0x05, 0x19, 0xba, 0xf6, 0x45, 0xd9, 0x0d, 0xa4, 0xda, + 0x85, 0x81, 0x09, 0xb5, 0x48, 0x03, 0xa6, 0x43, 0xe3, 0x54, 0x35, 0xf0, 0x6c, 0xa7, 0xd1, 0xdf, + 0x64, 0x3d, 0xf7, 0xe8, 0xe1, 0xec, 0xf4, 0x62, 0x8c, 0x04, 0x76, 0x11, 0x65, 0x07, 0x0c, 0x6e, + 0x4d, 0xd0, 0xd2, 0xd1, 0x38, 0x60, 0xdc, 0x52, 0x00, 0x0c, 0x71, 0x22, 0x16, 0xb2, 0xfc, 0x91, + 0x16, 0xb2, 0x17, 0x20, 0x57, 0x6f, 0xde, 0x93, 0x87, 0x1c, 0x6d, 0x9f, 0x5c, 0x5a, 0xbb, 0x85, + 0xac, 0x9c, 0x7c, 0xc7, 0x9c, 0x93, 0x42, 0xaa, 0xd4, 0x53, 0xce, 0xc9, 0x1e, 0xa3, 0x73, 0xa2, + 0x69, 0x39, 0x72, 0x2a, 0xd3, 0x92, 0x7c, 0x12, 0x26, 0xea, 0xb4, 0xe6, 0xd6, 0xe9, 0x3a, 0xf5, + 0x7d, 0xab, 0x41, 0xb9, 0x9e, 0x3d, 0xba, 0x70, 0x5e, 0xb6, 0x71, 0x62, 0xc9, 0x04, 0x62, 0x14, + 0x97, 0x2c, 0xc2, 0x99, 0xfb, 0x96, 0x1d, 0x6c, 0xd9, 0x2d, 0xba, 0xea, 0x54, 0x69, 0xcd, 0x75, + 0xea, 0x3e, 0x37, 0xce, 0x15, 0x84, 0xd9, 0xf3, 0x6e, 0x1c, 0x88, 0xdd, 0xf8, 0xe9, 0x16, 0xc6, + 0x9f, 0x15, 0xe1, 0x22, 0xef, 0xfa, 0x2a, 0xf5, 0xf6, 0xed, 0x1a, 0x5d, 0xe8, 0xf8, 0xe6, 0xb2, + 0x48, 0x9a, 0xca, 0x99, 0xa1, 0x4f, 0xe5, 0xec, 0x31, 0xa6, 0xf2, 0x3c, 0x94, 0x02, 0xb7, 0x6d, + 0xd7, 0x92, 0xe6, 0xfe, 0x96, 0x02, 0x60, 0x88, 0x43, 0x96, 0x60, 0xda, 0xef, 0x6c, 0xfb, 0x35, + 0xcf, 0x6e, 0xeb, 0xb3, 0xb4, 0x10, 0xbb, 0x33, 0xb2, 0xde, 0x74, 0x35, 0x06, 0xc7, 0xae, 0x1a, + 0xca, 0x6a, 0x5c, 0x18, 0x96, 0xd5, 0xb8, 0x3f, 0x1b, 0xf6, 0xb7, 0xcd, 0x25, 0x38, 0xc2, 0x97, + 0xe0, 0x76, 0xca, 0x25, 0x98, 0x38, 0x0f, 0x4e, 0xb4, 0x00, 0x47, 0x4f, 0x67, 0x01, 0x7e, 0x06, + 0x9e, 0xdd, 0xe9, 0x34, 0x9b, 0x07, 0xb7, 0x3a, 0x56, 0xd3, 0xde, 0xb1, 0x69, 0x9d, 0x8d, 0x93, + 0xdf, 0xb6, 0x6a, 0xc2, 0xcc, 0x5d, 0x5a, 0x98, 0x95, 0xad, 0x7d, 0x76, 0x25, 0x19, 0x0d, 0x7b, + 0xd5, 0x4f, 0xb7, 0xb2, 0xde, 0x2b, 0xc0, 0x85, 0x58, 0x8f, 0x2a, 0x65, 0xf9, 0x47, 0xab, 0xea, + 0x94, 0x57, 0x95, 0xa1, 0x78, 0x17, 0x9f, 0x98, 0xe2, 0x3d, 0x72, 0xea, 0x8a, 0xf7, 0x5f, 0x66, + 0x61, 0x44, 0x5d, 0x8e, 0xdd, 0x83, 0xd1, 0x7a, 0x47, 0x9a, 0x4a, 0xc4, 0x5c, 0xbb, 0x76, 0xf2, + 0x96, 0xac, 0x3a, 0xc1, 0x4f, 0x7d, 0xfc, 0xa6, 0x27, 0x66, 0x99, 0x38, 0x2d, 0x2e, 0x49, 0xe2, + 0xa8, 0xd9, 0x90, 0x3a, 0x14, 0xd9, 0xa1, 0xd5, 0xf5, 0xa4, 0xf6, 0xf3, 0xa9, 0x14, 0xa2, 0x89, + 0x5b, 0xa6, 0xe4, 0xfa, 0xe7, 0x34, 0x51, 0xd2, 0x66, 0x5c, 0xde, 0xb1, 0x03, 0x26, 0x70, 0x72, + 0x83, 0xe4, 0xf2, 0x06, 0xa7, 0x89, 0x92, 0x36, 0x79, 0x11, 0x0a, 0x7e, 0x40, 0xdb, 0x3e, 0x9f, + 0xdc, 0x85, 0x85, 0x09, 0xd9, 0xf3, 0x85, 0x2a, 0x2b, 0x44, 0x01, 0x2b, 0xff, 0x5e, 0x06, 0x4a, + 0xfa, 0x5e, 0x84, 0xdc, 0x84, 0xd1, 0x8e, 0x4f, 0x3d, 0x6d, 0xdc, 0x3e, 0xf6, 0xea, 0xe6, 0xfd, + 0x79, 0x5b, 0x56, 0x45, 0x4d, 0x84, 0x11, 0x6c, 0x5b, 0xbe, 0x7f, 0xdf, 0xf5, 0xea, 0xfd, 0xe9, + 0x93, 0x9c, 0xe0, 0xa6, 0xac, 0x8a, 0x9a, 0x48, 0xf9, 0x4f, 0x33, 0x30, 0xb1, 0x60, 0x07, 0xdb, + 0x9d, 0xda, 0x1e, 0x0d, 0x78, 0x9b, 0x5b, 0x50, 0xd8, 0x66, 0x1f, 0x20, 0x1b, 0xbc, 0x96, 0xe2, + 0x7e, 0x48, 0xd1, 0x0d, 0x2f, 0x8a, 0xb8, 0x21, 0x91, 0xff, 0x44, 0xc1, 0x85, 0xdc, 0x06, 0x70, + 0xad, 0x4e, 0xb0, 0xbb, 0xe5, 0xee, 0x51, 0xa7, 0xbf, 0x6f, 0x9a, 0x64, 0xf3, 0xfe, 0x66, 0x45, + 0x55, 0x46, 0x83, 0x50, 0xf9, 0x0f, 0x32, 0x40, 0xba, 0xf9, 0x3f, 0x05, 0x03, 0xf2, 0xef, 0x46, + 0xe0, 0x9c, 0x6e, 0x78, 0xec, 0x78, 0x52, 0xe7, 0xb7, 0x15, 0xd7, 0x5d, 0x77, 0xef, 0xa6, 0xb3, + 0x62, 0x3b, 0xb6, 0xbf, 0x2b, 0xef, 0x5c, 0xf4, 0xf1, 0x64, 0xa9, 0x0b, 0x03, 0x13, 0x6a, 0x91, + 0xaf, 0x9b, 0x4a, 0x43, 0x96, 0x0b, 0xa5, 0xcf, 0x0f, 0x60, 0x9c, 0x4f, 0xaa, 0x2e, 0x8c, 0xdc, + 0xa7, 0xdb, 0xbb, 0xae, 0xbb, 0x27, 0x97, 0xef, 0xf5, 0x93, 0x37, 0xe5, 0xae, 0x20, 0xb4, 0xe8, + 0x3a, 0x01, 0x7d, 0x10, 0x88, 0x0b, 0x50, 0x59, 0x86, 0x8a, 0x0b, 0xa1, 0xf2, 0x02, 0x34, 0x9f, + 0x56, 0x06, 0x46, 0x16, 0x4e, 0xd7, 0x25, 0x68, 0x19, 0x8a, 0xa2, 0x02, 0x3f, 0xad, 0x4b, 0xfb, + 0xa9, 0x38, 0x72, 0xa3, 0x84, 0x90, 0x0f, 0x43, 0xc1, 0xbd, 0xef, 0xc8, 0x13, 0x74, 0x69, 0xe1, + 0x59, 0xd9, 0x4d, 0x53, 0x4b, 0xb4, 0xed, 0xd1, 0x9a, 0x15, 0xd0, 0xfa, 0x4d, 0x06, 0x46, 0x81, + 0x45, 0xfe, 0x2a, 0x00, 0x6b, 0x1d, 0xad, 0xf1, 0xbb, 0x17, 0x71, 0x07, 0xf0, 0xbc, 0xac, 0x73, + 0x2e, 0xac, 0xb3, 0xa9, 0x71, 0xd0, 0xc0, 0x27, 0xd7, 0x61, 0xd2, 0xa3, 0x6d, 0xd7, 0xb7, 0x03, + 0xd7, 0x3b, 0xa8, 0x36, 0x3b, 0x0d, 0x79, 0x21, 0x70, 0x59, 0x52, 0x98, 0x09, 0x29, 0x60, 0x04, + 0x0f, 0x63, 0xf5, 0xc8, 0x2f, 0x67, 0x60, 0x5c, 0x17, 0xd9, 0x94, 0x1d, 0x58, 0x72, 0xe9, 0xae, + 0xcd, 0x75, 0x57, 0x86, 0x9c, 0xc3, 0x0b, 0x2e, 0x34, 0x58, 0x61, 0x84, 0xb1, 0xa1, 0x6b, 0xc2, + 0x53, 0x60, 0x83, 0x78, 0x17, 0xce, 0x26, 0x7c, 0x28, 0xdb, 0x59, 0xc4, 0x2c, 0x10, 0xc6, 0x06, + 0xbd, 0xb3, 0x44, 0xc6, 0xfe, 0xf5, 0xae, 0xd1, 0x13, 0xda, 0xdc, 0x05, 0x89, 0x3d, 0x79, 0xf8, + 0x98, 0x95, 0xff, 0xd3, 0x18, 0x5c, 0xd4, 0xcc, 0x99, 0x42, 0x4a, 0x3d, 0x53, 0xbc, 0x18, 0xab, + 0x30, 0x73, 0x2a, 0xab, 0x30, 0x3a, 0x97, 0xb3, 0xa9, 0xe7, 0x72, 0xee, 0x84, 0x73, 0xf9, 0x65, + 0x18, 0x95, 0x74, 0xd5, 0xdd, 0x8b, 0x10, 0xcd, 0xb2, 0x0c, 0x35, 0x94, 0xfc, 0xf5, 0xf8, 0xac, + 0x17, 0x56, 0xb8, 0xea, 0x00, 0x66, 0xbd, 0x18, 0x8f, 0x3e, 0xe7, 0x7e, 0x28, 0x60, 0x8a, 0x3d, + 0x05, 0xcc, 0x1e, 0xbc, 0xe0, 0xef, 0xd9, 0xed, 0x05, 0xcf, 0x72, 0x6a, 0xbb, 0x48, 0x77, 0xfc, + 0x45, 0xee, 0x8e, 0x50, 0xbf, 0xe9, 0xdc, 0x6c, 0x53, 0x67, 0x13, 0xb9, 0x10, 0x19, 0x5d, 0xf8, + 0x90, 0x64, 0xf7, 0x42, 0xf5, 0x30, 0x64, 0x3c, 0x9c, 0x16, 0xb9, 0x06, 0x67, 0x5c, 0x47, 0x58, + 0x6d, 0x36, 0xa9, 0x27, 0xa0, 0xd2, 0x18, 0xf2, 0x9c, 0x64, 0x70, 0xe6, 0x66, 0x1c, 0x01, 0xbb, + 0xeb, 0x90, 0x4f, 0xc3, 0x98, 0xb8, 0x6f, 0x16, 0x5a, 0x41, 0xa9, 0x9f, 0x8d, 0x75, 0xea, 0xd1, + 0xc3, 0xd9, 0xb1, 0x4a, 0x58, 0x1b, 0x4d, 0x52, 0xe4, 0x4d, 0x98, 0x90, 0x13, 0x50, 0x7a, 0xa7, + 0x40, 0x3f, 0xb4, 0xcf, 0x3c, 0x7a, 0x38, 0x3b, 0x71, 0xd7, 0xac, 0x8f, 0x51, 0x72, 0xe4, 0x0e, + 0x5c, 0xd8, 0x56, 0x83, 0xea, 0xf3, 0x41, 0x5d, 0xb0, 0x7c, 0x7a, 0x1b, 0xd7, 0xb8, 0x67, 0x51, + 0x69, 0xe1, 0x92, 0xec, 0x87, 0x0b, 0xb1, 0xa1, 0x97, 0x58, 0xd8, 0xa3, 0x76, 0x8f, 0xdd, 0x7f, + 0xfc, 0x44, 0xbb, 0x7f, 0xc4, 0x64, 0x30, 0x91, 0xd6, 0x64, 0xd0, 0x5b, 0xa6, 0x9c, 0xc8, 0x64, + 0x30, 0x79, 0x3a, 0x26, 0x03, 0x79, 0xdc, 0x9c, 0x1a, 0xd6, 0x71, 0xf3, 0x93, 0x30, 0x51, 0xdb, + 0xa5, 0xb5, 0x3d, 0xee, 0x6f, 0xb3, 0x6f, 0x35, 0x67, 0xa6, 0xf9, 0xf0, 0x6b, 0x9b, 0xe0, 0xa2, + 0x09, 0xc4, 0x28, 0x6e, 0xba, 0x3d, 0xe6, 0x5b, 0x19, 0x78, 0xae, 0xa7, 0x5c, 0x21, 0x57, 0x22, + 0x52, 0x37, 0x13, 0xf5, 0xee, 0xec, 0x21, 0x6b, 0xd3, 0xee, 0x3c, 0x7f, 0x98, 0x85, 0xd2, 0x42, + 0xc7, 0x97, 0xce, 0x3e, 0xdb, 0x90, 0x77, 0xac, 0xc0, 0x4f, 0x7f, 0x6d, 0xbd, 0x51, 0xd9, 0x52, + 0x7d, 0xcf, 0x55, 0x2f, 0xf6, 0x1b, 0x39, 0x6d, 0xb2, 0x0f, 0xa5, 0x77, 0x68, 0xe0, 0x07, 0x1e, + 0xb5, 0x5a, 0x52, 0x2d, 0x5f, 0x3d, 0x39, 0xa3, 0x37, 0x68, 0x50, 0xe5, 0xa4, 0x4c, 0x77, 0x3e, + 0x5d, 0x88, 0x21, 0x2b, 0x52, 0x83, 0xc2, 0x9e, 0xb5, 0xb3, 0x67, 0x49, 0x45, 0x76, 0x21, 0xc5, + 0x55, 0x2c, 0x23, 0xb3, 0xd0, 0xf1, 0xc5, 0x89, 0x89, 0xff, 0x42, 0x41, 0xbb, 0xfc, 0xdd, 0x02, + 0x9c, 0x5d, 0xb4, 0x9a, 0xd4, 0xa9, 0x5b, 0x91, 0x1d, 0xfc, 0x55, 0x18, 0xf5, 0x6b, 0xbb, 0xb4, + 0xde, 0x69, 0xaa, 0x5b, 0x0b, 0xbd, 0xe2, 0xaa, 0xb2, 0x1c, 0x35, 0x86, 0xf6, 0x11, 0x63, 0x73, + 0x33, 0x1b, 0xc5, 0xd6, 0xd3, 0x52, 0x63, 0x90, 0xd7, 0x60, 0x52, 0x3a, 0x3f, 0xb9, 0xce, 0x92, + 0x15, 0x50, 0xe1, 0x20, 0x21, 0x1d, 0x50, 0x96, 0x23, 0x10, 0x8c, 0x61, 0x32, 0x4e, 0x81, 0xdd, + 0xa2, 0xef, 0xba, 0x8e, 0xb2, 0x0b, 0x69, 0x4e, 0x5b, 0xb2, 0x1c, 0x35, 0x06, 0xf9, 0x5a, 0xf7, + 0x35, 0xd7, 0xe7, 0x4e, 0xde, 0x8d, 0x09, 0xfd, 0xd4, 0x87, 0x54, 0xfa, 0x02, 0x8c, 0xb5, 0xa9, + 0xe7, 0xdb, 0x7e, 0x40, 0x9d, 0x1a, 0x95, 0xb7, 0x5c, 0x6f, 0xa4, 0x14, 0x4d, 0x9b, 0x21, 0x45, + 0xb1, 0x57, 0x19, 0x05, 0x68, 0xf2, 0x3b, 0x75, 0x3b, 0x6a, 0x3a, 0xb9, 0xf3, 0x00, 0xce, 0x2d, + 0x5a, 0x41, 0x6d, 0xb7, 0xd3, 0x16, 0xcb, 0x44, 0x99, 0x80, 0x5e, 0x81, 0x11, 0xea, 0x58, 0xdb, + 0x4d, 0x5a, 0x8f, 0xfb, 0x3a, 0x2e, 0x8b, 0x62, 0x54, 0x70, 0xf2, 0x09, 0x18, 0x6b, 0x59, 0x0f, + 0x94, 0x19, 0x49, 0x4e, 0x4b, 0x1d, 0x07, 0xb0, 0x1e, 0x82, 0xd0, 0xc4, 0x2b, 0xff, 0x59, 0x16, + 0x4a, 0x8b, 0xae, 0x53, 0xb7, 0x39, 0xbf, 0x8f, 0x42, 0x3e, 0x38, 0x68, 0xab, 0x25, 0xf0, 0x82, + 0xba, 0x4c, 0xde, 0x3a, 0x68, 0xd3, 0xc7, 0x4c, 0xf0, 0x2a, 0x44, 0xee, 0x2c, 0xc5, 0x51, 0xc9, + 0x1a, 0x14, 0xfd, 0xc0, 0x0a, 0x3a, 0xbe, 0x64, 0xf9, 0x71, 0xe5, 0x7d, 0x56, 0xe5, 0xa5, 0x8f, + 0x1f, 0xce, 0x26, 0x04, 0x6c, 0xcc, 0x69, 0x4a, 0x02, 0x0b, 0x25, 0x0d, 0xb2, 0x0f, 0xa4, 0x69, + 0xf9, 0xc1, 0x96, 0x67, 0x39, 0xbe, 0xe0, 0x64, 0x6b, 0xcf, 0x85, 0x9f, 0x30, 0xf4, 0x0c, 0x1d, + 0x38, 0x11, 0x0e, 0x1b, 0x9b, 0x79, 0x4c, 0xf3, 0x60, 0x35, 0xc2, 0x6d, 0x7d, 0xad, 0x8b, 0x1a, + 0x26, 0x70, 0x10, 0x3e, 0x74, 0x96, 0x9f, 0xe4, 0x43, 0xc7, 0x4a, 0x51, 0x42, 0xd9, 0x80, 0xb4, + 0xe4, 0x45, 0x55, 0x21, 0x7a, 0xe7, 0xac, 0xae, 0xa8, 0x14, 0xbc, 0xdc, 0x80, 0xf3, 0xfa, 0x2b, + 0x7d, 0xa4, 0x3e, 0x0d, 0x16, 0x0e, 0x38, 0xaf, 0xcb, 0x90, 0xaf, 0x79, 0x6e, 0xd7, 0x8d, 0xfd, + 0xa2, 0xe7, 0x3a, 0xc8, 0x21, 0x91, 0x55, 0x9f, 0x3d, 0x6a, 0xd5, 0x97, 0xbf, 0x99, 0x81, 0x67, + 0x63, 0x9c, 0x16, 0x3d, 0x3b, 0xa0, 0x9e, 0x6d, 0x11, 0x1f, 0x8a, 0xdb, 0x9c, 0xab, 0xdc, 0x32, + 0x6e, 0xa6, 0x10, 0x07, 0x49, 0x1f, 0x23, 0x96, 0x82, 0xf8, 0x1f, 0x25, 0xab, 0xf2, 0x17, 0xe1, + 0x9c, 0xf6, 0xf5, 0x31, 0x16, 0xe8, 0x31, 0x5c, 0x55, 0x97, 0x60, 0xba, 0xe6, 0x51, 0x2b, 0xa0, + 0xab, 0x3b, 0x1b, 0x6e, 0xb0, 0xfc, 0xc0, 0xf6, 0x03, 0xe9, 0xb3, 0xaa, 0xcd, 0xe1, 0x8b, 0x31, + 0x38, 0x76, 0xd5, 0x28, 0x7f, 0x27, 0xcf, 0xe7, 0x74, 0x60, 0xb1, 0x19, 0x42, 0x3e, 0x03, 0x25, + 0xe5, 0x80, 0xa3, 0x36, 0xce, 0x44, 0xf7, 0x24, 0xed, 0xaf, 0x43, 0xef, 0x75, 0x6c, 0x8f, 0x72, + 0x97, 0xd2, 0xd0, 0x7a, 0xaf, 0xa0, 0x3e, 0x86, 0xd4, 0xc8, 0x36, 0x4c, 0xd9, 0x2d, 0xab, 0x41, + 0x37, 0x3b, 0xcd, 0xe6, 0xa6, 0xdb, 0xb4, 0x6b, 0xea, 0x2c, 0x76, 0x55, 0xd9, 0x22, 0x56, 0xa3, + 0xe0, 0xc7, 0x0f, 0x67, 0x5f, 0x48, 0x58, 0x0d, 0x21, 0x02, 0xc6, 0x09, 0x32, 0x1e, 0x3e, 0xad, + 0x75, 0x3c, 0x3b, 0x38, 0x90, 0x67, 0x42, 0xb9, 0x1c, 0x5e, 0xec, 0xa1, 0x76, 0x9b, 0xa8, 0xd2, + 0x93, 0x22, 0x5a, 0x88, 0x71, 0x82, 0xe4, 0x33, 0x30, 0xbe, 0xef, 0x36, 0x3b, 0x2d, 0xba, 0xee, + 0x76, 0x1c, 0x79, 0x94, 0x1b, 0xbb, 0x32, 0x9b, 0xc4, 0xe0, 0x4e, 0x88, 0x17, 0x9e, 0xb3, 0x8c, + 0x42, 0x1f, 0x23, 0xa4, 0xc8, 0xcf, 0x40, 0x8e, 0x3a, 0xfb, 0x72, 0x33, 0xba, 0x98, 0x44, 0x71, + 0xd9, 0xd9, 0xbf, 0x63, 0x79, 0xe1, 0x05, 0xf9, 0xb2, 0xb3, 0x8f, 0xac, 0x0e, 0x59, 0x63, 0xc2, + 0x6f, 0x7f, 0xc5, 0x73, 0x5b, 0xf2, 0xd6, 0xe1, 0xc7, 0x7b, 0x54, 0x67, 0x28, 0x42, 0x3e, 0x9b, + 0xf2, 0x91, 0x17, 0xa3, 0x22, 0x51, 0xfe, 0x83, 0x2c, 0x9c, 0xd1, 0x93, 0x62, 0x8b, 0xb6, 0xda, + 0x4d, 0x2b, 0xa0, 0x3f, 0x9a, 0x1c, 0x47, 0x4e, 0x8e, 0xf2, 0x3f, 0x2c, 0xc0, 0xc4, 0x62, 0xc7, + 0x0f, 0xdc, 0x96, 0xba, 0x7f, 0x9b, 0x87, 0x92, 0x38, 0x60, 0xb1, 0xa3, 0x59, 0x26, 0x7a, 0xcb, + 0x55, 0x55, 0x00, 0x0c, 0x71, 0x98, 0x74, 0xe5, 0x54, 0x95, 0x03, 0xba, 0x96, 0xae, 0x9c, 0x39, + 0x45, 0x09, 0x25, 0xb7, 0x01, 0x6a, 0xd4, 0x0b, 0xe4, 0xe9, 0x32, 0xd7, 0xb7, 0x3d, 0x7b, 0x51, + 0x57, 0x46, 0x83, 0x10, 0x77, 0x4e, 0xe1, 0x6d, 0x61, 0x92, 0xe6, 0xe6, 0x3e, 0xf5, 0x3c, 0xbb, + 0xae, 0xd4, 0xa9, 0xd0, 0x39, 0xa5, 0x0b, 0x03, 0x13, 0x6a, 0x11, 0x1f, 0xf2, 0x7e, 0x9b, 0xd6, + 0xe4, 0x84, 0xbe, 0x95, 0x42, 0x9c, 0x9a, 0x5d, 0x3a, 0x57, 0x6d, 0xd3, 0x9a, 0xd0, 0xa9, 0xb4, + 0x58, 0x64, 0x45, 0xc8, 0x99, 0x3d, 0x71, 0x17, 0x6a, 0xe3, 0xfe, 0x6f, 0xe4, 0xf4, 0xee, 0xff, + 0x2e, 0xfe, 0x34, 0x94, 0x74, 0xbf, 0xf4, 0xa5, 0x4e, 0xfd, 0x65, 0x06, 0x60, 0xc9, 0x0a, 0x2c, + 0xa1, 0xa2, 0xb1, 0x7d, 0xa7, 0x6d, 0x05, 0xbb, 0xf1, 0x7d, 0x67, 0xd3, 0x0a, 0x76, 0x91, 0x43, + 0xc8, 0xab, 0x52, 0xef, 0xc9, 0x46, 0xae, 0x5e, 0x95, 0xde, 0xc3, 0x5d, 0x07, 0x0c, 0x95, 0x47, + 0x3b, 0x78, 0x0b, 0x3d, 0xbe, 0xcb, 0xc1, 0x9b, 0x7c, 0x0a, 0xa0, 0xe6, 0xb6, 0x58, 0x07, 0x06, + 0xae, 0x27, 0x27, 0x9a, 0x32, 0xae, 0xc1, 0xa2, 0x86, 0x3c, 0x8e, 0xfc, 0x42, 0xa3, 0x0e, 0xd7, + 0x00, 0xa4, 0x8c, 0x92, 0x8a, 0x46, 0xa8, 0x01, 0xc8, 0x72, 0xd4, 0x18, 0xe5, 0xbf, 0xc8, 0xc1, + 0xf8, 0x72, 0xcb, 0xb2, 0x9b, 0x6a, 0x85, 0x46, 0x27, 0x4c, 0xe6, 0xd4, 0x27, 0xcc, 0xab, 0xc6, + 0x55, 0x51, 0x4c, 0x81, 0x49, 0xb8, 0x07, 0xfa, 0x1c, 0x8c, 0xfb, 0xad, 0xa0, 0xad, 0x2e, 0x74, + 0xfa, 0x5b, 0xf8, 0x3c, 0x42, 0xad, 0xba, 0xbe, 0xb5, 0xa9, 0xef, 0x83, 0x22, 0xc4, 0xd8, 0xe0, + 0xef, 0xba, 0x7e, 0x20, 0x47, 0x41, 0x0f, 0xfe, 0x75, 0xd7, 0x0f, 0x90, 0x43, 0xf8, 0xf4, 0x70, + 0x3d, 0x11, 0x8d, 0x52, 0x30, 0xa6, 0x87, 0xeb, 0x05, 0xc8, 0x21, 0xe4, 0x02, 0x64, 0x03, 0x57, + 0x1a, 0x0a, 0xb9, 0x97, 0xf7, 0x96, 0x8b, 0xd9, 0xc0, 0xe5, 0xbe, 0x97, 0x6c, 0x7b, 0x1a, 0x89, + 0xf9, 0x5e, 0xb2, 0x8d, 0x87, 0x43, 0x98, 0xbe, 0xe8, 0x77, 0xb6, 0xdf, 0xa1, 0xb5, 0x20, 0x1e, + 0x40, 0x50, 0x15, 0xc5, 0xa8, 0xe0, 0x8c, 0xd8, 0xb6, 0x5b, 0x3f, 0x90, 0x5e, 0x17, 0x9a, 0x18, + 0x77, 0x59, 0xe1, 0x90, 0xf2, 0xdf, 0x18, 0x01, 0xb2, 0xdc, 0xe2, 0x17, 0xaa, 0xe6, 0xd9, 0xf5, + 0x25, 0x28, 0x6e, 0x7b, 0xee, 0x9e, 0x36, 0x81, 0x6b, 0xe9, 0xba, 0xc0, 0x4b, 0x51, 0x42, 0xc9, + 0x15, 0x80, 0xda, 0xae, 0xe5, 0x38, 0xb4, 0x19, 0x1a, 0x8d, 0xf5, 0x40, 0x2e, 0x6a, 0x08, 0x1a, + 0x58, 0x3c, 0xba, 0x58, 0xfc, 0x32, 0x5c, 0x1a, 0xc2, 0xe8, 0xe2, 0x10, 0x84, 0x26, 0x5e, 0xe4, + 0xaa, 0x30, 0x3f, 0xe8, 0xab, 0xc2, 0xc2, 0x00, 0xae, 0x0a, 0x7b, 0x44, 0xdd, 0x16, 0x9f, 0x6c, + 0xd4, 0xed, 0xc8, 0x71, 0xa3, 0x6e, 0x47, 0x87, 0x65, 0x7a, 0xfb, 0xaa, 0x69, 0x41, 0x10, 0x17, + 0x53, 0x9f, 0x4d, 0x71, 0x72, 0xee, 0x9a, 0xac, 0x27, 0x32, 0x6b, 0x3e, 0x0d, 0xb7, 0x53, 0xbf, + 0x91, 0x81, 0x02, 0x67, 0x43, 0x5a, 0x3c, 0x2c, 0x95, 0xeb, 0x62, 0x99, 0xb4, 0x91, 0x1d, 0x9c, + 0x62, 0xe4, 0x2a, 0x48, 0xa9, 0x69, 0x8a, 0x07, 0x79, 0x1e, 0xf2, 0xf2, 0x26, 0x3a, 0xf3, 0xf2, + 0xb8, 0x30, 0xe6, 0xb1, 0xad, 0x0f, 0x79, 0xe9, 0x6b, 0xa3, 0xdf, 0xfb, 0xdb, 0xb3, 0xcf, 0xbc, + 0xf7, 0x1f, 0x2e, 0x3f, 0x53, 0xfe, 0x7e, 0x16, 0x46, 0x39, 0xb9, 0x85, 0x8e, 0x4f, 0xde, 0x36, + 0x46, 0x59, 0x34, 0xf2, 0x23, 0xc7, 0x3b, 0x5c, 0xdf, 0xe4, 0xb2, 0x8a, 0x75, 0x53, 0x28, 0x3a, + 0xc2, 0x32, 0x63, 0xf4, 0x76, 0xa5, 0x9e, 0x94, 0x1d, 0x48, 0x17, 0x2c, 0x74, 0x7c, 0xa6, 0x09, + 0x24, 0x2a, 0x47, 0x6d, 0x6d, 0x80, 0x48, 0x7d, 0x03, 0xae, 0x79, 0x71, 0x7a, 0x86, 0x9a, 0x1a, + 0x31, 0x52, 0x94, 0xff, 0x34, 0x03, 0xe3, 0x0a, 0x75, 0xcd, 0xf6, 0x03, 0xf2, 0xf9, 0xae, 0xee, + 0x9c, 0x3b, 0x5e, 0x77, 0xb2, 0xda, 0xbc, 0x33, 0xf5, 0x42, 0x50, 0x25, 0x46, 0x57, 0x36, 0xa0, + 0x60, 0x07, 0xb4, 0xe5, 0x4b, 0x67, 0x83, 0x85, 0xf4, 0xdf, 0x17, 0xde, 0x92, 0xae, 0x32, 0xc2, + 0x28, 0xe8, 0x97, 0xff, 0x24, 0x17, 0x7e, 0x17, 0xeb, 0x60, 0xf2, 0x56, 0xc4, 0xdc, 0x5c, 0x49, + 0x67, 0x6e, 0x66, 0x7c, 0xe3, 0xb6, 0x66, 0xbf, 0xdb, 0xd6, 0xbc, 0x32, 0x00, 0x5b, 0x33, 0xff, + 0xc4, 0x27, 0x6a, 0x68, 0x66, 0x82, 0x74, 0x4a, 0xb3, 0x5c, 0x7e, 0xe0, 0x06, 0x76, 0x4d, 0xee, + 0x84, 0x03, 0x34, 0xa6, 0xf3, 0x03, 0x9c, 0x2e, 0x14, 0x5c, 0x30, 0xce, 0xb6, 0xfc, 0x5f, 0x32, + 0x30, 0x19, 0x9d, 0xd9, 0x64, 0x57, 0xaf, 0x99, 0x4c, 0x5a, 0xa7, 0xaf, 0xc3, 0xd7, 0x0a, 0xd9, + 0x83, 0xa2, 0x08, 0xe9, 0x92, 0xc3, 0x9b, 0x26, 0x64, 0x5e, 0x5d, 0x83, 0x84, 0xcc, 0xc4, 0x6f, + 0x94, 0x2c, 0xca, 0xff, 0x33, 0x2b, 0x27, 0xb0, 0x32, 0x6c, 0x5c, 0x84, 0xac, 0x5d, 0x97, 0x6a, + 0x11, 0xc8, 0x4a, 0xd9, 0xd5, 0x25, 0xcc, 0xda, 0x75, 0x7e, 0x28, 0x15, 0xb1, 0x5f, 0xd9, 0xa8, + 0xda, 0x14, 0x8b, 0x92, 0xfc, 0x04, 0x8c, 0x31, 0x39, 0xb3, 0x4f, 0x3d, 0xdf, 0x76, 0x9d, 0xb8, + 0x0a, 0xc4, 0xd6, 0xc9, 0x1d, 0x01, 0x42, 0x13, 0x8f, 0xa9, 0x73, 0xfc, 0x48, 0x11, 0xd3, 0x3b, + 0x8d, 0x63, 0x44, 0x05, 0xa6, 0xd8, 0xfa, 0xe6, 0x82, 0xdc, 0x09, 0x38, 0x72, 0x21, 0xe6, 0xc9, + 0x62, 0x05, 0xd6, 0xa2, 0x00, 0xf3, 0x7a, 0x71, 0x7c, 0x53, 0xbd, 0x2c, 0x1e, 0xa1, 0x5e, 0xae, + 0x41, 0x3e, 0xb0, 0x5b, 0x2a, 0xd0, 0xad, 0x1f, 0x5b, 0x6a, 0xd8, 0x76, 0xbb, 0xc5, 0xda, 0x6e, + 0xb7, 0xa8, 0xb1, 0xaf, 0x7c, 0x33, 0x0f, 0x53, 0xbc, 0xcf, 0x97, 0x68, 0x9b, 0x3a, 0x75, 0xea, + 0xd4, 0x0e, 0x8e, 0x61, 0xe8, 0xab, 0xc0, 0x14, 0x0d, 0x37, 0x65, 0xc3, 0xbf, 0x56, 0x7f, 0xfb, + 0x72, 0x14, 0x8c, 0x71, 0x7c, 0x1e, 0x77, 0xce, 0x8a, 0x92, 0x7c, 0x6d, 0x97, 0x15, 0x00, 0x43, + 0x1c, 0xb2, 0x0f, 0x23, 0x62, 0xa7, 0xf7, 0xe5, 0x4a, 0xbc, 0x99, 0x52, 0x92, 0x86, 0x5f, 0x2c, + 0xb5, 0x0a, 0xbe, 0x43, 0x8b, 0xff, 0x7d, 0x54, 0xcc, 0xc8, 0x2f, 0x66, 0xa0, 0x14, 0x78, 0x96, + 0xe3, 0xef, 0xb8, 0x5e, 0x4b, 0x6a, 0xaf, 0x5b, 0x03, 0x63, 0xbd, 0xa5, 0x28, 0x53, 0x19, 0x4c, + 0xa9, 0x0b, 0x30, 0xe4, 0x4a, 0x6c, 0xb8, 0x20, 0x9b, 0xb3, 0xe6, 0x36, 0xec, 0x9a, 0xd5, 0x14, + 0x61, 0xbc, 0xae, 0x72, 0x9e, 0xfa, 0xa8, 0xba, 0x5a, 0x5f, 0x49, 0xc4, 0x7a, 0xfc, 0x70, 0x76, + 0x2a, 0x56, 0x84, 0x3d, 0x08, 0x96, 0x7f, 0xb7, 0x00, 0xe7, 0x13, 0xbb, 0x87, 0x6c, 0xcb, 0x29, + 0x98, 0xfa, 0xf6, 0x92, 0x4d, 0x44, 0xd9, 0xe5, 0xa3, 0xd1, 0x89, 0x69, 0x6a, 0x5f, 0xd9, 0x53, + 0xd0, 0xbe, 0x76, 0xa4, 0xf6, 0x25, 0x42, 0x9e, 0x53, 0x7c, 0x52, 0x68, 0xae, 0x08, 0xd7, 0x4b, + 0xa8, 0xc7, 0x11, 0x1b, 0x0a, 0xf4, 0x41, 0xdb, 0x53, 0xa6, 0xd9, 0x14, 0x8c, 0x96, 0x1f, 0xb4, + 0x3d, 0xc9, 0x48, 0x6b, 0x01, 0xac, 0xcc, 0x47, 0xc1, 0x81, 0xbc, 0x0d, 0x67, 0x19, 0xcb, 0xf8, + 0x3c, 0x11, 0xa2, 0x69, 0x4e, 0x56, 0x39, 0xbb, 0xd4, 0x8d, 0x92, 0x34, 0x49, 0x92, 0x48, 0x31, + 0x0e, 0x8c, 0x55, 0xf2, 0x4c, 0xd4, 0x1c, 0x96, 0xbb, 0x51, 0x12, 0x39, 0x24, 0x90, 0xe2, 0xb2, + 0x9d, 0x7b, 0xc8, 0xcb, 0xa3, 0x79, 0x28, 0xdb, 0x79, 0x29, 0x4a, 0x68, 0xf9, 0x6d, 0xb8, 0xd8, + 0x7b, 0x39, 0xb1, 0xdd, 0xe3, 0x9d, 0x7b, 0xf1, 0xdd, 0xe3, 0x8d, 0x5b, 0x98, 0x7d, 0xe7, 0x9e, + 0xc1, 0x21, 0x7b, 0x28, 0x87, 0xf7, 0xb3, 0x30, 0x1d, 0xbf, 0xba, 0x24, 0x1d, 0x18, 0xa9, 0x89, + 0xeb, 0x3e, 0xb9, 0x16, 0x36, 0xd2, 0xdc, 0xd2, 0x76, 0xdf, 0x1b, 0xca, 0xc9, 0x2a, 0x20, 0xa8, + 0x78, 0x91, 0xbf, 0xa6, 0x02, 0xb5, 0xd7, 0xad, 0xb6, 0x5c, 0x1d, 0x1b, 0xa9, 0xee, 0x83, 0xba, + 0xae, 0x78, 0xcc, 0x70, 0xee, 0xf5, 0x30, 0x9c, 0x7b, 0xdd, 0x6a, 0x97, 0xff, 0x38, 0x0b, 0x63, + 0xa6, 0xd5, 0x62, 0xf8, 0x47, 0x90, 0xbd, 0xc8, 0x11, 0x64, 0x75, 0x20, 0xc7, 0xc7, 0x9e, 0xa7, + 0x10, 0x3f, 0x76, 0x0a, 0x19, 0xcc, 0x69, 0xf5, 0x88, 0x83, 0xc8, 0x35, 0x38, 0xd3, 0x75, 0xb4, + 0x25, 0x57, 0x00, 0xd8, 0x92, 0xa0, 0xbe, 0x6f, 0xeb, 0x4b, 0x46, 0xdd, 0x51, 0xcb, 0x1a, 0x82, + 0x06, 0x56, 0xf9, 0xdf, 0x67, 0xc0, 0xdc, 0x70, 0x4f, 0xe1, 0x50, 0xf3, 0x4e, 0xf4, 0x50, 0xb3, + 0x3c, 0x90, 0xee, 0xea, 0x71, 0xae, 0xf9, 0x95, 0xa5, 0xc8, 0xd7, 0xf1, 0xa3, 0xcd, 0x55, 0x18, + 0xa7, 0x52, 0x27, 0x4e, 0x4a, 0x0b, 0xb3, 0x6c, 0xc0, 0x30, 0x82, 0x49, 0x9a, 0x86, 0x69, 0x36, + 0x9b, 0xf6, 0x04, 0xa1, 0x8c, 0xb9, 0xc2, 0x4e, 0xd5, 0x6d, 0xda, 0x25, 0xbb, 0x30, 0xe2, 0x8b, + 0x00, 0x28, 0x39, 0xb1, 0x52, 0x9c, 0xc2, 0x54, 0x24, 0x15, 0x97, 0x0e, 0xf2, 0x07, 0x2a, 0xf2, + 0xe4, 0x00, 0x0a, 0x2d, 0xdb, 0xb1, 0x5d, 0xb9, 0xc5, 0x6c, 0x0d, 0x6c, 0xbd, 0xcc, 0xad, 0x33, + 0xb2, 0xc2, 0xe0, 0xa3, 0x07, 0x88, 0x97, 0xa1, 0xe0, 0xc8, 0x73, 0xbd, 0xd5, 0xa4, 0xb7, 0x89, + 0xbc, 0x59, 0xb9, 0x3b, 0x38, 0xf6, 0xda, 0x8f, 0x25, 0x6a, 0x72, 0x52, 0xc5, 0xa8, 0x59, 0x93, + 0x8e, 0xcc, 0xc8, 0x51, 0x4c, 0xeb, 0x9b, 0x1a, 0x6f, 0xc2, 0x8a, 0xdd, 0xa4, 0xb1, 0xeb, 0x1d, + 0x23, 0x45, 0x07, 0xfb, 0x7c, 0x23, 0x11, 0xc5, 0x80, 0x3f, 0x5f, 0x5d, 0x4e, 0xc6, 0x3e, 0xbf, + 0x3b, 0x3d, 0x05, 0x53, 0x54, 0xb5, 0x1f, 0xb3, 0xc8, 0xb8, 0x77, 0x67, 0x70, 0xcd, 0x90, 0x9e, + 0x9f, 0xa2, 0x15, 0xfa, 0x98, 0xd2, 0xe5, 0xd9, 0xdc, 0x81, 0xbc, 0xd5, 0xba, 0xd7, 0x96, 0xb6, + 0xc7, 0x01, 0x0e, 0x41, 0xa5, 0x75, 0xaf, 0x1d, 0x1b, 0x82, 0xca, 0xfa, 0xad, 0x4d, 0xe4, 0xec, + 0xd8, 0xe4, 0x17, 0x36, 0x01, 0x18, 0xf4, 0xe4, 0xe7, 0x56, 0x81, 0xd8, 0xe4, 0x8f, 0x58, 0x0a, + 0x3a, 0x90, 0x6f, 0xdd, 0x0b, 0x82, 0x99, 0xb1, 0x41, 0x7f, 0xf1, 0xfa, 0xbd, 0x20, 0x88, 0x7d, + 0xf1, 0xfa, 0xad, 0xad, 0x2d, 0xe4, 0xec, 0x18, 0x5b, 0x6e, 0xdb, 0x19, 0x1f, 0x34, 0xdb, 0x0d, + 0x2b, 0xf0, 0x63, 0x6c, 0x0d, 0x8b, 0xcf, 0x3d, 0xc8, 0xf9, 0x8e, 0x2f, 0x3d, 0x67, 0x71, 0x70, + 0x5c, 0xab, 0x8e, 0x64, 0xaa, 0xfd, 0x08, 0xaa, 0x1b, 0x55, 0x64, 0xbc, 0x38, 0xcb, 0x7b, 0xfe, + 0xcc, 0xe4, 0xc0, 0x59, 0xde, 0xeb, 0x62, 0x79, 0x8b, 0xb1, 0xbc, 0xe7, 0x93, 0x2f, 0x40, 0xb1, + 0xdd, 0xd9, 0xae, 0x76, 0xb6, 0x67, 0xa6, 0x38, 0xd7, 0xdb, 0x83, 0xe3, 0xba, 0xc9, 0xe9, 0x0a, + 0xc6, 0x5a, 0x2f, 0x10, 0x85, 0x28, 0x99, 0x32, 0xf6, 0x82, 0xdf, 0xcc, 0xf4, 0xa0, 0xd9, 0x5f, + 0xe3, 0x84, 0x62, 0xec, 0x45, 0x21, 0x4a, 0xa6, 0x92, 0x7d, 0xd3, 0xda, 0x9e, 0x39, 0x33, 0x04, + 0xf6, 0x4d, 0x2b, 0x81, 0x7d, 0xd3, 0x12, 0xec, 0x9b, 0xd6, 0x36, 0x9b, 0xd9, 0xbb, 0xf5, 0x1d, + 0x7f, 0x86, 0x0c, 0x7a, 0x66, 0x5f, 0xaf, 0xef, 0xc4, 0x67, 0xf6, 0xf5, 0xa5, 0x95, 0x2a, 0x72, + 0x76, 0x4c, 0x84, 0xf8, 0x4d, 0xab, 0xb6, 0x37, 0x73, 0x76, 0xd0, 0x22, 0xa4, 0xca, 0xc8, 0xc6, + 0x44, 0x08, 0x2f, 0x43, 0xc1, 0x91, 0xfc, 0x6a, 0x06, 0xc6, 0x64, 0x22, 0x8d, 0x6b, 0x9e, 0x5d, + 0x9f, 0x39, 0x97, 0xfa, 0xe2, 0x26, 0xde, 0x82, 0x90, 0xb8, 0x68, 0x47, 0x68, 0xff, 0x0a, 0x21, + 0x68, 0xb6, 0x81, 0xfc, 0xad, 0x0c, 0x4c, 0x5a, 0x91, 0x44, 0x29, 0x33, 0xe7, 0x79, 0xb3, 0x7e, + 0x7e, 0x80, 0x32, 0x3d, 0x9a, 0x88, 0x85, 0xb7, 0x4c, 0x3b, 0x56, 0x47, 0x81, 0x18, 0x6b, 0x0c, + 0x9b, 0xa4, 0x7e, 0xe0, 0xd9, 0x6d, 0x3a, 0x73, 0x61, 0xd0, 0x93, 0xb4, 0xca, 0xe9, 0xc6, 0x26, + 0xa9, 0x28, 0x44, 0xc9, 0x94, 0xef, 0xb5, 0x54, 0x5c, 0x8f, 0xcd, 0x3c, 0x3b, 0xe8, 0xbd, 0x56, + 0xdd, 0xbb, 0x45, 0xf7, 0x5a, 0x59, 0x8a, 0x8a, 0x2f, 0x9b, 0xb1, 0x1e, 0xad, 0xdb, 0xfe, 0xcc, + 0xcc, 0xa0, 0x67, 0x2c, 0x32, 0xb2, 0xb1, 0x19, 0xcb, 0xcb, 0x50, 0x70, 0x64, 0x32, 0xd9, 0xf1, + 0xef, 0xcd, 0x3c, 0x37, 0x68, 0x99, 0xbc, 0xe1, 0xdf, 0x8b, 0xc9, 0xe4, 0x8d, 0xea, 0x2d, 0x64, + 0xbc, 0x84, 0x4c, 0x6e, 0xfa, 0x96, 0x37, 0x73, 0x71, 0xf0, 0x32, 0x99, 0xd1, 0xed, 0x92, 0xc9, + 0xac, 0x10, 0x25, 0x53, 0x3e, 0xe0, 0x3c, 0xa3, 0xb7, 0x5d, 0x9b, 0xf9, 0xb1, 0x41, 0x0f, 0xf8, + 0x35, 0x41, 0x38, 0x36, 0xe0, 0xb2, 0x14, 0x15, 0x5f, 0xf2, 0x32, 0xd3, 0x33, 0xdb, 0x4d, 0xbb, + 0x66, 0xf9, 0x33, 0xcf, 0x0b, 0x6f, 0x07, 0xa1, 0x0a, 0x8a, 0x32, 0xd4, 0x50, 0xf2, 0x9b, 0x19, + 0x98, 0x8a, 0x45, 0xd3, 0xcc, 0xbc, 0xc0, 0x5b, 0xfd, 0xe6, 0xe0, 0x5a, 0xbd, 0x10, 0x65, 0x20, + 0x5a, 0xaf, 0x0d, 0xc0, 0xf1, 0x38, 0x8c, 0x78, 0x7b, 0xc8, 0xd7, 0x32, 0x50, 0xd2, 0x65, 0x33, + 0x97, 0x78, 0xeb, 0x3e, 0x3d, 0x84, 0xd6, 0x89, 0x76, 0x69, 0xdb, 0x72, 0x18, 0x84, 0x18, 0x72, + 0xe7, 0x12, 0x98, 0xcf, 0x6c, 0x71, 0x15, 0x33, 0x33, 0x3b, 0x68, 0x09, 0x8c, 0x21, 0xf1, 0x98, + 0x04, 0x36, 0x20, 0x68, 0xb6, 0x81, 0x8f, 0xa1, 0x15, 0xcd, 0xa0, 0x31, 0x73, 0x79, 0xd0, 0x63, + 0x18, 0x4f, 0x7a, 0x12, 0x1d, 0xc3, 0x18, 0x14, 0xe3, 0xed, 0x21, 0xbf, 0x9b, 0x81, 0x33, 0x56, + 0x3c, 0x75, 0xd1, 0xcc, 0x8f, 0xf3, 0x56, 0xbe, 0x3d, 0xe0, 0x56, 0x46, 0xb2, 0x23, 0xf1, 0x76, + 0xea, 0xc0, 0xba, 0x2e, 0x38, 0x76, 0xb7, 0x8a, 0xe9, 0x15, 0xfe, 0x4e, 0xd0, 0x9e, 0x29, 0x0f, + 0x5a, 0xaf, 0xa8, 0xee, 0x04, 0xf1, 0xa3, 0x49, 0x75, 0x65, 0x6b, 0x13, 0x39, 0x3b, 0xae, 0x4d, + 0x51, 0xcf, 0xb3, 0x83, 0x99, 0x17, 0x07, 0xae, 0x4d, 0x71, 0xba, 0x71, 0x6d, 0x8a, 0x17, 0xa2, + 0x64, 0x7a, 0xf1, 0x8b, 0x00, 0xe1, 0xf9, 0x3d, 0xc1, 0x25, 0xe2, 0xb3, 0xa6, 0x4b, 0xc4, 0x80, + 0x52, 0x69, 0x1a, 0x8e, 0x15, 0x17, 0xbf, 0x9e, 0x81, 0x89, 0xc8, 0x09, 0x3e, 0xa1, 0x0d, 0xb5, + 0x68, 0x1b, 0xd6, 0x07, 0x1a, 0xf3, 0x62, 0x36, 0xe6, 0x97, 0x32, 0x50, 0xd2, 0x67, 0xf9, 0x84, + 0x86, 0xbc, 0x15, 0x6d, 0xc8, 0x6a, 0xba, 0x9c, 0x9e, 0x3d, 0x1a, 0xc1, 0x7a, 0x24, 0x72, 0xa8, + 0x1f, 0x6a, 0x8f, 0x68, 0x4e, 0xc9, 0x8d, 0xf9, 0x6a, 0x06, 0xc6, 0xcd, 0xa3, 0x7d, 0x42, 0x5b, + 0xb6, 0xa3, 0x6d, 0x59, 0x4b, 0x1d, 0x1b, 0x7d, 0xc8, 0xe0, 0xe8, 0x53, 0xfe, 0x50, 0x07, 0x27, + 0xf6, 0x9a, 0x80, 0xd9, 0x88, 0x2f, 0x67, 0x00, 0xc2, 0x23, 0x7f, 0x42, 0x2b, 0xde, 0x8e, 0xb6, + 0xe2, 0x8d, 0x94, 0xde, 0x07, 0x87, 0xf4, 0x85, 0x3e, 0xff, 0x0f, 0xb5, 0x2f, 0xd6, 0x6f, 0x6d, + 0x6d, 0xf5, 0x68, 0xc4, 0x97, 0x32, 0x50, 0xd2, 0xd6, 0x80, 0xa1, 0x76, 0xc5, 0x46, 0x65, 0xab, + 0x2a, 0x54, 0xfb, 0xee, 0x56, 0xbc, 0x97, 0x81, 0x51, 0x65, 0x1d, 0x48, 0x68, 0xc4, 0x9b, 0xd1, + 0x46, 0xa4, 0xf0, 0x1e, 0xaa, 0x6e, 0x54, 0x7b, 0x74, 0x04, 0x6f, 0xc2, 0xbd, 0xd3, 0x68, 0xc2, + 0xad, 0x5e, 0x4d, 0x78, 0x3f, 0x03, 0x63, 0x86, 0xe9, 0x20, 0xa1, 0x15, 0x56, 0xb4, 0x15, 0x29, + 0x2e, 0x30, 0x24, 0x9f, 0xde, 0x0d, 0x31, 0x8c, 0x08, 0x43, 0x6d, 0x88, 0xe4, 0x73, 0x68, 0x43, + 0x94, 0x39, 0x61, 0xd8, 0x0d, 0x61, 0x7c, 0x7a, 0xaf, 0x55, 0x6d, 0x5a, 0x18, 0xea, 0x5a, 0xbd, + 0xbe, 0xb4, 0x52, 0x3d, 0x44, 0x6e, 0x85, 0x76, 0x86, 0xa1, 0x2e, 0x56, 0xc1, 0x26, 0xb9, 0x19, + 0xdf, 0xce, 0xc0, 0x74, 0xdc, 0xd8, 0x90, 0xd0, 0x98, 0x9d, 0x68, 0x63, 0x36, 0xd3, 0xb8, 0x2f, + 0x85, 0xcc, 0x92, 0x9b, 0xf4, 0x6b, 0x19, 0x38, 0x9b, 0x60, 0x68, 0x48, 0x68, 0x95, 0x1d, 0x6d, + 0x55, 0x75, 0x08, 0x19, 0x66, 0xe3, 0x13, 0xd8, 0x30, 0x35, 0x0c, 0x75, 0x02, 0x4b, 0x3e, 0xbd, + 0x75, 0x00, 0xd3, 0xe4, 0x30, 0x54, 0x1d, 0xa0, 0xdb, 0xa7, 0x38, 0x3e, 0x8d, 0x43, 0xe3, 0xc3, + 0x50, 0xa7, 0xb1, 0x60, 0xd3, 0x5b, 0xe0, 0x2b, 0x53, 0xc4, 0x50, 0x05, 0xfe, 0x46, 0xf5, 0xd6, + 0xa1, 0x02, 0x5f, 0xdb, 0x25, 0x86, 0x2c, 0xf0, 0x39, 0x9f, 0xde, 0xb3, 0xc3, 0xb4, 0x4f, 0x0c, + 0x75, 0x76, 0x28, 0x46, 0xc9, 0x4d, 0xf9, 0x5e, 0xc6, 0xc8, 0x0f, 0x66, 0x18, 0x1d, 0x12, 0x9a, + 0xf4, 0x4e, 0xb4, 0x49, 0x5b, 0xc3, 0xc8, 0xf1, 0x61, 0x36, 0xed, 0x1b, 0x19, 0x98, 0x8c, 0x5a, + 0x1c, 0x12, 0x1a, 0x55, 0x8f, 0x36, 0x6a, 0x63, 0xb0, 0x69, 0xc7, 0xe2, 0x72, 0x38, 0x6e, 0x72, + 0x18, 0xaa, 0x1c, 0x36, 0x99, 0xf5, 0x1e, 0xbc, 0x24, 0x6b, 0xc3, 0x50, 0x07, 0xaf, 0x77, 0x4e, + 0x57, 0xb3, 0x69, 0xbf, 0x9e, 0x91, 0xb9, 0x4a, 0xbb, 0x4c, 0x0c, 0x09, 0x8d, 0x6b, 0x46, 0x1b, + 0x77, 0x67, 0x38, 0x39, 0x9f, 0xe3, 0x0a, 0x86, 0xb6, 0x31, 0x0c, 0x55, 0xc1, 0xa8, 0xae, 0x6c, + 0x6d, 0x1e, 0xa6, 0x6e, 0x85, 0xf6, 0x86, 0xe1, 0xaa, 0x5b, 0x82, 0x4f, 0x62, 0x43, 0xca, 0x5f, + 0x88, 0x38, 0xcd, 0x9c, 0xb6, 0x43, 0x74, 0xf9, 0x37, 0x32, 0x00, 0xa1, 0x0f, 0x1e, 0xb9, 0x0c, + 0x79, 0xfa, 0xa0, 0xed, 0xc5, 0x5d, 0x65, 0x19, 0x06, 0x72, 0x08, 0x71, 0xa0, 0xb8, 0x63, 0xd3, + 0x66, 0x5d, 0xb9, 0xca, 0xa4, 0x70, 0x68, 0x94, 0x11, 0x96, 0x2b, 0x8c, 0x5c, 0xd8, 0x40, 0xfe, + 0xd3, 0x47, 0xc9, 0xa5, 0xfc, 0x11, 0x18, 0x37, 0x1f, 0x14, 0x39, 0x3a, 0x7a, 0xb2, 0xfc, 0x8f, + 0xf2, 0x30, 0x15, 0xb3, 0x57, 0x68, 0xef, 0xdc, 0xad, 0x30, 0x9d, 0x44, 0xd4, 0x3b, 0x97, 0x3b, + 0x34, 0x87, 0x38, 0xe4, 0x1b, 0x19, 0x98, 0xba, 0x6f, 0x05, 0xb5, 0x5d, 0x46, 0x78, 0xd1, 0x74, + 0x19, 0x4f, 0x31, 0x1f, 0xef, 0x46, 0x09, 0x86, 0x86, 0xc9, 0x18, 0x00, 0xe3, 0xac, 0xc9, 0x2b, + 0x30, 0xd2, 0x76, 0x9b, 0x4d, 0xdb, 0x69, 0xc8, 0x67, 0xb0, 0xc2, 0x30, 0x55, 0x51, 0x8c, 0x0a, + 0x1e, 0x7d, 0xa9, 0x30, 0x9f, 0xd6, 0x7d, 0x23, 0xd6, 0x91, 0x27, 0x0a, 0x98, 0x2a, 0x3c, 0x05, + 0x01, 0x53, 0xff, 0x2a, 0x0f, 0xa4, 0x7b, 0xb7, 0x3e, 0xea, 0x51, 0xcf, 0x97, 0x22, 0xe1, 0x04, + 0xa5, 0x5e, 0x91, 0x00, 0x22, 0x43, 0x8f, 0x8c, 0x39, 0xef, 0x7a, 0xc5, 0x4d, 0x94, 0xa3, 0xc6, + 0xe8, 0x33, 0xaf, 0xff, 0x57, 0xbb, 0xb3, 0xec, 0x7c, 0x76, 0x90, 0x1a, 0x4b, 0x1f, 0x43, 0x7e, + 0x9b, 0xbf, 0xd7, 0xb6, 0x2b, 0x03, 0xe6, 0x8b, 0x7d, 0x07, 0xcc, 0x57, 0x74, 0x65, 0x34, 0x08, + 0x9d, 0xfa, 0x2b, 0x00, 0xe9, 0x66, 0xd2, 0x9f, 0x16, 0xe1, 0x4c, 0x97, 0xc4, 0x3f, 0xfd, 0x9c, + 0x8c, 0xaf, 0xc2, 0x28, 0xfb, 0xbb, 0x91, 0x10, 0xf3, 0x7c, 0x5d, 0x96, 0xa3, 0xc6, 0x30, 0xf2, + 0x0f, 0xe6, 0x7a, 0xe6, 0x1f, 0xb4, 0x22, 0xb9, 0x56, 0x87, 0xf2, 0xd8, 0xe4, 0x27, 0x61, 0x42, + 0xd8, 0xf9, 0x55, 0xa6, 0xbd, 0x42, 0x34, 0xd5, 0xda, 0x35, 0x13, 0x88, 0x51, 0xdc, 0x1e, 0x79, + 0xf5, 0x8a, 0x27, 0xca, 0xab, 0xf7, 0xcb, 0xdd, 0xa9, 0xf8, 0x3f, 0x33, 0x40, 0x05, 0xa0, 0x8f, + 0x35, 0x65, 0xe6, 0xb4, 0x1c, 0x3d, 0x34, 0xa7, 0xe5, 0x3c, 0x94, 0x7c, 0xbf, 0x79, 0x87, 0x7a, + 0xf6, 0x8e, 0x08, 0xdb, 0x36, 0x5e, 0x3e, 0xac, 0x2a, 0x00, 0x86, 0x38, 0x4f, 0x59, 0x48, 0xeb, + 0xfb, 0x05, 0x6e, 0x20, 0xd3, 0x8a, 0xc0, 0x11, 0xa2, 0xf9, 0x75, 0x98, 0xac, 0x35, 0x5d, 0x87, + 0x2e, 0xd9, 0x1e, 0x97, 0x30, 0x07, 0xf1, 0x4c, 0x77, 0x8b, 0x11, 0x28, 0xc6, 0xb0, 0x49, 0x0d, + 0x0a, 0x35, 0x8f, 0xd6, 0xfd, 0xf4, 0x61, 0x79, 0xd7, 0xec, 0x60, 0x91, 0x51, 0x12, 0x61, 0x79, + 0xfc, 0x5f, 0x14, 0xb4, 0x79, 0xaa, 0x01, 0x7f, 0x97, 0xcb, 0x41, 0x2e, 0x32, 0xf3, 0xfd, 0xa7, + 0x1a, 0xa8, 0x5e, 0xd7, 0xd5, 0x31, 0x42, 0x8c, 0x49, 0x80, 0x1d, 0xbb, 0x49, 0x99, 0x16, 0x11, + 0x4f, 0xda, 0xb0, 0x22, 0xcb, 0x51, 0x63, 0x88, 0xb0, 0x7d, 0xcb, 0xa9, 0xed, 0xca, 0xc0, 0x07, + 0x23, 0x6c, 0x9f, 0xe7, 0x08, 0x95, 0x50, 0xd6, 0xed, 0x81, 0xd5, 0x90, 0x81, 0x0c, 0xba, 0xdb, + 0xb7, 0xac, 0x06, 0xb2, 0x72, 0x06, 0xf6, 0xe8, 0x8e, 0xcc, 0x2e, 0xa0, 0xc1, 0x48, 0x77, 0x90, + 0x95, 0x93, 0x16, 0x14, 0x3d, 0xda, 0x72, 0x03, 0xf5, 0x68, 0xf1, 0x6a, 0xaa, 0x6e, 0x45, 0x4e, + 0x4a, 0x2a, 0x53, 0x20, 0xf2, 0x63, 0xb1, 0x12, 0x94, 0x4c, 0x48, 0x15, 0xce, 0xab, 0x5d, 0x75, + 0xb5, 0xe1, 0xb8, 0x1e, 0xbd, 0xee, 0xfa, 0x3c, 0x5b, 0x22, 0xf0, 0xe5, 0xa1, 0x32, 0x8a, 0x9d, + 0x5f, 0x4d, 0x42, 0xc2, 0xe4, 0xba, 0xe5, 0x7f, 0x90, 0x81, 0x51, 0x35, 0xa6, 0x4f, 0x41, 0x16, + 0xf2, 0x5b, 0x30, 0x15, 0xeb, 0xaa, 0x63, 0x04, 0xc4, 0x3d, 0x0f, 0xf9, 0x8e, 0xd7, 0x14, 0x3a, + 0xbe, 0x7c, 0xc1, 0xf0, 0x36, 0xae, 0x55, 0x91, 0x97, 0x96, 0xff, 0x30, 0x03, 0x93, 0xc2, 0x98, + 0x5d, 0x69, 0xb7, 0x45, 0x3f, 0xdc, 0x06, 0x68, 0x7b, 0xf6, 0xbe, 0x15, 0x50, 0x95, 0x8c, 0xb2, + 0xbf, 0xad, 0x7f, 0x53, 0x57, 0x46, 0x83, 0x10, 0x79, 0x11, 0x0a, 0x56, 0xbb, 0xbd, 0xba, 0xc4, + 0xbb, 0x22, 0x17, 0x7a, 0xef, 0x54, 0x58, 0x21, 0x0a, 0x18, 0x5b, 0xea, 0xb6, 0xe3, 0x07, 0x56, + 0xb3, 0xc9, 0xc3, 0x4d, 0x56, 0x97, 0xf8, 0x9a, 0xcd, 0x85, 0x4b, 0x7d, 0x35, 0x02, 0xc5, 0x18, + 0x76, 0xf9, 0xef, 0x8f, 0xc1, 0x99, 0x2e, 0xdb, 0xbc, 0x11, 0xac, 0x99, 0xeb, 0x0a, 0xd6, 0x34, + 0x76, 0xf3, 0xec, 0xa9, 0xec, 0xe6, 0x3a, 0xb9, 0x78, 0xee, 0xb8, 0xc9, 0xc5, 0xc3, 0xc4, 0x9d, + 0x32, 0xe6, 0x33, 0x21, 0x21, 0x73, 0x98, 0xec, 0x13, 0x0d, 0xfc, 0x63, 0x65, 0x3b, 0xbf, 0x09, + 0xa3, 0x56, 0xdb, 0x16, 0x39, 0x7d, 0x8b, 0x7d, 0x4f, 0xd3, 0xca, 0xe6, 0xaa, 0x48, 0xe8, 0xab, + 0x89, 0x74, 0x67, 0xf3, 0x1d, 0x19, 0x6c, 0x36, 0x5f, 0x53, 0x05, 0x1f, 0x3d, 0x52, 0x05, 0x7f, + 0x09, 0x8a, 0x56, 0x2d, 0xb0, 0xf7, 0xa9, 0xdc, 0x48, 0xb5, 0x34, 0xac, 0xf0, 0x52, 0x94, 0x50, + 0x9e, 0x90, 0x24, 0x8c, 0x88, 0xe5, 0x62, 0xc5, 0x4c, 0x48, 0x62, 0x04, 0xcb, 0x9a, 0x78, 0x5c, + 0xcf, 0xe1, 0xf3, 0x25, 0x9a, 0x51, 0x38, 0xd4, 0x73, 0x4c, 0x20, 0x46, 0x71, 0x49, 0x05, 0xa6, + 0x44, 0xc1, 0xed, 0x36, 0x3b, 0x3e, 0xb3, 0xea, 0xe3, 0xd1, 0x59, 0x71, 0x2d, 0x0a, 0xc6, 0x38, + 0x7e, 0x0f, 0x55, 0x69, 0x22, 0xbd, 0xaa, 0x34, 0x99, 0x5a, 0x55, 0x8a, 0xaf, 0xc3, 0x3e, 0x54, + 0xa5, 0xaf, 0xc4, 0x93, 0x7a, 0x0b, 0x6f, 0xe7, 0x14, 0x6a, 0x0d, 0x5b, 0x54, 0x75, 0x33, 0x6d, + 0xf7, 0xb1, 0x92, 0x79, 0xff, 0x34, 0x4c, 0xb8, 0x5e, 0xc3, 0x72, 0xec, 0x77, 0xb9, 0x84, 0xf1, + 0xb9, 0xdb, 0x73, 0x49, 0xcc, 0xd1, 0x9b, 0x26, 0x00, 0xa3, 0x78, 0xa4, 0x03, 0xa5, 0x86, 0x12, + 0xab, 0x33, 0x67, 0xd2, 0x0a, 0x96, 0xa8, 0x84, 0x16, 0xb1, 0x70, 0xba, 0x0c, 0x43, 0x4e, 0x86, + 0x1e, 0x48, 0x9e, 0x02, 0x3d, 0xf0, 0xff, 0x8e, 0x70, 0x69, 0x1d, 0xbd, 0xc0, 0x3c, 0xfd, 0xf3, + 0xd5, 0xcf, 0x40, 0x49, 0x6a, 0xde, 0x72, 0x77, 0x2a, 0x2d, 0xfc, 0x98, 0x8e, 0x46, 0x8d, 0xa7, + 0xbc, 0x5f, 0x5d, 0xc2, 0x10, 0xfb, 0x58, 0x87, 0xad, 0x58, 0xda, 0xf4, 0xfc, 0xe0, 0xd2, 0xa6, + 0x57, 0xe1, 0xbc, 0x48, 0xd2, 0x5a, 0xad, 0xae, 0xf1, 0x83, 0x80, 0x2d, 0x9e, 0x20, 0x96, 0x2f, + 0x03, 0x6a, 0x9d, 0x68, 0x39, 0x09, 0x09, 0x93, 0xeb, 0x4a, 0x81, 0xd6, 0xb4, 0xb4, 0x40, 0x2b, + 0x76, 0x09, 0xb4, 0x10, 0x88, 0x51, 0xdc, 0x1e, 0xd2, 0x68, 0x34, 0xbd, 0x34, 0x2a, 0x0d, 0x40, + 0x1a, 0x45, 0xe7, 0xd9, 0x09, 0x0f, 0x6e, 0x70, 0xe8, 0xc1, 0xed, 0xd3, 0x30, 0x26, 0x9e, 0x4f, + 0x17, 0x63, 0x3d, 0xd6, 0xf7, 0x58, 0x57, 0xc3, 0xda, 0x68, 0x92, 0x32, 0x56, 0xf6, 0xf8, 0xe9, + 0xe4, 0x62, 0x2f, 0x43, 0xb1, 0xe1, 0xb9, 0x9d, 0xb6, 0x08, 0xa9, 0x91, 0x53, 0xfb, 0x1a, 0x2f, + 0x41, 0x09, 0x49, 0xb7, 0xfa, 0xbf, 0x59, 0x82, 0xa9, 0x98, 0xdf, 0x40, 0xa2, 0xad, 0x36, 0xf3, + 0xe4, 0x6c, 0xb5, 0x97, 0x23, 0xd9, 0xfb, 0x92, 0x52, 0x6d, 0x74, 0x65, 0x94, 0xcf, 0x1d, 0x3f, + 0xa3, 0x3c, 0xf9, 0x49, 0x28, 0x59, 0xf5, 0xba, 0x47, 0x7d, 0x9f, 0xaa, 0x57, 0x2e, 0xc4, 0x03, + 0xff, 0xaa, 0x10, 0x43, 0x38, 0xb7, 0x02, 0xd5, 0x77, 0x7c, 0x76, 0xce, 0x88, 0x9f, 0x01, 0x59, + 0x2f, 0xb2, 0x72, 0xd4, 0x18, 0xa4, 0x0e, 0x53, 0x7b, 0xde, 0xf6, 0xe2, 0xa2, 0x55, 0xdb, 0xa5, + 0x27, 0x31, 0xe2, 0xf1, 0x04, 0x30, 0x37, 0xa2, 0x14, 0x30, 0x4e, 0x52, 0x72, 0xb9, 0x41, 0x0f, + 0x02, 0x6b, 0xfb, 0x24, 0xba, 0x9e, 0xe2, 0x62, 0x52, 0xc0, 0x38, 0x49, 0xa6, 0x99, 0xed, 0x79, + 0xdb, 0xea, 0x80, 0x25, 0x0f, 0xa4, 0x5a, 0x33, 0xbb, 0x11, 0x82, 0xd0, 0xc4, 0x63, 0x1d, 0xb6, + 0xe7, 0x6d, 0x23, 0xb5, 0x9a, 0x2d, 0x99, 0xfa, 0x4e, 0x77, 0xd8, 0x0d, 0x59, 0x8e, 0x1a, 0x83, + 0xb4, 0x81, 0xb0, 0xaf, 0xe3, 0xe3, 0xae, 0xc3, 0xcc, 0xa5, 0x35, 0xe5, 0xf8, 0x8f, 0x8e, 0x5f, + 0x60, 0xf2, 0xed, 0x46, 0x17, 0x1d, 0x4c, 0xa0, 0x4d, 0x3e, 0x03, 0xcf, 0xee, 0x79, 0xdb, 0xf2, + 0x0a, 0x70, 0xd3, 0xb3, 0x9d, 0x9a, 0xdd, 0xb6, 0x44, 0x36, 0xbc, 0xb1, 0xe8, 0xfb, 0x88, 0x37, + 0x92, 0xd1, 0xb0, 0x57, 0xfd, 0xe8, 0xc5, 0xc1, 0x78, 0xda, 0x8b, 0x83, 0xd8, 0x22, 0x3d, 0xd1, + 0xc5, 0xc1, 0xc4, 0x53, 0xa0, 0x8e, 0x7c, 0x79, 0x04, 0xc6, 0xae, 0x6f, 0x6d, 0x6d, 0xaa, 0x5c, + 0x97, 0x47, 0x98, 0xa5, 0x8c, 0xdc, 0xa5, 0xd9, 0x53, 0x7c, 0xbb, 0x50, 0x26, 0xea, 0xcb, 0x0d, + 0x2b, 0x51, 0xdf, 0x4b, 0x50, 0x6c, 0xd1, 0x60, 0xd7, 0xad, 0xc7, 0x13, 0x96, 0xaf, 0xf3, 0x52, + 0x94, 0xd0, 0x58, 0x26, 0xd0, 0xc2, 0xa9, 0x67, 0x02, 0x7d, 0x05, 0x46, 0x02, 0xbb, 0x45, 0xdd, + 0x8e, 0x90, 0x6c, 0xb9, 0xb0, 0xcb, 0xb6, 0x44, 0x31, 0x2a, 0x38, 0x69, 0x43, 0x69, 0x5b, 0x19, + 0xaa, 0xa5, 0x80, 0x1a, 0x88, 0xcd, 0x9b, 0x0b, 0x6b, 0xfd, 0x13, 0x43, 0x26, 0xe4, 0x0b, 0x30, + 0xb2, 0x4b, 0xad, 0x3a, 0xeb, 0x99, 0xd1, 0xb4, 0x91, 0x48, 0xc6, 0x94, 0x9c, 0xbb, 0x2e, 0x88, + 0xc6, 0xc2, 0x71, 0x64, 0x29, 0x2a, 0x9e, 0xe4, 0x17, 0x60, 0x42, 0x9c, 0x7e, 0x25, 0x44, 0xaa, + 0x4f, 0x2b, 0x69, 0x22, 0xfc, 0x43, 0x72, 0xe2, 0xf8, 0x63, 0x96, 0xf8, 0x18, 0xe5, 0x77, 0xf1, + 0x35, 0x18, 0x37, 0x9b, 0xda, 0xef, 0x53, 0x29, 0x13, 0x91, 0x77, 0x2c, 0xc9, 0xcb, 0xc6, 0xe3, + 0x01, 0x39, 0x7d, 0x6e, 0x53, 0x49, 0x74, 0xcd, 0xed, 0x58, 0xbc, 0x9f, 0xf1, 0x53, 0x1f, 0xbf, + 0x23, 0xdf, 0xcf, 0xc8, 0x45, 0xde, 0xcf, 0xe0, 0xe5, 0xa8, 0x31, 0x78, 0xaa, 0x95, 0xc0, 0xbb, + 0xa3, 0x77, 0x6d, 0x33, 0xa4, 0x8e, 0x61, 0x4a, 0x68, 0xf9, 0x97, 0x26, 0x61, 0xdc, 0x4c, 0x01, + 0xc7, 0xe6, 0x9e, 0xca, 0xda, 0x95, 0x89, 0x66, 0xc7, 0x52, 0x19, 0xbb, 0x14, 0x3c, 0x12, 0x19, + 0x95, 0x3d, 0x34, 0x32, 0xea, 0xdb, 0x22, 0x71, 0x68, 0x34, 0x8f, 0x78, 0xfa, 0xa4, 0x1f, 0x5d, + 0xa9, 0xc9, 0x75, 0x0a, 0xd1, 0x68, 0x31, 0x76, 0x33, 0x27, 0xbf, 0x93, 0x81, 0xe7, 0x3c, 0xca, + 0xc4, 0x0e, 0xf5, 0xba, 0x2a, 0xc8, 0x93, 0xcc, 0x40, 0x9b, 0xf6, 0xc2, 0xa3, 0x87, 0xb3, 0xcf, + 0x61, 0x2f, 0x8e, 0xd8, 0xbb, 0x31, 0xe4, 0xef, 0x64, 0x60, 0xa6, 0x45, 0x03, 0xcf, 0xae, 0xf9, + 0xdd, 0x2d, 0x2d, 0x0c, 0xbe, 0xa5, 0xcf, 0x3f, 0x7a, 0x38, 0x3b, 0xb3, 0xde, 0x83, 0x21, 0xf6, + 0x6c, 0x0a, 0x79, 0x2f, 0x93, 0xf4, 0x7c, 0x49, 0x8a, 0x30, 0x0a, 0x23, 0x49, 0x4e, 0x35, 0xf0, + 0xac, 0x80, 0x36, 0x0e, 0x8e, 0x78, 0xc1, 0xa4, 0x19, 0xb9, 0x10, 0x4b, 0x79, 0x25, 0xa2, 0xb6, + 0x5b, 0x31, 0xad, 0x13, 0x74, 0x80, 0xef, 0x64, 0x60, 0xdc, 0x71, 0xeb, 0x54, 0xe9, 0x48, 0x52, + 0x20, 0x7e, 0x7a, 0x30, 0xd9, 0x18, 0xe7, 0x36, 0x0c, 0xd2, 0x42, 0x2c, 0x6a, 0xbb, 0x8e, 0x09, + 0xc2, 0x48, 0x1b, 0xc8, 0x6d, 0x18, 0x0b, 0xdc, 0x26, 0xf5, 0xa4, 0x55, 0x47, 0x88, 0xc7, 0x4b, + 0x49, 0x6a, 0xde, 0x96, 0x46, 0x0b, 0x55, 0xce, 0xb0, 0xcc, 0x47, 0x93, 0x0e, 0xa1, 0xdd, 0x59, + 0xf3, 0x85, 0x06, 0xf9, 0x52, 0x12, 0xe9, 0x4d, 0xb7, 0x7e, 0xb2, 0x57, 0x15, 0x1c, 0x98, 0xd6, + 0xf9, 0xfa, 0x85, 0x8e, 0xec, 0xcb, 0x24, 0x0f, 0x89, 0x9a, 0xea, 0x9a, 0x5b, 0xb3, 0x9a, 0x22, + 0x91, 0x11, 0xd2, 0x1d, 0xea, 0xf1, 0x7c, 0x4a, 0xfa, 0xd9, 0x8b, 0xd5, 0x18, 0x25, 0xec, 0xa2, + 0x4d, 0xae, 0xc1, 0x99, 0xb6, 0x67, 0xbb, 0xbc, 0x09, 0x4d, 0xcb, 0x17, 0x79, 0x6d, 0x84, 0xa1, + 0x52, 0x07, 0xba, 0x6d, 0xc6, 0x11, 0xb0, 0xbb, 0x8e, 0x38, 0x48, 0x8b, 0x42, 0xae, 0x11, 0x16, + 0xd4, 0x41, 0x5a, 0x94, 0xa1, 0x86, 0x92, 0x15, 0x18, 0xb5, 0x76, 0x76, 0x6c, 0x87, 0x61, 0x8a, + 0xc7, 0xc7, 0x9e, 0x4f, 0xfa, 0xb4, 0x8a, 0xc4, 0x91, 0xb6, 0x68, 0xf9, 0x0b, 0x75, 0x5d, 0x95, + 0xa1, 0xdf, 0xae, 0xd1, 0x4a, 0xad, 0xe6, 0x76, 0x64, 0x52, 0xbf, 0xa9, 0xee, 0x0c, 0xfd, 0x51, + 0x0c, 0x4c, 0xa8, 0xc5, 0x5a, 0xef, 0xd3, 0x20, 0xb0, 0x9d, 0x86, 0x2f, 0x1f, 0x0e, 0xe3, 0x5c, + 0xab, 0xb2, 0x0c, 0x35, 0x94, 0x1d, 0xec, 0xfc, 0xc0, 0xf2, 0x82, 0x8a, 0xd7, 0xf0, 0x79, 0xaa, + 0x02, 0x79, 0xb0, 0xab, 0xaa, 0x42, 0x0c, 0xe1, 0xe4, 0xe3, 0x30, 0xee, 0x1b, 0xb9, 0x37, 0xb9, + 0xe5, 0xae, 0x24, 0xaf, 0x04, 0x8d, 0x72, 0x8c, 0x60, 0x91, 0x39, 0x80, 0x96, 0xf5, 0x40, 0x6a, + 0x87, 0x33, 0x67, 0xc5, 0xfe, 0xc5, 0xd4, 0xa5, 0x75, 0x5d, 0x8a, 0x06, 0xc6, 0xc5, 0x9f, 0x83, + 0x33, 0x5d, 0x4b, 0xa5, 0xaf, 0x6d, 0xf9, 0xb7, 0xb3, 0x30, 0x15, 0x4b, 0x13, 0x7a, 0x94, 0x86, + 0xfc, 0x39, 0x18, 0x17, 0xe6, 0x2a, 0x79, 0x36, 0xcc, 0xf6, 0x7d, 0x27, 0x5a, 0x31, 0xaa, 0x63, + 0x84, 0x18, 0xb9, 0x1a, 0xeb, 0xb6, 0x5c, 0x34, 0xcf, 0xd2, 0x21, 0x5d, 0x27, 0x35, 0xe8, 0xfc, + 0x90, 0x34, 0xe8, 0xf2, 0x1c, 0x8c, 0xdd, 0xb8, 0x5a, 0x55, 0xe1, 0x6d, 0x61, 0x52, 0xff, 0x0c, + 0x4f, 0xa4, 0xdc, 0x95, 0xd4, 0xbf, 0xfc, 0xcd, 0x1c, 0x9c, 0x31, 0x2a, 0xc8, 0x17, 0x38, 0x7e, + 0x01, 0x8a, 0x4d, 0x6b, 0x9b, 0x36, 0x55, 0x96, 0xfd, 0x14, 0x07, 0xb8, 0x2e, 0xe2, 0x73, 0x6b, + 0x9c, 0x72, 0x2c, 0x3e, 0x53, 0x14, 0xa2, 0x64, 0x4b, 0x76, 0x61, 0x64, 0x5b, 0x66, 0x2f, 0xcf, + 0x0e, 0x2a, 0x7b, 0x39, 0x37, 0xc0, 0xaa, 0x9c, 0xe5, 0x8a, 0x3c, 0xb7, 0x63, 0x7a, 0x9e, 0xeb, + 0xdd, 0x54, 0xb9, 0xcb, 0xa5, 0x06, 0x2f, 0x1d, 0xac, 0x42, 0x3b, 0x66, 0x12, 0x12, 0x26, 0xd7, + 0xbd, 0xf8, 0x33, 0x30, 0x66, 0x7c, 0x65, 0x5f, 0x53, 0xfd, 0x5f, 0xe4, 0x60, 0x54, 0x65, 0xe0, + 0x3d, 0x6a, 0x8e, 0xbf, 0x08, 0x05, 0xfe, 0xe8, 0xbe, 0xb4, 0x11, 0xe9, 0x6b, 0x4d, 0xfe, 0x28, + 0x3f, 0x0a, 0x98, 0xa9, 0x2f, 0xe6, 0x8e, 0xd0, 0x17, 0x87, 0x3c, 0x39, 0xc9, 0x36, 0xe4, 0x7d, + 0xcb, 0x6f, 0x4a, 0x95, 0x28, 0x4d, 0x50, 0x6d, 0xa5, 0xba, 0x66, 0x3e, 0xf4, 0xc7, 0x7e, 0x23, + 0xa7, 0x4d, 0xbe, 0x92, 0x81, 0x89, 0x9a, 0xeb, 0xf8, 0x9d, 0x16, 0xf5, 0xb8, 0xc5, 0x50, 0x6a, + 0x39, 0x6b, 0x29, 0x43, 0x12, 0x17, 0x4d, 0x9a, 0xe2, 0x14, 0x12, 0x29, 0xc2, 0x28, 0x57, 0xfe, + 0xdc, 0x78, 0x77, 0x45, 0x32, 0x0f, 0x25, 0x6e, 0xbf, 0x34, 0xd2, 0xb3, 0x69, 0xef, 0x9a, 0x6b, + 0x0a, 0x80, 0x21, 0x0e, 0x3b, 0x27, 0xb8, 0xcd, 0x3a, 0xd5, 0x4f, 0x46, 0xe9, 0x15, 0x73, 0x93, + 0x97, 0xa2, 0x84, 0xb2, 0x7d, 0xd2, 0xa3, 0xdb, 0x56, 0xd3, 0x32, 0x74, 0x31, 0x39, 0xe0, 0x7a, + 0x9f, 0xc4, 0x38, 0x02, 0x76, 0xd7, 0x29, 0xff, 0xe7, 0x51, 0x98, 0x8e, 0x07, 0x61, 0x1e, 0x35, + 0x11, 0xe7, 0xa1, 0xd4, 0xb6, 0xbc, 0xc0, 0x36, 0x1e, 0x69, 0xd3, 0x5f, 0xb5, 0xa9, 0x00, 0x18, + 0xe2, 0x84, 0x33, 0x37, 0x77, 0xc8, 0xcc, 0x4d, 0x7e, 0xcd, 0x20, 0x7f, 0xfa, 0xaf, 0x19, 0xc8, + 0x75, 0x51, 0x18, 0xd6, 0xba, 0x30, 0x3d, 0x35, 0x8b, 0x47, 0x7a, 0x6a, 0xbe, 0xdf, 0xed, 0x54, + 0xf6, 0xe9, 0xc1, 0xc5, 0xdb, 0xf6, 0x77, 0x51, 0x1a, 0x5b, 0x6a, 0xa3, 0x4f, 0x62, 0xa9, 0x91, + 0x4d, 0x38, 0xd7, 0xb4, 0x5b, 0xd2, 0x33, 0xce, 0xdf, 0xa4, 0x5e, 0x95, 0xd6, 0x5c, 0xa7, 0xce, + 0x0d, 0xaf, 0xb9, 0xd0, 0x61, 0x61, 0x2d, 0x01, 0x07, 0x13, 0x6b, 0x9a, 0x32, 0x13, 0x8e, 0x90, + 0x99, 0x4a, 0xa6, 0x8d, 0x0d, 0x51, 0xa6, 0x9d, 0xfa, 0xfd, 0x4b, 0xe8, 0x90, 0x3c, 0x71, 0x98, + 0x43, 0x72, 0x3a, 0x93, 0xe7, 0xdf, 0x04, 0x18, 0xe7, 0xe3, 0x7d, 0x4c, 0x9b, 0xe7, 0xb1, 0x76, + 0xbb, 0x88, 0x24, 0xca, 0x71, 0x35, 0xff, 0x70, 0x49, 0x14, 0x35, 0x25, 0xe6, 0x4f, 0xdd, 0x94, + 0x78, 0x15, 0xc6, 0x3d, 0xf1, 0xfc, 0x5a, 0xbd, 0x52, 0xdb, 0xf3, 0xe5, 0x7b, 0x3d, 0x86, 0x7f, + 0x40, 0x08, 0xc3, 0x08, 0x26, 0x93, 0x1a, 0x35, 0xb7, 0xc5, 0xb3, 0x9d, 0xc6, 0xa5, 0xc6, 0xa2, + 0x2c, 0x47, 0x8d, 0x41, 0x5e, 0x87, 0xc9, 0x9d, 0x66, 0xc7, 0xdf, 0x5d, 0x61, 0x34, 0xa8, 0x53, + 0x13, 0xef, 0xb2, 0x14, 0x42, 0xef, 0xa6, 0x95, 0x08, 0x14, 0x63, 0xd8, 0x43, 0x7f, 0xa3, 0xc5, + 0xb0, 0x68, 0x97, 0x4e, 0xd1, 0xa2, 0xfd, 0xb3, 0x30, 0xa5, 0xe7, 0x82, 0xed, 0x34, 0x94, 0x53, + 0x5f, 0x49, 0x9c, 0x86, 0x37, 0xa3, 0x20, 0x8c, 0xe3, 0x9a, 0x82, 0x62, 0xec, 0x98, 0x82, 0x62, + 0x7c, 0x88, 0x82, 0xe2, 0xeb, 0x19, 0x98, 0xf4, 0x6b, 0xbb, 0xb4, 0x65, 0x21, 0x6d, 0xd8, 0x7e, + 0xe0, 0x1d, 0xc8, 0xcb, 0x8f, 0x14, 0x41, 0x75, 0xd5, 0x08, 0x3d, 0xc9, 0x98, 0xbf, 0xf2, 0x1b, + 0x85, 0x60, 0x8c, 0x33, 0xf9, 0x62, 0x68, 0x87, 0x9e, 0x4c, 0x9b, 0x5c, 0xc6, 0x94, 0x13, 0x27, + 0x36, 0x44, 0x4f, 0x3d, 0x45, 0x86, 0xe8, 0x9b, 0x00, 0x6b, 0x6e, 0x43, 0x49, 0xc6, 0x0a, 0x4c, + 0xa9, 0x87, 0x97, 0xc5, 0x0e, 0x25, 0x22, 0xba, 0xf2, 0xe1, 0x75, 0xf2, 0x6a, 0x14, 0x8c, 0x71, + 0xfc, 0xf2, 0xef, 0x17, 0x61, 0x2a, 0x96, 0xd5, 0x62, 0x20, 0x02, 0x97, 0x49, 0xa1, 0xa6, 0x4d, + 0x9d, 0x60, 0xb5, 0x2e, 0x95, 0xb9, 0x50, 0x0a, 0x89, 0xf2, 0x25, 0xd4, 0x18, 0x1f, 0x1c, 0x95, + 0xce, 0x54, 0xb9, 0x0a, 0xc7, 0x7d, 0xa0, 0xaa, 0x38, 0x2c, 0xe1, 0xf7, 0x95, 0x6e, 0x95, 0xee, + 0xee, 0xc0, 0x92, 0x97, 0x9c, 0xe8, 0xce, 0xf4, 0x74, 0xde, 0x97, 0xd6, 0xc1, 0x20, 0xa5, 0xa1, + 0x05, 0x83, 0xa4, 0xd3, 0x51, 0xbe, 0x9e, 0x03, 0xdd, 0x4f, 0x4c, 0xba, 0x8e, 0x59, 0x8e, 0xe3, + 0x06, 0xd2, 0x72, 0x9b, 0x49, 0x2b, 0xd5, 0x14, 0xe5, 0xb9, 0x4a, 0x48, 0x35, 0x96, 0x07, 0xcd, + 0x80, 0xa0, 0xc9, 0x9c, 0xec, 0x6b, 0x13, 0x8d, 0xb8, 0x00, 0xde, 0x18, 0x40, 0x33, 0x8e, 0x61, + 0x99, 0xb9, 0xf8, 0x3a, 0x4c, 0xc7, 0x5b, 0xdb, 0x4f, 0x8f, 0xa6, 0x31, 0x8d, 0xfc, 0x49, 0x16, + 0x46, 0x37, 0x2a, 0x5b, 0x55, 0x7e, 0xcb, 0x59, 0x87, 0x02, 0xbf, 0xf2, 0x94, 0x2e, 0x3a, 0x03, + 0x99, 0x3a, 0xdc, 0x3c, 0xc6, 0x7f, 0xa2, 0x20, 0x4e, 0x56, 0x98, 0x08, 0xdc, 0xa3, 0x4e, 0x7f, + 0xe6, 0xc3, 0x92, 0x90, 0x92, 0x7b, 0xd4, 0x41, 0x51, 0x9d, 0x2c, 0x42, 0xde, 0x61, 0xdf, 0xd9, + 0xd7, 0x23, 0x90, 0xe2, 0x5d, 0x29, 0xa6, 0x77, 0xf0, 0xca, 0xfc, 0x21, 0x59, 0x8f, 0xd6, 0xa9, + 0x13, 0xd8, 0x56, 0xb3, 0x3f, 0x5f, 0x3e, 0xf1, 0x90, 0xac, 0xae, 0x8c, 0x06, 0xa1, 0xf2, 0x0f, + 0x32, 0x30, 0x22, 0x9f, 0xb2, 0x22, 0x4d, 0x28, 0x3a, 0x16, 0x77, 0x58, 0x4e, 0xed, 0xfe, 0xb8, + 0xc1, 0xe9, 0xe8, 0x6b, 0x21, 0xbe, 0xfa, 0x45, 0x19, 0x4a, 0x1e, 0x64, 0x17, 0x8a, 0x54, 0x3c, + 0x22, 0x95, 0x3a, 0xcd, 0x1a, 0xfb, 0x00, 0x33, 0x82, 0x43, 0x3e, 0x1b, 0x25, 0xe9, 0x97, 0x7f, + 0x98, 0x01, 0x08, 0x51, 0x8e, 0xda, 0xf8, 0x7e, 0x12, 0x4a, 0xb5, 0x66, 0xc7, 0x0f, 0xa8, 0xa7, + 0x9d, 0x32, 0xc5, 0x13, 0x10, 0xaa, 0x10, 0x43, 0x38, 0x79, 0x55, 0x8a, 0x30, 0xb1, 0xf9, 0xcd, + 0x28, 0xe9, 0xf3, 0xf8, 0xe1, 0xec, 0x38, 0x0f, 0x44, 0x54, 0xa6, 0x16, 0x11, 0x9a, 0x16, 0x37, + 0x4b, 0xe7, 0x07, 0x68, 0x96, 0x2e, 0xff, 0x5e, 0x11, 0xa6, 0xe3, 0x49, 0xa3, 0x8e, 0xfa, 0x56, + 0xe3, 0xb1, 0xa5, 0xec, 0x11, 0x8f, 0x2d, 0x25, 0x6f, 0xde, 0xb9, 0x27, 0xbb, 0x79, 0xe7, 0x8f, + 0xbb, 0x79, 0x0f, 0xcd, 0x7a, 0x13, 0xb1, 0xc7, 0x14, 0xd3, 0xda, 0x63, 0xe2, 0xe3, 0xd7, 0xc7, + 0xee, 0xfd, 0xb6, 0x9c, 0x89, 0xa9, 0xef, 0x55, 0x95, 0x90, 0xed, 0x0a, 0xac, 0x3c, 0x75, 0xfd, + 0x60, 0x16, 0x0a, 0xf7, 0x3a, 0xb4, 0x43, 0xa5, 0x13, 0x1d, 0x17, 0xac, 0x3c, 0x37, 0x04, 0x8a, + 0xf2, 0x74, 0xbb, 0xfb, 0xb7, 0xf3, 0x30, 0xc6, 0xbe, 0xf5, 0x98, 0x06, 0x88, 0x3e, 0x96, 0x8a, + 0x71, 0x9a, 0xcd, 0x9d, 0xe2, 0x69, 0xf6, 0x49, 0x1b, 0x33, 0x86, 0xbd, 0xd4, 0xd4, 0x0c, 0x2f, + 0x0e, 0x6b, 0x86, 0x97, 0x7f, 0x58, 0x80, 0xc9, 0x68, 0xfa, 0x21, 0xf2, 0x09, 0x18, 0xdb, 0x75, + 0xfd, 0x40, 0x3a, 0xc6, 0xca, 0xd9, 0xa1, 0x15, 0xb4, 0xeb, 0x21, 0x08, 0x4d, 0xbc, 0x63, 0x5f, + 0xce, 0xc8, 0x17, 0x86, 0xe3, 0x97, 0x33, 0xf2, 0x15, 0x62, 0x54, 0xf0, 0x1f, 0x1d, 0x9d, 0x92, + 0xa7, 0xc4, 0x97, 0xbb, 0x8f, 0x4e, 0x77, 0x06, 0x95, 0x79, 0xea, 0x03, 0x7c, 0x72, 0x4a, 0x27, + 0xf8, 0x7e, 0x75, 0x0a, 0x26, 0xa3, 0xfa, 0x19, 0x1b, 0x55, 0xed, 0x2b, 0x96, 0xe1, 0x96, 0x41, + 0xe3, 0x51, 0x95, 0x2e, 0x7f, 0x31, 0xa5, 0xf4, 0x64, 0x8f, 0xa5, 0xf4, 0xc4, 0xfd, 0x8e, 0x72, + 0xa7, 0xef, 0x77, 0x94, 0xec, 0xe0, 0x96, 0x7f, 0x92, 0x0e, 0x6e, 0x4f, 0x8b, 0xd7, 0xd8, 0x77, + 0xe3, 0x4e, 0x54, 0xc5, 0xb4, 0xd9, 0x41, 0xa2, 0x53, 0x6f, 0x30, 0x6e, 0x54, 0x23, 0x03, 0x72, + 0xa3, 0x32, 0x1d, 0xd4, 0x46, 0x87, 0xee, 0xa0, 0x96, 0xe0, 0xb4, 0x55, 0x1a, 0x82, 0xd3, 0x56, + 0x19, 0x8a, 0x2d, 0xeb, 0x41, 0xa5, 0xa1, 0x42, 0x4b, 0xb9, 0x40, 0x59, 0xe7, 0x25, 0x28, 0x21, + 0xa7, 0xee, 0xd8, 0x95, 0xec, 0x1d, 0x35, 0x7e, 0x22, 0xef, 0xa8, 0x44, 0x27, 0xb1, 0x89, 0x94, + 0x4e, 0x62, 0x93, 0xc7, 0x76, 0x12, 0x9b, 0x4a, 0xe1, 0x24, 0xf6, 0x21, 0x18, 0x69, 0x59, 0x0f, + 0xd6, 0x7d, 0xe9, 0xd7, 0x95, 0x17, 0x6e, 0x2a, 0xeb, 0xa2, 0x08, 0x15, 0x8c, 0x35, 0xac, 0x65, + 0x3d, 0x58, 0x38, 0x08, 0xa8, 0xcf, 0x43, 0x3a, 0xa5, 0xff, 0xd7, 0xba, 0x2c, 0x43, 0x0d, 0x95, + 0x04, 0xab, 0x9d, 0x6d, 0x9f, 0x7b, 0x73, 0x85, 0x04, 0x59, 0x11, 0x2a, 0x58, 0xbf, 0x3e, 0x5c, + 0x64, 0x0d, 0xce, 0x79, 0xd6, 0x4e, 0x70, 0x9d, 0x5a, 0x5e, 0xb0, 0x4d, 0xad, 0x40, 0xb9, 0xc9, + 0x9c, 0xd3, 0x3b, 0xc0, 0x39, 0x4c, 0x80, 0x63, 0x62, 0x2d, 0xb2, 0x0a, 0x67, 0x59, 0xf9, 0x72, + 0x53, 0xa8, 0x16, 0x8a, 0xd8, 0x79, 0x11, 0x80, 0xfc, 0xe8, 0xe1, 0xec, 0x59, 0xec, 0x06, 0x63, + 0x52, 0x1d, 0xf2, 0x29, 0x98, 0x66, 0xc5, 0x6b, 0xd4, 0xf2, 0xa9, 0xa2, 0x73, 0x41, 0xf8, 0x63, + 0xb1, 0x99, 0x88, 0x31, 0x18, 0x76, 0x61, 0x93, 0x45, 0x38, 0xc3, 0xca, 0x16, 0xdd, 0x56, 0xcb, + 0xd6, 0xdf, 0xf5, 0xac, 0x88, 0xa5, 0xe2, 0x6e, 0x13, 0x71, 0x20, 0x76, 0xe3, 0xa7, 0xf7, 0x71, + 0xfb, 0x56, 0x1e, 0xa6, 0x6f, 0xb6, 0xa9, 0x73, 0x77, 0xd7, 0xf6, 0xf7, 0xd4, 0x89, 0xe4, 0x32, + 0xe4, 0x99, 0x4e, 0x19, 0x4f, 0xb1, 0xc0, 0x94, 0x4e, 0xe4, 0x10, 0xf3, 0x06, 0x2a, 0x7b, 0xc4, + 0x0d, 0xd4, 0x3c, 0x94, 0x1c, 0xab, 0x45, 0xfd, 0xb6, 0x55, 0xeb, 0x7a, 0x5b, 0x78, 0x43, 0x01, + 0x30, 0xc4, 0x21, 0x08, 0x25, 0xb6, 0x7f, 0x9f, 0x20, 0x76, 0x54, 0x84, 0x92, 0xa9, 0xba, 0x18, + 0x92, 0x21, 0x57, 0x00, 0x2c, 0x3e, 0x7e, 0x7c, 0x8d, 0x16, 0xa2, 0x0f, 0x39, 0x56, 0x34, 0x04, + 0x0d, 0x2c, 0xf3, 0x34, 0x55, 0x7c, 0x62, 0xa7, 0xa9, 0x91, 0xd3, 0x3e, 0x4d, 0x95, 0x3f, 0x03, + 0x67, 0xba, 0x22, 0xc7, 0xd9, 0xb1, 0x42, 0xa4, 0x70, 0xc8, 0x44, 0x8f, 0x15, 0x91, 0xc4, 0x0d, + 0xb3, 0x50, 0xe0, 0xa3, 0x28, 0x13, 0x6f, 0xf0, 0x63, 0x33, 0x1f, 0x61, 0x14, 0xe5, 0x65, 0x84, + 0x71, 0x33, 0x6d, 0xde, 0xd1, 0xe9, 0xf0, 0x74, 0xb2, 0x8f, 0x6c, 0xaf, 0x64, 0x1f, 0xe5, 0xef, + 0x65, 0xe1, 0x6c, 0x82, 0x62, 0xc6, 0x16, 0xa8, 0x7c, 0x42, 0x29, 0x94, 0xcd, 0x99, 0x70, 0x81, + 0x56, 0x63, 0x30, 0xec, 0xc2, 0x26, 0x6f, 0xb1, 0x39, 0x53, 0xa3, 0xbe, 0xbf, 0xee, 0xd6, 0x55, + 0x0b, 0x7e, 0x4e, 0xcc, 0x17, 0x55, 0xfa, 0xf8, 0xe1, 0xec, 0x87, 0xc5, 0xcc, 0x9c, 0xb7, 0xda, + 0xf6, 0x3c, 0x9b, 0x99, 0xf3, 0xfb, 0x86, 0xa2, 0x18, 0xdc, 0x71, 0x9b, 0x9d, 0x16, 0x0d, 0x2b, + 0xa0, 0x41, 0x92, 0xbc, 0x09, 0xb0, 0xcf, 0xe1, 0x55, 0xfb, 0x5d, 0xa5, 0x9e, 0x1e, 0xfa, 0x2e, + 0xe8, 0x9c, 0x7a, 0x5e, 0x70, 0xee, 0x56, 0xc7, 0x72, 0x02, 0x26, 0xe0, 0xb9, 0xf0, 0xbc, 0xa3, + 0xa9, 0xa0, 0x41, 0xb1, 0xfc, 0xeb, 0x45, 0x38, 0xd3, 0x95, 0x3f, 0x9c, 0xfb, 0x2a, 0xe8, 0xd8, + 0xef, 0x98, 0x2f, 0x58, 0x62, 0xc4, 0xf7, 0xeb, 0x30, 0xc9, 0x8f, 0x8d, 0x9b, 0xb1, 0x88, 0x71, + 0x7d, 0x87, 0xbf, 0x15, 0x81, 0x62, 0x0c, 0xfb, 0x78, 0x5e, 0x57, 0xaf, 0xc3, 0xa4, 0xdf, 0xd9, + 0x16, 0x0f, 0xfd, 0x8a, 0x34, 0x28, 0xf9, 0x28, 0x93, 0x6a, 0x04, 0x8a, 0x31, 0x6c, 0xd2, 0x80, + 0xe9, 0xd0, 0xb8, 0x2c, 0xad, 0x9c, 0x85, 0x7e, 0x64, 0x07, 0x9f, 0x15, 0x8b, 0x31, 0x12, 0xd8, + 0x45, 0x94, 0x6c, 0xc3, 0x45, 0x11, 0xb9, 0x6d, 0x36, 0x28, 0x96, 0xb0, 0xab, 0x2c, 0x1b, 0x7d, + 0x71, 0xa9, 0x27, 0x26, 0x1e, 0x42, 0x25, 0x72, 0xd6, 0x1d, 0x39, 0xf2, 0xac, 0x1b, 0x89, 0x1a, + 0x1f, 0x4d, 0x1b, 0x35, 0xde, 0x35, 0x61, 0x4e, 0x74, 0x1c, 0x2d, 0x3d, 0x05, 0xc7, 0xd1, 0xbf, + 0x37, 0xc6, 0x96, 0x47, 0x2c, 0xdb, 0x32, 0x53, 0x5a, 0xf9, 0x8c, 0x14, 0x17, 0x6d, 0x52, 0x69, + 0xe5, 0x53, 0xd5, 0x47, 0x09, 0x39, 0x46, 0x90, 0xb4, 0xb4, 0xe9, 0xe5, 0x7a, 0xd8, 0xf4, 0xda, + 0x70, 0x36, 0x68, 0xfa, 0x5b, 0x5e, 0xc7, 0x0f, 0x16, 0xa9, 0x17, 0x9c, 0xc8, 0x2c, 0xcf, 0xf5, + 0x95, 0xad, 0xb5, 0x6a, 0x9c, 0x0a, 0x26, 0x91, 0x66, 0xd3, 0x36, 0x68, 0xfa, 0x95, 0x66, 0xd3, + 0xbd, 0xaf, 0x32, 0xc6, 0x84, 0x66, 0x17, 0x69, 0x50, 0xd1, 0xd3, 0x76, 0x6b, 0xad, 0xda, 0x03, + 0x13, 0x0f, 0xa1, 0x42, 0xd6, 0xf9, 0x57, 0xdd, 0xb1, 0x9a, 0x76, 0xdd, 0x0a, 0x78, 0xc6, 0x29, + 0x2e, 0xbb, 0xc5, 0x9a, 0xd0, 0xf9, 0x25, 0xb6, 0xd6, 0xaa, 0x71, 0x14, 0x4c, 0xaa, 0xa7, 0x6c, + 0x38, 0x23, 0x43, 0xb4, 0xa0, 0x27, 0x98, 0xb6, 0x46, 0x9f, 0xac, 0x69, 0xab, 0xd4, 0xdf, 0x72, + 0x87, 0xf4, 0xcb, 0x3d, 0xb6, 0x00, 0xfa, 0x58, 0xee, 0x75, 0x98, 0xd2, 0x1a, 0x96, 0x9c, 0xc1, + 0x63, 0x7d, 0xc7, 0xc2, 0x57, 0xa2, 0x14, 0x30, 0x4e, 0xf2, 0xf4, 0xdd, 0x10, 0x7f, 0x3b, 0x03, + 0xd3, 0xac, 0x11, 0x95, 0x60, 0x97, 0x3a, 0xef, 0x72, 0x2d, 0x49, 0x3d, 0xb2, 0x6a, 0x0d, 0xb2, + 0xa3, 0x2b, 0x31, 0x1e, 0xa2, 0xc3, 0xf5, 0x61, 0x36, 0x0e, 0xc6, 0xae, 0x46, 0xb1, 0x4d, 0x2f, + 0x2c, 0x93, 0x23, 0x30, 0xd9, 0xf7, 0xa6, 0x57, 0x89, 0x91, 0xc0, 0x2e, 0xa2, 0xa9, 0xe4, 0xec, + 0xc5, 0x45, 0x38, 0x9f, 0xf8, 0xa9, 0x7d, 0x09, 0xeb, 0xef, 0x00, 0x4c, 0x88, 0x2e, 0x1c, 0xa4, + 0xdf, 0x66, 0x54, 0xd7, 0xce, 0x9d, 0xfa, 0xcd, 0x85, 0x71, 0xc4, 0xc8, 0x9f, 0xe2, 0x11, 0xa3, + 0xc7, 0xf6, 0x53, 0x78, 0x52, 0xdb, 0x4f, 0x71, 0x98, 0xdb, 0xcf, 0x48, 0xba, 0xed, 0x67, 0x68, + 0xae, 0xa7, 0x09, 0xd2, 0xb3, 0x34, 0x78, 0xe9, 0x99, 0xbc, 0xc9, 0xc1, 0xe9, 0x6f, 0x72, 0xbf, + 0x95, 0x24, 0x55, 0xc7, 0xd2, 0xbe, 0x62, 0x1b, 0x11, 0x09, 0x43, 0x92, 0xa8, 0xe3, 0xc3, 0x90, + 0xa8, 0x03, 0x11, 0x8a, 0xbf, 0x94, 0x81, 0x12, 0x5a, 0x01, 0xe5, 0x31, 0x06, 0xe4, 0x0a, 0xe4, + 0x3b, 0x8e, 0xad, 0xac, 0x36, 0x97, 0x94, 0x56, 0x7a, 0xdb, 0xb1, 0x83, 0xc7, 0x0f, 0x67, 0x27, + 0x35, 0x22, 0x65, 0x25, 0xc8, 0x71, 0x49, 0x05, 0xa6, 0xb8, 0xaf, 0xb5, 0xcf, 0xe3, 0x10, 0x18, + 0x40, 0x86, 0xec, 0x6b, 0x17, 0x4f, 0x8c, 0x82, 0x31, 0x8e, 0x5f, 0xfe, 0x72, 0x51, 0x3e, 0x6f, + 0x31, 0x80, 0xdb, 0xcb, 0x41, 0xe7, 0x0f, 0xed, 0xdf, 0xf8, 0x74, 0x11, 0xb2, 0xf5, 0x6d, 0xae, + 0x88, 0x17, 0xc2, 0xc4, 0x99, 0x4b, 0x0b, 0x98, 0xad, 0x6f, 0x93, 0x97, 0x61, 0x54, 0x5e, 0x8b, + 0xaa, 0xe4, 0x92, 0x9c, 0xad, 0xbc, 0x33, 0xf5, 0x51, 0x43, 0x87, 0x7e, 0xfd, 0x38, 0xd8, 0x60, + 0x9c, 0xf8, 0xe8, 0x7d, 0x90, 0x5d, 0x37, 0xfb, 0xd3, 0x95, 0x5f, 0x35, 0x12, 0xdc, 0x42, 0xd4, + 0x4d, 0xb8, 0x3b, 0x7b, 0x6d, 0xba, 0xd3, 0xe4, 0x3f, 0x2e, 0xc2, 0x85, 0xe4, 0x87, 0x57, 0x3e, + 0x30, 0x8b, 0x41, 0xcc, 0xed, 0x5c, 0xe2, 0xdc, 0xfe, 0x10, 0x8c, 0x88, 0x88, 0x61, 0x95, 0x96, + 0x8b, 0xdb, 0xef, 0xc5, 0xb7, 0xf8, 0xa8, 0x60, 0xe4, 0x0d, 0x20, 0xe2, 0x6e, 0x60, 0xd1, 0xed, + 0x38, 0xc1, 0x26, 0xf5, 0x90, 0x5a, 0x75, 0x19, 0x3d, 0xa2, 0xaf, 0x4f, 0xd6, 0xbb, 0x30, 0x30, + 0xa1, 0x16, 0x4f, 0x24, 0xd6, 0x15, 0x32, 0x69, 0x26, 0x12, 0x3b, 0x2c, 0xfa, 0x6a, 0xd8, 0x87, + 0xc3, 0x6f, 0x74, 0x1b, 0x55, 0xde, 0x1c, 0xf4, 0x8b, 0x3c, 0x1f, 0x60, 0xcb, 0xca, 0x69, 0xae, + 0x9c, 0x3f, 0xce, 0xc3, 0xd9, 0x84, 0x97, 0x51, 0xa3, 0xb2, 0x3b, 0x73, 0x0c, 0xd9, 0xdd, 0xd4, + 0x9d, 0x94, 0x3a, 0xaf, 0xb1, 0x6a, 0xcf, 0x21, 0x3d, 0xf4, 0x8d, 0x0c, 0x9c, 0xe3, 0x01, 0xb3, + 0xea, 0xc6, 0x43, 0x56, 0x91, 0x86, 0xdc, 0xd7, 0x0e, 0x33, 0xe4, 0xfa, 0x73, 0x6c, 0x64, 0xd9, + 0xea, 0xbd, 0x96, 0x40, 0x21, 0x0c, 0x1e, 0x4c, 0x82, 0x62, 0x22, 0x57, 0xb2, 0x08, 0xa0, 0x1f, + 0x80, 0x51, 0x6b, 0xf8, 0x45, 0x76, 0xf4, 0xd0, 0x2f, 0xc4, 0xf8, 0x8f, 0x79, 0x30, 0xae, 0xd1, + 0xd1, 0xdc, 0x60, 0x65, 0x54, 0x23, 0x5f, 0xeb, 0x7e, 0x8e, 0xe3, 0x73, 0x03, 0x7d, 0xee, 0xf6, + 0xf8, 0x53, 0x3e, 0xdd, 0x9c, 0xfa, 0xcd, 0x1c, 0x4c, 0x46, 0xc7, 0x90, 0xbc, 0x04, 0xc5, 0xb6, + 0x47, 0x77, 0xec, 0x07, 0x72, 0x2e, 0x85, 0x8f, 0xcb, 0xf3, 0x52, 0x94, 0x50, 0xf2, 0x4e, 0xcc, + 0xc5, 0x7d, 0x21, 0x4d, 0xe4, 0x8e, 0x72, 0x84, 0xee, 0x91, 0x70, 0xe0, 0x1d, 0xfd, 0x1e, 0x51, + 0x6e, 0xf0, 0xbc, 0xa2, 0x6f, 0x11, 0x91, 0xcf, 0x41, 0xa9, 0xe6, 0x51, 0x2b, 0xa0, 0xf5, 0x85, + 0x03, 0x69, 0x69, 0xfc, 0x89, 0xe3, 0xcd, 0xd1, 0x2d, 0xbb, 0x45, 0xc3, 0xa5, 0xb7, 0xa8, 0x88, + 0x60, 0x48, 0x8f, 0xdf, 0xaf, 0xed, 0x04, 0xd4, 0xe3, 0xe9, 0x3e, 0xa4, 0x39, 0x31, 0xbc, 0x5f, + 0xd3, 0x10, 0x34, 0xb0, 0xca, 0x7f, 0x58, 0x04, 0x08, 0xdf, 0xa9, 0x66, 0x12, 0x87, 0x3a, 0xf5, + 0xb6, 0x6b, 0x3b, 0x4a, 0x85, 0xd5, 0xb3, 0x63, 0x59, 0x96, 0xa3, 0xc6, 0x20, 0x3b, 0x50, 0x94, + 0x8f, 0xd5, 0x67, 0xd3, 0xba, 0x4b, 0x54, 0x3f, 0xb6, 0xc0, 0x29, 0x89, 0x55, 0x2e, 0xfe, 0x47, + 0x49, 0x9d, 0xcd, 0x1a, 0x8f, 0x36, 0xc2, 0x34, 0x06, 0xba, 0x77, 0x91, 0x97, 0xa2, 0x84, 0x46, + 0x32, 0x74, 0xe7, 0x8f, 0xcc, 0xd0, 0x8d, 0x50, 0x12, 0xf7, 0x40, 0x37, 0xe8, 0x41, 0x7f, 0xc7, + 0x6e, 0x71, 0xc5, 0xa9, 0xea, 0x62, 0x48, 0x86, 0xd1, 0xf4, 0x15, 0x7a, 0x7f, 0x99, 0x2f, 0x45, + 0xa2, 0x16, 0x55, 0x8c, 0x21, 0x19, 0x23, 0xd9, 0xef, 0x48, 0xcf, 0x64, 0xbf, 0x3b, 0x31, 0x15, + 0x30, 0xd5, 0x48, 0x1c, 0x22, 0x6f, 0xdf, 0xeb, 0x4e, 0x8e, 0x8b, 0x83, 0x78, 0x20, 0xbd, 0x8f, + 0x5d, 0xf8, 0x4d, 0x98, 0xa8, 0x59, 0x8b, 0x94, 0x55, 0xb4, 0x6b, 0x56, 0x40, 0xe5, 0x39, 0xba, + 0x9f, 0x34, 0xef, 0x8b, 0x15, 0xa3, 0x3e, 0x46, 0xc9, 0xa5, 0x13, 0x79, 0x37, 0x60, 0x54, 0xcd, + 0x64, 0xf2, 0x82, 0x51, 0x2f, 0xb4, 0x8d, 0xb1, 0xc1, 0xe5, 0x44, 0x8e, 0xbe, 0x55, 0xfd, 0x2c, + 0x23, 0xd6, 0xa7, 0xe0, 0x7c, 0x09, 0x8a, 0x7e, 0x67, 0x87, 0xe1, 0xc5, 0xde, 0x93, 0xaa, 0xf2, + 0x52, 0x94, 0xd0, 0xf2, 0xff, 0xca, 0x00, 0x84, 0xd1, 0xa4, 0x6c, 0x9b, 0x6f, 0x51, 0x76, 0x72, + 0xb2, 0xfd, 0x56, 0x7c, 0x9b, 0x5f, 0x57, 0x00, 0x0c, 0x71, 0xc8, 0x6d, 0x00, 0xa6, 0x78, 0x9c, + 0x24, 0xc3, 0x0e, 0xbf, 0x2d, 0xbd, 0xad, 0x2b, 0xa3, 0x41, 0x88, 0x58, 0x30, 0xa9, 0x34, 0x65, + 0x49, 0xba, 0xaf, 0xb0, 0x19, 0x1e, 0x9b, 0xba, 0x19, 0x21, 0x80, 0x31, 0x82, 0xe5, 0xbf, 0x3b, + 0x02, 0x53, 0xb1, 0x67, 0xfd, 0x9e, 0xfa, 0xc7, 0xdd, 0xcc, 0x37, 0x44, 0x72, 0x83, 0x7e, 0x43, + 0x24, 0x3f, 0x88, 0x63, 0x4f, 0xfc, 0x9d, 0x9a, 0xc2, 0x20, 0xdf, 0xa9, 0x59, 0x83, 0x11, 0x99, + 0xb0, 0xb8, 0x3f, 0x99, 0xcb, 0x8f, 0x57, 0xea, 0xd8, 0xa7, 0x48, 0x0c, 0x38, 0x22, 0x33, 0x36, + 0xd5, 0x3e, 0xc8, 0xc7, 0xfa, 0x4d, 0x38, 0xd7, 0x76, 0x9b, 0x4d, 0x15, 0x4f, 0xbc, 0xd4, 0x11, + 0x8e, 0x91, 0x32, 0x00, 0x43, 0xeb, 0xc3, 0x9b, 0x09, 0x38, 0x98, 0x58, 0x33, 0x9d, 0x2c, 0xfd, + 0xb7, 0x45, 0x98, 0x8c, 0x3e, 0x41, 0xff, 0x44, 0xde, 0x40, 0xe3, 0x97, 0x14, 0x15, 0xcf, 0x89, + 0xbf, 0x81, 0xb6, 0x25, 0xcb, 0x51, 0x63, 0x44, 0x35, 0x8a, 0xdc, 0x10, 0x34, 0x8a, 0xfc, 0x60, + 0x34, 0x8a, 0x50, 0x9f, 0x2a, 0x1c, 0xaa, 0x4f, 0xbd, 0x02, 0x23, 0x9e, 0xdb, 0xa4, 0x15, 0xdc, + 0x90, 0x66, 0x01, 0x7d, 0x9b, 0x81, 0xa2, 0x18, 0x15, 0x7c, 0xc0, 0xbe, 0xf8, 0xd1, 0x61, 0xef, + 0x63, 0xcd, 0x5c, 0x83, 0x33, 0xfb, 0xf2, 0x0e, 0xa1, 0x6a, 0x37, 0x1c, 0x2b, 0x08, 0x1f, 0x6b, + 0xd1, 0xde, 0xa0, 0x77, 0xe2, 0x08, 0xd8, 0x5d, 0xe7, 0x89, 0x9c, 0xf5, 0xb5, 0xe6, 0x0d, 0x47, + 0x69, 0xde, 0xe9, 0x16, 0xd6, 0x3f, 0x1d, 0x81, 0xc9, 0xea, 0xad, 0xc8, 0xc2, 0x8a, 0xcc, 0xdc, + 0xcc, 0x10, 0x66, 0x6e, 0x76, 0xd0, 0x33, 0xf7, 0xf0, 0x93, 0xc0, 0x8b, 0x2a, 0x78, 0x2c, 0x1f, + 0xbd, 0x78, 0x34, 0x03, 0xc8, 0x48, 0x85, 0xed, 0xe1, 0xc2, 0x8d, 0x53, 0xa5, 0x56, 0x28, 0xf0, + 0xbc, 0x41, 0xc6, 0xc6, 0x1b, 0x01, 0x63, 0x1c, 0xbf, 0x9f, 0x15, 0xd2, 0x9f, 0x3f, 0xd1, 0xeb, + 0x30, 0xc9, 0x1b, 0x29, 0x5d, 0x9d, 0x57, 0xeb, 0x32, 0xff, 0xbc, 0x76, 0xc5, 0xba, 0x65, 0x42, + 0x97, 0x30, 0x86, 0x1d, 0x5d, 0x8f, 0xa5, 0xd4, 0xeb, 0xf1, 0xd6, 0x09, 0xd7, 0xe3, 0x0b, 0x90, + 0xab, 0x37, 0xef, 0xc9, 0xc7, 0xd2, 0xb4, 0x0e, 0xbc, 0xb4, 0x76, 0x0b, 0x59, 0xb9, 0xb1, 0xca, + 0xc6, 0x4e, 0x7f, 0x95, 0x8d, 0x1f, 0x79, 0xbe, 0x65, 0x4a, 0x0b, 0xf5, 0x7d, 0xdb, 0x75, 0x84, + 0x1f, 0xec, 0x44, 0xff, 0x4a, 0x8b, 0x51, 0x1d, 0x23, 0xc4, 0xd2, 0x2d, 0xe1, 0x7f, 0x9d, 0x81, + 0x73, 0x49, 0xd9, 0x59, 0x8e, 0xba, 0x90, 0x7f, 0x15, 0x46, 0x45, 0xaa, 0x96, 0xd5, 0xba, 0xbc, + 0x63, 0xd2, 0xdf, 0x2f, 0xc8, 0xad, 0x2e, 0xa1, 0xc6, 0x20, 0xd4, 0x88, 0x6f, 0x1e, 0x50, 0x9c, + 0xbd, 0x3e, 0xe7, 0x18, 0x81, 0x77, 0xbf, 0x93, 0x81, 0x71, 0x33, 0x9b, 0xca, 0x31, 0x5e, 0x97, + 0xdb, 0x87, 0x12, 0xef, 0x8c, 0x15, 0xcf, 0x6d, 0xa5, 0x57, 0xbc, 0xef, 0x28, 0x52, 0x62, 0xfe, + 0x08, 0xf9, 0xa3, 0x0b, 0x31, 0x64, 0x55, 0xfe, 0x05, 0x18, 0xd5, 0x51, 0x28, 0x47, 0x9c, 0xef, + 0xe6, 0xa1, 0xe4, 0xb6, 0x65, 0x6c, 0x49, 0x3c, 0x31, 0xde, 0x4d, 0x05, 0xc0, 0x10, 0x87, 0xc9, + 0x2c, 0x31, 0xda, 0x31, 0x17, 0xcd, 0x48, 0xd2, 0xce, 0x7f, 0x96, 0x85, 0x62, 0x95, 0x3a, 0xbe, + 0xeb, 0x91, 0xb7, 0x8d, 0x15, 0x2e, 0x44, 0xf6, 0x47, 0x8e, 0x67, 0x4a, 0x12, 0xa1, 0x1b, 0x6c, + 0xf2, 0x85, 0xe6, 0xa1, 0xb0, 0xcc, 0x58, 0xbd, 0x3b, 0x90, 0xf7, 0xdb, 0x74, 0x00, 0x21, 0xfa, + 0xa2, 0xc5, 0xd5, 0x36, 0xad, 0x85, 0xa3, 0xc9, 0x7e, 0x21, 0xa7, 0x4f, 0x1c, 0xfd, 0x58, 0xb9, + 0x98, 0x69, 0x2b, 0xa9, 0x39, 0x1d, 0xfe, 0x64, 0xf9, 0x1f, 0xb3, 0xc3, 0x2f, 0x47, 0x5c, 0xb3, + 0xfd, 0x80, 0x7c, 0xbe, 0xab, 0x23, 0xe7, 0x8e, 0xd7, 0x91, 0xac, 0x36, 0xef, 0x46, 0xbd, 0x88, + 0x54, 0x49, 0x24, 0xce, 0xa7, 0x60, 0x07, 0xb4, 0xa5, 0x2c, 0x99, 0x9f, 0x4a, 0xfb, 0x6d, 0xe1, + 0xc4, 0x58, 0x65, 0x64, 0x51, 0x50, 0x2f, 0x7f, 0xbf, 0xa8, 0xbe, 0x89, 0x75, 0x2c, 0xf9, 0x52, + 0x06, 0xc6, 0xeb, 0xb4, 0x4d, 0x9d, 0x3a, 0x75, 0x6a, 0x36, 0x55, 0x19, 0x4b, 0x56, 0x53, 0x0a, + 0xd8, 0x25, 0x45, 0xd2, 0x08, 0xd4, 0x5a, 0x32, 0xd8, 0x60, 0x84, 0x29, 0x71, 0x61, 0x34, 0x10, + 0x6e, 0x01, 0xea, 0xf3, 0x2b, 0xa9, 0x7d, 0x6b, 0x0c, 0x0d, 0x5c, 0x92, 0x46, 0xcd, 0x84, 0x34, + 0x61, 0x34, 0x88, 0xa6, 0xb0, 0x4f, 0x61, 0x09, 0xd3, 0xe1, 0x73, 0xfc, 0x50, 0xab, 0xc3, 0xe5, + 0x34, 0x07, 0xf2, 0x06, 0x10, 0x99, 0x04, 0x76, 0xc5, 0xb2, 0x9b, 0xb4, 0x8e, 0x6e, 0xc7, 0xa9, + 0x4b, 0xcb, 0xa3, 0xbe, 0x88, 0x5b, 0xee, 0xc2, 0xc0, 0x84, 0x5a, 0xe4, 0x2a, 0x8c, 0x73, 0xfe, + 0x0b, 0x1d, 0xdf, 0x08, 0x8f, 0xd0, 0x9d, 0xbc, 0x6c, 0xc0, 0x30, 0x82, 0x19, 0x49, 0xf5, 0x5f, + 0x3c, 0x34, 0xd5, 0xff, 0x1a, 0x9c, 0xf3, 0xe8, 0xbe, 0xcd, 0xf6, 0xa0, 0xeb, 0xb6, 0x1f, 0xb8, + 0xde, 0x01, 0xf7, 0x45, 0x90, 0xe9, 0xe0, 0x44, 0x20, 0x4f, 0x02, 0x1c, 0x13, 0x6b, 0x91, 0xef, + 0x66, 0x60, 0xa2, 0xe9, 0x36, 0x1a, 0xb6, 0xd3, 0x10, 0x56, 0x6e, 0x79, 0x45, 0x77, 0x77, 0x10, + 0x72, 0x62, 0x6e, 0xcd, 0xa4, 0x2c, 0x14, 0x0d, 0x7d, 0x29, 0x19, 0x81, 0x61, 0xb4, 0x11, 0x17, + 0x3f, 0x05, 0xa4, 0xbb, 0x6e, 0x5f, 0x9b, 0xeb, 0x03, 0xb6, 0x1d, 0x85, 0x62, 0x84, 0xec, 0x6a, + 0xf1, 0x24, 0xa4, 0x43, 0x9a, 0x25, 0x7c, 0xb8, 0x60, 0xfa, 0x6f, 0x19, 0x18, 0x91, 0x71, 0x6f, + 0x91, 0x68, 0xc4, 0xcc, 0xd0, 0xa3, 0x11, 0x97, 0xa0, 0xd0, 0x76, 0xbd, 0x40, 0x2d, 0xd3, 0xd9, + 0x64, 0x1d, 0x47, 0xbc, 0xf9, 0xe3, 0x7a, 0x41, 0x28, 0x84, 0xd8, 0x2f, 0x1f, 0x45, 0x65, 0xb6, + 0xe7, 0xa9, 0xec, 0x28, 0x9b, 0x71, 0x4f, 0x0f, 0x95, 0x41, 0x65, 0x33, 0xcc, 0xa0, 0xb2, 0x59, + 0x7e, 0x94, 0x87, 0xe9, 0x6a, 0xd3, 0xaa, 0xed, 0x99, 0x87, 0x91, 0x37, 0x61, 0xc2, 0xb7, 0x1b, + 0x8e, 0xed, 0x34, 0xa4, 0xb1, 0x28, 0xd3, 0xb7, 0x85, 0xb7, 0x6a, 0xd6, 0xc7, 0x28, 0xb9, 0x81, + 0x65, 0xf6, 0x31, 0xac, 0x11, 0xb9, 0x53, 0xb1, 0x46, 0x44, 0x3c, 0x4e, 0xf2, 0x69, 0x3d, 0x4e, + 0xe2, 0xfd, 0x7e, 0x22, 0xd3, 0x54, 0xe1, 0x29, 0x88, 0x31, 0xf8, 0x79, 0x18, 0xe3, 0xdf, 0x5a, + 0x65, 0x1b, 0x53, 0xf4, 0x56, 0x3d, 0x73, 0xd4, 0xad, 0x3a, 0xd3, 0x45, 0xed, 0x9a, 0xd6, 0xe0, + 0xb4, 0xf6, 0xb2, 0x5a, 0x73, 0x1d, 0xe4, 0x90, 0xf2, 0x3f, 0xcf, 0x48, 0xfa, 0x5b, 0xbb, 0x1e, + 0xb5, 0xea, 0xa4, 0x0a, 0xe7, 0x5b, 0xd4, 0xf7, 0xad, 0x06, 0xad, 0x34, 0x1a, 0x1e, 0x6d, 0x70, + 0xed, 0xee, 0x86, 0xd6, 0x14, 0x75, 0x5a, 0xf1, 0xf5, 0x24, 0x24, 0x4c, 0xae, 0x4b, 0xde, 0x82, + 0xe7, 0xb6, 0x3d, 0xd7, 0xaa, 0xd7, 0x2c, 0xa6, 0x60, 0x70, 0x8c, 0x2d, 0x57, 0x3a, 0x3d, 0xc9, + 0xf4, 0xd0, 0x3f, 0x2e, 0x09, 0x3f, 0xb7, 0xd0, 0x0b, 0x11, 0x7b, 0xd3, 0x28, 0xff, 0xef, 0x3c, + 0x8c, 0x8b, 0xaf, 0x90, 0xae, 0xbd, 0x51, 0xb7, 0xdc, 0xcc, 0xa9, 0xbb, 0xe5, 0xde, 0x06, 0xf0, + 0x79, 0x7b, 0xfa, 0x5f, 0xaa, 0xfc, 0x86, 0xa1, 0xaa, 0x2b, 0xa3, 0x41, 0xa8, 0x9f, 0xb4, 0x1b, + 0xaf, 0xc0, 0x88, 0x1c, 0x0c, 0x69, 0x46, 0xd0, 0xa8, 0xb2, 0xf7, 0x50, 0xc1, 0xc9, 0x27, 0x60, + 0xcc, 0x0a, 0x02, 0xab, 0xb6, 0xdb, 0x92, 0xaf, 0x1e, 0x47, 0xbc, 0x8b, 0x2a, 0x21, 0x08, 0x4d, + 0x3c, 0xfe, 0x64, 0x7a, 0xd3, 0xad, 0xed, 0xf9, 0x5d, 0x4f, 0xa6, 0xf3, 0x52, 0x94, 0x50, 0xd2, + 0x82, 0x62, 0xc0, 0x27, 0x97, 0xf4, 0xb5, 0x59, 0x4e, 0xb9, 0xea, 0xc5, 0x4c, 0x0d, 0xd9, 0x89, + 0xdf, 0x28, 0x99, 0x30, 0x76, 0x3e, 0x5f, 0x2b, 0xd2, 0xf2, 0x9c, 0x96, 0x9d, 0x58, 0x78, 0xc6, + 0xae, 0xc7, 0x7f, 0xa3, 0x64, 0x52, 0xfe, 0x1f, 0x39, 0x20, 0xd5, 0xc0, 0x72, 0xea, 0x96, 0x57, + 0xbf, 0x71, 0x55, 0xa7, 0xe4, 0x61, 0xa7, 0x02, 0xe1, 0xcc, 0x21, 0xe4, 0x7f, 0x8a, 0xc9, 0xa7, + 0xae, 0x19, 0xd7, 0x5c, 0xf1, 0xda, 0xa8, 0x90, 0x31, 0x42, 0xea, 0xa0, 0xe4, 0x42, 0x36, 0xba, + 0x0f, 0x6c, 0x1f, 0xe9, 0x3a, 0xb0, 0x3d, 0x7e, 0x38, 0xfb, 0x63, 0x37, 0x3a, 0xdb, 0xd4, 0x73, + 0x68, 0x40, 0x7d, 0xe5, 0xdd, 0x90, 0x78, 0x9e, 0x7b, 0xd2, 0x7e, 0xed, 0x3b, 0x30, 0xd1, 0xb6, + 0x82, 0x9a, 0xce, 0xc8, 0x21, 0x27, 0xf1, 0xa7, 0x94, 0x16, 0xb5, 0x69, 0x02, 0x1f, 0x3f, 0x9c, + 0xfd, 0x2b, 0x61, 0x10, 0xa5, 0x3e, 0xf3, 0xcc, 0xb7, 0xf7, 0x1a, 0xf3, 0xc1, 0x41, 0x9b, 0xfa, + 0x73, 0x1c, 0x9d, 0xdf, 0x83, 0x45, 0xc9, 0x92, 0x2b, 0x00, 0x4d, 0x7b, 0x9f, 0x8a, 0x13, 0x64, + 0xdc, 0xed, 0x60, 0x4d, 0x43, 0xd0, 0xc0, 0x2a, 0xff, 0x62, 0x06, 0xa4, 0xee, 0x43, 0xee, 0x03, + 0xd4, 0x5c, 0xa7, 0x6e, 0x9b, 0x89, 0x15, 0x17, 0x53, 0x25, 0xbf, 0x10, 0xb4, 0xc2, 0x36, 0xe8, + 0x22, 0x1f, 0x0d, 0x56, 0xe5, 0x79, 0x18, 0x17, 0x4d, 0x90, 0x2f, 0x5f, 0xcc, 0x42, 0xc1, 0x6a, + 0x36, 0xdd, 0xfb, 0xbc, 0x0d, 0x05, 0xb1, 0xdf, 0x73, 0x37, 0x77, 0x14, 0xe5, 0xe5, 0xbf, 0x28, + 0xc0, 0x05, 0x19, 0xb2, 0x7a, 0xcd, 0xb3, 0xeb, 0x4f, 0xf4, 0x62, 0x22, 0x74, 0x0a, 0xc8, 0xf6, + 0x74, 0x0a, 0x08, 0x77, 0xe9, 0xd4, 0xaf, 0x79, 0x19, 0x9f, 0x7d, 0xb8, 0x75, 0x4d, 0xdf, 0x96, + 0xe4, 0x8f, 0xbc, 0x2d, 0x79, 0x49, 0x7b, 0x8f, 0xc4, 0x6e, 0x21, 0x7a, 0x7a, 0x7f, 0x14, 0x0f, + 0xb5, 0xf9, 0x46, 0x42, 0xd6, 0x47, 0x06, 0x13, 0xb2, 0xfe, 0x12, 0x14, 0xad, 0xb6, 0x7d, 0x1b, + 0xd7, 0xa4, 0xf9, 0x35, 0x7c, 0xc5, 0x7d, 0x73, 0xf5, 0x36, 0xae, 0xa1, 0x84, 0x46, 0x3d, 0x15, + 0x4b, 0x69, 0x3d, 0x15, 0x93, 0x27, 0xd9, 0x69, 0xb9, 0x6d, 0xd5, 0xe0, 0x4c, 0xd7, 0x70, 0x0f, + 0xdc, 0xff, 0xe0, 0xfd, 0x3c, 0xe3, 0xe2, 0xd9, 0x6d, 0xfa, 0x44, 0x97, 0xd1, 0x27, 0x61, 0x42, + 0xf8, 0x4f, 0x49, 0x88, 0x54, 0xa5, 0x42, 0xf7, 0x57, 0x13, 0x88, 0x51, 0x5c, 0xb2, 0xca, 0x27, + 0x47, 0xdf, 0x77, 0x7d, 0x20, 0xe7, 0x0f, 0xd3, 0xf6, 0x24, 0x01, 0xf2, 0x51, 0x18, 0xe3, 0xed, + 0x17, 0xbd, 0x2d, 0x3d, 0x07, 0x79, 0x5a, 0xa3, 0xe5, 0xb0, 0x18, 0x4d, 0x9c, 0x68, 0x08, 0x62, + 0x21, 0x6d, 0x08, 0x62, 0xd7, 0x58, 0x9c, 0xd6, 0x6c, 0xfb, 0x52, 0x0e, 0x4a, 0xda, 0xff, 0x97, + 0x7c, 0x0e, 0xc6, 0x85, 0x37, 0xce, 0x49, 0x4e, 0x7e, 0xdc, 0xe2, 0x2e, 0x7c, 0x7b, 0x94, 0x9b, + 0x80, 0x49, 0x8c, 0x87, 0xa7, 0xf3, 0x6c, 0xd4, 0x06, 0x83, 0x6c, 0xff, 0xe1, 0xe9, 0x31, 0x12, + 0xd8, 0x45, 0x94, 0xd4, 0x61, 0x4a, 0x94, 0x85, 0xfe, 0x0e, 0xb9, 0xbe, 0xa3, 0x8a, 0x16, 0xa3, + 0x14, 0x30, 0x4e, 0x92, 0xbc, 0x01, 0x44, 0xf9, 0xb2, 0x55, 0xf7, 0xec, 0x36, 0x7f, 0x4d, 0xfd, + 0x20, 0x6e, 0x7d, 0x5a, 0xed, 0xc2, 0xc0, 0x84, 0x5a, 0xe5, 0x7f, 0x32, 0x0a, 0xda, 0xc0, 0x75, + 0xca, 0x96, 0x87, 0xe4, 0x64, 0x40, 0xd9, 0x13, 0x25, 0x03, 0x6a, 0x43, 0x49, 0x27, 0xdb, 0x4a, + 0x7f, 0x6b, 0xa1, 0xf3, 0x61, 0xc9, 0x14, 0xb0, 0xea, 0x27, 0x86, 0x4c, 0xc8, 0x32, 0x8c, 0x88, + 0x64, 0x0f, 0x2a, 0xe7, 0xe2, 0xc5, 0xa4, 0x21, 0x16, 0xb9, 0x21, 0x8c, 0xfc, 0x2c, 0xa2, 0x0a, + 0xaa, 0xba, 0x49, 0xc9, 0xa0, 0x0a, 0x43, 0x48, 0x06, 0xf5, 0xcd, 0xe4, 0x7c, 0x5e, 0x5b, 0xe9, + 0x6d, 0xa4, 0x1f, 0xac, 0x4c, 0x5e, 0x49, 0x09, 0xad, 0x46, 0x4f, 0xfb, 0xa5, 0xc2, 0x52, 0xca, + 0x24, 0x54, 0x70, 0xec, 0x24, 0x54, 0x63, 0x27, 0x4f, 0x42, 0x95, 0x3e, 0x79, 0x51, 0x15, 0x60, + 0xcb, 0x6e, 0x29, 0x07, 0xef, 0x17, 0xa1, 0xc0, 0x9f, 0x18, 0x8c, 0xe7, 0xa8, 0x11, 0x9e, 0xc7, + 0x02, 0x46, 0x2e, 0x43, 0xde, 0x0f, 0xdc, 0x76, 0xdc, 0xa6, 0x52, 0x0d, 0xdc, 0x36, 0x72, 0x48, + 0xf9, 0x4b, 0x45, 0x18, 0x51, 0xe7, 0x40, 0xdf, 0xb0, 0xe9, 0xa7, 0x7e, 0x94, 0x5f, 0x12, 0x3d, + 0xd2, 0xb4, 0x1f, 0x3d, 0xbc, 0x65, 0x4f, 0xfd, 0xf0, 0xb6, 0x07, 0xc5, 0x36, 0x3f, 0x96, 0x48, + 0x31, 0x76, 0x2d, 0x3d, 0x6f, 0x4e, 0x4e, 0x68, 0x1f, 0xe2, 0x7f, 0x94, 0x2c, 0xc8, 0xbb, 0x30, + 0xe1, 0xd1, 0xc0, 0x3b, 0x88, 0x9c, 0x14, 0x07, 0x12, 0x9a, 0xca, 0x8d, 0xb1, 0x68, 0xd2, 0xc6, + 0x28, 0x2b, 0x26, 0xb2, 0x3d, 0x15, 0x14, 0x99, 0x3e, 0x7b, 0xac, 0x8e, 0xaf, 0x14, 0x22, 0x5b, + 0xff, 0xc4, 0x90, 0x89, 0xb0, 0xd5, 0xac, 0x51, 0xcb, 0x0f, 0x6e, 0xaa, 0x97, 0x70, 0x47, 0x4d, + 0x5b, 0x8d, 0x06, 0xa1, 0x89, 0x47, 0xee, 0x01, 0xd4, 0x9b, 0xf7, 0x64, 0x67, 0xca, 0xf3, 0xc5, + 0x00, 0x6e, 0xb3, 0xb8, 0xad, 0x6a, 0x49, 0x13, 0x46, 0x83, 0x49, 0xf9, 0xbf, 0x67, 0x60, 0x3a, + 0x3e, 0x73, 0xc8, 0x1e, 0xe4, 0x7c, 0x4f, 0xe5, 0xbe, 0xdf, 0x1c, 0xdc, 0x94, 0x94, 0x77, 0xdf, + 0x3c, 0x02, 0xab, 0xea, 0xd5, 0x90, 0x71, 0x61, 0x2b, 0x55, 0x3f, 0x40, 0x67, 0xac, 0xd4, 0x25, + 0xea, 0x07, 0xc8, 0x21, 0x64, 0xcd, 0xb4, 0x9a, 0x08, 0x8b, 0xda, 0x5c, 0x92, 0xd5, 0xe4, 0xb9, + 0x38, 0xbf, 0x24, 0x9b, 0x49, 0xf9, 0x6b, 0x39, 0xb8, 0x90, 0xdc, 0x30, 0xf2, 0x3a, 0x4c, 0xea, + 0xbb, 0xc5, 0x03, 0x23, 0x93, 0x94, 0xf6, 0x88, 0x59, 0x8a, 0x40, 0x31, 0x86, 0x4d, 0xae, 0x70, + 0x3b, 0x03, 0xdb, 0x06, 0x95, 0x3f, 0x52, 0x29, 0x62, 0x22, 0x90, 0x10, 0x34, 0xb0, 0x48, 0x05, + 0xa6, 0xe4, 0xaf, 0xc8, 0xc3, 0xd8, 0xa5, 0xd0, 0x43, 0x68, 0x31, 0x0a, 0xc6, 0x38, 0x3e, 0x79, + 0x05, 0x46, 0x98, 0x9a, 0xa3, 0xbc, 0xf7, 0x0c, 0x23, 0xe2, 0x92, 0x28, 0x46, 0x05, 0x27, 0x57, + 0x61, 0x9c, 0xfd, 0x1b, 0x49, 0x04, 0x6a, 0x5c, 0x01, 0x2e, 0x19, 0x30, 0x8c, 0x60, 0x86, 0x6f, + 0x7d, 0x16, 0xc3, 0x5c, 0xd9, 0xa6, 0xdb, 0x00, 0xfb, 0xf8, 0x8e, 0x4f, 0xd1, 0xba, 0xbf, 0xa4, + 0x5e, 0x5f, 0x36, 0x6c, 0x34, 0xb7, 0x35, 0x04, 0x0d, 0xac, 0xf2, 0x0f, 0x33, 0x30, 0x11, 0x91, + 0x1d, 0x64, 0x07, 0x72, 0x7b, 0x57, 0xd5, 0x2d, 0xd8, 0x8d, 0x01, 0x3e, 0x0c, 0x2a, 0x66, 0xdd, + 0x8d, 0xab, 0x3e, 0x32, 0x06, 0xe4, 0x1d, 0x7d, 0xe1, 0x96, 0x4d, 0xed, 0x0f, 0x60, 0x58, 0x78, + 0xa4, 0xd5, 0x2f, 0x7a, 0xe5, 0xf6, 0x2f, 0x27, 0x61, 0x2a, 0xb6, 0x29, 0x1c, 0xc3, 0xff, 0xe4, + 0x4a, 0xc4, 0x68, 0xd5, 0x3d, 0x99, 0x12, 0xec, 0x4d, 0xa4, 0x21, 0x7a, 0x2f, 0x97, 0xf6, 0xa1, + 0xbc, 0x6e, 0x53, 0x69, 0xac, 0xfb, 0xbe, 0x94, 0x81, 0x71, 0x46, 0xe9, 0xae, 0xeb, 0xed, 0xed, + 0x34, 0xdd, 0xfb, 0x52, 0x9c, 0xaf, 0xa7, 0xb1, 0x9f, 0x86, 0xd4, 0xf4, 0x35, 0x3c, 0x7f, 0x91, + 0xc0, 0x00, 0x60, 0x84, 0x29, 0xa9, 0x41, 0x7e, 0x37, 0x08, 0xda, 0x52, 0xa6, 0xa7, 0x30, 0x21, + 0x5f, 0xdf, 0xda, 0xda, 0x54, 0x4c, 0x79, 0xce, 0x6e, 0x56, 0x80, 0x9c, 0x38, 0xb9, 0x0f, 0x25, + 0xeb, 0xbe, 0xbf, 0x66, 0xb5, 0xb6, 0xeb, 0x96, 0xf4, 0xfd, 0x4e, 0x63, 0x26, 0xbe, 0x5b, 0x15, + 0xa4, 0x14, 0x3b, 0x61, 0x18, 0x52, 0xa5, 0x18, 0xf2, 0x22, 0x1e, 0x14, 0x6b, 0x1d, 0x3f, 0x70, + 0x5b, 0x72, 0x27, 0x48, 0xb1, 0x3f, 0x2f, 0x72, 0x3a, 0x8a, 0xa5, 0x08, 0x50, 0x31, 0x8b, 0x50, + 0x72, 0x22, 0x0d, 0x28, 0xec, 0x59, 0x3b, 0x7b, 0x2a, 0x39, 0xed, 0xca, 0x60, 0xde, 0xd4, 0x12, + 0xd2, 0x82, 0x97, 0xa0, 0xa0, 0xcf, 0x86, 0xce, 0xb1, 0x02, 0x5f, 0xba, 0xbe, 0x2e, 0xa7, 0xcb, + 0xb5, 0x1e, 0x19, 0x3a, 0x56, 0x80, 0x9c, 0x38, 0xfb, 0x1a, 0x7e, 0x2d, 0x23, 0xe3, 0x77, 0x56, + 0xd2, 0x5e, 0x69, 0x98, 0x5f, 0xc3, 0x4b, 0x50, 0xd0, 0x67, 0x73, 0xc4, 0x55, 0xc9, 0x35, 0xa5, + 0xaa, 0x9c, 0x62, 0x8e, 0xc4, 0xf3, 0x74, 0x8a, 0x39, 0xa2, 0x4b, 0x31, 0xe4, 0x45, 0xde, 0x82, + 0x5c, 0xd3, 0x6d, 0xa4, 0x7f, 0xf5, 0x2d, 0x7c, 0x0d, 0x4c, 0x2c, 0xf4, 0x35, 0xb7, 0x81, 0x8c, + 0x32, 0xf9, 0x95, 0x0c, 0x4c, 0x5a, 0xef, 0x76, 0x3c, 0x61, 0xb7, 0xb9, 0xde, 0xd9, 0xf6, 0xa5, + 0x8b, 0xe2, 0xcd, 0x14, 0x6b, 0x20, 0x42, 0x4f, 0xf1, 0xe5, 0x81, 0x35, 0x51, 0x10, 0xc6, 0x58, + 0x73, 0x95, 0x95, 0x67, 0x02, 0x91, 0xe9, 0x8f, 0xae, 0x0d, 0x28, 0xa3, 0x88, 0x54, 0x59, 0x79, + 0x11, 0x4a, 0x16, 0xe4, 0xbb, 0x19, 0xbe, 0x35, 0x2b, 0x39, 0x4b, 0x7d, 0x1a, 0xc8, 0x47, 0xde, + 0x6e, 0x0d, 0xe0, 0xee, 0x40, 0x10, 0x5c, 0xf4, 0xec, 0x80, 0x7a, 0xb6, 0x15, 0xd9, 0xed, 0x4d, + 0x04, 0x8c, 0x37, 0x81, 0x7c, 0x2b, 0x03, 0x53, 0xbc, 0x5b, 0xa4, 0xc1, 0x62, 0xa1, 0x23, 0x72, + 0xfb, 0xa6, 0xd2, 0xd4, 0x2a, 0x51, 0x82, 0xaa, 0x5b, 0x44, 0xee, 0x99, 0x28, 0x0c, 0xe3, 0xdc, + 0xd9, 0x32, 0xa3, 0x2d, 0xcb, 0x6e, 0xf2, 0xd4, 0xc1, 0xa9, 0x96, 0xd9, 0x32, 0x23, 0x13, 0x59, + 0x66, 0xbc, 0x04, 0x05, 0xfd, 0x72, 0x0d, 0xc6, 0x6e, 0xe3, 0x9a, 0x8e, 0x24, 0x3d, 0x3a, 0xad, + 0xe8, 0x15, 0x80, 0x7d, 0x6e, 0x7d, 0x5a, 0xa4, 0x9e, 0x7a, 0xe2, 0x58, 0xef, 0xa1, 0x77, 0x34, + 0x04, 0x0d, 0xac, 0xf2, 0x9f, 0x65, 0x60, 0x2a, 0xe6, 0xad, 0x29, 0xbc, 0x74, 0x95, 0xaf, 0x38, + 0xdd, 0x39, 0x81, 0xcd, 0xb0, 0x6a, 0x54, 0xc7, 0x08, 0x31, 0xd2, 0xe0, 0xd3, 0x6c, 0xc7, 0x6e, + 0xac, 0x5b, 0x6d, 0x49, 0x5f, 0xe8, 0x24, 0x89, 0x86, 0x84, 0x45, 0x03, 0x35, 0x66, 0xcd, 0x8b, + 0x12, 0xc1, 0x38, 0xd5, 0xf2, 0xf7, 0x32, 0x10, 0x8f, 0xf3, 0x22, 0xf3, 0x50, 0xaa, 0xdb, 0x1e, + 0xa7, 0x72, 0x10, 0x0f, 0x4b, 0x5b, 0x52, 0x00, 0x0c, 0x71, 0x74, 0xa7, 0x67, 0x0f, 0xeb, 0x74, + 0xf6, 0x17, 0x69, 0x83, 0x3e, 0x68, 0x4b, 0x65, 0xd6, 0x38, 0x8b, 0x2a, 0x08, 0x1a, 0x58, 0xe5, + 0x7f, 0x53, 0x80, 0xc9, 0xa8, 0x35, 0xbd, 0xcf, 0x38, 0xe1, 0x97, 0xa0, 0xd8, 0xa2, 0xc1, 0xae, + 0x5b, 0x8f, 0x5f, 0x0a, 0xac, 0xf3, 0x52, 0x94, 0x50, 0xde, 0x7c, 0xd7, 0x0b, 0x64, 0xb3, 0xc2, + 0xe6, 0xbb, 0x5e, 0x80, 0x1c, 0xa2, 0xdc, 0x9b, 0xf3, 0x3d, 0xdc, 0x9b, 0x1b, 0x30, 0xed, 0x53, + 0x6f, 0x9f, 0x7a, 0x86, 0x85, 0xb7, 0xff, 0x04, 0xa4, 0xd5, 0x18, 0x09, 0xec, 0x22, 0x4a, 0xea, + 0x30, 0x25, 0xca, 0x42, 0x0b, 0x6f, 0xb1, 0x6f, 0x0b, 0x6f, 0x35, 0x4a, 0x01, 0xe3, 0x24, 0x07, + 0x1c, 0x54, 0x13, 0x1d, 0xc2, 0x3e, 0xbc, 0x7d, 0x6e, 0x03, 0x58, 0x9d, 0x60, 0x57, 0x7e, 0xe7, + 0x68, 0xdf, 0x9e, 0x18, 0x15, 0x5d, 0x19, 0x0d, 0x42, 0xe4, 0x35, 0x98, 0x0c, 0x93, 0x8c, 0xf3, + 0xec, 0xbb, 0xe2, 0xd5, 0x66, 0xbe, 0xd7, 0xac, 0x47, 0x20, 0x18, 0xc3, 0x4c, 0xf9, 0xf6, 0x4f, + 0x16, 0x88, 0xec, 0x0c, 0xf3, 0xf2, 0xe9, 0xab, 0x19, 0x98, 0xbc, 0x1f, 0xe9, 0xa3, 0x81, 0x5f, + 0x42, 0xe9, 0xb3, 0x6a, 0xb4, 0x1c, 0x63, 0x7c, 0x8d, 0x9b, 0xdb, 0xec, 0xa9, 0xf8, 0x57, 0x2d, + 0xbc, 0xf9, 0xfd, 0x1f, 0x5c, 0x7a, 0xe6, 0x8f, 0x7e, 0x70, 0xe9, 0x99, 0x3f, 0xff, 0xc1, 0xa5, + 0x67, 0xde, 0x7b, 0x74, 0x29, 0xf3, 0xfd, 0x47, 0x97, 0x32, 0x7f, 0xf4, 0xe8, 0x52, 0xe6, 0xcf, + 0x1f, 0x5d, 0xca, 0xfc, 0xc7, 0x47, 0x97, 0x32, 0xdf, 0xfe, 0xe1, 0xa5, 0x67, 0x3e, 0x7b, 0x35, + 0x6c, 0xc5, 0xbc, 0x6a, 0x05, 0xff, 0xe7, 0xc3, 0x82, 0x2b, 0xf7, 0x16, 0x60, 0xad, 0x98, 0x97, + 0xbf, 0x55, 0x2b, 0xfe, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, 0xb2, 0xf6, 0x85, 0x97, 0x1d, + 0x01, 0x00, +} + +func (m *AMQPConsumeConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPConsumeConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPConsumeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i-- + if m.NoLocal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.Exclusive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i-- + if m.AutoAck { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.ConsumerTag) + copy(dAtA[i:], m.ConsumerTag) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ConsumerTag))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AMQPEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.URLSecret != nil { + { + size, err := m.URLSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.Consume != nil { + { + size, err := m.Consume.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.QueueBind != nil { + { + size, err := m.QueueBind.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.QueueDeclare != nil { + { + size, err := m.QueueDeclare.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.ExchangeDeclare != nil { + { + size, err := m.ExchangeDeclare.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.RoutingKey) + copy(dAtA[i:], m.RoutingKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoutingKey))) + i-- + dAtA[i] = 0x22 + i -= len(m.ExchangeType) + copy(dAtA[i:], m.ExchangeType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExchangeType))) + i-- + dAtA[i] = 0x1a + i -= len(m.ExchangeName) + copy(dAtA[i:], m.ExchangeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExchangeName))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AMQPExchangeDeclareConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPExchangeDeclareConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPExchangeDeclareConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.Internal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i-- + if m.AutoDelete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i-- + if m.Durable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *AMQPQueueBindConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPQueueBindConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPQueueBindConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *AMQPQueueDeclareConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPQueueDeclareConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPQueueDeclareConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Arguments) + copy(dAtA[i:], m.Arguments) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Arguments))) + i-- + dAtA[i] = 0x32 + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i-- + if m.Exclusive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.AutoDelete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i-- + if m.Durable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AWSLambdaTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AWSLambdaTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AWSLambdaTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RoleARN) + copy(dAtA[i:], m.RoleARN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoleARN))) + i-- + dAtA[i] = 0x42 + if m.InvocationType != nil { + i -= len(*m.InvocationType) + copy(dAtA[i:], *m.InvocationType) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.InvocationType))) + i-- + dAtA[i] = 0x3a + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x22 + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.FunctionName) + copy(dAtA[i:], m.FunctionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FunctionName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Amount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Amount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Amount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ArgoWorkflowTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArgoWorkflowTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArgoWorkflowTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x12 + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ArtifactLocation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArtifactLocation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArtifactLocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Resource != nil { + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Git != nil { + { + size, err := m.Git.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Configmap != nil { + { + size, err := m.Configmap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.URL != nil { + { + size, err := m.URL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.File != nil { + { + size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Inline != nil { + i -= len(*m.Inline) + copy(dAtA[i:], *m.Inline) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Inline))) + i-- + dAtA[i] = 0x12 + } + if m.S3 != nil { + { + size, err := m.S3.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AzureEventHubsTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureEventHubsTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureEventHubsTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.SharedAccessKey != nil { + { + size, err := m.SharedAccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.SharedAccessKeyName != nil { + { + size, err := m.SharedAccessKeyName.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.HubName) + copy(dAtA[i:], m.HubName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HubName))) + i-- + dAtA[i] = 0x12 + i -= len(m.FQDN) + copy(dAtA[i:], m.FQDN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FQDN))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AzureEventsHubEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureEventsHubEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureEventsHubEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.HubName) + copy(dAtA[i:], m.HubName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HubName))) + i-- + dAtA[i] = 0x22 + if m.SharedAccessKey != nil { + { + size, err := m.SharedAccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.SharedAccessKeyName != nil { + { + size, err := m.SharedAccessKeyName.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.FQDN) + copy(dAtA[i:], m.FQDN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FQDN))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AzureQueueStorageEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureQueueStorageEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureQueueStorageEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.WaitTimeInSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.WaitTimeInSeconds)) + i-- + dAtA[i] = 0x48 + } + i-- + if m.DecodeMessage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + i-- + if m.DLQ { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i -= len(m.QueueName) + copy(dAtA[i:], m.QueueName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueName))) + i-- + dAtA[i] = 0x1a + if m.ConnectionString != nil { + { + size, err := m.ConnectionString.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.StorageAccountName) + copy(dAtA[i:], m.StorageAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StorageAccountName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AzureServiceBusEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureServiceBusEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureServiceBusEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.FullyQualifiedNamespace) + copy(dAtA[i:], m.FullyQualifiedNamespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FullyQualifiedNamespace))) + i-- + dAtA[i] = 0x4a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.SubscriptionName) + copy(dAtA[i:], m.SubscriptionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubscriptionName))) + i-- + dAtA[i] = 0x22 + i -= len(m.TopicName) + copy(dAtA[i:], m.TopicName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicName))) + i-- + dAtA[i] = 0x1a + i -= len(m.QueueName) + copy(dAtA[i:], m.QueueName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueName))) + i-- + dAtA[i] = 0x12 + if m.ConnectionString != nil { + { + size, err := m.ConnectionString.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AzureServiceBusTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureServiceBusTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureServiceBusTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.SubscriptionName) + copy(dAtA[i:], m.SubscriptionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubscriptionName))) + i-- + dAtA[i] = 0x22 + i -= len(m.TopicName) + copy(dAtA[i:], m.TopicName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicName))) + i-- + dAtA[i] = 0x1a + i -= len(m.QueueName) + copy(dAtA[i:], m.QueueName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueName))) + i-- + dAtA[i] = 0x12 + if m.ConnectionString != nil { + { + size, err := m.ConnectionString.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Backoff) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Backoff) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Backoff) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Steps)) + i-- + dAtA[i] = 0x20 + if m.Jitter != nil { + { + size, err := m.Jitter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Factor != nil { + { + size, err := m.Factor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Duration != nil { + { + size, err := m.Duration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BasicAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BasicAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OAuthToken != nil { + { + size, err := m.OAuthToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketBasicAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketBasicAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketBasicAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Repositories) > 0 { + for iNdEx := len(m.Repositories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Repositories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + i -= len(m.DeprecatedRepositorySlug) + copy(dAtA[i:], m.DeprecatedRepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedRepositorySlug))) + i-- + dAtA[i] = 0x42 + i -= len(m.DeprecatedProjectKey) + copy(dAtA[i:], m.DeprecatedProjectKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedProjectKey))) + i-- + dAtA[i] = 0x3a + i -= len(m.DeprecatedOwner) + copy(dAtA[i:], m.DeprecatedOwner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedOwner))) + i-- + dAtA[i] = 0x32 + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *BitbucketRepository) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketRepository) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketRepository) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RepositorySlug) + copy(dAtA[i:], m.RepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RepositorySlug))) + i-- + dAtA[i] = 0x12 + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *BitbucketServerEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketServerEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketServerEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.CheckInterval) + copy(dAtA[i:], m.CheckInterval) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CheckInterval))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + i -= len(m.BitbucketServerBaseURL) + copy(dAtA[i:], m.BitbucketServerBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.BitbucketServerBaseURL))) + i-- + dAtA[i] = 0x5a + if m.WebhookSecret != nil { + { + size, err := m.WebhookSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.AccessToken != nil { + { + size, err := m.AccessToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + i-- + if m.OneEventPerChange { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + i-- + if m.SkipBranchRefsChangedOnOpenPR { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Repositories) > 0 { + for iNdEx := len(m.Repositories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Repositories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Projects) > 0 { + for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Projects[iNdEx]) + copy(dAtA[i:], m.Projects[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Projects[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i -= len(m.DeprecatedRepositorySlug) + copy(dAtA[i:], m.DeprecatedRepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedRepositorySlug))) + i-- + dAtA[i] = 0x1a + i -= len(m.DeprecatedProjectKey) + copy(dAtA[i:], m.DeprecatedProjectKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedProjectKey))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketServerRepository) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketServerRepository) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketServerRepository) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RepositorySlug) + copy(dAtA[i:], m.RepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RepositorySlug))) + i-- + dAtA[i] = 0x12 + i -= len(m.ProjectKey) + copy(dAtA[i:], m.ProjectKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ProjectKey))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *BusConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BusConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BusConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Kafka != nil { + { + size, err := m.Kafka.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.JetStream != nil { + { + size, err := m.JetStream.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NATS != nil { + { + size, err := m.NATS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CalendarEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CalendarEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CalendarEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Persistence != nil { + { + size, err := m.Persistence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Timezone) + copy(dAtA[i:], m.Timezone) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Timezone))) + i-- + dAtA[i] = 0x22 + if len(m.ExclusionDates) > 0 { + for iNdEx := len(m.ExclusionDates) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExclusionDates[iNdEx]) + copy(dAtA[i:], m.ExclusionDates[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExclusionDates[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Interval) + copy(dAtA[i:], m.Interval) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Interval))) + i-- + dAtA[i] = 0x12 + i -= len(m.Schedule) + copy(dAtA[i:], m.Schedule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Schedule))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CatchupConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CatchupConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CatchupConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.MaxDuration) + copy(dAtA[i:], m.MaxDuration) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MaxDuration))) + i-- + dAtA[i] = 0x12 + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *Condition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Condition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Condition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x22 + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x12 + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ConditionsResetByTime) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConditionsResetByTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConditionsResetByTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Timezone) + copy(dAtA[i:], m.Timezone) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Timezone))) + i-- + dAtA[i] = 0x12 + i -= len(m.Cron) + copy(dAtA[i:], m.Cron) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Cron))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ConditionsResetCriteria) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConditionsResetCriteria) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConditionsResetCriteria) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ByTime != nil { + { + size, err := m.ByTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigMapPersistence) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigMapPersistence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigMapPersistence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.CreateIfNotExist { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Container) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Container) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EnvFrom) > 0 { + for iNdEx := len(m.EnvFrom) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.EnvFrom[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Env[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.VolumeMounts) > 0 { + for iNdEx := len(m.VolumeMounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VolumeMounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.ImagePullPolicy) + copy(dAtA[i:], m.ImagePullPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ImagePullPolicy))) + i-- + dAtA[i] = 0x12 + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ContainerTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.ImagePullPolicy) + copy(dAtA[i:], m.ImagePullPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ImagePullPolicy))) + i-- + dAtA[i] = 0x12 + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CustomTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CustomTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CustomTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Spec) > 0 { + keysForSpec := make([]string, 0, len(m.Spec)) + for k := range m.Spec { + keysForSpec = append(keysForSpec, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSpec) + for iNdEx := len(keysForSpec) - 1; iNdEx >= 0; iNdEx-- { + v := m.Spec[string(keysForSpec[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForSpec[iNdEx]) + copy(dAtA[i:], keysForSpec[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSpec[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.ServerNameOverride) + copy(dAtA[i:], m.ServerNameOverride) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServerNameOverride))) + i-- + dAtA[i] = 0x22 + if m.CertSecret != nil { + { + size, err := m.CertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i-- + if m.Secure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.ServerURL) + copy(dAtA[i:], m.ServerURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServerURL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DataFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DataFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DataFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Template) + copy(dAtA[i:], m.Template) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Template))) + i-- + dAtA[i] = 0x2a + i -= len(m.Comparator) + copy(dAtA[i:], m.Comparator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Comparator))) + i-- + dAtA[i] = 0x22 + if len(m.Value) > 0 { + for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Value[iNdEx]) + copy(dAtA[i:], m.Value[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EmailTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EmailTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EmailTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x4a + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x42 + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0x3a + if len(m.To) > 0 { + for iNdEx := len(m.To) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.To[iNdEx]) + copy(dAtA[i:], m.To[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.To[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x28 + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0x22 + if m.SMTPPassword != nil { + { + size, err := m.SMTPPassword.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *EmitterEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EmitterEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EmitterEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.ChannelName) + copy(dAtA[i:], m.ChannelName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ChannelName))) + i-- + dAtA[i] = 0x1a + i -= len(m.ChannelKey) + copy(dAtA[i:], m.ChannelKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ChannelKey))) + i-- + dAtA[i] = 0x12 + i -= len(m.Broker) + copy(dAtA[i:], m.Broker) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Broker))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Event) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Data != nil { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if m.Context != nil { + { + size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventBusList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBusList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBusList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventBusSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBusSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBusSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.JetStreamExotic != nil { + { + size, err := m.JetStreamExotic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Kafka != nil { + { + size, err := m.Kafka.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.JetStream != nil { + { + size, err := m.JetStream.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NATS != nil { + { + size, err := m.NATS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBusStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBusStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBusStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Time.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x32 + i -= len(m.DataContentType) + copy(dAtA[i:], m.DataContentType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataContentType))) + i-- + dAtA[i] = 0x2a + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x22 + i -= len(m.SpecVersion) + copy(dAtA[i:], m.SpecVersion) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SpecVersion))) + i-- + dAtA[i] = 0x1a + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x12 + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventDependency) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventDependency) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDependency) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.FiltersLogicalOperator) + copy(dAtA[i:], m.FiltersLogicalOperator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FiltersLogicalOperator))) + i-- + dAtA[i] = 0x32 + if m.Transform != nil { + { + size, err := m.Transform.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Filters != nil { + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.EventName) + copy(dAtA[i:], m.EventName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventName))) + i-- + dAtA[i] = 0x1a + i -= len(m.EventSourceName) + copy(dAtA[i:], m.EventSourceName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventSourceName))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventDependencyFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventDependencyFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDependencyFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Script) + copy(dAtA[i:], m.Script) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Script))) + i-- + dAtA[i] = 0x3a + i -= len(m.ExprLogicalOperator) + copy(dAtA[i:], m.ExprLogicalOperator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExprLogicalOperator))) + i-- + dAtA[i] = 0x32 + i -= len(m.DataLogicalOperator) + copy(dAtA[i:], m.DataLogicalOperator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataLogicalOperator))) + i-- + dAtA[i] = 0x2a + if len(m.Exprs) > 0 { + for iNdEx := len(m.Exprs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exprs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Context != nil { + { + size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Time != nil { + { + size, err := m.Time.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventDependencyTransformer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventDependencyTransformer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDependencyTransformer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Script) + copy(dAtA[i:], m.Script) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Script))) + i-- + dAtA[i] = 0x12 + i -= len(m.JQ) + copy(dAtA[i:], m.JQ) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.JQ))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventPersistence) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventPersistence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventPersistence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConfigMap != nil { + { + size, err := m.ConfigMap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Catchup != nil { + { + size, err := m.Catchup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Gerrit) > 0 { + keysForGerrit := make([]string, 0, len(m.Gerrit)) + for k := range m.Gerrit { + keysForGerrit = append(keysForGerrit, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGerrit) + for iNdEx := len(keysForGerrit) - 1; iNdEx >= 0; iNdEx-- { + v := m.Gerrit[string(keysForGerrit[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGerrit[iNdEx]) + copy(dAtA[i:], keysForGerrit[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGerrit[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a + } + } + if len(m.SFTP) > 0 { + keysForSFTP := make([]string, 0, len(m.SFTP)) + for k := range m.SFTP { + keysForSFTP = append(keysForSFTP, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSFTP) + for iNdEx := len(keysForSFTP) - 1; iNdEx >= 0; iNdEx-- { + v := m.SFTP[string(keysForSFTP[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSFTP[iNdEx]) + copy(dAtA[i:], keysForSFTP[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSFTP[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + } + if len(m.AzureQueueStorage) > 0 { + keysForAzureQueueStorage := make([]string, 0, len(m.AzureQueueStorage)) + for k := range m.AzureQueueStorage { + keysForAzureQueueStorage = append(keysForAzureQueueStorage, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureQueueStorage) + for iNdEx := len(keysForAzureQueueStorage) - 1; iNdEx >= 0; iNdEx-- { + v := m.AzureQueueStorage[string(keysForAzureQueueStorage[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAzureQueueStorage[iNdEx]) + copy(dAtA[i:], keysForAzureQueueStorage[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAzureQueueStorage[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } + } + if len(m.AzureServiceBus) > 0 { + keysForAzureServiceBus := make([]string, 0, len(m.AzureServiceBus)) + for k := range m.AzureServiceBus { + keysForAzureServiceBus = append(keysForAzureServiceBus, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureServiceBus) + for iNdEx := len(keysForAzureServiceBus) - 1; iNdEx >= 0; iNdEx-- { + v := m.AzureServiceBus[string(keysForAzureServiceBus[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAzureServiceBus[iNdEx]) + copy(dAtA[i:], keysForAzureServiceBus[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAzureServiceBus[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + } + if len(m.RedisStream) > 0 { + keysForRedisStream := make([]string, 0, len(m.RedisStream)) + for k := range m.RedisStream { + keysForRedisStream = append(keysForRedisStream, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedisStream) + for iNdEx := len(keysForRedisStream) - 1; iNdEx >= 0; iNdEx-- { + v := m.RedisStream[string(keysForRedisStream[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForRedisStream[iNdEx]) + copy(dAtA[i:], keysForRedisStream[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForRedisStream[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + } + if len(m.Bitbucket) > 0 { + keysForBitbucket := make([]string, 0, len(m.Bitbucket)) + for k := range m.Bitbucket { + keysForBitbucket = append(keysForBitbucket, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucket) + for iNdEx := len(keysForBitbucket) - 1; iNdEx >= 0; iNdEx-- { + v := m.Bitbucket[string(keysForBitbucket[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForBitbucket[iNdEx]) + copy(dAtA[i:], keysForBitbucket[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForBitbucket[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + } + if len(m.BitbucketServer) > 0 { + keysForBitbucketServer := make([]string, 0, len(m.BitbucketServer)) + for k := range m.BitbucketServer { + keysForBitbucketServer = append(keysForBitbucketServer, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucketServer) + for iNdEx := len(keysForBitbucketServer) - 1; iNdEx >= 0; iNdEx-- { + v := m.BitbucketServer[string(keysForBitbucketServer[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForBitbucketServer[iNdEx]) + copy(dAtA[i:], keysForBitbucketServer[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForBitbucketServer[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + } + if m.Replicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Replicas)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe0 + } + if len(m.Generic) > 0 { + keysForGeneric := make([]string, 0, len(m.Generic)) + for k := range m.Generic { + keysForGeneric = append(keysForGeneric, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGeneric) + for iNdEx := len(keysForGeneric) - 1; iNdEx >= 0; iNdEx-- { + v := m.Generic[string(keysForGeneric[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGeneric[iNdEx]) + copy(dAtA[i:], keysForGeneric[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGeneric[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + } + if len(m.Pulsar) > 0 { + keysForPulsar := make([]string, 0, len(m.Pulsar)) + for k := range m.Pulsar { + keysForPulsar = append(keysForPulsar, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPulsar) + for iNdEx := len(keysForPulsar) - 1; iNdEx >= 0; iNdEx-- { + v := m.Pulsar[string(keysForPulsar[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForPulsar[iNdEx]) + copy(dAtA[i:], keysForPulsar[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForPulsar[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + } + if len(m.NSQ) > 0 { + keysForNSQ := make([]string, 0, len(m.NSQ)) + for k := range m.NSQ { + keysForNSQ = append(keysForNSQ, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNSQ) + for iNdEx := len(keysForNSQ) - 1; iNdEx >= 0; iNdEx-- { + v := m.NSQ[string(keysForNSQ[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForNSQ[iNdEx]) + copy(dAtA[i:], keysForNSQ[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNSQ[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + } + if len(m.Redis) > 0 { + keysForRedis := make([]string, 0, len(m.Redis)) + for k := range m.Redis { + keysForRedis = append(keysForRedis, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedis) + for iNdEx := len(keysForRedis) - 1; iNdEx >= 0; iNdEx-- { + v := m.Redis[string(keysForRedis[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForRedis[iNdEx]) + copy(dAtA[i:], keysForRedis[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForRedis[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + } + if len(m.Emitter) > 0 { + keysForEmitter := make([]string, 0, len(m.Emitter)) + for k := range m.Emitter { + keysForEmitter = append(keysForEmitter, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForEmitter) + for iNdEx := len(keysForEmitter) - 1; iNdEx >= 0; iNdEx-- { + v := m.Emitter[string(keysForEmitter[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForEmitter[iNdEx]) + copy(dAtA[i:], keysForEmitter[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForEmitter[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + } + if len(m.Stripe) > 0 { + keysForStripe := make([]string, 0, len(m.Stripe)) + for k := range m.Stripe { + keysForStripe = append(keysForStripe, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStripe) + for iNdEx := len(keysForStripe) - 1; iNdEx >= 0; iNdEx-- { + v := m.Stripe[string(keysForStripe[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForStripe[iNdEx]) + copy(dAtA[i:], keysForStripe[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForStripe[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + } + if len(m.AzureEventsHub) > 0 { + keysForAzureEventsHub := make([]string, 0, len(m.AzureEventsHub)) + for k := range m.AzureEventsHub { + keysForAzureEventsHub = append(keysForAzureEventsHub, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureEventsHub) + for iNdEx := len(keysForAzureEventsHub) - 1; iNdEx >= 0; iNdEx-- { + v := m.AzureEventsHub[string(keysForAzureEventsHub[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAzureEventsHub[iNdEx]) + copy(dAtA[i:], keysForAzureEventsHub[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAzureEventsHub[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + } + if len(m.StorageGrid) > 0 { + keysForStorageGrid := make([]string, 0, len(m.StorageGrid)) + for k := range m.StorageGrid { + keysForStorageGrid = append(keysForStorageGrid, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStorageGrid) + for iNdEx := len(keysForStorageGrid) - 1; iNdEx >= 0; iNdEx-- { + v := m.StorageGrid[string(keysForStorageGrid[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForStorageGrid[iNdEx]) + copy(dAtA[i:], keysForStorageGrid[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForStorageGrid[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + } + if len(m.Slack) > 0 { + keysForSlack := make([]string, 0, len(m.Slack)) + for k := range m.Slack { + keysForSlack = append(keysForSlack, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSlack) + for iNdEx := len(keysForSlack) - 1; iNdEx >= 0; iNdEx-- { + v := m.Slack[string(keysForSlack[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSlack[iNdEx]) + copy(dAtA[i:], keysForSlack[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSlack[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + } + if len(m.HDFS) > 0 { + keysForHDFS := make([]string, 0, len(m.HDFS)) + for k := range m.HDFS { + keysForHDFS = append(keysForHDFS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHDFS) + for iNdEx := len(keysForHDFS) - 1; iNdEx >= 0; iNdEx-- { + v := m.HDFS[string(keysForHDFS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForHDFS[iNdEx]) + copy(dAtA[i:], keysForHDFS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForHDFS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + } + if len(m.Gitlab) > 0 { + keysForGitlab := make([]string, 0, len(m.Gitlab)) + for k := range m.Gitlab { + keysForGitlab = append(keysForGitlab, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGitlab) + for iNdEx := len(keysForGitlab) - 1; iNdEx >= 0; iNdEx-- { + v := m.Gitlab[string(keysForGitlab[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGitlab[iNdEx]) + copy(dAtA[i:], keysForGitlab[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGitlab[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } + if len(m.Github) > 0 { + keysForGithub := make([]string, 0, len(m.Github)) + for k := range m.Github { + keysForGithub = append(keysForGithub, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGithub) + for iNdEx := len(keysForGithub) - 1; iNdEx >= 0; iNdEx-- { + v := m.Github[string(keysForGithub[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGithub[iNdEx]) + copy(dAtA[i:], keysForGithub[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGithub[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if len(m.PubSub) > 0 { + keysForPubSub := make([]string, 0, len(m.PubSub)) + for k := range m.PubSub { + keysForPubSub = append(keysForPubSub, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPubSub) + for iNdEx := len(keysForPubSub) - 1; iNdEx >= 0; iNdEx-- { + v := m.PubSub[string(keysForPubSub[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForPubSub[iNdEx]) + copy(dAtA[i:], keysForPubSub[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForPubSub[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x7a + } + } + if len(m.SQS) > 0 { + keysForSQS := make([]string, 0, len(m.SQS)) + for k := range m.SQS { + keysForSQS = append(keysForSQS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSQS) + for iNdEx := len(keysForSQS) - 1; iNdEx >= 0; iNdEx-- { + v := m.SQS[string(keysForSQS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSQS[iNdEx]) + copy(dAtA[i:], keysForSQS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSQS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + if len(m.SNS) > 0 { + keysForSNS := make([]string, 0, len(m.SNS)) + for k := range m.SNS { + keysForSNS = append(keysForSNS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSNS) + for iNdEx := len(keysForSNS) - 1; iNdEx >= 0; iNdEx-- { + v := m.SNS[string(keysForSNS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSNS[iNdEx]) + copy(dAtA[i:], keysForSNS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSNS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + if len(m.NATS) > 0 { + keysForNATS := make([]string, 0, len(m.NATS)) + for k := range m.NATS { + keysForNATS = append(keysForNATS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNATS) + for iNdEx := len(keysForNATS) - 1; iNdEx >= 0; iNdEx-- { + v := m.NATS[string(keysForNATS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForNATS[iNdEx]) + copy(dAtA[i:], keysForNATS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNATS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x62 + } + } + if len(m.MQTT) > 0 { + keysForMQTT := make([]string, 0, len(m.MQTT)) + for k := range m.MQTT { + keysForMQTT = append(keysForMQTT, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMQTT) + for iNdEx := len(keysForMQTT) - 1; iNdEx >= 0; iNdEx-- { + v := m.MQTT[string(keysForMQTT[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForMQTT[iNdEx]) + copy(dAtA[i:], keysForMQTT[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMQTT[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a + } + } + if len(m.Kafka) > 0 { + keysForKafka := make([]string, 0, len(m.Kafka)) + for k := range m.Kafka { + keysForKafka = append(keysForKafka, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForKafka) + for iNdEx := len(keysForKafka) - 1; iNdEx >= 0; iNdEx-- { + v := m.Kafka[string(keysForKafka[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForKafka[iNdEx]) + copy(dAtA[i:], keysForKafka[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForKafka[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + if len(m.AMQP) > 0 { + keysForAMQP := make([]string, 0, len(m.AMQP)) + for k := range m.AMQP { + keysForAMQP = append(keysForAMQP, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAMQP) + for iNdEx := len(keysForAMQP) - 1; iNdEx >= 0; iNdEx-- { + v := m.AMQP[string(keysForAMQP[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAMQP[iNdEx]) + copy(dAtA[i:], keysForAMQP[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAMQP[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if len(m.Webhook) > 0 { + keysForWebhook := make([]string, 0, len(m.Webhook)) + for k := range m.Webhook { + keysForWebhook = append(keysForWebhook, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForWebhook) + for iNdEx := len(keysForWebhook) - 1; iNdEx >= 0; iNdEx-- { + v := m.Webhook[string(keysForWebhook[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForWebhook[iNdEx]) + copy(dAtA[i:], keysForWebhook[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForWebhook[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Resource) > 0 { + keysForResource := make([]string, 0, len(m.Resource)) + for k := range m.Resource { + keysForResource = append(keysForResource, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForResource) + for iNdEx := len(keysForResource) - 1; iNdEx >= 0; iNdEx-- { + v := m.Resource[string(keysForResource[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForResource[iNdEx]) + copy(dAtA[i:], keysForResource[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForResource[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if len(m.File) > 0 { + keysForFile := make([]string, 0, len(m.File)) + for k := range m.File { + keysForFile = append(keysForFile, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForFile) + for iNdEx := len(keysForFile) - 1; iNdEx >= 0; iNdEx-- { + v := m.File[string(keysForFile[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForFile[iNdEx]) + copy(dAtA[i:], keysForFile[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForFile[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Calendar) > 0 { + keysForCalendar := make([]string, 0, len(m.Calendar)) + for k := range m.Calendar { + keysForCalendar = append(keysForCalendar, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCalendar) + for iNdEx := len(keysForCalendar) - 1; iNdEx >= 0; iNdEx-- { + v := m.Calendar[string(keysForCalendar[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForCalendar[iNdEx]) + copy(dAtA[i:], keysForCalendar[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForCalendar[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Minio) > 0 { + keysForMinio := make([]string, 0, len(m.Minio)) + for k := range m.Minio { + keysForMinio = append(keysForMinio, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMinio) + for iNdEx := len(keysForMinio) - 1; iNdEx >= 0; iNdEx-- { + v := m.Minio[string(keysForMinio[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForMinio[iNdEx]) + copy(dAtA[i:], keysForMinio[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMinio[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Template != nil { + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.EventBusName) + copy(dAtA[i:], m.EventBusName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventBusName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ExprFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExprFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExprFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fields) > 0 { + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Expr) + copy(dAtA[i:], m.Expr) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expr))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FileArtifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileArtifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileArtifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FileEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + i-- + if m.Polling { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + { + size, err := m.WatchPathConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.EventType) + copy(dAtA[i:], m.EventType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventType))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GenericEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenericEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.AuthSecret != nil { + { + size, err := m.AuthSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.Insecure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GerritEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GerritEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GerritEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + i-- + if m.SslVerify { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + if len(m.Projects) > 0 { + for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Projects[iNdEx]) + copy(dAtA[i:], m.Projects[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Projects[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + i -= len(m.GerritBaseURL) + copy(dAtA[i:], m.GerritBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GerritBaseURL))) + i-- + dAtA[i] = 0x2a + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.HookName) + copy(dAtA[i:], m.HookName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HookName))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GitArtifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitArtifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitArtifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.InsecureIgnoreHostKey { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + if m.Remote != nil { + { + size, err := m.Remote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0x42 + i -= len(m.Tag) + copy(dAtA[i:], m.Tag) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Tag))) + i-- + dAtA[i] = 0x3a + i -= len(m.Branch) + copy(dAtA[i:], m.Branch) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Branch))) + i-- + dAtA[i] = 0x32 + i -= len(m.FilePath) + copy(dAtA[i:], m.FilePath) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FilePath))) + i-- + dAtA[i] = 0x2a + if m.SSHKeySecret != nil { + { + size, err := m.SSHKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Creds != nil { + { + size, err := m.Creds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.CloneDirectory) + copy(dAtA[i:], m.CloneDirectory) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CloneDirectory))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GitCreds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitCreds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitCreds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GitRemoteConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitRemoteConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitRemoteConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.URLS) > 0 { + for iNdEx := len(m.URLS) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.URLS[iNdEx]) + copy(dAtA[i:], m.URLS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URLS[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GithubAppCreds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GithubAppCreds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GithubAppCreds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.InstallationID)) + i-- + dAtA[i] = 0x18 + i = encodeVarintGenerated(dAtA, i, uint64(m.AppID)) + i-- + dAtA[i] = 0x10 + if m.PrivateKey != nil { + { + size, err := m.PrivateKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GithubEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GithubEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GithubEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if m.GithubApp != nil { + { + size, err := m.GithubApp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Organizations) > 0 { + for iNdEx := len(m.Organizations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Organizations[iNdEx]) + copy(dAtA[i:], m.Organizations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Organizations[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if len(m.Repositories) > 0 { + for iNdEx := len(m.Repositories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Repositories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + i -= len(m.GithubUploadURL) + copy(dAtA[i:], m.GithubUploadURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GithubUploadURL))) + i-- + dAtA[i] = 0x62 + i -= len(m.GithubBaseURL) + copy(dAtA[i:], m.GithubBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GithubBaseURL))) + i-- + dAtA[i] = 0x5a + i -= len(m.ContentType) + copy(dAtA[i:], m.ContentType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContentType))) + i-- + dAtA[i] = 0x52 + i-- + if m.Active { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + i-- + if m.Insecure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + if m.WebhookSecret != nil { + { + size, err := m.WebhookSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.APIToken != nil { + { + size, err := m.APIToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.DeprecatedRepository) + copy(dAtA[i:], m.DeprecatedRepository) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedRepository))) + i-- + dAtA[i] = 0x22 + i -= len(m.DeprecatedOwner) + copy(dAtA[i:], m.DeprecatedOwner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedOwner))) + i-- + dAtA[i] = 0x1a + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *GitlabEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitlabEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitlabEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Groups[iNdEx]) + copy(dAtA[i:], m.Groups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Groups[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.SecretToken != nil { + { + size, err := m.SecretToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if len(m.Projects) > 0 { + for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Projects[iNdEx]) + copy(dAtA[i:], m.Projects[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Projects[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + i -= len(m.GitlabBaseURL) + copy(dAtA[i:], m.GitlabBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GitlabBaseURL))) + i-- + dAtA[i] = 0x32 + i-- + if m.EnableSSLVerification { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.AccessToken != nil { + { + size, err := m.AccessToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.DeprecatedProjectID) + copy(dAtA[i:], m.DeprecatedProjectID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedProjectID))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HDFSEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HDFSEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HDFSEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x62 + } + } + i -= len(m.KrbServicePrincipalName) + copy(dAtA[i:], m.KrbServicePrincipalName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KrbServicePrincipalName))) + i-- + dAtA[i] = 0x5a + if m.KrbConfigConfigMap != nil { + { + size, err := m.KrbConfigConfigMap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + i -= len(m.KrbRealm) + copy(dAtA[i:], m.KrbRealm) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KrbRealm))) + i-- + dAtA[i] = 0x4a + i -= len(m.KrbUsername) + copy(dAtA[i:], m.KrbUsername) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KrbUsername))) + i-- + dAtA[i] = 0x42 + if m.KrbKeytabSecret != nil { + { + size, err := m.KrbKeytabSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.KrbCCacheSecret != nil { + { + size, err := m.KrbCCacheSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + i -= len(m.HDFSUser) + copy(dAtA[i:], m.HDFSUser) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HDFSUser))) + i-- + dAtA[i] = 0x2a + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i -= len(m.CheckInterval) + copy(dAtA[i:], m.CheckInterval) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CheckInterval))) + i-- + dAtA[i] = 0x1a + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + { + size, err := m.WatchPathConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *HTTPTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SecureHeaders) > 0 { + for iNdEx := len(m.SecureHeaders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SecureHeaders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.Headers) > 0 { + keysForHeaders := make([]string, 0, len(m.Headers)) + for k := range m.Headers { + keysForHeaders = append(keysForHeaders, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + for iNdEx := len(keysForHeaders) - 1; iNdEx >= 0; iNdEx-- { + v := m.Headers[string(keysForHeaders[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForHeaders[iNdEx]) + copy(dAtA[i:], keysForHeaders[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForHeaders[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.BasicAuth != nil { + { + size, err := m.BasicAuth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Timeout)) + i-- + dAtA[i] = 0x30 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x22 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Int64OrString) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Int64OrString) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Int64OrString) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.StrVal) + copy(dAtA[i:], m.StrVal) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StrVal))) + i-- + dAtA[i] = 0x1a + i = encodeVarintGenerated(dAtA, i, uint64(m.Int64Val)) + i-- + dAtA[i] = 0x10 + i = encodeVarintGenerated(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *JetStreamBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JetStreamBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JetStreamBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxPayload != nil { + i -= len(*m.MaxPayload) + copy(dAtA[i:], *m.MaxPayload) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxPayload))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.StreamConfig != nil { + i -= len(*m.StreamConfig) + copy(dAtA[i:], *m.StreamConfig) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StreamConfig))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.StartArgs) > 0 { + for iNdEx := len(m.StartArgs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.StartArgs[iNdEx]) + copy(dAtA[i:], m.StartArgs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StartArgs[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } + if m.Settings != nil { + i -= len(*m.Settings) + copy(dAtA[i:], *m.Settings) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Settings))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x7a + if m.Affinity != nil { + { + size, err := m.Affinity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x68 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x62 + if len(m.ImagePullSecrets) > 0 { + for iNdEx := len(m.ImagePullSecrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImagePullSecrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeSelector[string(keysForNodeSelector[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForNodeSelector[iNdEx]) + copy(dAtA[i:], keysForNodeSelector[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeSelector[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Persistence != nil { + { + size, err := m.Persistence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.MetricsContainerTemplate != nil { + { + size, err := m.MetricsContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ReloaderContainerTemplate != nil { + { + size, err := m.ReloaderContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ContainerTemplate != nil { + { + size, err := m.ContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Replicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Replicas)) + i-- + dAtA[i] = 0x10 + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *JetStreamConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JetStreamConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JetStreamConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.StreamConfig) + copy(dAtA[i:], m.StreamConfig) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StreamConfig))) + i-- + dAtA[i] = 0x1a + if m.AccessSecret != nil { + { + size, err := m.AccessSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *K8SResource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *K8SResource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *K8SResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *K8SResourcePolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *K8SResourcePolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *K8SResourcePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.ErrorOnBackoffTimeout { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + if m.Backoff != nil { + { + size, err := m.Backoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Labels) > 0 { + keysForLabels := make([]string, 0, len(m.Labels)) + for k := range m.Labels { + keysForLabels = append(keysForLabels, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + for iNdEx := len(keysForLabels) - 1; iNdEx >= 0; iNdEx-- { + v := m.Labels[string(keysForLabels[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForLabels[iNdEx]) + copy(dAtA[i:], keysForLabels[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLabels[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *KafkaBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConsumerGroup != nil { + { + size, err := m.ConsumerGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.SASL != nil { + { + size, err := m.SASL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *KafkaConsumerGroup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaConsumerGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaConsumerGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RebalanceStrategy) + copy(dAtA[i:], m.RebalanceStrategy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RebalanceStrategy))) + i-- + dAtA[i] = 0x1a + i-- + if m.Oldest { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.GroupName) + copy(dAtA[i:], m.GroupName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GroupName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *KafkaEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0x6a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.SASL != nil { + { + size, err := m.SASL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x52 + i = encodeVarintGenerated(dAtA, i, uint64(m.LimitEventsPerSecond)) + i-- + dAtA[i] = 0x48 + if m.ConsumerGroup != nil { + { + size, err := m.ConsumerGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x1a + i -= len(m.Partition) + copy(dAtA[i:], m.Partition) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Partition))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *KafkaTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SecureHeaders) > 0 { + for iNdEx := len(m.SecureHeaders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SecureHeaders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + } + if len(m.Headers) > 0 { + keysForHeaders := make([]string, 0, len(m.Headers)) + for k := range m.Headers { + keysForHeaders = append(keysForHeaders, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + for iNdEx := len(keysForHeaders) - 1; iNdEx >= 0; iNdEx-- { + v := m.Headers[string(keysForHeaders[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForHeaders[iNdEx]) + copy(dAtA[i:], keysForHeaders[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForHeaders[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + if m.SchemaRegistry != nil { + { + size, err := m.SchemaRegistry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.SASL != nil { + { + size, err := m.SASL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x5a + if m.PartitioningKey != nil { + i -= len(*m.PartitioningKey) + copy(dAtA[i:], *m.PartitioningKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PartitioningKey))) + i-- + dAtA[i] = 0x52 + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.FlushFrequency)) + i-- + dAtA[i] = 0x38 + i-- + if m.Compress { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + i = encodeVarintGenerated(dAtA, i, uint64(m.RequiredAcks)) + i-- + dAtA[i] = 0x28 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Partition)) + i-- + dAtA[i] = 0x18 + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *LogTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.IntervalSeconds)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *MQTTEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MQTTEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MQTTEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x1a + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + keysForLabels := make([]string, 0, len(m.Labels)) + for k := range m.Labels { + keysForLabels = append(keysForLabels, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + for iNdEx := len(keysForLabels) - 1; iNdEx >= 0; iNdEx-- { + v := m.Labels[string(keysForLabels[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForLabels[iNdEx]) + copy(dAtA[i:], keysForLabels[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLabels[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Annotations) > 0 { + keysForAnnotations := make([]string, 0, len(m.Annotations)) + for k := range m.Annotations { + keysForAnnotations = append(keysForAnnotations, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + for iNdEx := len(keysForAnnotations) - 1; iNdEx >= 0; iNdEx-- { + v := m.Annotations[string(keysForAnnotations[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAnnotations[iNdEx]) + copy(dAtA[i:], keysForAnnotations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAnnotations[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *NATSAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Credential != nil { + { + size, err := m.Credential.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.NKey != nil { + { + size, err := m.NKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NATSBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exotic != nil { + { + size, err := m.Exotic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Native != nil { + { + size, err := m.Native.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NATSConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccessSecret != nil { + { + size, err := m.AccessSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Auth != nil { + i -= len(*m.Auth) + copy(dAtA[i:], *m.Auth) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Auth))) + i-- + dAtA[i] = 0x1a + } + if m.ClusterID != nil { + i -= len(*m.ClusterID) + copy(dAtA[i:], *m.ClusterID) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ClusterID))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NATSEventsSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSEventsSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSEventsSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Queue != nil { + i -= len(*m.Queue) + copy(dAtA[i:], *m.Queue) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Queue))) + i-- + dAtA[i] = 0x4a + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NATSTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NSQEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NSQEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NSQEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Channel))) + i-- + dAtA[i] = 0x1a + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.HostAddress) + copy(dAtA[i:], m.HostAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HostAddress))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NativeStrategy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NativeStrategy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NativeStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RaftCommitTimeout != nil { + i -= len(*m.RaftCommitTimeout) + copy(dAtA[i:], *m.RaftCommitTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftCommitTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.RaftLeaseTimeout != nil { + i -= len(*m.RaftLeaseTimeout) + copy(dAtA[i:], *m.RaftLeaseTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftLeaseTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.RaftElectionTimeout != nil { + i -= len(*m.RaftElectionTimeout) + copy(dAtA[i:], *m.RaftElectionTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftElectionTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.RaftHeartbeatTimeout != nil { + i -= len(*m.RaftHeartbeatTimeout) + copy(dAtA[i:], *m.RaftHeartbeatTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftHeartbeatTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.MaxPayload != nil { + i -= len(*m.MaxPayload) + copy(dAtA[i:], *m.MaxPayload) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxPayload))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.MaxSubs != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxSubs)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.MaxBytes != nil { + i -= len(*m.MaxBytes) + copy(dAtA[i:], *m.MaxBytes) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxBytes))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.MaxMsgs != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxMsgs)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.Affinity != nil { + { + size, err := m.Affinity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x70 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x6a + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x62 + if len(m.ImagePullSecrets) > 0 { + for iNdEx := len(m.ImagePullSecrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImagePullSecrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if m.MaxAge != nil { + i -= len(*m.MaxAge) + copy(dAtA[i:], *m.MaxAge) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxAge))) + i-- + dAtA[i] = 0x52 + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeSelector[string(keysForNodeSelector[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForNodeSelector[iNdEx]) + copy(dAtA[i:], keysForNodeSelector[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeSelector[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.MetricsContainerTemplate != nil { + { + size, err := m.MetricsContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ContainerTemplate != nil { + { + size, err := m.ContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Persistence != nil { + { + size, err := m.Persistence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Auth != nil { + i -= len(*m.Auth) + copy(dAtA[i:], *m.Auth) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Auth))) + i-- + dAtA[i] = 0x12 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Replicas)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *OpenWhiskTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OpenWhiskTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OpenWhiskTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + i -= len(m.ActionName) + copy(dAtA[i:], m.ActionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ActionName))) + i-- + dAtA[i] = 0x2a + if m.AuthToken != nil { + { + size, err := m.AuthToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x1a + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *OwnedRepositories) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OwnedRepositories) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OwnedRepositories) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PayloadField) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PayloadField) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PayloadField) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PersistenceStrategy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PersistenceStrategy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PersistenceStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VolumeSize != nil { + { + size, err := m.VolumeSize.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.AccessMode != nil { + i -= len(*m.AccessMode) + copy(dAtA[i:], *m.AccessMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.AccessMode))) + i-- + dAtA[i] = 0x12 + } + if m.StorageClassName != nil { + i -= len(*m.StorageClassName) + copy(dAtA[i:], *m.StorageClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StorageClassName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PubSubEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PubSubEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubSubEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + i-- + if m.DeleteSubscriptionOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.CredentialSecret != nil { + { + size, err := m.CredentialSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.SubscriptionID) + copy(dAtA[i:], m.SubscriptionID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubscriptionID))) + i-- + dAtA[i] = 0x22 + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x1a + i -= len(m.TopicProjectID) + copy(dAtA[i:], m.TopicProjectID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicProjectID))) + i-- + dAtA[i] = 0x12 + i -= len(m.ProjectID) + copy(dAtA[i:], m.ProjectID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ProjectID))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PulsarEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PulsarEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PulsarEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuthAthenzSecret != nil { + { + size, err := m.AuthAthenzSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if len(m.AuthAthenzParams) > 0 { + keysForAuthAthenzParams := make([]string, 0, len(m.AuthAthenzParams)) + for k := range m.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + for iNdEx := len(keysForAuthAthenzParams) - 1; iNdEx >= 0; iNdEx-- { + v := m.AuthAthenzParams[string(keysForAuthAthenzParams[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAuthAthenzParams[iNdEx]) + copy(dAtA[i:], keysForAuthAthenzParams[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAuthAthenzParams[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.AuthTokenSecret != nil { + { + size, err := m.AuthTokenSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i-- + if m.TLSValidateHostname { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + i-- + if m.TLSAllowInsecureConnection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.TLSTrustCertsSecret != nil { + { + size, err := m.TLSTrustCertsSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x1a + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + if len(m.Topics) > 0 { + for iNdEx := len(m.Topics) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Topics[iNdEx]) + copy(dAtA[i:], m.Topics[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topics[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PulsarTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PulsarTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PulsarTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuthAthenzSecret != nil { + { + size, err := m.AuthAthenzSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.AuthAthenzParams) > 0 { + keysForAuthAthenzParams := make([]string, 0, len(m.AuthAthenzParams)) + for k := range m.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + for iNdEx := len(keysForAuthAthenzParams) - 1; iNdEx >= 0; iNdEx-- { + v := m.AuthAthenzParams[string(keysForAuthAthenzParams[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAuthAthenzParams[iNdEx]) + copy(dAtA[i:], keysForAuthAthenzParams[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAuthAthenzParams[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a + } + } + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.AuthTokenSecret != nil { + { + size, err := m.AuthTokenSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + i-- + if m.TLSValidateHostname { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + i-- + if m.TLSAllowInsecureConnection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.TLSTrustCertsSecret != nil { + { + size, err := m.TLSTrustCertsSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RateLimit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RateLimit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.RequestsPerUnit)) + i-- + dAtA[i] = 0x10 + i -= len(m.Unit) + copy(dAtA[i:], m.Unit) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Unit))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RedisEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedisEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedisEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x52 + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Channels[iNdEx]) + copy(dAtA[i:], m.Channels[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Channels[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.DB)) + i-- + dAtA[i] = 0x20 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x1a + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.HostAddress) + copy(dAtA[i:], m.HostAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HostAddress))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RedisStreamEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedisStreamEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedisStreamEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x52 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i -= len(m.ConsumerGroup) + copy(dAtA[i:], m.ConsumerGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ConsumerGroup))) + i-- + dAtA[i] = 0x32 + i = encodeVarintGenerated(dAtA, i, uint64(m.MaxMsgCountPerRead)) + i-- + dAtA[i] = 0x28 + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Streams[iNdEx]) + copy(dAtA[i:], m.Streams[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Streams[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.DB)) + i-- + dAtA[i] = 0x18 + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.HostAddress) + copy(dAtA[i:], m.HostAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HostAddress))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.EventTypes) > 0 { + for iNdEx := len(m.EventTypes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EventTypes[iNdEx]) + copy(dAtA[i:], m.EventTypes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventTypes[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + { + size, err := m.GroupVersionResource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.AfterStart { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + { + size, err := m.CreatedBy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Fields) > 0 { + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *S3Artifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *S3Artifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *S3Artifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CACertificate != nil { + { + size, err := m.CACertificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i-- + if m.Insecure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x1a + if m.Bucket != nil { + { + size, err := m.Bucket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *S3Bucket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *S3Bucket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *S3Bucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *S3Filter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *S3Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *S3Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Suffix) + copy(dAtA[i:], m.Suffix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Suffix))) + i-- + dAtA[i] = 0x12 + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SASLConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SASLConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SASLConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PasswordSecret != nil { + { + size, err := m.PasswordSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.UserSecret != nil { + { + size, err := m.UserSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Mechanism) + copy(dAtA[i:], m.Mechanism) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Mechanism))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SFTPEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SFTPEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SFTPEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.PollIntervalDuration) + copy(dAtA[i:], m.PollIntervalDuration) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PollIntervalDuration))) + i-- + dAtA[i] = 0x4a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.SSHKeySecret != nil { + { + size, err := m.SSHKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.WatchPathConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.EventType) + copy(dAtA[i:], m.EventType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventType))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SNSEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SNSEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SNSEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x52 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + i-- + if m.ValidateSignature { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i -= len(m.RoleARN) + copy(dAtA[i:], m.RoleARN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoleARN))) + i-- + dAtA[i] = 0x32 + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x2a + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.TopicArn) + copy(dAtA[i:], m.TopicArn) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicArn))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SQSEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SQSEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SQSEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SessionToken != nil { + { + size, err := m.SessionToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x62 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + i-- + if m.DLQ { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + i -= len(m.QueueAccountID) + copy(dAtA[i:], m.QueueAccountID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueAccountID))) + i-- + dAtA[i] = 0x42 + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + i -= len(m.RoleARN) + copy(dAtA[i:], m.RoleARN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoleARN))) + i-- + dAtA[i] = 0x32 + i = encodeVarintGenerated(dAtA, i, uint64(m.WaitTimeSeconds)) + i-- + dAtA[i] = 0x28 + i -= len(m.Queue) + copy(dAtA[i:], m.Queue) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Queue))) + i-- + dAtA[i] = 0x22 + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x1a + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SchemaRegistryConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SchemaRegistryConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SchemaRegistryConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + i = encodeVarintGenerated(dAtA, i, uint64(m.SchemaID)) + i-- + dAtA[i] = 0x10 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SecureHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecureHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecureHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValueFrom != nil { + { + size, err := m.ValueFrom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Selector) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Selector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Selector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x12 + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Sensor) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sensor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sensor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SensorList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SensorList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SensorList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SensorSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SensorSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SensorSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LoggingFields) > 0 { + keysForLoggingFields := make([]string, 0, len(m.LoggingFields)) + for k := range m.LoggingFields { + keysForLoggingFields = append(keysForLoggingFields, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLoggingFields) + for iNdEx := len(keysForLoggingFields) - 1; iNdEx >= 0; iNdEx-- { + v := m.LoggingFields[string(keysForLoggingFields[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForLoggingFields[iNdEx]) + copy(dAtA[i:], keysForLoggingFields[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLoggingFields[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.RevisionHistoryLimit != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.RevisionHistoryLimit)) + i-- + dAtA[i] = 0x38 + } + if m.Replicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Replicas)) + i-- + dAtA[i] = 0x30 + } + i -= len(m.EventBusName) + copy(dAtA[i:], m.EventBusName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventBusName))) + i-- + dAtA[i] = 0x2a + i-- + if m.ErrorOnFailedRound { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if m.Template != nil { + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Triggers) > 0 { + for iNdEx := len(m.Triggers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Triggers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Dependencies) > 0 { + for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SensorStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SensorStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SensorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Service) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Service) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.ClusterIP) + copy(dAtA[i:], m.ClusterIP) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ClusterIP))) + i-- + dAtA[i] = 0x1a + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlackEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SigningSecret != nil { + { + size, err := m.SigningSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlackSender) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackSender) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackSender) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x12 + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SlackThread) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackThread) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackThread) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.BroadcastMessageToChannel { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.MessageAggregationKey) + copy(dAtA[i:], m.MessageAggregationKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MessageAggregationKey))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SlackTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Sender.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.Thread.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + i -= len(m.Blocks) + copy(dAtA[i:], m.Blocks) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Blocks))) + i-- + dAtA[i] = 0x32 + i -= len(m.Attachments) + copy(dAtA[i:], m.Attachments) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Attachments))) + i-- + dAtA[i] = 0x2a + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x22 + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Channel))) + i-- + dAtA[i] = 0x1a + if m.SlackToken != nil { + { + size, err := m.SlackToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StandardK8STrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StandardK8STrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StandardK8STrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.LiveObject { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i -= len(m.PatchStrategy) + copy(dAtA[i:], m.PatchStrategy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PatchStrategy))) + i-- + dAtA[i] = 0x22 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x12 + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Status) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Status) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StatusPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Allow) > 0 { + for iNdEx := len(m.Allow) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintGenerated(dAtA, i, uint64(m.Allow[iNdEx])) + i-- + dAtA[i] = 0x8 + } + } + return len(dAtA) - i, nil +} + +func (m *StorageGridEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageGridEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageGridEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + i -= len(m.APIURL) + copy(dAtA[i:], m.APIURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIURL))) + i-- + dAtA[i] = 0x42 + if m.AuthToken != nil { + { + size, err := m.AuthToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x32 + i -= len(m.Bucket) + copy(dAtA[i:], m.Bucket) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Bucket))) + i-- + dAtA[i] = 0x2a + i -= len(m.TopicArn) + copy(dAtA[i:], m.TopicArn) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicArn))) + i-- + dAtA[i] = 0x22 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StorageGridFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageGridFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageGridFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Suffix) + copy(dAtA[i:], m.Suffix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Suffix))) + i-- + dAtA[i] = 0x12 + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StripeEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StripeEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StripeEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.EventFilter) > 0 { + for iNdEx := len(m.EventFilter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EventFilter[iNdEx]) + copy(dAtA[i:], m.EventFilter[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventFilter[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.APIKey != nil { + { + size, err := m.APIKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i-- + if m.CreateWebhook { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TLSConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TLSConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.InsecureSkipVerify { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if m.ClientKeySecret != nil { + { + size, err := m.ClientKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClientCertSecret != nil { + { + size, err := m.ClientCertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.CACertSecret != nil { + { + size, err := m.CACertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Template) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Template) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Template) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Affinity != nil { + { + size, err := m.Affinity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x50 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x4a + if len(m.ImagePullSecrets) > 0 { + for iNdEx := len(m.ImagePullSecrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImagePullSecrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeSelector[string(keysForNodeSelector[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForNodeSelector[iNdEx]) + copy(dAtA[i:], keysForNodeSelector[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeSelector[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Volumes) > 0 { + for iNdEx := len(m.Volumes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Volumes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Container != nil { + { + size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x12 + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TimeFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TimeFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TimeFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Stop) + copy(dAtA[i:], m.Stop) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Stop))) + i-- + dAtA[i] = 0x12 + i -= len(m.Start) + copy(dAtA[i:], m.Start) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Start))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Trigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Trigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Trigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DlqTrigger != nil { + { + size, err := m.DlqTrigger.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i-- + if m.AtLeastOnce { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.RateLimit != nil { + { + size, err := m.RateLimit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.RetryStrategy != nil { + { + size, err := m.RetryStrategy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Policy != nil { + { + size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Template != nil { + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TriggerParameter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerParameter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerParameter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x1a + i -= len(m.Dest) + copy(dAtA[i:], m.Dest) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Dest))) + i-- + dAtA[i] = 0x12 + if m.Src != nil { + { + size, err := m.Src.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TriggerParameterSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerParameterSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerParameterSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.UseRawData { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if m.Value != nil { + i -= len(*m.Value) + copy(dAtA[i:], *m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Value))) + i-- + dAtA[i] = 0x32 + } + i -= len(m.DataTemplate) + copy(dAtA[i:], m.DataTemplate) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataTemplate))) + i-- + dAtA[i] = 0x2a + i -= len(m.DataKey) + copy(dAtA[i:], m.DataKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataKey))) + i-- + dAtA[i] = 0x22 + i -= len(m.ContextTemplate) + copy(dAtA[i:], m.ContextTemplate) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContextTemplate))) + i-- + dAtA[i] = 0x1a + i -= len(m.ContextKey) + copy(dAtA[i:], m.ContextKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContextKey))) + i-- + dAtA[i] = 0x12 + i -= len(m.DependencyName) + copy(dAtA[i:], m.DependencyName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DependencyName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TriggerPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.K8s != nil { + { + size, err := m.K8s.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TriggerTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Email != nil { + { + size, err := m.Email.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.AzureServiceBus != nil { + { + size, err := m.AzureServiceBus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.ConditionsReset) > 0 { + for iNdEx := len(m.ConditionsReset) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConditionsReset[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + } + if m.Pulsar != nil { + { + size, err := m.Pulsar.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.AzureEventHubs != nil { + { + size, err := m.AzureEventHubs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.Log != nil { + { + size, err := m.Log.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.OpenWhisk != nil { + { + size, err := m.OpenWhisk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.Slack != nil { + { + size, err := m.Slack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.NATS != nil { + { + size, err := m.NATS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Kafka != nil { + { + size, err := m.Kafka.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.CustomTrigger != nil { + { + size, err := m.CustomTrigger.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.AWSLambda != nil { + { + size, err := m.AWSLambda.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.HTTP != nil { + { + size, err := m.HTTP.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ArgoWorkflow != nil { + { + size, err := m.ArgoWorkflow.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.K8s != nil { + { + size, err := m.K8s.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Conditions) + copy(dAtA[i:], m.Conditions) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Conditions))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *URLArtifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *URLArtifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *URLArtifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.VerifyCert { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ValueFromSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValueFromSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueFromSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConfigMapKeyRef != nil { + { + size, err := m.ConfigMapKeyRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SecretKeyRef != nil { + { + size, err := m.SecretKeyRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WatchPathConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WatchPathConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchPathConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.PathRegexp) + copy(dAtA[i:], m.PathRegexp) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PathRegexp))) + i-- + dAtA[i] = 0x1a + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + i -= len(m.Directory) + copy(dAtA[i:], m.Directory) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Directory))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WebhookContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WebhookContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WebhookContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxPayloadSize != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxPayloadSize)) + i-- + dAtA[i] = 0x48 + } + if m.AuthSecret != nil { + { + size, err := m.AuthSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.ServerKeySecret != nil { + { + size, err := m.ServerKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.ServerCertSecret != nil { + { + size, err := m.ServerCertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x22 + i -= len(m.Port) + copy(dAtA[i:], m.Port) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Port))) + i-- + dAtA[i] = 0x1a + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x12 + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WebhookEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WebhookEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WebhookEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.WebhookContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AMQPConsumeConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerTag) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + n += 2 + n += 2 + return n +} + +func (m *AMQPEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ExchangeName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ExchangeType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RoutingKey) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.ExchangeDeclare != nil { + l = m.ExchangeDeclare.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.QueueDeclare != nil { + l = m.QueueDeclare.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.QueueBind != nil { + l = m.QueueBind.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Consume != nil { + l = m.Consume.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.URLSecret != nil { + l = m.URLSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *AMQPExchangeDeclareConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + n += 2 + n += 2 + n += 2 + return n +} + +func (m *AMQPQueueBindConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} + +func (m *AMQPQueueDeclareConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + n += 2 + n += 2 + l = len(m.Arguments) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AWSLambdaTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FunctionName) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.InvocationType != nil { + l = len(*m.InvocationType) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.RoleARN) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Amount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ArgoWorkflowTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ArtifactLocation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.S3 != nil { + l = m.S3.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Inline != nil { + l = len(*m.Inline) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.File != nil { + l = m.File.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.URL != nil { + l = m.URL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Configmap != nil { + l = m.Configmap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Git != nil { + l = m.Git.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Resource != nil { + l = m.Resource.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *AzureEventHubsTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FQDN) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.HubName) + n += 1 + l + sovGenerated(uint64(l)) + if m.SharedAccessKeyName != nil { + l = m.SharedAccessKeyName.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SharedAccessKey != nil { + l = m.SharedAccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *AzureEventsHubEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FQDN) + n += 1 + l + sovGenerated(uint64(l)) + if m.SharedAccessKeyName != nil { + l = m.SharedAccessKeyName.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SharedAccessKey != nil { + l = m.SharedAccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.HubName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *AzureQueueStorageEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StorageAccountName) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionString != nil { + l = m.ConnectionString.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.QueueName) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.WaitTimeInSeconds != nil { + n += 1 + sovGenerated(uint64(*m.WaitTimeInSeconds)) + } + return n +} + +func (m *AzureServiceBusEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConnectionString != nil { + l = m.ConnectionString.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.QueueName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TopicName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SubscriptionName) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.FullyQualifiedNamespace) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AzureServiceBusTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConnectionString != nil { + l = m.ConnectionString.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.QueueName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TopicName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SubscriptionName) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *Backoff) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Duration != nil { + l = m.Duration.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Factor != nil { + l = m.Factor.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Jitter != nil { + l = m.Jitter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.Steps)) + return n +} + +func (m *BasicAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.OAuthToken != nil { + l = m.OAuthToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketBasicAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.DeprecatedOwner) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedProjectKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedRepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Repositories) > 0 { + for _, e := range m.Repositories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketRepository) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *BitbucketServerEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.DeprecatedProjectKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedRepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Repositories) > 0 { + for _, e := range m.Repositories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + n += 2 + if m.AccessToken != nil { + l = m.AccessToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WebhookSecret != nil { + l = m.WebhookSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.BitbucketServerBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.CheckInterval) + n += 2 + l + sovGenerated(uint64(l)) + return n +} + +func (m *BitbucketServerRepository) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *BusConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NATS != nil { + l = m.NATS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.JetStream != nil { + l = m.JetStream.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Kafka != nil { + l = m.Kafka.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CalendarEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Schedule) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Interval) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.ExclusionDates) > 0 { + for _, s := range m.ExclusionDates { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Timezone) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CatchupConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + l = len(m.MaxDuration) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Condition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ConditionsResetByTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cron) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Timezone) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ConditionsResetCriteria) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ByTime != nil { + l = m.ByTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ConfigMapPersistence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *Container) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Resources.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ImagePullPolicy) + n += 1 + l + sovGenerated(uint64(l)) + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.VolumeMounts) > 0 { + for _, e := range m.VolumeMounts { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, e := range m.Env { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.EnvFrom) > 0 { + for _, e := range m.EnvFrom { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ContainerTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Resources.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ImagePullPolicy) + n += 1 + l + sovGenerated(uint64(l)) + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CustomTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServerURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.CertSecret != nil { + l = m.CertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ServerNameOverride) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Spec) > 0 { + for k, v := range m.Spec { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DataFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Value) > 0 { + for _, s := range m.Value { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Comparator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Template) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EmailTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + if m.SMTPPassword != nil { + l = m.SMTPPassword.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Host) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Port)) + if len(m.To) > 0 { + for _, s := range m.To { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.From) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Body) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EmitterEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Broker) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ChannelKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ChannelName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *Event) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EventBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventBusList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *EventBusSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NATS != nil { + l = m.NATS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.JetStream != nil { + l = m.JetStream.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Kafka != nil { + l = m.Kafka.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.JetStreamExotic != nil { + l = m.JetStreamExotic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EventBusStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Config.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Source) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SpecVersion) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DataContentType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventDependency) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.EventSourceName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.EventName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Filters != nil { + l = m.Filters.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Transform != nil { + l = m.Transform.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.FiltersLogicalOperator) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventDependencyFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Time != nil { + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Data) > 0 { + for _, e := range m.Data { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Exprs) > 0 { + for _, e := range m.Exprs { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.DataLogicalOperator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ExprLogicalOperator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Script) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventDependencyTransformer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.JQ) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Script) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventPersistence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Catchup != nil { + l = m.Catchup.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConfigMap != nil { + l = m.ConfigMap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventSourceFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expression) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventSourceList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *EventSourceSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EventBusName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Minio) > 0 { + for k, v := range m.Minio { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Calendar) > 0 { + for k, v := range m.Calendar { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.File) > 0 { + for k, v := range m.File { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Resource) > 0 { + for k, v := range m.Resource { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Webhook) > 0 { + for k, v := range m.Webhook { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AMQP) > 0 { + for k, v := range m.AMQP { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Kafka) > 0 { + for k, v := range m.Kafka { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.MQTT) > 0 { + for k, v := range m.MQTT { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.NATS) > 0 { + for k, v := range m.NATS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SNS) > 0 { + for k, v := range m.SNS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SQS) > 0 { + for k, v := range m.SQS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.PubSub) > 0 { + for k, v := range m.PubSub { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Github) > 0 { + for k, v := range m.Github { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Gitlab) > 0 { + for k, v := range m.Gitlab { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.HDFS) > 0 { + for k, v := range m.HDFS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Slack) > 0 { + for k, v := range m.Slack { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.StorageGrid) > 0 { + for k, v := range m.StorageGrid { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AzureEventsHub) > 0 { + for k, v := range m.AzureEventsHub { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Stripe) > 0 { + for k, v := range m.Stripe { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Emitter) > 0 { + for k, v := range m.Emitter { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Redis) > 0 { + for k, v := range m.Redis { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.NSQ) > 0 { + for k, v := range m.NSQ { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Pulsar) > 0 { + for k, v := range m.Pulsar { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Generic) > 0 { + for k, v := range m.Generic { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Replicas != nil { + n += 2 + sovGenerated(uint64(*m.Replicas)) + } + if len(m.BitbucketServer) > 0 { + for k, v := range m.BitbucketServer { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Bitbucket) > 0 { + for k, v := range m.Bitbucket { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.RedisStream) > 0 { + for k, v := range m.RedisStream { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AzureServiceBus) > 0 { + for k, v := range m.AzureServiceBus { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AzureQueueStorage) > 0 { + for k, v := range m.AzureQueueStorage { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SFTP) > 0 { + for k, v := range m.SFTP { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Gerrit) > 0 { + for k, v := range m.Gerrit { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *EventSourceStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ExprFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expr) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Fields) > 0 { + for _, e := range m.Fields { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *FileArtifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *FileEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EventType) + n += 1 + l + sovGenerated(uint64(l)) + l = m.WatchPathConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GenericEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Config) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthSecret != nil { + l = m.AuthSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GerritEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.HookName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.GerritBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GitArtifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.CloneDirectory) + n += 1 + l + sovGenerated(uint64(l)) + if m.Creds != nil { + l = m.Creds.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SSHKeySecret != nil { + l = m.SSHKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.FilePath) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Branch) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Tag) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Ref) + n += 1 + l + sovGenerated(uint64(l)) + if m.Remote != nil { + l = m.Remote.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *GitCreds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GitRemoteConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.URLS) > 0 { + for _, s := range m.URLS { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *GithubAppCreds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PrivateKey != nil { + l = m.PrivateKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.AppID)) + n += 1 + sovGenerated(uint64(m.InstallationID)) + return n +} + +func (m *GithubEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.ID)) + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.DeprecatedOwner) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedRepository) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.APIToken != nil { + l = m.APIToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WebhookSecret != nil { + l = m.WebhookSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + l = len(m.ContentType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.GithubBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.GithubUploadURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Repositories) > 0 { + for _, e := range m.Repositories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Organizations) > 0 { + for _, s := range m.Organizations { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if m.GithubApp != nil { + l = m.GithubApp.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GitlabEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.DeprecatedProjectID) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.AccessToken != nil { + l = m.AccessToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + l = len(m.GitlabBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SecretToken != nil { + l = m.SecretToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Groups) > 0 { + for _, s := range m.Groups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *HDFSEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.WatchPathConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.CheckInterval) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.HDFSUser) + n += 1 + l + sovGenerated(uint64(l)) + if m.KrbCCacheSecret != nil { + l = m.KrbCCacheSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.KrbKeytabSecret != nil { + l = m.KrbKeytabSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.KrbUsername) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.KrbRealm) + n += 1 + l + sovGenerated(uint64(l)) + if m.KrbConfigConfigMap != nil { + l = m.KrbConfigConfigMap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.KrbServicePrincipalName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *HTTPTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Method) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 1 + sovGenerated(uint64(m.Timeout)) + if m.BasicAuth != nil { + l = m.BasicAuth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Headers) > 0 { + for k, v := range m.Headers { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SecureHeaders) > 0 { + for _, e := range m.SecureHeaders { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *Int64OrString) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Type)) + n += 1 + sovGenerated(uint64(m.Int64Val)) + l = len(m.StrVal) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *JetStreamBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.Replicas != nil { + n += 1 + sovGenerated(uint64(*m.Replicas)) + } + if m.ContainerTemplate != nil { + l = m.ContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ReloaderContainerTemplate != nil { + l = m.ReloaderContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MetricsContainerTemplate != nil { + l = m.MetricsContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ImagePullSecrets) > 0 { + for _, e := range m.ImagePullSecrets { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.Affinity != nil { + l = m.Affinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Settings != nil { + l = len(*m.Settings) + n += 2 + l + sovGenerated(uint64(l)) + } + if len(m.StartArgs) > 0 { + for _, s := range m.StartArgs { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if m.StreamConfig != nil { + l = len(*m.StreamConfig) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.MaxPayload != nil { + l = len(*m.MaxPayload) + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *JetStreamConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessSecret != nil { + l = m.AccessSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.StreamConfig) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *K8SResource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *K8SResourcePolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Backoff != nil { + l = m.Backoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *KafkaBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SASL != nil { + l = m.SASL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConsumerGroup != nil { + l = m.ConsumerGroup.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *KafkaConsumerGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GroupName) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + l = len(m.RebalanceStrategy) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *KafkaEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Partition) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.ConsumerGroup != nil { + l = m.ConsumerGroup.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.LimitEventsPerSecond)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.SASL != nil { + l = m.SASL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Config) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *KafkaTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Partition)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 1 + sovGenerated(uint64(m.RequiredAcks)) + n += 2 + n += 1 + sovGenerated(uint64(m.FlushFrequency)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.PartitioningKey != nil { + l = len(*m.PartitioningKey) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.SASL != nil { + l = m.SASL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SchemaRegistry != nil { + l = m.SchemaRegistry.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Headers) > 0 { + for k, v := range m.Headers { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SecureHeaders) > 0 { + for _, e := range m.SecureHeaders { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *LogTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.IntervalSeconds)) + return n +} + +func (m *MQTTEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ClientID) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *NATSAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NKey != nil { + l = m.NKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Credential != nil { + l = m.Credential.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Native != nil { + l = m.Native.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Exotic != nil { + l = m.Exotic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.ClusterID != nil { + l = len(*m.ClusterID) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = len(*m.Auth) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AccessSecret != nil { + l = m.AccessSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSEventsSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Queue != nil { + l = len(*m.Queue) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NSQEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostAddress) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Channel) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NativeStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Replicas)) + if m.Auth != nil { + l = len(*m.Auth) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ContainerTemplate != nil { + l = m.ContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MetricsContainerTemplate != nil { + l = m.MetricsContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxAge != nil { + l = len(*m.MaxAge) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ImagePullSecrets) > 0 { + for _, e := range m.ImagePullSecrets { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.Affinity != nil { + l = m.Affinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxMsgs != nil { + n += 2 + sovGenerated(uint64(*m.MaxMsgs)) + } + if m.MaxBytes != nil { + l = len(*m.MaxBytes) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.MaxSubs != nil { + n += 2 + sovGenerated(uint64(*m.MaxSubs)) + } + if m.MaxPayload != nil { + l = len(*m.MaxPayload) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftHeartbeatTimeout != nil { + l = len(*m.RaftHeartbeatTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftElectionTimeout != nil { + l = len(*m.RaftElectionTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftLeaseTimeout != nil { + l = len(*m.RaftLeaseTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftCommitTimeout != nil { + l = len(*m.RaftCommitTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *OpenWhiskTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Host) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + if m.AuthToken != nil { + l = m.AuthToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ActionName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *OwnedRepositories) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PayloadField) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PersistenceStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StorageClassName != nil { + l = len(*m.StorageClassName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AccessMode != nil { + l = len(*m.AccessMode) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.VolumeSize != nil { + l = m.VolumeSize.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PubSubEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TopicProjectID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SubscriptionID) + n += 1 + l + sovGenerated(uint64(l)) + if m.CredentialSecret != nil { + l = m.CredentialSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PulsarEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topics) > 0 { + for _, s := range m.Topics { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLSTrustCertsSecret != nil { + l = m.TLSTrustCertsSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthTokenSecret != nil { + l = m.AuthTokenSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.AuthAthenzParams) > 0 { + for k, v := range m.AuthAthenzParams { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthAthenzSecret != nil { + l = m.AuthAthenzSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PulsarTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLSTrustCertsSecret != nil { + l = m.TLSTrustCertsSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AuthTokenSecret != nil { + l = m.AuthTokenSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.AuthAthenzParams) > 0 { + for k, v := range m.AuthAthenzParams { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthAthenzSecret != nil { + l = m.AuthAthenzSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *RateLimit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Unit) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.RequestsPerUnit)) + return n +} + +func (m *RedisEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostAddress) + n += 1 + l + sovGenerated(uint64(l)) + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.DB)) + if len(m.Channels) > 0 { + for _, s := range m.Channels { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *RedisStreamEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostAddress) + n += 1 + l + sovGenerated(uint64(l)) + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.DB)) + if len(m.Streams) > 0 { + for _, s := range m.Streams { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 1 + sovGenerated(uint64(m.MaxMsgCountPerRead)) + l = len(m.ConsumerGroup) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ResourceEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.GroupVersionResource.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.EventTypes) > 0 { + for _, s := range m.EventTypes { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *ResourceFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Fields) > 0 { + for _, e := range m.Fields { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.CreatedBy.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *S3Artifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + if m.Bucket != nil { + l = m.Bucket.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.CACertificate != nil { + l = m.CACertificate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *S3Bucket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *S3Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Suffix) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SASLConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Mechanism) + n += 1 + l + sovGenerated(uint64(l)) + if m.UserSecret != nil { + l = m.UserSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.PasswordSecret != nil { + l = m.PasswordSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SFTPEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EventType) + n += 1 + l + sovGenerated(uint64(l)) + l = m.WatchPathConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SSHKeySecret != nil { + l = m.SSHKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PollIntervalDuration) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SNSEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.TopicArn) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RoleARN) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 2 + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SQSEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Queue) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.WaitTimeSeconds)) + l = len(m.RoleARN) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + l = len(m.QueueAccountID) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 2 + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + if m.SessionToken != nil { + l = m.SessionToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SchemaRegistryConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.SchemaID)) + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SecureHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ValueFrom != nil { + l = m.ValueFrom.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *Selector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Sensor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SensorList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *SensorSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Dependencies) > 0 { + for _, e := range m.Dependencies { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Triggers) > 0 { + for _, e := range m.Triggers { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + l = len(m.EventBusName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Replicas != nil { + n += 1 + sovGenerated(uint64(*m.Replicas)) + } + if m.RevisionHistoryLimit != nil { + n += 1 + sovGenerated(uint64(*m.RevisionHistoryLimit)) + } + if len(m.LoggingFields) > 0 { + for k, v := range m.LoggingFields { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *SensorStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Service) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.ClusterIP) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SlackEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SigningSecret != nil { + l = m.SigningSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SlackSender) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Icon) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SlackThread) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MessageAggregationKey) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *SlackTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SlackToken != nil { + l = m.SlackToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Channel) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Attachments) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Blocks) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Thread.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Sender.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *StandardK8STrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.PatchStrategy) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *Status) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *StatusPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allow) > 0 { + for _, e := range m.Allow { + n += 1 + sovGenerated(uint64(e)) + } + } + return n +} + +func (m *StorageGridEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.TopicArn) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Bucket) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + if m.AuthToken != nil { + l = m.AuthToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.APIURL) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *StorageGridFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Suffix) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *StripeEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.APIKey != nil { + l = m.APIKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.EventFilter) > 0 { + for _, s := range m.EventFilter { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *TLSConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CACertSecret != nil { + l = m.CACertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ClientCertSecret != nil { + l = m.ClientCertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ClientKeySecret != nil { + l = m.ClientKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *Template) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.ImagePullSecrets) > 0 { + for _, e := range m.ImagePullSecrets { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.Affinity != nil { + l = m.Affinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TimeFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Start) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Stop) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Trigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Policy != nil { + l = m.Policy.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.RetryStrategy != nil { + l = m.RetryStrategy.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.RateLimit != nil { + l = m.RateLimit.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.DlqTrigger != nil { + l = m.DlqTrigger.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TriggerParameter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Src != nil { + l = m.Src.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Dest) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *TriggerParameterSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DependencyName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ContextKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ContextTemplate) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DataKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DataTemplate) + n += 1 + l + sovGenerated(uint64(l)) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *TriggerPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.K8s != nil { + l = m.K8s.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TriggerTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Conditions) + n += 1 + l + sovGenerated(uint64(l)) + if m.K8s != nil { + l = m.K8s.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ArgoWorkflow != nil { + l = m.ArgoWorkflow.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.HTTP != nil { + l = m.HTTP.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AWSLambda != nil { + l = m.AWSLambda.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.CustomTrigger != nil { + l = m.CustomTrigger.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Kafka != nil { + l = m.Kafka.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NATS != nil { + l = m.NATS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Slack != nil { + l = m.Slack.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.OpenWhisk != nil { + l = m.OpenWhisk.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Log != nil { + l = m.Log.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AzureEventHubs != nil { + l = m.AzureEventHubs.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Pulsar != nil { + l = m.Pulsar.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ConditionsReset) > 0 { + for _, e := range m.ConditionsReset { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.AzureServiceBus != nil { + l = m.AzureServiceBus.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + if m.Email != nil { + l = m.Email.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *URLArtifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *ValueFromSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SecretKeyRef != nil { + l = m.SecretKeyRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConfigMapKeyRef != nil { + l = m.ConfigMapKeyRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WatchPathConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Directory) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PathRegexp) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *WebhookContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Method) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Port) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.ServerCertSecret != nil { + l = m.ServerCertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ServerKeySecret != nil { + l = m.ServerKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthSecret != nil { + l = m.AuthSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxPayloadSize != nil { + n += 1 + sovGenerated(uint64(*m.MaxPayloadSize)) + } + return n +} + +func (m *WebhookEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.WebhookContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AMQPConsumeConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPConsumeConfig{`, + `ConsumerTag:` + fmt.Sprintf("%v", this.ConsumerTag) + `,`, + `AutoAck:` + fmt.Sprintf("%v", this.AutoAck) + `,`, + `Exclusive:` + fmt.Sprintf("%v", this.Exclusive) + `,`, + `NoLocal:` + fmt.Sprintf("%v", this.NoLocal) + `,`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AMQPEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `ExchangeName:` + fmt.Sprintf("%v", this.ExchangeName) + `,`, + `ExchangeType:` + fmt.Sprintf("%v", this.ExchangeType) + `,`, + `RoutingKey:` + fmt.Sprintf("%v", this.RoutingKey) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `ExchangeDeclare:` + strings.Replace(this.ExchangeDeclare.String(), "AMQPExchangeDeclareConfig", "AMQPExchangeDeclareConfig", 1) + `,`, + `QueueDeclare:` + strings.Replace(this.QueueDeclare.String(), "AMQPQueueDeclareConfig", "AMQPQueueDeclareConfig", 1) + `,`, + `QueueBind:` + strings.Replace(this.QueueBind.String(), "AMQPQueueBindConfig", "AMQPQueueBindConfig", 1) + `,`, + `Consume:` + strings.Replace(this.Consume.String(), "AMQPConsumeConfig", "AMQPConsumeConfig", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `URLSecret:` + strings.Replace(fmt.Sprintf("%v", this.URLSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPExchangeDeclareConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPExchangeDeclareConfig{`, + `Durable:` + fmt.Sprintf("%v", this.Durable) + `,`, + `AutoDelete:` + fmt.Sprintf("%v", this.AutoDelete) + `,`, + `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPQueueBindConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPQueueBindConfig{`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPQueueDeclareConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPQueueDeclareConfig{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Durable:` + fmt.Sprintf("%v", this.Durable) + `,`, + `AutoDelete:` + fmt.Sprintf("%v", this.AutoDelete) + `,`, + `Exclusive:` + fmt.Sprintf("%v", this.Exclusive) + `,`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `Arguments:` + fmt.Sprintf("%v", this.Arguments) + `,`, + `}`, + }, "") + return s +} +func (this *AWSLambdaTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&AWSLambdaTrigger{`, + `FunctionName:` + fmt.Sprintf("%v", this.FunctionName) + `,`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `InvocationType:` + valueToStringGenerated(this.InvocationType) + `,`, + `RoleARN:` + fmt.Sprintf("%v", this.RoleARN) + `,`, + `}`, + }, "") + return s +} +func (this *Amount) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Amount{`, + `Value:` + valueToStringGenerated(this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *ArgoWorkflowTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&ArgoWorkflowTrigger{`, + `Source:` + strings.Replace(this.Source.String(), "ArtifactLocation", "ArtifactLocation", 1) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Args:` + fmt.Sprintf("%v", this.Args) + `,`, + `}`, + }, "") + return s +} +func (this *ArtifactLocation) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ArtifactLocation{`, + `S3:` + strings.Replace(this.S3.String(), "S3Artifact", "S3Artifact", 1) + `,`, + `Inline:` + valueToStringGenerated(this.Inline) + `,`, + `File:` + strings.Replace(this.File.String(), "FileArtifact", "FileArtifact", 1) + `,`, + `URL:` + strings.Replace(this.URL.String(), "URLArtifact", "URLArtifact", 1) + `,`, + `Configmap:` + strings.Replace(fmt.Sprintf("%v", this.Configmap), "ConfigMapKeySelector", "v1.ConfigMapKeySelector", 1) + `,`, + `Git:` + strings.Replace(this.Git.String(), "GitArtifact", "GitArtifact", 1) + `,`, + `Resource:` + strings.Replace(this.Resource.String(), "K8SResource", "K8SResource", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AzureEventHubsTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&AzureEventHubsTrigger{`, + `FQDN:` + fmt.Sprintf("%v", this.FQDN) + `,`, + `HubName:` + fmt.Sprintf("%v", this.HubName) + `,`, + `SharedAccessKeyName:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKeyName), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SharedAccessKey:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `}`, + }, "") + return s +} +func (this *AzureEventsHubEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AzureEventsHubEventSource{`, + `FQDN:` + fmt.Sprintf("%v", this.FQDN) + `,`, + `SharedAccessKeyName:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKeyName), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SharedAccessKey:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `HubName:` + fmt.Sprintf("%v", this.HubName) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AzureQueueStorageEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AzureQueueStorageEventSource{`, + `StorageAccountName:` + fmt.Sprintf("%v", this.StorageAccountName) + `,`, + `ConnectionString:` + strings.Replace(fmt.Sprintf("%v", this.ConnectionString), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `QueueName:` + fmt.Sprintf("%v", this.QueueName) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `DLQ:` + fmt.Sprintf("%v", this.DLQ) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `DecodeMessage:` + fmt.Sprintf("%v", this.DecodeMessage) + `,`, + `WaitTimeInSeconds:` + valueToStringGenerated(this.WaitTimeInSeconds) + `,`, + `}`, + }, "") + return s +} +func (this *AzureServiceBusEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AzureServiceBusEventSource{`, + `ConnectionString:` + strings.Replace(fmt.Sprintf("%v", this.ConnectionString), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `QueueName:` + fmt.Sprintf("%v", this.QueueName) + `,`, + `TopicName:` + fmt.Sprintf("%v", this.TopicName) + `,`, + `SubscriptionName:` + fmt.Sprintf("%v", this.SubscriptionName) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `FullyQualifiedNamespace:` + fmt.Sprintf("%v", this.FullyQualifiedNamespace) + `,`, + `}`, + }, "") + return s +} +func (this *AzureServiceBusTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&AzureServiceBusTrigger{`, + `ConnectionString:` + strings.Replace(fmt.Sprintf("%v", this.ConnectionString), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `QueueName:` + fmt.Sprintf("%v", this.QueueName) + `,`, + `TopicName:` + fmt.Sprintf("%v", this.TopicName) + `,`, + `SubscriptionName:` + fmt.Sprintf("%v", this.SubscriptionName) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `}`, + }, "") + return s +} +func (this *Backoff) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Backoff{`, + `Duration:` + strings.Replace(this.Duration.String(), "Int64OrString", "Int64OrString", 1) + `,`, + `Factor:` + strings.Replace(this.Factor.String(), "Amount", "Amount", 1) + `,`, + `Jitter:` + strings.Replace(this.Jitter.String(), "Amount", "Amount", 1) + `,`, + `Steps:` + fmt.Sprintf("%v", this.Steps) + `,`, + `}`, + }, "") + return s +} +func (this *BasicAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BasicAuth{`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketAuth{`, + `Basic:` + strings.Replace(this.Basic.String(), "BitbucketBasicAuth", "BitbucketBasicAuth", 1) + `,`, + `OAuthToken:` + strings.Replace(fmt.Sprintf("%v", this.OAuthToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketBasicAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketBasicAuth{`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketEventSource) String() string { + if this == nil { + return "nil" + } + repeatedStringForRepositories := "[]BitbucketRepository{" + for _, f := range this.Repositories { + repeatedStringForRepositories += strings.Replace(strings.Replace(f.String(), "BitbucketRepository", "BitbucketRepository", 1), `&`, ``, 1) + "," + } + repeatedStringForRepositories += "}" + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&BitbucketEventSource{`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BitbucketAuth", "BitbucketAuth", 1) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `DeprecatedOwner:` + fmt.Sprintf("%v", this.DeprecatedOwner) + `,`, + `DeprecatedProjectKey:` + fmt.Sprintf("%v", this.DeprecatedProjectKey) + `,`, + `DeprecatedRepositorySlug:` + fmt.Sprintf("%v", this.DeprecatedRepositorySlug) + `,`, + `Repositories:` + repeatedStringForRepositories + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketRepository) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketRepository{`, + `Owner:` + fmt.Sprintf("%v", this.Owner) + `,`, + `RepositorySlug:` + fmt.Sprintf("%v", this.RepositorySlug) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketServerEventSource) String() string { + if this == nil { + return "nil" + } + repeatedStringForRepositories := "[]BitbucketServerRepository{" + for _, f := range this.Repositories { + repeatedStringForRepositories += strings.Replace(strings.Replace(f.String(), "BitbucketServerRepository", "BitbucketServerRepository", 1), `&`, ``, 1) + "," + } + repeatedStringForRepositories += "}" + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&BitbucketServerEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `DeprecatedProjectKey:` + fmt.Sprintf("%v", this.DeprecatedProjectKey) + `,`, + `DeprecatedRepositorySlug:` + fmt.Sprintf("%v", this.DeprecatedRepositorySlug) + `,`, + `Projects:` + fmt.Sprintf("%v", this.Projects) + `,`, + `Repositories:` + repeatedStringForRepositories + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `SkipBranchRefsChangedOnOpenPR:` + fmt.Sprintf("%v", this.SkipBranchRefsChangedOnOpenPR) + `,`, + `OneEventPerChange:` + fmt.Sprintf("%v", this.OneEventPerChange) + `,`, + `AccessToken:` + strings.Replace(fmt.Sprintf("%v", this.AccessToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `WebhookSecret:` + strings.Replace(fmt.Sprintf("%v", this.WebhookSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `BitbucketServerBaseURL:` + fmt.Sprintf("%v", this.BitbucketServerBaseURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `CheckInterval:` + fmt.Sprintf("%v", this.CheckInterval) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketServerRepository) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketServerRepository{`, + `ProjectKey:` + fmt.Sprintf("%v", this.ProjectKey) + `,`, + `RepositorySlug:` + fmt.Sprintf("%v", this.RepositorySlug) + `,`, + `}`, + }, "") + return s +} +func (this *BusConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BusConfig{`, + `NATS:` + strings.Replace(this.NATS.String(), "NATSConfig", "NATSConfig", 1) + `,`, + `JetStream:` + strings.Replace(this.JetStream.String(), "JetStreamConfig", "JetStreamConfig", 1) + `,`, + `Kafka:` + strings.Replace(this.Kafka.String(), "KafkaBus", "KafkaBus", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CalendarEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&CalendarEventSource{`, + `Schedule:` + fmt.Sprintf("%v", this.Schedule) + `,`, + `Interval:` + fmt.Sprintf("%v", this.Interval) + `,`, + `ExclusionDates:` + fmt.Sprintf("%v", this.ExclusionDates) + `,`, + `Timezone:` + fmt.Sprintf("%v", this.Timezone) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Persistence:` + strings.Replace(this.Persistence.String(), "EventPersistence", "EventPersistence", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CatchupConfiguration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CatchupConfiguration{`, + `Enabled:` + fmt.Sprintf("%v", this.Enabled) + `,`, + `MaxDuration:` + fmt.Sprintf("%v", this.MaxDuration) + `,`, + `}`, + }, "") + return s +} +func (this *Condition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Condition{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v11.Time", 1), `&`, ``, 1) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *ConditionsResetByTime) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConditionsResetByTime{`, + `Cron:` + fmt.Sprintf("%v", this.Cron) + `,`, + `Timezone:` + fmt.Sprintf("%v", this.Timezone) + `,`, + `}`, + }, "") + return s +} +func (this *ConditionsResetCriteria) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConditionsResetCriteria{`, + `ByTime:` + strings.Replace(this.ByTime.String(), "ConditionsResetByTime", "ConditionsResetByTime", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ConfigMapPersistence) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConfigMapPersistence{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `CreateIfNotExist:` + fmt.Sprintf("%v", this.CreateIfNotExist) + `,`, + `}`, + }, "") + return s +} +func (this *Container) String() string { + if this == nil { + return "nil" + } + repeatedStringForVolumeMounts := "[]VolumeMount{" + for _, f := range this.VolumeMounts { + repeatedStringForVolumeMounts += fmt.Sprintf("%v", f) + "," + } + repeatedStringForVolumeMounts += "}" + repeatedStringForEnv := "[]EnvVar{" + for _, f := range this.Env { + repeatedStringForEnv += fmt.Sprintf("%v", f) + "," + } + repeatedStringForEnv += "}" + repeatedStringForEnvFrom := "[]EnvFromSource{" + for _, f := range this.EnvFrom { + repeatedStringForEnvFrom += fmt.Sprintf("%v", f) + "," + } + repeatedStringForEnvFrom += "}" + s := strings.Join([]string{`&Container{`, + `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "v1.ResourceRequirements", 1), `&`, ``, 1) + `,`, + `ImagePullPolicy:` + fmt.Sprintf("%v", this.ImagePullPolicy) + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "SecurityContext", "v1.SecurityContext", 1) + `,`, + `VolumeMounts:` + repeatedStringForVolumeMounts + `,`, + `Env:` + repeatedStringForEnv + `,`, + `EnvFrom:` + repeatedStringForEnvFrom + `,`, + `}`, + }, "") + return s +} +func (this *ContainerTemplate) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ContainerTemplate{`, + `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "v1.ResourceRequirements", 1), `&`, ``, 1) + `,`, + `ImagePullPolicy:` + fmt.Sprintf("%v", this.ImagePullPolicy) + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "SecurityContext", "v1.SecurityContext", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CustomTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + keysForSpec := make([]string, 0, len(this.Spec)) + for k := range this.Spec { + keysForSpec = append(keysForSpec, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSpec) + mapStringForSpec := "map[string]string{" + for _, k := range keysForSpec { + mapStringForSpec += fmt.Sprintf("%v: %v,", k, this.Spec[k]) + } + mapStringForSpec += "}" + s := strings.Join([]string{`&CustomTrigger{`, + `ServerURL:` + fmt.Sprintf("%v", this.ServerURL) + `,`, + `Secure:` + fmt.Sprintf("%v", this.Secure) + `,`, + `CertSecret:` + strings.Replace(fmt.Sprintf("%v", this.CertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ServerNameOverride:` + fmt.Sprintf("%v", this.ServerNameOverride) + `,`, + `Spec:` + mapStringForSpec + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `}`, + }, "") + return s +} +func (this *DataFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DataFilter{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `Comparator:` + fmt.Sprintf("%v", this.Comparator) + `,`, + `Template:` + fmt.Sprintf("%v", this.Template) + `,`, + `}`, + }, "") + return s +} +func (this *EmailTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&EmailTrigger{`, + `Parameters:` + repeatedStringForParameters + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `SMTPPassword:` + strings.Replace(fmt.Sprintf("%v", this.SMTPPassword), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Host:` + fmt.Sprintf("%v", this.Host) + `,`, + `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + `To:` + fmt.Sprintf("%v", this.To) + `,`, + `From:` + fmt.Sprintf("%v", this.From) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `Body:` + fmt.Sprintf("%v", this.Body) + `,`, + `}`, + }, "") + return s +} +func (this *EmitterEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&EmitterEventSource{`, + `Broker:` + fmt.Sprintf("%v", this.Broker) + `,`, + `ChannelKey:` + fmt.Sprintf("%v", this.ChannelKey) + `,`, + `ChannelName:` + fmt.Sprintf("%v", this.ChannelName) + `,`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventBus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventBus{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "EventBusSpec", "EventBusSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "EventBusStatus", "EventBusStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventBusList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]EventBus{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EventBus", "EventBus", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&EventBusList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *EventBusSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventBusSpec{`, + `NATS:` + strings.Replace(this.NATS.String(), "NATSBus", "NATSBus", 1) + `,`, + `JetStream:` + strings.Replace(this.JetStream.String(), "JetStreamBus", "JetStreamBus", 1) + `,`, + `Kafka:` + strings.Replace(this.Kafka.String(), "KafkaBus", "KafkaBus", 1) + `,`, + `JetStreamExotic:` + strings.Replace(this.JetStreamExotic.String(), "JetStreamConfig", "JetStreamConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventBusStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventBusStatus{`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "Status", 1), `&`, ``, 1) + `,`, + `Config:` + strings.Replace(strings.Replace(this.Config.String(), "BusConfig", "BusConfig", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventDependency) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventDependency{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `EventSourceName:` + fmt.Sprintf("%v", this.EventSourceName) + `,`, + `EventName:` + fmt.Sprintf("%v", this.EventName) + `,`, + `Filters:` + strings.Replace(this.Filters.String(), "EventDependencyFilter", "EventDependencyFilter", 1) + `,`, + `Transform:` + strings.Replace(this.Transform.String(), "EventDependencyTransformer", "EventDependencyTransformer", 1) + `,`, + `FiltersLogicalOperator:` + fmt.Sprintf("%v", this.FiltersLogicalOperator) + `,`, + `}`, + }, "") + return s +} +func (this *EventDependencyFilter) String() string { + if this == nil { + return "nil" + } + repeatedStringForData := "[]DataFilter{" + for _, f := range this.Data { + repeatedStringForData += strings.Replace(strings.Replace(f.String(), "DataFilter", "DataFilter", 1), `&`, ``, 1) + "," + } + repeatedStringForData += "}" + repeatedStringForExprs := "[]ExprFilter{" + for _, f := range this.Exprs { + repeatedStringForExprs += strings.Replace(strings.Replace(f.String(), "ExprFilter", "ExprFilter", 1), `&`, ``, 1) + "," + } + repeatedStringForExprs += "}" + s := strings.Join([]string{`&EventDependencyFilter{`, + `Time:` + strings.Replace(this.Time.String(), "TimeFilter", "TimeFilter", 1) + `,`, + `Context:` + strings.Replace(fmt.Sprintf("%v", this.Context), "EventContext", "EventContext", 1) + `,`, + `Data:` + repeatedStringForData + `,`, + `Exprs:` + repeatedStringForExprs + `,`, + `DataLogicalOperator:` + fmt.Sprintf("%v", this.DataLogicalOperator) + `,`, + `ExprLogicalOperator:` + fmt.Sprintf("%v", this.ExprLogicalOperator) + `,`, + `Script:` + fmt.Sprintf("%v", this.Script) + `,`, + `}`, + }, "") + return s +} +func (this *EventDependencyTransformer) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventDependencyTransformer{`, + `JQ:` + fmt.Sprintf("%v", this.JQ) + `,`, + `Script:` + fmt.Sprintf("%v", this.Script) + `,`, + `}`, + }, "") + return s +} +func (this *EventPersistence) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventPersistence{`, + `Catchup:` + strings.Replace(this.Catchup.String(), "CatchupConfiguration", "CatchupConfiguration", 1) + `,`, + `ConfigMap:` + strings.Replace(this.ConfigMap.String(), "ConfigMapPersistence", "ConfigMapPersistence", 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventSource{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "EventSourceSpec", "EventSourceSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "EventSourceStatus", "EventSourceStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventSourceFilter{`, + `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]EventSource{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EventSource", "EventSource", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&EventSourceList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceSpec) String() string { + if this == nil { + return "nil" + } + keysForMinio := make([]string, 0, len(this.Minio)) + for k := range this.Minio { + keysForMinio = append(keysForMinio, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMinio) + mapStringForMinio := "map[string]S3Artifact{" + for _, k := range keysForMinio { + mapStringForMinio += fmt.Sprintf("%v: %v,", k, this.Minio[k]) + } + mapStringForMinio += "}" + keysForCalendar := make([]string, 0, len(this.Calendar)) + for k := range this.Calendar { + keysForCalendar = append(keysForCalendar, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCalendar) + mapStringForCalendar := "map[string]CalendarEventSource{" + for _, k := range keysForCalendar { + mapStringForCalendar += fmt.Sprintf("%v: %v,", k, this.Calendar[k]) + } + mapStringForCalendar += "}" + keysForFile := make([]string, 0, len(this.File)) + for k := range this.File { + keysForFile = append(keysForFile, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForFile) + mapStringForFile := "map[string]FileEventSource{" + for _, k := range keysForFile { + mapStringForFile += fmt.Sprintf("%v: %v,", k, this.File[k]) + } + mapStringForFile += "}" + keysForResource := make([]string, 0, len(this.Resource)) + for k := range this.Resource { + keysForResource = append(keysForResource, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForResource) + mapStringForResource := "map[string]ResourceEventSource{" + for _, k := range keysForResource { + mapStringForResource += fmt.Sprintf("%v: %v,", k, this.Resource[k]) + } + mapStringForResource += "}" + keysForWebhook := make([]string, 0, len(this.Webhook)) + for k := range this.Webhook { + keysForWebhook = append(keysForWebhook, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForWebhook) + mapStringForWebhook := "map[string]WebhookEventSource{" + for _, k := range keysForWebhook { + mapStringForWebhook += fmt.Sprintf("%v: %v,", k, this.Webhook[k]) + } + mapStringForWebhook += "}" + keysForAMQP := make([]string, 0, len(this.AMQP)) + for k := range this.AMQP { + keysForAMQP = append(keysForAMQP, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAMQP) + mapStringForAMQP := "map[string]AMQPEventSource{" + for _, k := range keysForAMQP { + mapStringForAMQP += fmt.Sprintf("%v: %v,", k, this.AMQP[k]) + } + mapStringForAMQP += "}" + keysForKafka := make([]string, 0, len(this.Kafka)) + for k := range this.Kafka { + keysForKafka = append(keysForKafka, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForKafka) + mapStringForKafka := "map[string]KafkaEventSource{" + for _, k := range keysForKafka { + mapStringForKafka += fmt.Sprintf("%v: %v,", k, this.Kafka[k]) + } + mapStringForKafka += "}" + keysForMQTT := make([]string, 0, len(this.MQTT)) + for k := range this.MQTT { + keysForMQTT = append(keysForMQTT, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMQTT) + mapStringForMQTT := "map[string]MQTTEventSource{" + for _, k := range keysForMQTT { + mapStringForMQTT += fmt.Sprintf("%v: %v,", k, this.MQTT[k]) + } + mapStringForMQTT += "}" + keysForNATS := make([]string, 0, len(this.NATS)) + for k := range this.NATS { + keysForNATS = append(keysForNATS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNATS) + mapStringForNATS := "map[string]NATSEventsSource{" + for _, k := range keysForNATS { + mapStringForNATS += fmt.Sprintf("%v: %v,", k, this.NATS[k]) + } + mapStringForNATS += "}" + keysForSNS := make([]string, 0, len(this.SNS)) + for k := range this.SNS { + keysForSNS = append(keysForSNS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSNS) + mapStringForSNS := "map[string]SNSEventSource{" + for _, k := range keysForSNS { + mapStringForSNS += fmt.Sprintf("%v: %v,", k, this.SNS[k]) + } + mapStringForSNS += "}" + keysForSQS := make([]string, 0, len(this.SQS)) + for k := range this.SQS { + keysForSQS = append(keysForSQS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSQS) + mapStringForSQS := "map[string]SQSEventSource{" + for _, k := range keysForSQS { + mapStringForSQS += fmt.Sprintf("%v: %v,", k, this.SQS[k]) + } + mapStringForSQS += "}" + keysForPubSub := make([]string, 0, len(this.PubSub)) + for k := range this.PubSub { + keysForPubSub = append(keysForPubSub, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPubSub) + mapStringForPubSub := "map[string]PubSubEventSource{" + for _, k := range keysForPubSub { + mapStringForPubSub += fmt.Sprintf("%v: %v,", k, this.PubSub[k]) + } + mapStringForPubSub += "}" + keysForGithub := make([]string, 0, len(this.Github)) + for k := range this.Github { + keysForGithub = append(keysForGithub, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGithub) + mapStringForGithub := "map[string]GithubEventSource{" + for _, k := range keysForGithub { + mapStringForGithub += fmt.Sprintf("%v: %v,", k, this.Github[k]) + } + mapStringForGithub += "}" + keysForGitlab := make([]string, 0, len(this.Gitlab)) + for k := range this.Gitlab { + keysForGitlab = append(keysForGitlab, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGitlab) + mapStringForGitlab := "map[string]GitlabEventSource{" + for _, k := range keysForGitlab { + mapStringForGitlab += fmt.Sprintf("%v: %v,", k, this.Gitlab[k]) + } + mapStringForGitlab += "}" + keysForHDFS := make([]string, 0, len(this.HDFS)) + for k := range this.HDFS { + keysForHDFS = append(keysForHDFS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHDFS) + mapStringForHDFS := "map[string]HDFSEventSource{" + for _, k := range keysForHDFS { + mapStringForHDFS += fmt.Sprintf("%v: %v,", k, this.HDFS[k]) + } + mapStringForHDFS += "}" + keysForSlack := make([]string, 0, len(this.Slack)) + for k := range this.Slack { + keysForSlack = append(keysForSlack, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSlack) + mapStringForSlack := "map[string]SlackEventSource{" + for _, k := range keysForSlack { + mapStringForSlack += fmt.Sprintf("%v: %v,", k, this.Slack[k]) + } + mapStringForSlack += "}" + keysForStorageGrid := make([]string, 0, len(this.StorageGrid)) + for k := range this.StorageGrid { + keysForStorageGrid = append(keysForStorageGrid, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStorageGrid) + mapStringForStorageGrid := "map[string]StorageGridEventSource{" + for _, k := range keysForStorageGrid { + mapStringForStorageGrid += fmt.Sprintf("%v: %v,", k, this.StorageGrid[k]) + } + mapStringForStorageGrid += "}" + keysForAzureEventsHub := make([]string, 0, len(this.AzureEventsHub)) + for k := range this.AzureEventsHub { + keysForAzureEventsHub = append(keysForAzureEventsHub, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureEventsHub) + mapStringForAzureEventsHub := "map[string]AzureEventsHubEventSource{" + for _, k := range keysForAzureEventsHub { + mapStringForAzureEventsHub += fmt.Sprintf("%v: %v,", k, this.AzureEventsHub[k]) + } + mapStringForAzureEventsHub += "}" + keysForStripe := make([]string, 0, len(this.Stripe)) + for k := range this.Stripe { + keysForStripe = append(keysForStripe, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStripe) + mapStringForStripe := "map[string]StripeEventSource{" + for _, k := range keysForStripe { + mapStringForStripe += fmt.Sprintf("%v: %v,", k, this.Stripe[k]) + } + mapStringForStripe += "}" + keysForEmitter := make([]string, 0, len(this.Emitter)) + for k := range this.Emitter { + keysForEmitter = append(keysForEmitter, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForEmitter) + mapStringForEmitter := "map[string]EmitterEventSource{" + for _, k := range keysForEmitter { + mapStringForEmitter += fmt.Sprintf("%v: %v,", k, this.Emitter[k]) + } + mapStringForEmitter += "}" + keysForRedis := make([]string, 0, len(this.Redis)) + for k := range this.Redis { + keysForRedis = append(keysForRedis, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedis) + mapStringForRedis := "map[string]RedisEventSource{" + for _, k := range keysForRedis { + mapStringForRedis += fmt.Sprintf("%v: %v,", k, this.Redis[k]) + } + mapStringForRedis += "}" + keysForNSQ := make([]string, 0, len(this.NSQ)) + for k := range this.NSQ { + keysForNSQ = append(keysForNSQ, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNSQ) + mapStringForNSQ := "map[string]NSQEventSource{" + for _, k := range keysForNSQ { + mapStringForNSQ += fmt.Sprintf("%v: %v,", k, this.NSQ[k]) + } + mapStringForNSQ += "}" + keysForPulsar := make([]string, 0, len(this.Pulsar)) + for k := range this.Pulsar { + keysForPulsar = append(keysForPulsar, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPulsar) + mapStringForPulsar := "map[string]PulsarEventSource{" + for _, k := range keysForPulsar { + mapStringForPulsar += fmt.Sprintf("%v: %v,", k, this.Pulsar[k]) + } + mapStringForPulsar += "}" + keysForGeneric := make([]string, 0, len(this.Generic)) + for k := range this.Generic { + keysForGeneric = append(keysForGeneric, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGeneric) + mapStringForGeneric := "map[string]GenericEventSource{" + for _, k := range keysForGeneric { + mapStringForGeneric += fmt.Sprintf("%v: %v,", k, this.Generic[k]) + } + mapStringForGeneric += "}" + keysForBitbucketServer := make([]string, 0, len(this.BitbucketServer)) + for k := range this.BitbucketServer { + keysForBitbucketServer = append(keysForBitbucketServer, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucketServer) + mapStringForBitbucketServer := "map[string]BitbucketServerEventSource{" + for _, k := range keysForBitbucketServer { + mapStringForBitbucketServer += fmt.Sprintf("%v: %v,", k, this.BitbucketServer[k]) + } + mapStringForBitbucketServer += "}" + keysForBitbucket := make([]string, 0, len(this.Bitbucket)) + for k := range this.Bitbucket { + keysForBitbucket = append(keysForBitbucket, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucket) + mapStringForBitbucket := "map[string]BitbucketEventSource{" + for _, k := range keysForBitbucket { + mapStringForBitbucket += fmt.Sprintf("%v: %v,", k, this.Bitbucket[k]) + } + mapStringForBitbucket += "}" + keysForRedisStream := make([]string, 0, len(this.RedisStream)) + for k := range this.RedisStream { + keysForRedisStream = append(keysForRedisStream, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedisStream) + mapStringForRedisStream := "map[string]RedisStreamEventSource{" + for _, k := range keysForRedisStream { + mapStringForRedisStream += fmt.Sprintf("%v: %v,", k, this.RedisStream[k]) + } + mapStringForRedisStream += "}" + keysForAzureServiceBus := make([]string, 0, len(this.AzureServiceBus)) + for k := range this.AzureServiceBus { + keysForAzureServiceBus = append(keysForAzureServiceBus, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureServiceBus) + mapStringForAzureServiceBus := "map[string]AzureServiceBusEventSource{" + for _, k := range keysForAzureServiceBus { + mapStringForAzureServiceBus += fmt.Sprintf("%v: %v,", k, this.AzureServiceBus[k]) + } + mapStringForAzureServiceBus += "}" + keysForAzureQueueStorage := make([]string, 0, len(this.AzureQueueStorage)) + for k := range this.AzureQueueStorage { + keysForAzureQueueStorage = append(keysForAzureQueueStorage, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureQueueStorage) + mapStringForAzureQueueStorage := "map[string]AzureQueueStorageEventSource{" + for _, k := range keysForAzureQueueStorage { + mapStringForAzureQueueStorage += fmt.Sprintf("%v: %v,", k, this.AzureQueueStorage[k]) + } + mapStringForAzureQueueStorage += "}" + keysForSFTP := make([]string, 0, len(this.SFTP)) + for k := range this.SFTP { + keysForSFTP = append(keysForSFTP, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSFTP) + mapStringForSFTP := "map[string]SFTPEventSource{" + for _, k := range keysForSFTP { + mapStringForSFTP += fmt.Sprintf("%v: %v,", k, this.SFTP[k]) + } + mapStringForSFTP += "}" + keysForGerrit := make([]string, 0, len(this.Gerrit)) + for k := range this.Gerrit { + keysForGerrit = append(keysForGerrit, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGerrit) + mapStringForGerrit := "map[string]GerritEventSource{" + for _, k := range keysForGerrit { + mapStringForGerrit += fmt.Sprintf("%v: %v,", k, this.Gerrit[k]) + } + mapStringForGerrit += "}" + s := strings.Join([]string{`&EventSourceSpec{`, + `EventBusName:` + fmt.Sprintf("%v", this.EventBusName) + `,`, + `Template:` + strings.Replace(this.Template.String(), "Template", "Template", 1) + `,`, + `Service:` + strings.Replace(this.Service.String(), "Service", "Service", 1) + `,`, + `Minio:` + mapStringForMinio + `,`, + `Calendar:` + mapStringForCalendar + `,`, + `File:` + mapStringForFile + `,`, + `Resource:` + mapStringForResource + `,`, + `Webhook:` + mapStringForWebhook + `,`, + `AMQP:` + mapStringForAMQP + `,`, + `Kafka:` + mapStringForKafka + `,`, + `MQTT:` + mapStringForMQTT + `,`, + `NATS:` + mapStringForNATS + `,`, + `SNS:` + mapStringForSNS + `,`, + `SQS:` + mapStringForSQS + `,`, + `PubSub:` + mapStringForPubSub + `,`, + `Github:` + mapStringForGithub + `,`, + `Gitlab:` + mapStringForGitlab + `,`, + `HDFS:` + mapStringForHDFS + `,`, + `Slack:` + mapStringForSlack + `,`, + `StorageGrid:` + mapStringForStorageGrid + `,`, + `AzureEventsHub:` + mapStringForAzureEventsHub + `,`, + `Stripe:` + mapStringForStripe + `,`, + `Emitter:` + mapStringForEmitter + `,`, + `Redis:` + mapStringForRedis + `,`, + `NSQ:` + mapStringForNSQ + `,`, + `Pulsar:` + mapStringForPulsar + `,`, + `Generic:` + mapStringForGeneric + `,`, + `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, + `BitbucketServer:` + mapStringForBitbucketServer + `,`, + `Bitbucket:` + mapStringForBitbucket + `,`, + `RedisStream:` + mapStringForRedisStream + `,`, + `AzureServiceBus:` + mapStringForAzureServiceBus + `,`, + `AzureQueueStorage:` + mapStringForAzureQueueStorage + `,`, + `SFTP:` + mapStringForSFTP + `,`, + `Gerrit:` + mapStringForGerrit + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventSourceStatus{`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "Status", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ExprFilter) String() string { + if this == nil { + return "nil" + } + repeatedStringForFields := "[]PayloadField{" + for _, f := range this.Fields { + repeatedStringForFields += strings.Replace(strings.Replace(f.String(), "PayloadField", "PayloadField", 1), `&`, ``, 1) + "," + } + repeatedStringForFields += "}" + s := strings.Join([]string{`&ExprFilter{`, + `Expr:` + fmt.Sprintf("%v", this.Expr) + `,`, + `Fields:` + repeatedStringForFields + `,`, + `}`, + }, "") + return s +} +func (this *FileArtifact) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileArtifact{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `}`, + }, "") + return s +} +func (this *FileEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&FileEventSource{`, + `EventType:` + fmt.Sprintf("%v", this.EventType) + `,`, + `WatchPathConfig:` + strings.Replace(strings.Replace(this.WatchPathConfig.String(), "WatchPathConfig", "WatchPathConfig", 1), `&`, ``, 1) + `,`, + `Polling:` + fmt.Sprintf("%v", this.Polling) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GenericEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GenericEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Config:` + fmt.Sprintf("%v", this.Config) + `,`, + `Insecure:` + fmt.Sprintf("%v", this.Insecure) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `AuthSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GerritEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GerritEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `HookName:` + fmt.Sprintf("%v", this.HookName) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `GerritBaseURL:` + fmt.Sprintf("%v", this.GerritBaseURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Projects:` + fmt.Sprintf("%v", this.Projects) + `,`, + `SslVerify:` + fmt.Sprintf("%v", this.SslVerify) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GitArtifact) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GitArtifact{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `CloneDirectory:` + fmt.Sprintf("%v", this.CloneDirectory) + `,`, + `Creds:` + strings.Replace(this.Creds.String(), "GitCreds", "GitCreds", 1) + `,`, + `SSHKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.SSHKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `FilePath:` + fmt.Sprintf("%v", this.FilePath) + `,`, + `Branch:` + fmt.Sprintf("%v", this.Branch) + `,`, + `Tag:` + fmt.Sprintf("%v", this.Tag) + `,`, + `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`, + `Remote:` + strings.Replace(this.Remote.String(), "GitRemoteConfig", "GitRemoteConfig", 1) + `,`, + `InsecureIgnoreHostKey:` + fmt.Sprintf("%v", this.InsecureIgnoreHostKey) + `,`, + `}`, + }, "") + return s +} +func (this *GitCreds) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GitCreds{`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GitRemoteConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GitRemoteConfig{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `URLS:` + fmt.Sprintf("%v", this.URLS) + `,`, + `}`, + }, "") + return s +} +func (this *GithubAppCreds) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GithubAppCreds{`, + `PrivateKey:` + strings.Replace(fmt.Sprintf("%v", this.PrivateKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `AppID:` + fmt.Sprintf("%v", this.AppID) + `,`, + `InstallationID:` + fmt.Sprintf("%v", this.InstallationID) + `,`, + `}`, + }, "") + return s +} +func (this *GithubEventSource) String() string { + if this == nil { + return "nil" + } + repeatedStringForRepositories := "[]OwnedRepositories{" + for _, f := range this.Repositories { + repeatedStringForRepositories += strings.Replace(strings.Replace(f.String(), "OwnedRepositories", "OwnedRepositories", 1), `&`, ``, 1) + "," + } + repeatedStringForRepositories += "}" + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GithubEventSource{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `DeprecatedOwner:` + fmt.Sprintf("%v", this.DeprecatedOwner) + `,`, + `DeprecatedRepository:` + fmt.Sprintf("%v", this.DeprecatedRepository) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `APIToken:` + strings.Replace(fmt.Sprintf("%v", this.APIToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `WebhookSecret:` + strings.Replace(fmt.Sprintf("%v", this.WebhookSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Insecure:` + fmt.Sprintf("%v", this.Insecure) + `,`, + `Active:` + fmt.Sprintf("%v", this.Active) + `,`, + `ContentType:` + fmt.Sprintf("%v", this.ContentType) + `,`, + `GithubBaseURL:` + fmt.Sprintf("%v", this.GithubBaseURL) + `,`, + `GithubUploadURL:` + fmt.Sprintf("%v", this.GithubUploadURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Repositories:` + repeatedStringForRepositories + `,`, + `Organizations:` + fmt.Sprintf("%v", this.Organizations) + `,`, + `GithubApp:` + strings.Replace(this.GithubApp.String(), "GithubAppCreds", "GithubAppCreds", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GitlabEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GitlabEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `DeprecatedProjectID:` + fmt.Sprintf("%v", this.DeprecatedProjectID) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `AccessToken:` + strings.Replace(fmt.Sprintf("%v", this.AccessToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `EnableSSLVerification:` + fmt.Sprintf("%v", this.EnableSSLVerification) + `,`, + `GitlabBaseURL:` + fmt.Sprintf("%v", this.GitlabBaseURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Projects:` + fmt.Sprintf("%v", this.Projects) + `,`, + `SecretToken:` + strings.Replace(fmt.Sprintf("%v", this.SecretToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, + `}`, + }, "") + return s +} +func (this *HDFSEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&HDFSEventSource{`, + `WatchPathConfig:` + strings.Replace(strings.Replace(this.WatchPathConfig.String(), "WatchPathConfig", "WatchPathConfig", 1), `&`, ``, 1) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `CheckInterval:` + fmt.Sprintf("%v", this.CheckInterval) + `,`, + `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, + `HDFSUser:` + fmt.Sprintf("%v", this.HDFSUser) + `,`, + `KrbCCacheSecret:` + strings.Replace(fmt.Sprintf("%v", this.KrbCCacheSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `KrbKeytabSecret:` + strings.Replace(fmt.Sprintf("%v", this.KrbKeytabSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `KrbUsername:` + fmt.Sprintf("%v", this.KrbUsername) + `,`, + `KrbRealm:` + fmt.Sprintf("%v", this.KrbRealm) + `,`, + `KrbConfigConfigMap:` + strings.Replace(fmt.Sprintf("%v", this.KrbConfigConfigMap), "ConfigMapKeySelector", "v1.ConfigMapKeySelector", 1) + `,`, + `KrbServicePrincipalName:` + fmt.Sprintf("%v", this.KrbServicePrincipalName) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *HTTPTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForSecureHeaders := "[]*SecureHeader{" + for _, f := range this.SecureHeaders { + repeatedStringForSecureHeaders += strings.Replace(f.String(), "SecureHeader", "SecureHeader", 1) + "," + } + repeatedStringForSecureHeaders += "}" + keysForHeaders := make([]string, 0, len(this.Headers)) + for k := range this.Headers { + keysForHeaders = append(keysForHeaders, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + mapStringForHeaders := "map[string]string{" + for _, k := range keysForHeaders { + mapStringForHeaders += fmt.Sprintf("%v: %v,", k, this.Headers[k]) + } + mapStringForHeaders += "}" + s := strings.Join([]string{`&HTTPTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Method:` + fmt.Sprintf("%v", this.Method) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, + `BasicAuth:` + strings.Replace(this.BasicAuth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `Headers:` + mapStringForHeaders + `,`, + `SecureHeaders:` + repeatedStringForSecureHeaders + `,`, + `}`, + }, "") + return s +} +func (this *Int64OrString) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Int64OrString{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Int64Val:` + fmt.Sprintf("%v", this.Int64Val) + `,`, + `StrVal:` + fmt.Sprintf("%v", this.StrVal) + `,`, + `}`, + }, "") + return s +} +func (this *JetStreamBus) String() string { + if this == nil { + return "nil" + } + repeatedStringForTolerations := "[]Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForTolerations += "}" + repeatedStringForImagePullSecrets := "[]LocalObjectReference{" + for _, f := range this.ImagePullSecrets { + repeatedStringForImagePullSecrets += fmt.Sprintf("%v", f) + "," + } + repeatedStringForImagePullSecrets += "}" + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&JetStreamBus{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, + `ContainerTemplate:` + strings.Replace(this.ContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `ReloaderContainerTemplate:` + strings.Replace(this.ReloaderContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `MetricsContainerTemplate:` + strings.Replace(this.MetricsContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `Persistence:` + strings.Replace(this.Persistence.String(), "PersistenceStrategy", "PersistenceStrategy", 1) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `ImagePullSecrets:` + repeatedStringForImagePullSecrets + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `Affinity:` + strings.Replace(fmt.Sprintf("%v", this.Affinity), "Affinity", "v1.Affinity", 1) + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `Settings:` + valueToStringGenerated(this.Settings) + `,`, + `StartArgs:` + fmt.Sprintf("%v", this.StartArgs) + `,`, + `StreamConfig:` + valueToStringGenerated(this.StreamConfig) + `,`, + `MaxPayload:` + valueToStringGenerated(this.MaxPayload) + `,`, + `}`, + }, "") + return s +} +func (this *JetStreamConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&JetStreamConfig{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `AccessSecret:` + strings.Replace(fmt.Sprintf("%v", this.AccessSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `StreamConfig:` + fmt.Sprintf("%v", this.StreamConfig) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *K8SResource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&K8SResource{`, + `Value:` + valueToStringGenerated(this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *K8SResourcePolicy) String() string { + if this == nil { + return "nil" + } + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + s := strings.Join([]string{`&K8SResourcePolicy{`, + `Labels:` + mapStringForLabels + `,`, + `Backoff:` + strings.Replace(this.Backoff.String(), "Backoff", "Backoff", 1) + `,`, + `ErrorOnBackoffTimeout:` + fmt.Sprintf("%v", this.ErrorOnBackoffTimeout) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaBus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&KafkaBus{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `SASL:` + strings.Replace(this.SASL.String(), "SASLConfig", "SASLConfig", 1) + `,`, + `ConsumerGroup:` + strings.Replace(this.ConsumerGroup.String(), "KafkaConsumerGroup", "KafkaConsumerGroup", 1) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaConsumerGroup) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&KafkaConsumerGroup{`, + `GroupName:` + fmt.Sprintf("%v", this.GroupName) + `,`, + `Oldest:` + fmt.Sprintf("%v", this.Oldest) + `,`, + `RebalanceStrategy:` + fmt.Sprintf("%v", this.RebalanceStrategy) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&KafkaEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Partition:` + fmt.Sprintf("%v", this.Partition) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `ConsumerGroup:` + strings.Replace(this.ConsumerGroup.String(), "KafkaConsumerGroup", "KafkaConsumerGroup", 1) + `,`, + `LimitEventsPerSecond:` + fmt.Sprintf("%v", this.LimitEventsPerSecond) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `SASL:` + strings.Replace(this.SASL.String(), "SASLConfig", "SASLConfig", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Config:` + fmt.Sprintf("%v", this.Config) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForSecureHeaders := "[]*SecureHeader{" + for _, f := range this.SecureHeaders { + repeatedStringForSecureHeaders += strings.Replace(f.String(), "SecureHeader", "SecureHeader", 1) + "," + } + repeatedStringForSecureHeaders += "}" + keysForHeaders := make([]string, 0, len(this.Headers)) + for k := range this.Headers { + keysForHeaders = append(keysForHeaders, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + mapStringForHeaders := "map[string]string{" + for _, k := range keysForHeaders { + mapStringForHeaders += fmt.Sprintf("%v: %v,", k, this.Headers[k]) + } + mapStringForHeaders += "}" + s := strings.Join([]string{`&KafkaTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Partition:` + fmt.Sprintf("%v", this.Partition) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `RequiredAcks:` + fmt.Sprintf("%v", this.RequiredAcks) + `,`, + `Compress:` + fmt.Sprintf("%v", this.Compress) + `,`, + `FlushFrequency:` + fmt.Sprintf("%v", this.FlushFrequency) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `PartitioningKey:` + valueToStringGenerated(this.PartitioningKey) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `SASL:` + strings.Replace(this.SASL.String(), "SASLConfig", "SASLConfig", 1) + `,`, + `SchemaRegistry:` + strings.Replace(this.SchemaRegistry.String(), "SchemaRegistryConfig", "SchemaRegistryConfig", 1) + `,`, + `Headers:` + mapStringForHeaders + `,`, + `SecureHeaders:` + repeatedStringForSecureHeaders + `,`, + `}`, + }, "") + return s +} +func (this *LogTrigger) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LogTrigger{`, + `IntervalSeconds:` + fmt.Sprintf("%v", this.IntervalSeconds) + `,`, + `}`, + }, "") + return s +} +func (this *MQTTEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&MQTTEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `ClientID:` + fmt.Sprintf("%v", this.ClientID) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Metadata) String() string { + if this == nil { + return "nil" + } + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + s := strings.Join([]string{`&Metadata{`, + `Annotations:` + mapStringForAnnotations + `,`, + `Labels:` + mapStringForLabels + `,`, + `}`, + }, "") + return s +} +func (this *NATSAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NATSAuth{`, + `Basic:` + strings.Replace(this.Basic.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `Token:` + strings.Replace(fmt.Sprintf("%v", this.Token), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `NKey:` + strings.Replace(fmt.Sprintf("%v", this.NKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Credential:` + strings.Replace(fmt.Sprintf("%v", this.Credential), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NATSBus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NATSBus{`, + `Native:` + strings.Replace(this.Native.String(), "NativeStrategy", "NativeStrategy", 1) + `,`, + `Exotic:` + strings.Replace(this.Exotic.String(), "NATSConfig", "NATSConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NATSConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NATSConfig{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `ClusterID:` + valueToStringGenerated(this.ClusterID) + `,`, + `Auth:` + valueToStringGenerated(this.Auth) + `,`, + `AccessSecret:` + strings.Replace(fmt.Sprintf("%v", this.AccessSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NATSEventsSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&NATSEventsSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "NATSAuth", "NATSAuth", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Queue:` + valueToStringGenerated(this.Queue) + `,`, + `}`, + }, "") + return s +} +func (this *NATSTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&NATSTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "NATSAuth", "NATSAuth", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NSQEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&NSQEventSource{`, + `HostAddress:` + fmt.Sprintf("%v", this.HostAddress) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Channel:` + fmt.Sprintf("%v", this.Channel) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NativeStrategy) String() string { + if this == nil { + return "nil" + } + repeatedStringForTolerations := "[]Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForTolerations += "}" + repeatedStringForImagePullSecrets := "[]LocalObjectReference{" + for _, f := range this.ImagePullSecrets { + repeatedStringForImagePullSecrets += fmt.Sprintf("%v", f) + "," + } + repeatedStringForImagePullSecrets += "}" + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&NativeStrategy{`, + `Replicas:` + fmt.Sprintf("%v", this.Replicas) + `,`, + `Auth:` + valueToStringGenerated(this.Auth) + `,`, + `Persistence:` + strings.Replace(this.Persistence.String(), "PersistenceStrategy", "PersistenceStrategy", 1) + `,`, + `ContainerTemplate:` + strings.Replace(this.ContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `MetricsContainerTemplate:` + strings.Replace(this.MetricsContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `MaxAge:` + valueToStringGenerated(this.MaxAge) + `,`, + `ImagePullSecrets:` + repeatedStringForImagePullSecrets + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `Affinity:` + strings.Replace(fmt.Sprintf("%v", this.Affinity), "Affinity", "v1.Affinity", 1) + `,`, + `MaxMsgs:` + valueToStringGenerated(this.MaxMsgs) + `,`, + `MaxBytes:` + valueToStringGenerated(this.MaxBytes) + `,`, + `MaxSubs:` + valueToStringGenerated(this.MaxSubs) + `,`, + `MaxPayload:` + valueToStringGenerated(this.MaxPayload) + `,`, + `RaftHeartbeatTimeout:` + valueToStringGenerated(this.RaftHeartbeatTimeout) + `,`, + `RaftElectionTimeout:` + valueToStringGenerated(this.RaftElectionTimeout) + `,`, + `RaftLeaseTimeout:` + valueToStringGenerated(this.RaftLeaseTimeout) + `,`, + `RaftCommitTimeout:` + valueToStringGenerated(this.RaftCommitTimeout) + `,`, + `}`, + }, "") + return s +} +func (this *OpenWhiskTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&OpenWhiskTrigger{`, + `Host:` + fmt.Sprintf("%v", this.Host) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `AuthToken:` + strings.Replace(fmt.Sprintf("%v", this.AuthToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ActionName:` + fmt.Sprintf("%v", this.ActionName) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `}`, + }, "") + return s +} +func (this *OwnedRepositories) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&OwnedRepositories{`, + `Owner:` + fmt.Sprintf("%v", this.Owner) + `,`, + `Names:` + fmt.Sprintf("%v", this.Names) + `,`, + `}`, + }, "") + return s +} +func (this *PayloadField) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PayloadField{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *PersistenceStrategy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PersistenceStrategy{`, + `StorageClassName:` + valueToStringGenerated(this.StorageClassName) + `,`, + `AccessMode:` + valueToStringGenerated(this.AccessMode) + `,`, + `VolumeSize:` + strings.Replace(fmt.Sprintf("%v", this.VolumeSize), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PubSubEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&PubSubEventSource{`, + `ProjectID:` + fmt.Sprintf("%v", this.ProjectID) + `,`, + `TopicProjectID:` + fmt.Sprintf("%v", this.TopicProjectID) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `SubscriptionID:` + fmt.Sprintf("%v", this.SubscriptionID) + `,`, + `CredentialSecret:` + strings.Replace(fmt.Sprintf("%v", this.CredentialSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `DeleteSubscriptionOnFinish:` + fmt.Sprintf("%v", this.DeleteSubscriptionOnFinish) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PulsarEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + keysForAuthAthenzParams := make([]string, 0, len(this.AuthAthenzParams)) + for k := range this.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + mapStringForAuthAthenzParams := "map[string]string{" + for _, k := range keysForAuthAthenzParams { + mapStringForAuthAthenzParams += fmt.Sprintf("%v: %v,", k, this.AuthAthenzParams[k]) + } + mapStringForAuthAthenzParams += "}" + s := strings.Join([]string{`&PulsarEventSource{`, + `Topics:` + fmt.Sprintf("%v", this.Topics) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `TLSTrustCertsSecret:` + strings.Replace(fmt.Sprintf("%v", this.TLSTrustCertsSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `TLSAllowInsecureConnection:` + fmt.Sprintf("%v", this.TLSAllowInsecureConnection) + `,`, + `TLSValidateHostname:` + fmt.Sprintf("%v", this.TLSValidateHostname) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `AuthTokenSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthTokenSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `AuthAthenzParams:` + mapStringForAuthAthenzParams + `,`, + `AuthAthenzSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthAthenzSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PulsarTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + keysForAuthAthenzParams := make([]string, 0, len(this.AuthAthenzParams)) + for k := range this.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + mapStringForAuthAthenzParams := "map[string]string{" + for _, k := range keysForAuthAthenzParams { + mapStringForAuthAthenzParams += fmt.Sprintf("%v: %v,", k, this.AuthAthenzParams[k]) + } + mapStringForAuthAthenzParams += "}" + s := strings.Join([]string{`&PulsarTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `TLSTrustCertsSecret:` + strings.Replace(fmt.Sprintf("%v", this.TLSTrustCertsSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `TLSAllowInsecureConnection:` + fmt.Sprintf("%v", this.TLSAllowInsecureConnection) + `,`, + `TLSValidateHostname:` + fmt.Sprintf("%v", this.TLSValidateHostname) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `AuthTokenSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthTokenSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `AuthAthenzParams:` + mapStringForAuthAthenzParams + `,`, + `AuthAthenzSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthAthenzSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RateLimit) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RateLimit{`, + `Unit:` + fmt.Sprintf("%v", this.Unit) + `,`, + `RequestsPerUnit:` + fmt.Sprintf("%v", this.RequestsPerUnit) + `,`, + `}`, + }, "") + return s +} +func (this *RedisEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&RedisEventSource{`, + `HostAddress:` + fmt.Sprintf("%v", this.HostAddress) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `DB:` + fmt.Sprintf("%v", this.DB) + `,`, + `Channels:` + fmt.Sprintf("%v", this.Channels) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `}`, + }, "") + return s +} +func (this *RedisStreamEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&RedisStreamEventSource{`, + `HostAddress:` + fmt.Sprintf("%v", this.HostAddress) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `DB:` + fmt.Sprintf("%v", this.DB) + `,`, + `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, + `MaxMsgCountPerRead:` + fmt.Sprintf("%v", this.MaxMsgCountPerRead) + `,`, + `ConsumerGroup:` + fmt.Sprintf("%v", this.ConsumerGroup) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&ResourceEventSource{`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "ResourceFilter", "ResourceFilter", 1) + `,`, + `GroupVersionResource:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.GroupVersionResource), "GroupVersionResource", "v11.GroupVersionResource", 1), `&`, ``, 1) + `,`, + `EventTypes:` + fmt.Sprintf("%v", this.EventTypes) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *ResourceFilter) String() string { + if this == nil { + return "nil" + } + repeatedStringForLabels := "[]Selector{" + for _, f := range this.Labels { + repeatedStringForLabels += strings.Replace(strings.Replace(f.String(), "Selector", "Selector", 1), `&`, ``, 1) + "," + } + repeatedStringForLabels += "}" + repeatedStringForFields := "[]Selector{" + for _, f := range this.Fields { + repeatedStringForFields += strings.Replace(strings.Replace(f.String(), "Selector", "Selector", 1), `&`, ``, 1) + "," + } + repeatedStringForFields += "}" + s := strings.Join([]string{`&ResourceFilter{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Labels:` + repeatedStringForLabels + `,`, + `Fields:` + repeatedStringForFields + `,`, + `CreatedBy:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedBy), "Time", "v11.Time", 1), `&`, ``, 1) + `,`, + `AfterStart:` + fmt.Sprintf("%v", this.AfterStart) + `,`, + `}`, + }, "") + return s +} +func (this *S3Artifact) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&S3Artifact{`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `Bucket:` + strings.Replace(this.Bucket.String(), "S3Bucket", "S3Bucket", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `Insecure:` + fmt.Sprintf("%v", this.Insecure) + `,`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "S3Filter", "S3Filter", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `CACertificate:` + strings.Replace(fmt.Sprintf("%v", this.CACertificate), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *S3Bucket) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&S3Bucket{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *S3Filter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&S3Filter{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Suffix:` + fmt.Sprintf("%v", this.Suffix) + `,`, + `}`, + }, "") + return s +} +func (this *SASLConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SASLConfig{`, + `Mechanism:` + fmt.Sprintf("%v", this.Mechanism) + `,`, + `UserSecret:` + strings.Replace(fmt.Sprintf("%v", this.UserSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `PasswordSecret:` + strings.Replace(fmt.Sprintf("%v", this.PasswordSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SFTPEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SFTPEventSource{`, + `EventType:` + fmt.Sprintf("%v", this.EventType) + `,`, + `WatchPathConfig:` + strings.Replace(strings.Replace(this.WatchPathConfig.String(), "WatchPathConfig", "WatchPathConfig", 1), `&`, ``, 1) + `,`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SSHKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.SSHKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Address:` + strings.Replace(fmt.Sprintf("%v", this.Address), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `PollIntervalDuration:` + fmt.Sprintf("%v", this.PollIntervalDuration) + `,`, + `}`, + }, "") + return s +} +func (this *SNSEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SNSEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `TopicArn:` + fmt.Sprintf("%v", this.TopicArn) + `,`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `RoleARN:` + fmt.Sprintf("%v", this.RoleARN) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `ValidateSignature:` + fmt.Sprintf("%v", this.ValidateSignature) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `}`, + }, "") + return s +} +func (this *SQSEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SQSEventSource{`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `Queue:` + fmt.Sprintf("%v", this.Queue) + `,`, + `WaitTimeSeconds:` + fmt.Sprintf("%v", this.WaitTimeSeconds) + `,`, + `RoleARN:` + fmt.Sprintf("%v", this.RoleARN) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `QueueAccountID:` + fmt.Sprintf("%v", this.QueueAccountID) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `DLQ:` + fmt.Sprintf("%v", this.DLQ) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `SessionToken:` + strings.Replace(fmt.Sprintf("%v", this.SessionToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SchemaRegistryConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchemaRegistryConfig{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `SchemaID:` + fmt.Sprintf("%v", this.SchemaID) + `,`, + `Auth:` + strings.Replace(strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *SecureHeader) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SecureHeader{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ValueFrom:` + strings.Replace(this.ValueFrom.String(), "ValueFromSource", "ValueFromSource", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Selector) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Selector{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *Sensor) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Sensor{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "SensorSpec", "SensorSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "SensorStatus", "SensorStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *SensorList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]Sensor{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Sensor", "Sensor", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&SensorList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *SensorSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForDependencies := "[]EventDependency{" + for _, f := range this.Dependencies { + repeatedStringForDependencies += strings.Replace(strings.Replace(f.String(), "EventDependency", "EventDependency", 1), `&`, ``, 1) + "," + } + repeatedStringForDependencies += "}" + repeatedStringForTriggers := "[]Trigger{" + for _, f := range this.Triggers { + repeatedStringForTriggers += strings.Replace(strings.Replace(f.String(), "Trigger", "Trigger", 1), `&`, ``, 1) + "," + } + repeatedStringForTriggers += "}" + keysForLoggingFields := make([]string, 0, len(this.LoggingFields)) + for k := range this.LoggingFields { + keysForLoggingFields = append(keysForLoggingFields, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLoggingFields) + mapStringForLoggingFields := "map[string]string{" + for _, k := range keysForLoggingFields { + mapStringForLoggingFields += fmt.Sprintf("%v: %v,", k, this.LoggingFields[k]) + } + mapStringForLoggingFields += "}" + s := strings.Join([]string{`&SensorSpec{`, + `Dependencies:` + repeatedStringForDependencies + `,`, + `Triggers:` + repeatedStringForTriggers + `,`, + `Template:` + strings.Replace(this.Template.String(), "Template", "Template", 1) + `,`, + `ErrorOnFailedRound:` + fmt.Sprintf("%v", this.ErrorOnFailedRound) + `,`, + `EventBusName:` + fmt.Sprintf("%v", this.EventBusName) + `,`, + `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, + `RevisionHistoryLimit:` + valueToStringGenerated(this.RevisionHistoryLimit) + `,`, + `LoggingFields:` + mapStringForLoggingFields + `,`, + `}`, + }, "") + return s +} +func (this *SensorStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SensorStatus{`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "Status", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *Service) String() string { + if this == nil { + return "nil" + } + repeatedStringForPorts := "[]ServicePort{" + for _, f := range this.Ports { + repeatedStringForPorts += fmt.Sprintf("%v", f) + "," + } + repeatedStringForPorts += "}" + s := strings.Join([]string{`&Service{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, + `ClusterIP:` + fmt.Sprintf("%v", this.ClusterIP) + `,`, + `}`, + }, "") + return s +} +func (this *SlackEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SlackEventSource{`, + `SigningSecret:` + strings.Replace(fmt.Sprintf("%v", this.SigningSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Token:` + strings.Replace(fmt.Sprintf("%v", this.Token), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SlackSender) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SlackSender{`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `Icon:` + fmt.Sprintf("%v", this.Icon) + `,`, + `}`, + }, "") + return s +} +func (this *SlackThread) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SlackThread{`, + `MessageAggregationKey:` + fmt.Sprintf("%v", this.MessageAggregationKey) + `,`, + `BroadcastMessageToChannel:` + fmt.Sprintf("%v", this.BroadcastMessageToChannel) + `,`, + `}`, + }, "") + return s +} +func (this *SlackTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&SlackTrigger{`, + `Parameters:` + repeatedStringForParameters + `,`, + `SlackToken:` + strings.Replace(fmt.Sprintf("%v", this.SlackToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Channel:` + fmt.Sprintf("%v", this.Channel) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `Attachments:` + fmt.Sprintf("%v", this.Attachments) + `,`, + `Blocks:` + fmt.Sprintf("%v", this.Blocks) + `,`, + `Thread:` + strings.Replace(strings.Replace(this.Thread.String(), "SlackThread", "SlackThread", 1), `&`, ``, 1) + `,`, + `Sender:` + strings.Replace(strings.Replace(this.Sender.String(), "SlackSender", "SlackSender", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *StandardK8STrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&StandardK8STrigger{`, + `Source:` + strings.Replace(this.Source.String(), "ArtifactLocation", "ArtifactLocation", 1) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `PatchStrategy:` + fmt.Sprintf("%v", this.PatchStrategy) + `,`, + `LiveObject:` + fmt.Sprintf("%v", this.LiveObject) + `,`, + `}`, + }, "") + return s +} +func (this *Status) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "Condition", "Condition", 1), `&`, ``, 1) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&Status{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *StatusPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StatusPolicy{`, + `Allow:` + fmt.Sprintf("%v", this.Allow) + `,`, + `}`, + }, "") + return s +} +func (this *StorageGridEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&StorageGridEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "StorageGridFilter", "StorageGridFilter", 1) + `,`, + `TopicArn:` + fmt.Sprintf("%v", this.TopicArn) + `,`, + `Bucket:` + fmt.Sprintf("%v", this.Bucket) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `AuthToken:` + strings.Replace(fmt.Sprintf("%v", this.AuthToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `APIURL:` + fmt.Sprintf("%v", this.APIURL) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *StorageGridFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StorageGridFilter{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Suffix:` + fmt.Sprintf("%v", this.Suffix) + `,`, + `}`, + }, "") + return s +} +func (this *StripeEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&StripeEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `CreateWebhook:` + fmt.Sprintf("%v", this.CreateWebhook) + `,`, + `APIKey:` + strings.Replace(fmt.Sprintf("%v", this.APIKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `EventFilter:` + fmt.Sprintf("%v", this.EventFilter) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *TLSConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TLSConfig{`, + `CACertSecret:` + strings.Replace(fmt.Sprintf("%v", this.CACertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ClientCertSecret:` + strings.Replace(fmt.Sprintf("%v", this.ClientCertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ClientKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.ClientKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `InsecureSkipVerify:` + fmt.Sprintf("%v", this.InsecureSkipVerify) + `,`, + `}`, + }, "") + return s +} +func (this *Template) String() string { + if this == nil { + return "nil" + } + repeatedStringForVolumes := "[]Volume{" + for _, f := range this.Volumes { + repeatedStringForVolumes += fmt.Sprintf("%v", f) + "," + } + repeatedStringForVolumes += "}" + repeatedStringForTolerations := "[]Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForTolerations += "}" + repeatedStringForImagePullSecrets := "[]LocalObjectReference{" + for _, f := range this.ImagePullSecrets { + repeatedStringForImagePullSecrets += fmt.Sprintf("%v", f) + "," + } + repeatedStringForImagePullSecrets += "}" + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&Template{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `Container:` + strings.Replace(this.Container.String(), "Container", "Container", 1) + `,`, + `Volumes:` + repeatedStringForVolumes + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `ImagePullSecrets:` + repeatedStringForImagePullSecrets + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `Affinity:` + strings.Replace(fmt.Sprintf("%v", this.Affinity), "Affinity", "v1.Affinity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TimeFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TimeFilter{`, + `Start:` + fmt.Sprintf("%v", this.Start) + `,`, + `Stop:` + fmt.Sprintf("%v", this.Stop) + `,`, + `}`, + }, "") + return s +} +func (this *Trigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&Trigger{`, + `Template:` + strings.Replace(this.Template.String(), "TriggerTemplate", "TriggerTemplate", 1) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Policy:` + strings.Replace(this.Policy.String(), "TriggerPolicy", "TriggerPolicy", 1) + `,`, + `RetryStrategy:` + strings.Replace(this.RetryStrategy.String(), "Backoff", "Backoff", 1) + `,`, + `RateLimit:` + strings.Replace(this.RateLimit.String(), "RateLimit", "RateLimit", 1) + `,`, + `AtLeastOnce:` + fmt.Sprintf("%v", this.AtLeastOnce) + `,`, + `DlqTrigger:` + strings.Replace(this.DlqTrigger.String(), "Trigger", "Trigger", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerParameter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TriggerParameter{`, + `Src:` + strings.Replace(this.Src.String(), "TriggerParameterSource", "TriggerParameterSource", 1) + `,`, + `Dest:` + fmt.Sprintf("%v", this.Dest) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerParameterSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TriggerParameterSource{`, + `DependencyName:` + fmt.Sprintf("%v", this.DependencyName) + `,`, + `ContextKey:` + fmt.Sprintf("%v", this.ContextKey) + `,`, + `ContextTemplate:` + fmt.Sprintf("%v", this.ContextTemplate) + `,`, + `DataKey:` + fmt.Sprintf("%v", this.DataKey) + `,`, + `DataTemplate:` + fmt.Sprintf("%v", this.DataTemplate) + `,`, + `Value:` + valueToStringGenerated(this.Value) + `,`, + `UseRawData:` + fmt.Sprintf("%v", this.UseRawData) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TriggerPolicy{`, + `K8s:` + strings.Replace(this.K8s.String(), "K8SResourcePolicy", "K8SResourcePolicy", 1) + `,`, + `Status:` + strings.Replace(this.Status.String(), "StatusPolicy", "StatusPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerTemplate) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditionsReset := "[]ConditionsResetCriteria{" + for _, f := range this.ConditionsReset { + repeatedStringForConditionsReset += strings.Replace(strings.Replace(f.String(), "ConditionsResetCriteria", "ConditionsResetCriteria", 1), `&`, ``, 1) + "," + } + repeatedStringForConditionsReset += "}" + s := strings.Join([]string{`&TriggerTemplate{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Conditions:` + fmt.Sprintf("%v", this.Conditions) + `,`, + `K8s:` + strings.Replace(this.K8s.String(), "StandardK8STrigger", "StandardK8STrigger", 1) + `,`, + `ArgoWorkflow:` + strings.Replace(this.ArgoWorkflow.String(), "ArgoWorkflowTrigger", "ArgoWorkflowTrigger", 1) + `,`, + `HTTP:` + strings.Replace(this.HTTP.String(), "HTTPTrigger", "HTTPTrigger", 1) + `,`, + `AWSLambda:` + strings.Replace(this.AWSLambda.String(), "AWSLambdaTrigger", "AWSLambdaTrigger", 1) + `,`, + `CustomTrigger:` + strings.Replace(this.CustomTrigger.String(), "CustomTrigger", "CustomTrigger", 1) + `,`, + `Kafka:` + strings.Replace(this.Kafka.String(), "KafkaTrigger", "KafkaTrigger", 1) + `,`, + `NATS:` + strings.Replace(this.NATS.String(), "NATSTrigger", "NATSTrigger", 1) + `,`, + `Slack:` + strings.Replace(this.Slack.String(), "SlackTrigger", "SlackTrigger", 1) + `,`, + `OpenWhisk:` + strings.Replace(this.OpenWhisk.String(), "OpenWhiskTrigger", "OpenWhiskTrigger", 1) + `,`, + `Log:` + strings.Replace(this.Log.String(), "LogTrigger", "LogTrigger", 1) + `,`, + `AzureEventHubs:` + strings.Replace(this.AzureEventHubs.String(), "AzureEventHubsTrigger", "AzureEventHubsTrigger", 1) + `,`, + `Pulsar:` + strings.Replace(this.Pulsar.String(), "PulsarTrigger", "PulsarTrigger", 1) + `,`, + `ConditionsReset:` + repeatedStringForConditionsReset + `,`, + `AzureServiceBus:` + strings.Replace(this.AzureServiceBus.String(), "AzureServiceBusTrigger", "AzureServiceBusTrigger", 1) + `,`, + `Email:` + strings.Replace(this.Email.String(), "EmailTrigger", "EmailTrigger", 1) + `,`, + `}`, + }, "") + return s +} +func (this *URLArtifact) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&URLArtifact{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `VerifyCert:` + fmt.Sprintf("%v", this.VerifyCert) + `,`, + `}`, + }, "") + return s +} +func (this *ValueFromSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ValueFromSource{`, + `SecretKeyRef:` + strings.Replace(fmt.Sprintf("%v", this.SecretKeyRef), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ConfigMapKeyRef:` + strings.Replace(fmt.Sprintf("%v", this.ConfigMapKeyRef), "ConfigMapKeySelector", "v1.ConfigMapKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *WatchPathConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WatchPathConfig{`, + `Directory:` + fmt.Sprintf("%v", this.Directory) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `PathRegexp:` + fmt.Sprintf("%v", this.PathRegexp) + `,`, + `}`, + }, "") + return s +} +func (this *WebhookContext) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&WebhookContext{`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `Method:` + fmt.Sprintf("%v", this.Method) + `,`, + `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `ServerCertSecret:` + strings.Replace(fmt.Sprintf("%v", this.ServerCertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ServerKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.ServerKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `AuthSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `MaxPayloadSize:` + valueToStringGenerated(this.MaxPayloadSize) + `,`, + `}`, + }, "") + return s +} +func (this *WebhookEventSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WebhookEventSource{`, + `WebhookContext:` + strings.Replace(strings.Replace(this.WebhookContext.String(), "WebhookContext", "WebhookContext", 1), `&`, ``, 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AMQPConsumeConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPConsumeConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPConsumeConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerTag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerTag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoAck", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AutoAck = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exclusive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exclusive = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoLocal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoLocal = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoutingKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoutingKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeDeclare", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExchangeDeclare == nil { + m.ExchangeDeclare = &AMQPExchangeDeclareConfig{} + } + if err := m.ExchangeDeclare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueDeclare", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueueDeclare == nil { + m.QueueDeclare = &AMQPQueueDeclareConfig{} + } + if err := m.QueueDeclare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueBind", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueueBind == nil { + m.QueueBind = &AMQPQueueBindConfig{} + } + if err := m.QueueBind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consume", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Consume == nil { + m.Consume = &AMQPConsumeConfig{} + } + if err := m.Consume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BasicAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URLSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.URLSecret == nil { + m.URLSecret = &v1.SecretKeySelector{} + } + if err := m.URLSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPExchangeDeclareConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPExchangeDeclareConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPExchangeDeclareConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Durable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Durable = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoDelete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AutoDelete = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Internal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Internal = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPQueueBindConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPQueueBindConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPQueueBindConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPQueueDeclareConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPQueueDeclareConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPQueueDeclareConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Durable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Durable = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoDelete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AutoDelete = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exclusive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exclusive = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Arguments", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Arguments = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AWSLambdaTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AWSLambdaTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AWSLambdaTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunctionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FunctionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvocationType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.InvocationType = &s + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoleARN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoleARN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Amount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Amount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Amount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArgoWorkflowTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArgoWorkflowTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArgoWorkflowTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &ArtifactLocation{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = ArgoWorkflowOperation(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArtifactLocation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArtifactLocation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArtifactLocation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field S3", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.S3 == nil { + m.S3 = &S3Artifact{} + } + if err := m.S3.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inline", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Inline = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.File == nil { + m.File = &FileArtifact{} + } + if err := m.File.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.URL == nil { + m.URL = &URLArtifact{} + } + if err := m.URL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configmap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Configmap == nil { + m.Configmap = &v1.ConfigMapKeySelector{} + } + if err := m.Configmap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Git", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Git == nil { + m.Git = &GitArtifact{} + } + if err := m.Git.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resource == nil { + m.Resource = &K8SResource{} + } + if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureEventHubsTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureEventHubsTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureEventHubsTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FQDN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FQDN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HubName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HubName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKeyName", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKeyName == nil { + m.SharedAccessKeyName = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKeyName.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKey == nil { + m.SharedAccessKey = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureEventsHubEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureEventsHubEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureEventsHubEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FQDN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FQDN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKeyName", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKeyName == nil { + m.SharedAccessKeyName = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKeyName.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKey == nil { + m.SharedAccessKey = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HubName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HubName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureQueueStorageEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureQueueStorageEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureQueueStorageEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StorageAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionString", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionString == nil { + m.ConnectionString = &v1.SecretKeySelector{} + } + if err := m.ConnectionString.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DLQ", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DLQ = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DecodeMessage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DecodeMessage = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WaitTimeInSeconds", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WaitTimeInSeconds = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureServiceBusEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureServiceBusEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureServiceBusEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionString", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionString == nil { + m.ConnectionString = &v1.SecretKeySelector{} + } + if err := m.ConnectionString.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubscriptionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FullyQualifiedNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FullyQualifiedNamespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureServiceBusTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureServiceBusTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureServiceBusTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionString", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionString == nil { + m.ConnectionString = &v1.SecretKeySelector{} + } + if err := m.ConnectionString.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubscriptionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Backoff) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Backoff: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Backoff: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Duration == nil { + m.Duration = &Int64OrString{} + } + if err := m.Duration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Factor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Factor == nil { + m.Factor = &Amount{} + } + if err := m.Factor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Jitter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Jitter == nil { + m.Jitter = &Amount{} + } + if err := m.Jitter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Steps", wireType) + } + m.Steps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Steps |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasicAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BasicAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &BitbucketBasicAuth{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OAuthToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OAuthToken == nil { + m.OAuthToken = &v1.SecretKeySelector{} + } + if err := m.OAuthToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketBasicAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketBasicAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketBasicAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BitbucketAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedProjectKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedProjectKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedRepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedRepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repositories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Repositories = append(m.Repositories, BitbucketRepository{}) + if err := m.Repositories[len(m.Repositories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketRepository) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketRepository: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketRepository: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketServerEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketServerEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketServerEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedProjectKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedProjectKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedRepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedRepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repositories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Repositories = append(m.Repositories, BitbucketServerRepository{}) + if err := m.Repositories[len(m.Repositories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipBranchRefsChangedOnOpenPR", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipBranchRefsChangedOnOpenPR = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OneEventPerChange", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OneEventPerChange = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessToken == nil { + m.AccessToken = &v1.SecretKeySelector{} + } + if err := m.AccessToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebhookSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WebhookSecret == nil { + m.WebhookSecret = &v1.SecretKeySelector{} + } + if err := m.WebhookSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BitbucketServerBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BitbucketServerBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckInterval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CheckInterval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketServerRepository) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketServerRepository: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketServerRepository: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProjectKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BusConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BusConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BusConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = &NATSConfig{} + } + if err := m.NATS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JetStream", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JetStream == nil { + m.JetStream = &JetStreamConfig{} + } + if err := m.JetStream.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = &KafkaBus{} + } + if err := m.Kafka.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CalendarEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CalendarEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CalendarEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schedule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schedule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Interval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExclusionDates", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExclusionDates = append(m.ExclusionDates, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timezone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timezone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &EventPersistence{} + } + if err := m.Persistence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CatchupConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CatchupConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CatchupConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDuration", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MaxDuration = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Condition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Condition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Condition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = ConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConditionsResetByTime) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConditionsResetByTime: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConditionsResetByTime: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cron", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cron = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timezone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timezone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConditionsResetCriteria) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConditionsResetCriteria: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConditionsResetCriteria: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ByTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ByTime == nil { + m.ByTime = &ConditionsResetByTime{} + } + if err := m.ByTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigMapPersistence) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigMapPersistence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigMapPersistence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateIfNotExist", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CreateIfNotExist = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Container) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Container: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullPolicy = k8s_io_api_core_v1.PullPolicy(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.SecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeMounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VolumeMounts = append(m.VolumeMounts, v1.VolumeMount{}) + if err := m.VolumeMounts[len(m.VolumeMounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, v1.EnvVar{}) + if err := m.Env[len(m.Env)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnvFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EnvFrom = append(m.EnvFrom, v1.EnvFromSource{}) + if err := m.EnvFrom[len(m.EnvFrom)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContainerTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullPolicy = k8s_io_api_core_v1.PullPolicy(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.SecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CustomTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CustomTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CustomTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServerURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Secure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Secure = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CertSecret == nil { + m.CertSecret = &v1.SecretKeySelector{} + } + if err := m.CertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerNameOverride", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServerNameOverride = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Spec == nil { + m.Spec = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Spec[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DataFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DataFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DataFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = JSONType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Comparator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Comparator = Comparator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Template = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EmailTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EmailTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EmailTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SMTPPassword", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SMTPPassword == nil { + m.SMTPPassword = &v1.SecretKeySelector{} + } + if err := m.SMTPPassword.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = append(m.To, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Body = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EmitterEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EmitterEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EmitterEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Broker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Broker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Event) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Event: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &EventContext{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBusList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBusList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBusList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, EventBus{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBusSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBusSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBusSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = &NATSBus{} + } + if err := m.NATS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JetStream", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JetStream == nil { + m.JetStream = &JetStreamBus{} + } + if err := m.JetStream.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = &KafkaBus{} + } + if err := m.Kafka.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JetStreamExotic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JetStreamExotic == nil { + m.JetStreamExotic = &JetStreamConfig{} + } + if err := m.JetStreamExotic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBusStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBusStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBusStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpecVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpecVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataContentType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataContentType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDependency) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventDependency: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDependency: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventSourceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventSourceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filters == nil { + m.Filters = &EventDependencyFilter{} + } + if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transform", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Transform == nil { + m.Transform = &EventDependencyTransformer{} + } + if err := m.Transform.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FiltersLogicalOperator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FiltersLogicalOperator = LogicalOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDependencyFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventDependencyFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDependencyFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Time == nil { + m.Time = &TimeFilter{} + } + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &EventContext{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, DataFilter{}) + if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exprs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Exprs = append(m.Exprs, ExprFilter{}) + if err := m.Exprs[len(m.Exprs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataLogicalOperator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataLogicalOperator = LogicalOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExprLogicalOperator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExprLogicalOperator = LogicalOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Script", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Script = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDependencyTransformer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventDependencyTransformer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDependencyTransformer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JQ", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.JQ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Script", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Script = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventPersistence) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventPersistence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventPersistence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Catchup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Catchup == nil { + m.Catchup = &CatchupConfiguration{} + } + if err := m.Catchup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigMap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConfigMap == nil { + m.ConfigMap = &ConfigMapPersistence{} + } + if err := m.ConfigMap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expression = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, EventSource{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventBusName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventBusName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Template == nil { + m.Template = &Template{} + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Service == nil { + m.Service = &Service{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minio", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Minio == nil { + m.Minio = make(map[string]S3Artifact) + } + var mapkey string + mapvalue := &S3Artifact{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &S3Artifact{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Minio[mapkey] = *mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Calendar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Calendar == nil { + m.Calendar = make(map[string]CalendarEventSource) + } + var mapkey string + mapvalue := &CalendarEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &CalendarEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Calendar[mapkey] = *mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.File == nil { + m.File = make(map[string]FileEventSource) + } + var mapkey string + mapvalue := &FileEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &FileEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.File[mapkey] = *mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resource == nil { + m.Resource = make(map[string]ResourceEventSource) + } + var mapkey string + mapvalue := &ResourceEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ResourceEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Resource[mapkey] = *mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = make(map[string]WebhookEventSource) + } + var mapkey string + mapvalue := &WebhookEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &WebhookEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Webhook[mapkey] = *mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AMQP", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AMQP == nil { + m.AMQP = make(map[string]AMQPEventSource) + } + var mapkey string + mapvalue := &AMQPEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AMQPEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AMQP[mapkey] = *mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = make(map[string]KafkaEventSource) + } + var mapkey string + mapvalue := &KafkaEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KafkaEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Kafka[mapkey] = *mapvalue + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MQTT", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MQTT == nil { + m.MQTT = make(map[string]MQTTEventSource) + } + var mapkey string + mapvalue := &MQTTEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &MQTTEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.MQTT[mapkey] = *mapvalue + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = make(map[string]NATSEventsSource) + } + var mapkey string + mapvalue := &NATSEventsSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &NATSEventsSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NATS[mapkey] = *mapvalue + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SNS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SNS == nil { + m.SNS = make(map[string]SNSEventSource) + } + var mapkey string + mapvalue := &SNSEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SNSEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SNS[mapkey] = *mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SQS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SQS == nil { + m.SQS = make(map[string]SQSEventSource) + } + var mapkey string + mapvalue := &SQSEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SQSEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SQS[mapkey] = *mapvalue + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubSub", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubSub == nil { + m.PubSub = make(map[string]PubSubEventSource) + } + var mapkey string + mapvalue := &PubSubEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &PubSubEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.PubSub[mapkey] = *mapvalue + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Github", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Github == nil { + m.Github = make(map[string]GithubEventSource) + } + var mapkey string + mapvalue := &GithubEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GithubEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Github[mapkey] = *mapvalue + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gitlab", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gitlab == nil { + m.Gitlab = make(map[string]GitlabEventSource) + } + var mapkey string + mapvalue := &GitlabEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GitlabEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Gitlab[mapkey] = *mapvalue + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HDFS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HDFS == nil { + m.HDFS = make(map[string]HDFSEventSource) + } + var mapkey string + mapvalue := &HDFSEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &HDFSEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.HDFS[mapkey] = *mapvalue + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Slack", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Slack == nil { + m.Slack = make(map[string]SlackEventSource) + } + var mapkey string + mapvalue := &SlackEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SlackEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Slack[mapkey] = *mapvalue + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageGrid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StorageGrid == nil { + m.StorageGrid = make(map[string]StorageGridEventSource) + } + var mapkey string + mapvalue := &StorageGridEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StorageGridEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.StorageGrid[mapkey] = *mapvalue + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureEventsHub", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureEventsHub == nil { + m.AzureEventsHub = make(map[string]AzureEventsHubEventSource) + } + var mapkey string + mapvalue := &AzureEventsHubEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AzureEventsHubEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AzureEventsHub[mapkey] = *mapvalue + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stripe", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stripe == nil { + m.Stripe = make(map[string]StripeEventSource) + } + var mapkey string + mapvalue := &StripeEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StripeEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Stripe[mapkey] = *mapvalue + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Emitter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Emitter == nil { + m.Emitter = make(map[string]EmitterEventSource) + } + var mapkey string + mapvalue := &EmitterEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &EmitterEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Emitter[mapkey] = *mapvalue + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Redis", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Redis == nil { + m.Redis = make(map[string]RedisEventSource) + } + var mapkey string + mapvalue := &RedisEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &RedisEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Redis[mapkey] = *mapvalue + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NSQ", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NSQ == nil { + m.NSQ = make(map[string]NSQEventSource) + } + var mapkey string + mapvalue := &NSQEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &NSQEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NSQ[mapkey] = *mapvalue + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pulsar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pulsar == nil { + m.Pulsar = make(map[string]PulsarEventSource) + } + var mapkey string + mapvalue := &PulsarEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &PulsarEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Pulsar[mapkey] = *mapvalue + iNdEx = postIndex + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Generic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Generic == nil { + m.Generic = make(map[string]GenericEventSource) + } + var mapkey string + mapvalue := &GenericEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GenericEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Generic[mapkey] = *mapvalue + iNdEx = postIndex + case 28: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Replicas = &v + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BitbucketServer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BitbucketServer == nil { + m.BitbucketServer = make(map[string]BitbucketServerEventSource) + } + var mapkey string + mapvalue := &BitbucketServerEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &BitbucketServerEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.BitbucketServer[mapkey] = *mapvalue + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bitbucket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bitbucket == nil { + m.Bitbucket = make(map[string]BitbucketEventSource) + } + var mapkey string + mapvalue := &BitbucketEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &BitbucketEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Bitbucket[mapkey] = *mapvalue + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedisStream", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RedisStream == nil { + m.RedisStream = make(map[string]RedisStreamEventSource) + } + var mapkey string + mapvalue := &RedisStreamEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &RedisStreamEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.RedisStream[mapkey] = *mapvalue + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureServiceBus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureServiceBus == nil { + m.AzureServiceBus = make(map[string]AzureServiceBusEventSource) + } + var mapkey string + mapvalue := &AzureServiceBusEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AzureServiceBusEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AzureServiceBus[mapkey] = *mapvalue + iNdEx = postIndex + case 33: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureQueueStorage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureQueueStorage == nil { + m.AzureQueueStorage = make(map[string]AzureQueueStorageEventSource) + } + var mapkey string + mapvalue := &AzureQueueStorageEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AzureQueueStorageEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AzureQueueStorage[mapkey] = *mapvalue + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SFTP", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SFTP == nil { + m.SFTP = make(map[string]SFTPEventSource) + } + var mapkey string + mapvalue := &SFTPEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SFTPEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SFTP[mapkey] = *mapvalue + iNdEx = postIndex + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gerrit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gerrit == nil { + m.Gerrit = make(map[string]GerritEventSource) + } + var mapkey string + mapvalue := &GerritEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GerritEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Gerrit[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExprFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExprFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExprFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fields = append(m.Fields, PayloadField{}) + if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FileArtifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileArtifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileArtifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FileEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchPathConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WatchPathConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Polling", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Polling = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenericEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenericEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenericEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Insecure = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSecret == nil { + m.AuthSecret = &v1.SecretKeySelector{} + } + if err := m.AuthSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GerritEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GerritEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GerritEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HookName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HookName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BasicAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GerritBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GerritBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SslVerify", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SslVerify = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitArtifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitArtifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitArtifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CloneDirectory", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CloneDirectory = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Creds == nil { + m.Creds = &GitCreds{} + } + if err := m.Creds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SSHKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SSHKeySecret == nil { + m.SSHKeySecret = &v1.SecretKeySelector{} + } + if err := m.SSHKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FilePath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FilePath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Branch", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Branch = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ref = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Remote == nil { + m.Remote = &GitRemoteConfig{} + } + if err := m.Remote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InsecureIgnoreHostKey", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.InsecureIgnoreHostKey = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitCreds) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitCreds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitCreds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitRemoteConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitRemoteConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitRemoteConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URLS", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URLS = append(m.URLS, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GithubAppCreds) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GithubAppCreds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GithubAppCreds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrivateKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PrivateKey == nil { + m.PrivateKey = &v1.SecretKeySelector{} + } + if err := m.PrivateKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppID", wireType) + } + m.AppID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppID |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InstallationID", wireType) + } + m.InstallationID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InstallationID |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GithubEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GithubEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GithubEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedRepository", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedRepository = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.APIToken == nil { + m.APIToken = &v1.SecretKeySelector{} + } + if err := m.APIToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebhookSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WebhookSecret == nil { + m.WebhookSecret = &v1.SecretKeySelector{} + } + if err := m.WebhookSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Insecure = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Active = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContentType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContentType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GithubBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GithubBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GithubUploadURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GithubUploadURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repositories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Repositories = append(m.Repositories, OwnedRepositories{}) + if err := m.Repositories[len(m.Repositories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Organizations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Organizations = append(m.Organizations, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GithubApp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GithubApp == nil { + m.GithubApp = &GithubAppCreds{} + } + if err := m.GithubApp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitlabEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitlabEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitlabEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedProjectID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedProjectID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessToken == nil { + m.AccessToken = &v1.SecretKeySelector{} + } + if err := m.AccessToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableSSLVerification", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableSSLVerification = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GitlabBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GitlabBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretToken == nil { + m.SecretToken = &v1.SecretKeySelector{} + } + if err := m.SecretToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HDFSEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HDFSEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HDFSEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchPathConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WatchPathConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckInterval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CheckInterval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HDFSUser", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HDFSUser = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbCCacheSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KrbCCacheSecret == nil { + m.KrbCCacheSecret = &v1.SecretKeySelector{} + } + if err := m.KrbCCacheSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbKeytabSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KrbKeytabSecret == nil { + m.KrbKeytabSecret = &v1.SecretKeySelector{} + } + if err := m.KrbKeytabSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbUsername", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KrbUsername = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbRealm", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KrbRealm = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbConfigConfigMap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KrbConfigConfigMap == nil { + m.KrbConfigConfigMap = &v1.ConfigMapKeySelector{} + } + if err := m.KrbConfigConfigMap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbServicePrincipalName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KrbServicePrincipalName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + m.Timeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timeout |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasicAuth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BasicAuth == nil { + m.BasicAuth = &BasicAuth{} + } + if err := m.BasicAuth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Headers[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecureHeaders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecureHeaders = append(m.SecureHeaders, &SecureHeader{}) + if err := m.SecureHeaders[len(m.SecureHeaders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Int64OrString) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Int64OrString: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Int64OrString: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Int64Val", wireType) + } + m.Int64Val = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Int64Val |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StrVal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StrVal = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JetStreamBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JetStreamBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JetStreamBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Replicas = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContainerTemplate == nil { + m.ContainerTemplate = &ContainerTemplate{} + } + if err := m.ContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReloaderContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ReloaderContainerTemplate == nil { + m.ReloaderContainerTemplate = &ContainerTemplate{} + } + if err := m.ReloaderContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricsContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetricsContainerTemplate == nil { + m.MetricsContainerTemplate = &ContainerTemplate{} + } + if err := m.MetricsContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &PersistenceStrategy{} + } + if err := m.Persistence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NodeSelector[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, v1.Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.PodSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecrets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullSecrets = append(m.ImagePullSecrets, v1.LocalObjectReference{}) + if err := m.ImagePullSecrets[len(m.ImagePullSecrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Affinity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Affinity == nil { + m.Affinity = &v1.Affinity{} + } + if err := m.Affinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Settings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Settings = &s + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartArgs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartArgs = append(m.StartArgs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.StreamConfig = &s + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPayload", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxPayload = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JetStreamConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JetStreamConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JetStreamConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessSecret == nil { + m.AccessSecret = &v1.SecretKeySelector{} + } + if err := m.AccessSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StreamConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *K8SResource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: K8SResource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: K8SResource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *K8SResourcePolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: K8SResourcePolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: K8SResourcePolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Backoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Backoff == nil { + m.Backoff = &Backoff{} + } + if err := m.Backoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorOnBackoffTimeout", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ErrorOnBackoffTimeout = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SASL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SASL == nil { + m.SASL = &SASLConfig{} + } + if err := m.SASL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerGroup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsumerGroup == nil { + m.ConsumerGroup = &KafkaConsumerGroup{} + } + if err := m.ConsumerGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaConsumerGroup) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaConsumerGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaConsumerGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Oldest", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Oldest = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RebalanceStrategy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RebalanceStrategy = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Partition = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerGroup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsumerGroup == nil { + m.ConsumerGroup = &KafkaConsumerGroup{} + } + if err := m.ConsumerGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitEventsPerSecond", wireType) + } + m.LimitEventsPerSecond = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitEventsPerSecond |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SASL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SASL == nil { + m.SASL = &SASLConfig{} + } + if err := m.SASL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) + } + m.Partition = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Partition |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequiredAcks", wireType) + } + m.RequiredAcks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequiredAcks |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Compress", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Compress = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FlushFrequency", wireType) + } + m.FlushFrequency = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FlushFrequency |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitioningKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.PartitioningKey = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SASL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SASL == nil { + m.SASL = &SASLConfig{} + } + if err := m.SASL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaRegistry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchemaRegistry == nil { + m.SchemaRegistry = &SchemaRegistryConfig{} + } + if err := m.SchemaRegistry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Headers[mapkey] = mapvalue + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecureHeaders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecureHeaders = append(m.SecureHeaders, &SecureHeader{}) + if err := m.SecureHeaders[len(m.SecureHeaders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LogTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) + } + m.IntervalSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IntervalSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MQTTEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MQTTEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MQTTEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BasicAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &BasicAuth{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Token == nil { + m.Token = &v1.SecretKeySelector{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NKey == nil { + m.NKey = &v1.SecretKeySelector{} + } + if err := m.NKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credential", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Credential == nil { + m.Credential = &v1.SecretKeySelector{} + } + if err := m.Credential.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Native", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Native == nil { + m.Native = &NativeStrategy{} + } + if err := m.Native.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exotic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exotic == nil { + m.Exotic = &NATSConfig{} + } + if err := m.Exotic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ClusterID = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := AuthStrategy(dAtA[iNdEx:postIndex]) + m.Auth = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessSecret == nil { + m.AccessSecret = &v1.SecretKeySelector{} + } + if err := m.AccessSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSEventsSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSEventsSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSEventsSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &NATSAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Queue = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &NATSAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NSQEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NSQEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NSQEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NativeStrategy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NativeStrategy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NativeStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + m.Replicas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Replicas |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := AuthStrategy(dAtA[iNdEx:postIndex]) + m.Auth = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &PersistenceStrategy{} + } + if err := m.Persistence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContainerTemplate == nil { + m.ContainerTemplate = &ContainerTemplate{} + } + if err := m.ContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricsContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetricsContainerTemplate == nil { + m.MetricsContainerTemplate = &ContainerTemplate{} + } + if err := m.MetricsContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NodeSelector[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, v1.Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.PodSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAge", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxAge = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecrets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullSecrets = append(m.ImagePullSecrets, v1.LocalObjectReference{}) + if err := m.ImagePullSecrets[len(m.ImagePullSecrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Affinity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Affinity == nil { + m.Affinity = &v1.Affinity{} + } + if err := m.Affinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxMsgs", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxMsgs = &v + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxBytes = &s + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxSubs", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxSubs = &v + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPayload", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxPayload = &s + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftHeartbeatTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftHeartbeatTimeout = &s + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftElectionTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftElectionTimeout = &s + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftLeaseTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftLeaseTimeout = &s + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftCommitTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftCommitTimeout = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OpenWhiskTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OpenWhiskTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OpenWhiskTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthToken == nil { + m.AuthToken = &v1.SecretKeySelector{} + } + if err := m.AuthToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OwnedRepositories) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OwnedRepositories: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OwnedRepositories: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PayloadField) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PayloadField: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PayloadField: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PersistenceStrategy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PersistenceStrategy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PersistenceStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.StorageClassName = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeAccessMode(dAtA[iNdEx:postIndex]) + m.AccessMode = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeSize", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VolumeSize == nil { + m.VolumeSize = &resource.Quantity{} + } + if err := m.VolumeSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubSubEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PubSubEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubSubEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProjectID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicProjectID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicProjectID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubscriptionID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CredentialSecret == nil { + m.CredentialSecret = &v1.SecretKeySelector{} + } + if err := m.CredentialSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteSubscriptionOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteSubscriptionOnFinish = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PulsarEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PulsarEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PulsarEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topics", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topics = append(m.Topics, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSTrustCertsSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLSTrustCertsSecret == nil { + m.TLSTrustCertsSecret = &v1.SecretKeySelector{} + } + if err := m.TLSTrustCertsSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSAllowInsecureConnection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSAllowInsecureConnection = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSValidateHostname", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSValidateHostname = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthTokenSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthTokenSecret == nil { + m.AuthTokenSecret = &v1.SecretKeySelector{} + } + if err := m.AuthTokenSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzParams == nil { + m.AuthAthenzParams = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AuthAthenzParams[mapkey] = mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzSecret == nil { + m.AuthAthenzSecret = &v1.SecretKeySelector{} + } + if err := m.AuthAthenzSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PulsarTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PulsarTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PulsarTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSTrustCertsSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLSTrustCertsSecret == nil { + m.TLSTrustCertsSecret = &v1.SecretKeySelector{} + } + if err := m.TLSTrustCertsSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSAllowInsecureConnection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSAllowInsecureConnection = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSValidateHostname", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSValidateHostname = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthTokenSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthTokenSecret == nil { + m.AuthTokenSecret = &v1.SecretKeySelector{} + } + if err := m.AuthTokenSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzParams == nil { + m.AuthAthenzParams = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AuthAthenzParams[mapkey] = mapvalue + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzSecret == nil { + m.AuthAthenzSecret = &v1.SecretKeySelector{} + } + if err := m.AuthAthenzSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RateLimit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RateLimit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RateLimit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Unit = RateLimiteUnit(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestsPerUnit", wireType) + } + m.RequestsPerUnit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequestsPerUnit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RedisEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RedisEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RedisEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DB", wireType) + } + m.DB = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DB |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channels = append(m.Channels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RedisStreamEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RedisStreamEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RedisStreamEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DB", wireType) + } + m.DB = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DB |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Streams = append(m.Streams, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxMsgCountPerRead", wireType) + } + m.MaxMsgCountPerRead = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxMsgCountPerRead |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerGroup = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &ResourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupVersionResource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GroupVersionResource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventTypes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventTypes = append(m.EventTypes, ResourceEventType(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, Selector{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fields = append(m.Fields, Selector{}) + if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedBy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CreatedBy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AfterStart", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AfterStart = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *S3Artifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: S3Artifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: S3Artifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bucket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bucket == nil { + m.Bucket = &S3Bucket{} + } + if err := m.Bucket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Insecure = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &S3Filter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CACertificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CACertificate == nil { + m.CACertificate = &v1.SecretKeySelector{} + } + if err := m.CACertificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *S3Bucket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: S3Bucket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: S3Bucket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *S3Filter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: S3Filter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: S3Filter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Suffix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Suffix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SASLConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SASLConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SASLConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mechanism", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mechanism = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UserSecret == nil { + m.UserSecret = &v1.SecretKeySelector{} + } + if err := m.UserSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PasswordSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PasswordSecret == nil { + m.PasswordSecret = &v1.SecretKeySelector{} + } + if err := m.PasswordSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SFTPEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SFTPEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SFTPEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchPathConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WatchPathConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SSHKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SSHKeySecret == nil { + m.SSHKeySecret = &v1.SecretKeySelector{} + } + if err := m.SSHKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1.SecretKeySelector{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PollIntervalDuration", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PollIntervalDuration = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SNSEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SNSEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SNSEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicArn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicArn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoleARN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoleARN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidateSignature", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ValidateSignature = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SQSEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SQSEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SQSEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Queue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WaitTimeSeconds", wireType) + } + m.WaitTimeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WaitTimeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoleARN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoleARN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueAccountID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueAccountID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DLQ", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DLQ = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionToken == nil { + m.SessionToken = &v1.SecretKeySelector{} + } + if err := m.SessionToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SchemaRegistryConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SchemaRegistryConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SchemaRegistryConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaID", wireType) + } + m.SchemaID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaID |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecureHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecureHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecureHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValueFrom == nil { + m.ValueFrom = &ValueFromSource{} + } + if err := m.ValueFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Selector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Selector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Selector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Sensor) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sensor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sensor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SensorList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SensorList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SensorList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, Sensor{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SensorSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SensorSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SensorSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dependencies = append(m.Dependencies, EventDependency{}) + if err := m.Dependencies[len(m.Dependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Triggers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Triggers = append(m.Triggers, Trigger{}) + if err := m.Triggers[len(m.Triggers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Template == nil { + m.Template = &Template{} + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorOnFailedRound", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ErrorOnFailedRound = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventBusName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventBusName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Replicas = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevisionHistoryLimit", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RevisionHistoryLimit = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoggingFields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LoggingFields == nil { + m.LoggingFields = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.LoggingFields[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SensorStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SensorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SensorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Service) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, v1.ServicePort{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClusterIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigningSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SigningSecret == nil { + m.SigningSecret = &v1.SecretKeySelector{} + } + if err := m.SigningSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Token == nil { + m.Token = &v1.SecretKeySelector{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackSender) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackSender: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackSender: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackThread) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackThread: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackThread: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageAggregationKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageAggregationKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BroadcastMessageToChannel", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BroadcastMessageToChannel = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlackToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlackToken == nil { + m.SlackToken = &v1.SecretKeySelector{} + } + if err := m.SlackToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attachments = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocks = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Thread", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Thread.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Sender.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StandardK8STrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StandardK8STrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StandardK8STrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &ArtifactLocation{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = KubernetesResourceOperation(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PatchStrategy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PatchStrategy = k8s_io_apimachinery_pkg_types.PatchType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LiveObject", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LiveObject = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Status) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Status: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Allow = append(m.Allow, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Allow) == 0 { + m.Allow = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Allow = append(m.Allow, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Allow", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageGridEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageGridEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageGridEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &StorageGridFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicArn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicArn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bucket", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bucket = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthToken == nil { + m.AuthToken = &v1.SecretKeySelector{} + } + if err := m.AuthToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageGridFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageGridFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageGridFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Suffix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Suffix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StripeEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StripeEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StripeEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateWebhook", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CreateWebhook = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.APIKey == nil { + m.APIKey = &v1.SecretKeySelector{} + } + if err := m.APIKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventFilter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventFilter = append(m.EventFilter, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TLSConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TLSConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TLSConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CACertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CACertSecret == nil { + m.CACertSecret = &v1.SecretKeySelector{} + } + if err := m.CACertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientCertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientCertSecret == nil { + m.ClientCertSecret = &v1.SecretKeySelector{} + } + if err := m.ClientCertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientKeySecret == nil { + m.ClientKeySecret = &v1.SecretKeySelector{} + } + if err := m.ClientKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InsecureSkipVerify", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.InsecureSkipVerify = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Template) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Template: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Template: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, v1.Volume{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.PodSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NodeSelector[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, v1.Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecrets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullSecrets = append(m.ImagePullSecrets, v1.LocalObjectReference{}) + if err := m.ImagePullSecrets[len(m.ImagePullSecrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Affinity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Affinity == nil { + m.Affinity = &v1.Affinity{} + } + if err := m.Affinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimeFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TimeFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimeFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Start = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stop", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stop = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Trigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Trigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Trigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Template == nil { + m.Template = &TriggerTemplate{} + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Policy == nil { + m.Policy = &TriggerPolicy{} + } + if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetryStrategy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RetryStrategy == nil { + m.RetryStrategy = &Backoff{} + } + if err := m.RetryStrategy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RateLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RateLimit == nil { + m.RateLimit = &RateLimit{} + } + if err := m.RateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AtLeastOnce", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AtLeastOnce = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DlqTrigger", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DlqTrigger == nil { + m.DlqTrigger = &Trigger{} + } + if err := m.DlqTrigger.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerParameter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerParameter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerParameter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Src", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Src == nil { + m.Src = &TriggerParameterSource{} + } + if err := m.Src.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dest", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dest = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = TriggerParameterOperation(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerParameterSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerParameterSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerParameterSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DependencyName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DependencyName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContextKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextTemplate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContextTemplate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataTemplate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataTemplate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UseRawData", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UseRawData = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field K8s", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.K8s == nil { + m.K8s = &K8SResourcePolicy{} + } + if err := m.K8s.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &StatusPolicy{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field K8s", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.K8s == nil { + m.K8s = &StandardK8STrigger{} + } + if err := m.K8s.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArgoWorkflow", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ArgoWorkflow == nil { + m.ArgoWorkflow = &ArgoWorkflowTrigger{} + } + if err := m.ArgoWorkflow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HTTP == nil { + m.HTTP = &HTTPTrigger{} + } + if err := m.HTTP.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AWSLambda", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AWSLambda == nil { + m.AWSLambda = &AWSLambdaTrigger{} + } + if err := m.AWSLambda.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CustomTrigger", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CustomTrigger == nil { + m.CustomTrigger = &CustomTrigger{} + } + if err := m.CustomTrigger.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = &KafkaTrigger{} + } + if err := m.Kafka.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = &NATSTrigger{} + } + if err := m.NATS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Slack", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Slack == nil { + m.Slack = &SlackTrigger{} + } + if err := m.Slack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OpenWhisk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OpenWhisk == nil { + m.OpenWhisk = &OpenWhiskTrigger{} + } + if err := m.OpenWhisk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Log == nil { + m.Log = &LogTrigger{} + } + if err := m.Log.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureEventHubs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureEventHubs == nil { + m.AzureEventHubs = &AzureEventHubsTrigger{} + } + if err := m.AzureEventHubs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pulsar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pulsar == nil { + m.Pulsar = &PulsarTrigger{} + } + if err := m.Pulsar.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConditionsReset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConditionsReset = append(m.ConditionsReset, ConditionsResetCriteria{}) + if err := m.ConditionsReset[len(m.ConditionsReset)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureServiceBus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureServiceBus == nil { + m.AzureServiceBus = &AzureServiceBusTrigger{} + } + if err := m.AzureServiceBus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Email", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Email == nil { + m.Email = &EmailTrigger{} + } + if err := m.Email.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *URLArtifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: URLArtifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: URLArtifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyCert", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VerifyCert = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValueFromSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValueFromSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValueFromSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKeyRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKeyRef == nil { + m.SecretKeyRef = &v1.SecretKeySelector{} + } + if err := m.SecretKeyRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigMapKeyRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConfigMapKeyRef == nil { + m.ConfigMapKeyRef = &v1.ConfigMapKeySelector{} + } + if err := m.ConfigMapKeyRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WatchPathConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WatchPathConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WatchPathConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Directory", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Directory = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PathRegexp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PathRegexp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WebhookContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WebhookContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WebhookContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Port = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerCertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServerCertSecret == nil { + m.ServerCertSecret = &v1.SecretKeySelector{} + } + if err := m.ServerCertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServerKeySecret == nil { + m.ServerKeySecret = &v1.SecretKeySelector{} + } + if err := m.ServerKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSecret == nil { + m.AuthSecret = &v1.SecretKeySelector{} + } + if err := m.AuthSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPayloadSize", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxPayloadSize = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WebhookEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WebhookEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WebhookEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebhookContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WebhookContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) +``` + +## `pkg/apis/events/v1alpha1/template.go` (changed lines (3, 4, 5, 6, 18, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103)) + +```go +package v1alpha1 + +import ( + "dario.cat/mergo" + corev1 "k8s.io/api/core/v1" +) + +// Template holds the information of a deployment template +type Template struct { + // Metadata sets the pods's metadata, i.e. annotations and labels + Metadata *Metadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // ServiceAccountName is the name of the ServiceAccount to use to run sensor pod. + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ + // +optional + ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,2,opt,name=serviceAccountName"` + // Container is the main container image to run in the sensor pod + // +optional + Container *Container `json:"container,omitempty" protobuf:"bytes,3,opt,name=container"` + // Volumes is a list of volumes that can be mounted by containers in a workflow. + // +patchStrategy=merge + // +patchMergeKey=name + // +optional + Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,4,rep,name=volumes"` + // SecurityContext holds pod-level security attributes and common container settings. + // Optional: Defaults to empty. See type description for default values of each field. + // +optional + SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,5,opt,name=securityContext"` + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,6,rep,name=nodeSelector"` + // If specified, the pod's tolerations. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,7,rep,name=tolerations"` + // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. + // If specified, these secrets will be passed to individual puller implementations for them to use. For example, + // in the case of docker, only DockerConfig type secrets are honored. + // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,8,rep,name=imagePullSecrets"` + // If specified, indicates the EventSource pod's priority. "system-node-critical" + // and "system-cluster-critical" are two special keywords which indicate the + // highest priorities with the former being the highest priority. Any other + // name must be defined by creating a PriorityClass object with that name. + // If not specified, the pod priority will be default or zero if there is no + // default. + // More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ + // +optional + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,9,opt,name=priorityClassName"` + // The priority value. Various system components use this field to find the + // priority of the EventSource pod. When Priority Admission Controller is enabled, + // it prevents users from setting this field. The admission controller populates + // this field from PriorityClassName. + // The higher the value, the higher the priority. + // More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ + // +optional + Priority *int32 `json:"priority,omitempty" protobuf:"bytes,10,opt,name=priority"` + // If specified, the pod's scheduling constraints + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty" protobuf:"bytes,11,opt,name=affinity"` +} + +// Container defines customized spec for a container +type Container struct { + // +optional + Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` + // +optional + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,2,opt,name=imagePullPolicy,casttype=PullPolicy"` + // +optional + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,3,opt,name=securityContext"` + // +optional + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" protobuf:"bytes,4,rep,name=volumeMounts"` + // +optional + Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,5,rep,name=env"` + // +optional + EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,6,rep,name=envFrom"` +} + +// ApplyToContainer updates the Container with the values from the customized container +func (c *Container) ApplyToContainer(cc *corev1.Container) { + if c == nil { + return + } + _ = mergo.Merge(&cc.Resources, c.Resources, mergo.WithOverride) + if cc.SecurityContext == nil { + cc.SecurityContext = c.SecurityContext + } + if cc.ImagePullPolicy == "" { + cc.ImagePullPolicy = c.ImagePullPolicy + } + if len(c.Env) > 0 { + cc.Env = append(cc.Env, c.Env...) + } + if len(c.EnvFrom) > 0 { + cc.EnvFrom = append(cc.EnvFrom, c.EnvFrom...) + } + if len(c.VolumeMounts) > 0 { + cc.VolumeMounts = append(cc.VolumeMounts, c.VolumeMounts...) + } +} +``` + +## `pkg/apis/events/v1alpha1/template_test.go` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61)) + +```go +package v1alpha1 + +import ( + "testing" + + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +var ( + testContainer = &Container{ + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + "cpu": resource.MustParse("100m"), + }, + }, + } +) + +func Test_ApplyToContainer(t *testing.T) { + c := &corev1.Container{} + testContainer.ApplyToContainer(c) + assert.Equal(t, "", string(c.ImagePullPolicy)) + assert.Equal(t, testContainer.Resources, c.Resources) + c.Resources.Limits = corev1.ResourceList{ + "cpu": resource.MustParse("200m"), + } + testContainer.ApplyToContainer(c) + assert.Equal(t, resource.MustParse("200m"), *c.Resources.Limits.Cpu()) + c.Resources.Limits = corev1.ResourceList{ + "memory": resource.MustParse("32Mi"), + } + assert.Equal(t, resource.MustParse("32Mi"), *c.Resources.Limits.Memory()) + testContainer.ImagePullPolicy = corev1.PullAlways + testContainer.ApplyToContainer(c) + assert.Equal(t, corev1.PullAlways, c.ImagePullPolicy) + c.ImagePullPolicy = corev1.PullIfNotPresent + testContainer.ApplyToContainer(c) + assert.Equal(t, corev1.PullIfNotPresent, c.ImagePullPolicy) + testContainer.SecurityContext = &corev1.SecurityContext{} + testContainer.ApplyToContainer(c) + assert.NotNil(t, c.SecurityContext) + testContainer.Env = []corev1.EnvVar{{Name: "a", Value: "b"}} + testContainer.EnvFrom = []corev1.EnvFromSource{{Prefix: "a", ConfigMapRef: &corev1.ConfigMapEnvSource{LocalObjectReference: corev1.LocalObjectReference{Name: "b"}}}} + testContainer.ApplyToContainer(c) + envs := []string{} + for _, e := range c.Env { + envs = append(envs, e.Name) + } + assert.Contains(t, envs, "a") + envFroms := []string{} + for _, e := range c.EnvFrom { + envFroms = append(envFroms, e.Prefix) + } + assert.Contains(t, envFroms, "a") + testContainer.VolumeMounts = []corev1.VolumeMount{{Name: "test", MountPath: "/test"}} + testContainer.ApplyToContainer(c) + assert.Equal(t, 1, len(c.VolumeMounts)) + assert.Equal(t, "test", c.VolumeMounts[0].Name) +} +``` + +## `pkg/apis/events/v1alpha1/zz_generated.deepcopy.go` (changed lines (912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 4186)) + +```go +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPConsumeConfig) DeepCopyInto(out *AMQPConsumeConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPConsumeConfig. +func (in *AMQPConsumeConfig) DeepCopy() *AMQPConsumeConfig { + if in == nil { + return nil + } + out := new(AMQPConsumeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPEventSource) DeepCopyInto(out *AMQPEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExchangeDeclare != nil { + in, out := &in.ExchangeDeclare, &out.ExchangeDeclare + *out = new(AMQPExchangeDeclareConfig) + **out = **in + } + if in.QueueDeclare != nil { + in, out := &in.QueueDeclare, &out.QueueDeclare + *out = new(AMQPQueueDeclareConfig) + **out = **in + } + if in.QueueBind != nil { + in, out := &in.QueueBind, &out.QueueBind + *out = new(AMQPQueueBindConfig) + **out = **in + } + if in.Consume != nil { + in, out := &in.Consume, &out.Consume + *out = new(AMQPConsumeConfig) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.URLSecret != nil { + in, out := &in.URLSecret, &out.URLSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPEventSource. +func (in *AMQPEventSource) DeepCopy() *AMQPEventSource { + if in == nil { + return nil + } + out := new(AMQPEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPExchangeDeclareConfig) DeepCopyInto(out *AMQPExchangeDeclareConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPExchangeDeclareConfig. +func (in *AMQPExchangeDeclareConfig) DeepCopy() *AMQPExchangeDeclareConfig { + if in == nil { + return nil + } + out := new(AMQPExchangeDeclareConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPQueueBindConfig) DeepCopyInto(out *AMQPQueueBindConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPQueueBindConfig. +func (in *AMQPQueueBindConfig) DeepCopy() *AMQPQueueBindConfig { + if in == nil { + return nil + } + out := new(AMQPQueueBindConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPQueueDeclareConfig) DeepCopyInto(out *AMQPQueueDeclareConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPQueueDeclareConfig. +func (in *AMQPQueueDeclareConfig) DeepCopy() *AMQPQueueDeclareConfig { + if in == nil { + return nil + } + out := new(AMQPQueueDeclareConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLambdaTrigger) DeepCopyInto(out *AWSLambdaTrigger) { + *out = *in + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InvocationType != nil { + in, out := &in.InvocationType, &out.InvocationType + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLambdaTrigger. +func (in *AWSLambdaTrigger) DeepCopy() *AWSLambdaTrigger { + if in == nil { + return nil + } + out := new(AWSLambdaTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Amount) DeepCopyInto(out *Amount) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Amount. +func (in *Amount) DeepCopy() *Amount { + if in == nil { + return nil + } + out := new(Amount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArgoWorkflowTrigger) DeepCopyInto(out *ArgoWorkflowTrigger) { + *out = *in + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(ArtifactLocation) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoWorkflowTrigger. +func (in *ArgoWorkflowTrigger) DeepCopy() *ArgoWorkflowTrigger { + if in == nil { + return nil + } + out := new(ArgoWorkflowTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArtifactLocation) DeepCopyInto(out *ArtifactLocation) { + *out = *in + if in.S3 != nil { + in, out := &in.S3, &out.S3 + *out = new(S3Artifact) + (*in).DeepCopyInto(*out) + } + if in.Inline != nil { + in, out := &in.Inline, &out.Inline + *out = new(string) + **out = **in + } + if in.File != nil { + in, out := &in.File, &out.File + *out = new(FileArtifact) + **out = **in + } + if in.URL != nil { + in, out := &in.URL, &out.URL + *out = new(URLArtifact) + **out = **in + } + if in.Configmap != nil { + in, out := &in.Configmap, &out.Configmap + *out = new(v1.ConfigMapKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitArtifact) + (*in).DeepCopyInto(*out) + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = new(K8SResource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactLocation. +func (in *ArtifactLocation) DeepCopy() *ArtifactLocation { + if in == nil { + return nil + } + out := new(ArtifactLocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureEventHubsTrigger) DeepCopyInto(out *AzureEventHubsTrigger) { + *out = *in + if in.SharedAccessKeyName != nil { + in, out := &in.SharedAccessKeyName, &out.SharedAccessKeyName + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SharedAccessKey != nil { + in, out := &in.SharedAccessKey, &out.SharedAccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureEventHubsTrigger. +func (in *AzureEventHubsTrigger) DeepCopy() *AzureEventHubsTrigger { + if in == nil { + return nil + } + out := new(AzureEventHubsTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureEventsHubEventSource) DeepCopyInto(out *AzureEventsHubEventSource) { + *out = *in + if in.SharedAccessKeyName != nil { + in, out := &in.SharedAccessKeyName, &out.SharedAccessKeyName + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SharedAccessKey != nil { + in, out := &in.SharedAccessKey, &out.SharedAccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureEventsHubEventSource. +func (in *AzureEventsHubEventSource) DeepCopy() *AzureEventsHubEventSource { + if in == nil { + return nil + } + out := new(AzureEventsHubEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureQueueStorageEventSource) DeepCopyInto(out *AzureQueueStorageEventSource) { + *out = *in + if in.ConnectionString != nil { + in, out := &in.ConnectionString, &out.ConnectionString + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.WaitTimeInSeconds != nil { + in, out := &in.WaitTimeInSeconds, &out.WaitTimeInSeconds + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureQueueStorageEventSource. +func (in *AzureQueueStorageEventSource) DeepCopy() *AzureQueueStorageEventSource { + if in == nil { + return nil + } + out := new(AzureQueueStorageEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureServiceBusEventSource) DeepCopyInto(out *AzureServiceBusEventSource) { + *out = *in + if in.ConnectionString != nil { + in, out := &in.ConnectionString, &out.ConnectionString + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureServiceBusEventSource. +func (in *AzureServiceBusEventSource) DeepCopy() *AzureServiceBusEventSource { + if in == nil { + return nil + } + out := new(AzureServiceBusEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureServiceBusTrigger) DeepCopyInto(out *AzureServiceBusTrigger) { + *out = *in + if in.ConnectionString != nil { + in, out := &in.ConnectionString, &out.ConnectionString + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureServiceBusTrigger. +func (in *AzureServiceBusTrigger) DeepCopy() *AzureServiceBusTrigger { + if in == nil { + return nil + } + out := new(AzureServiceBusTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Backoff) DeepCopyInto(out *Backoff) { + *out = *in + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(Int64OrString) + **out = **in + } + if in.Factor != nil { + in, out := &in.Factor, &out.Factor + *out = new(Amount) + (*in).DeepCopyInto(*out) + } + if in.Jitter != nil { + in, out := &in.Jitter, &out.Jitter + *out = new(Amount) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backoff. +func (in *Backoff) DeepCopy() *Backoff { + if in == nil { + return nil + } + out := new(Backoff) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth. +func (in *BasicAuth) DeepCopy() *BasicAuth { + if in == nil { + return nil + } + out := new(BasicAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketAuth) DeepCopyInto(out *BitbucketAuth) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BitbucketBasicAuth) + (*in).DeepCopyInto(*out) + } + if in.OAuthToken != nil { + in, out := &in.OAuthToken, &out.OAuthToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketAuth. +func (in *BitbucketAuth) DeepCopy() *BitbucketAuth { + if in == nil { + return nil + } + out := new(BitbucketAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketBasicAuth) DeepCopyInto(out *BitbucketBasicAuth) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketBasicAuth. +func (in *BitbucketBasicAuth) DeepCopy() *BitbucketBasicAuth { + if in == nil { + return nil + } + out := new(BitbucketBasicAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketEventSource) DeepCopyInto(out *BitbucketEventSource) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BitbucketAuth) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]BitbucketRepository, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketEventSource. +func (in *BitbucketEventSource) DeepCopy() *BitbucketEventSource { + if in == nil { + return nil + } + out := new(BitbucketEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketRepository) DeepCopyInto(out *BitbucketRepository) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketRepository. +func (in *BitbucketRepository) DeepCopy() *BitbucketRepository { + if in == nil { + return nil + } + out := new(BitbucketRepository) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketServerEventSource) DeepCopyInto(out *BitbucketServerEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Projects != nil { + in, out := &in.Projects, &out.Projects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]BitbucketServerRepository, len(*in)) + copy(*out, *in) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AccessToken != nil { + in, out := &in.AccessToken, &out.AccessToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.WebhookSecret != nil { + in, out := &in.WebhookSecret, &out.WebhookSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerEventSource. +func (in *BitbucketServerEventSource) DeepCopy() *BitbucketServerEventSource { + if in == nil { + return nil + } + out := new(BitbucketServerEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketServerRepository) DeepCopyInto(out *BitbucketServerRepository) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerRepository. +func (in *BitbucketServerRepository) DeepCopy() *BitbucketServerRepository { + if in == nil { + return nil + } + out := new(BitbucketServerRepository) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BusConfig) DeepCopyInto(out *BusConfig) { + *out = *in + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = new(NATSConfig) + (*in).DeepCopyInto(*out) + } + if in.JetStream != nil { + in, out := &in.JetStream, &out.JetStream + *out = new(JetStreamConfig) + (*in).DeepCopyInto(*out) + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = new(KafkaBus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusConfig. +func (in *BusConfig) DeepCopy() *BusConfig { + if in == nil { + return nil + } + out := new(BusConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CalendarEventSource) DeepCopyInto(out *CalendarEventSource) { + *out = *in + if in.ExclusionDates != nil { + in, out := &in.ExclusionDates, &out.ExclusionDates + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(EventPersistence) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CalendarEventSource. +func (in *CalendarEventSource) DeepCopy() *CalendarEventSource { + if in == nil { + return nil + } + out := new(CalendarEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatchupConfiguration) DeepCopyInto(out *CatchupConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatchupConfiguration. +func (in *CatchupConfiguration) DeepCopy() *CatchupConfiguration { + if in == nil { + return nil + } + out := new(CatchupConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionsResetByTime) DeepCopyInto(out *ConditionsResetByTime) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionsResetByTime. +func (in *ConditionsResetByTime) DeepCopy() *ConditionsResetByTime { + if in == nil { + return nil + } + out := new(ConditionsResetByTime) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionsResetCriteria) DeepCopyInto(out *ConditionsResetCriteria) { + *out = *in + if in.ByTime != nil { + in, out := &in.ByTime, &out.ByTime + *out = new(ConditionsResetByTime) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionsResetCriteria. +func (in *ConditionsResetCriteria) DeepCopy() *ConditionsResetCriteria { + if in == nil { + return nil + } + out := new(ConditionsResetCriteria) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapPersistence) DeepCopyInto(out *ConfigMapPersistence) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapPersistence. +func (in *ConfigMapPersistence) DeepCopy() *ConfigMapPersistence { + if in == nil { + return nil + } + out := new(ConfigMapPersistence) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Container) DeepCopyInto(out *Container) { + *out = *in + in.Resources.DeepCopyInto(&out.Resources) + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = make([]v1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EnvFrom != nil { + in, out := &in.EnvFrom, &out.EnvFrom + *out = make([]v1.EnvFromSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Container. +func (in *Container) DeepCopy() *Container { + if in == nil { + return nil + } + out := new(Container) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate) { + *out = *in + in.Resources.DeepCopyInto(&out.Resources) + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerTemplate. +func (in *ContainerTemplate) DeepCopy() *ContainerTemplate { + if in == nil { + return nil + } + out := new(ContainerTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomTrigger) DeepCopyInto(out *CustomTrigger) { + *out = *in + if in.CertSecret != nil { + in, out := &in.CertSecret, &out.CertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomTrigger. +func (in *CustomTrigger) DeepCopy() *CustomTrigger { + if in == nil { + return nil + } + out := new(CustomTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFilter) DeepCopyInto(out *DataFilter) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFilter. +func (in *DataFilter) DeepCopy() *DataFilter { + if in == nil { + return nil + } + out := new(DataFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EmailTrigger) DeepCopyInto(out *EmailTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SMTPPassword != nil { + in, out := &in.SMTPPassword, &out.SMTPPassword + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.To != nil { + in, out := &in.To, &out.To + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmailTrigger. +func (in *EmailTrigger) DeepCopy() *EmailTrigger { + if in == nil { + return nil + } + out := new(EmailTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EmitterEventSource) DeepCopyInto(out *EmitterEventSource) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmitterEventSource. +func (in *EmitterEventSource) DeepCopy() *EmitterEventSource { + if in == nil { + return nil + } + out := new(EmitterEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Event) DeepCopyInto(out *Event) { + *out = *in + if in.Context != nil { + in, out := &in.Context, &out.Context + *out = new(EventContext) + (*in).DeepCopyInto(*out) + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Event. +func (in *Event) DeepCopy() *Event { + if in == nil { + return nil + } + out := new(Event) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBus) DeepCopyInto(out *EventBus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBus. +func (in *EventBus) DeepCopy() *EventBus { + if in == nil { + return nil + } + out := new(EventBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventBus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBusList) DeepCopyInto(out *EventBusList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EventBus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBusList. +func (in *EventBusList) DeepCopy() *EventBusList { + if in == nil { + return nil + } + out := new(EventBusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventBusList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBusSpec) DeepCopyInto(out *EventBusSpec) { + *out = *in + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = new(NATSBus) + (*in).DeepCopyInto(*out) + } + if in.JetStream != nil { + in, out := &in.JetStream, &out.JetStream + *out = new(JetStreamBus) + (*in).DeepCopyInto(*out) + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = new(KafkaBus) + (*in).DeepCopyInto(*out) + } + if in.JetStreamExotic != nil { + in, out := &in.JetStreamExotic, &out.JetStreamExotic + *out = new(JetStreamConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBusSpec. +func (in *EventBusSpec) DeepCopy() *EventBusSpec { + if in == nil { + return nil + } + out := new(EventBusSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBusStatus) DeepCopyInto(out *EventBusStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + in.Config.DeepCopyInto(&out.Config) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBusStatus. +func (in *EventBusStatus) DeepCopy() *EventBusStatus { + if in == nil { + return nil + } + out := new(EventBusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventContext) DeepCopyInto(out *EventContext) { + *out = *in + in.Time.DeepCopyInto(&out.Time) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventContext. +func (in *EventContext) DeepCopy() *EventContext { + if in == nil { + return nil + } + out := new(EventContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventDependency) DeepCopyInto(out *EventDependency) { + *out = *in + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = new(EventDependencyFilter) + (*in).DeepCopyInto(*out) + } + if in.Transform != nil { + in, out := &in.Transform, &out.Transform + *out = new(EventDependencyTransformer) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventDependency. +func (in *EventDependency) DeepCopy() *EventDependency { + if in == nil { + return nil + } + out := new(EventDependency) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventDependencyFilter) DeepCopyInto(out *EventDependencyFilter) { + *out = *in + if in.Time != nil { + in, out := &in.Time, &out.Time + *out = new(TimeFilter) + **out = **in + } + if in.Context != nil { + in, out := &in.Context, &out.Context + *out = new(EventContext) + (*in).DeepCopyInto(*out) + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make([]DataFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Exprs != nil { + in, out := &in.Exprs, &out.Exprs + *out = make([]ExprFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventDependencyFilter. +func (in *EventDependencyFilter) DeepCopy() *EventDependencyFilter { + if in == nil { + return nil + } + out := new(EventDependencyFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventDependencyTransformer) DeepCopyInto(out *EventDependencyTransformer) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventDependencyTransformer. +func (in *EventDependencyTransformer) DeepCopy() *EventDependencyTransformer { + if in == nil { + return nil + } + out := new(EventDependencyTransformer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPersistence) DeepCopyInto(out *EventPersistence) { + *out = *in + if in.Catchup != nil { + in, out := &in.Catchup, &out.Catchup + *out = new(CatchupConfiguration) + **out = **in + } + if in.ConfigMap != nil { + in, out := &in.ConfigMap, &out.ConfigMap + *out = new(ConfigMapPersistence) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPersistence. +func (in *EventPersistence) DeepCopy() *EventPersistence { + if in == nil { + return nil + } + out := new(EventPersistence) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSource) DeepCopyInto(out *EventSource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSource. +func (in *EventSource) DeepCopy() *EventSource { + if in == nil { + return nil + } + out := new(EventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventSource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceFilter) DeepCopyInto(out *EventSourceFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceFilter. +func (in *EventSourceFilter) DeepCopy() *EventSourceFilter { + if in == nil { + return nil + } + out := new(EventSourceFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceList) DeepCopyInto(out *EventSourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EventSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceList. +func (in *EventSourceList) DeepCopy() *EventSourceList { + if in == nil { + return nil + } + out := new(EventSourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventSourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceSpec) DeepCopyInto(out *EventSourceSpec) { + *out = *in + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(Template) + (*in).DeepCopyInto(*out) + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(Service) + (*in).DeepCopyInto(*out) + } + if in.Minio != nil { + in, out := &in.Minio, &out.Minio + *out = make(map[string]S3Artifact, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Calendar != nil { + in, out := &in.Calendar, &out.Calendar + *out = make(map[string]CalendarEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.File != nil { + in, out := &in.File, &out.File + *out = make(map[string]FileEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = make(map[string]ResourceEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = make(map[string]WebhookEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AMQP != nil { + in, out := &in.AMQP, &out.AMQP + *out = make(map[string]AMQPEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = make(map[string]KafkaEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.MQTT != nil { + in, out := &in.MQTT, &out.MQTT + *out = make(map[string]MQTTEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = make(map[string]NATSEventsSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.SNS != nil { + in, out := &in.SNS, &out.SNS + *out = make(map[string]SNSEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.SQS != nil { + in, out := &in.SQS, &out.SQS + *out = make(map[string]SQSEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.PubSub != nil { + in, out := &in.PubSub, &out.PubSub + *out = make(map[string]PubSubEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Github != nil { + in, out := &in.Github, &out.Github + *out = make(map[string]GithubEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Gitlab != nil { + in, out := &in.Gitlab, &out.Gitlab + *out = make(map[string]GitlabEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.HDFS != nil { + in, out := &in.HDFS, &out.HDFS + *out = make(map[string]HDFSEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Slack != nil { + in, out := &in.Slack, &out.Slack + *out = make(map[string]SlackEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.StorageGrid != nil { + in, out := &in.StorageGrid, &out.StorageGrid + *out = make(map[string]StorageGridEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AzureEventsHub != nil { + in, out := &in.AzureEventsHub, &out.AzureEventsHub + *out = make(map[string]AzureEventsHubEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Stripe != nil { + in, out := &in.Stripe, &out.Stripe + *out = make(map[string]StripeEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Emitter != nil { + in, out := &in.Emitter, &out.Emitter + *out = make(map[string]EmitterEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Redis != nil { + in, out := &in.Redis, &out.Redis + *out = make(map[string]RedisEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.NSQ != nil { + in, out := &in.NSQ, &out.NSQ + *out = make(map[string]NSQEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Pulsar != nil { + in, out := &in.Pulsar, &out.Pulsar + *out = make(map[string]PulsarEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Generic != nil { + in, out := &in.Generic, &out.Generic + *out = make(map[string]GenericEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.BitbucketServer != nil { + in, out := &in.BitbucketServer, &out.BitbucketServer + *out = make(map[string]BitbucketServerEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Bitbucket != nil { + in, out := &in.Bitbucket, &out.Bitbucket + *out = make(map[string]BitbucketEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.RedisStream != nil { + in, out := &in.RedisStream, &out.RedisStream + *out = make(map[string]RedisStreamEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AzureServiceBus != nil { + in, out := &in.AzureServiceBus, &out.AzureServiceBus + *out = make(map[string]AzureServiceBusEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AzureQueueStorage != nil { + in, out := &in.AzureQueueStorage, &out.AzureQueueStorage + *out = make(map[string]AzureQueueStorageEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.SFTP != nil { + in, out := &in.SFTP, &out.SFTP + *out = make(map[string]SFTPEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Gerrit != nil { + in, out := &in.Gerrit, &out.Gerrit + *out = make(map[string]GerritEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceSpec. +func (in *EventSourceSpec) DeepCopy() *EventSourceSpec { + if in == nil { + return nil + } + out := new(EventSourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceStatus) DeepCopyInto(out *EventSourceStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceStatus. +func (in *EventSourceStatus) DeepCopy() *EventSourceStatus { + if in == nil { + return nil + } + out := new(EventSourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExprFilter) DeepCopyInto(out *ExprFilter) { + *out = *in + if in.Fields != nil { + in, out := &in.Fields, &out.Fields + *out = make([]PayloadField, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExprFilter. +func (in *ExprFilter) DeepCopy() *ExprFilter { + if in == nil { + return nil + } + out := new(ExprFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FileArtifact) DeepCopyInto(out *FileArtifact) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileArtifact. +func (in *FileArtifact) DeepCopy() *FileArtifact { + if in == nil { + return nil + } + out := new(FileArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FileEventSource) DeepCopyInto(out *FileEventSource) { + *out = *in + out.WatchPathConfig = in.WatchPathConfig + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileEventSource. +func (in *FileEventSource) DeepCopy() *FileEventSource { + if in == nil { + return nil + } + out := new(FileEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GenericEventSource) DeepCopyInto(out *GenericEventSource) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthSecret != nil { + in, out := &in.AuthSecret, &out.AuthSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericEventSource. +func (in *GenericEventSource) DeepCopy() *GenericEventSource { + if in == nil { + return nil + } + out := new(GenericEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GerritEventSource) DeepCopyInto(out *GerritEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Projects != nil { + in, out := &in.Projects, &out.Projects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GerritEventSource. +func (in *GerritEventSource) DeepCopy() *GerritEventSource { + if in == nil { + return nil + } + out := new(GerritEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitArtifact) DeepCopyInto(out *GitArtifact) { + *out = *in + if in.Creds != nil { + in, out := &in.Creds, &out.Creds + *out = new(GitCreds) + (*in).DeepCopyInto(*out) + } + if in.SSHKeySecret != nil { + in, out := &in.SSHKeySecret, &out.SSHKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Remote != nil { + in, out := &in.Remote, &out.Remote + *out = new(GitRemoteConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitArtifact. +func (in *GitArtifact) DeepCopy() *GitArtifact { + if in == nil { + return nil + } + out := new(GitArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitCreds) DeepCopyInto(out *GitCreds) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCreds. +func (in *GitCreds) DeepCopy() *GitCreds { + if in == nil { + return nil + } + out := new(GitCreds) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitRemoteConfig) DeepCopyInto(out *GitRemoteConfig) { + *out = *in + if in.URLS != nil { + in, out := &in.URLS, &out.URLS + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRemoteConfig. +func (in *GitRemoteConfig) DeepCopy() *GitRemoteConfig { + if in == nil { + return nil + } + out := new(GitRemoteConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GithubAppCreds) DeepCopyInto(out *GithubAppCreds) { + *out = *in + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubAppCreds. +func (in *GithubAppCreds) DeepCopy() *GithubAppCreds { + if in == nil { + return nil + } + out := new(GithubAppCreds) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GithubEventSource) DeepCopyInto(out *GithubEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.APIToken != nil { + in, out := &in.APIToken, &out.APIToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.WebhookSecret != nil { + in, out := &in.WebhookSecret, &out.WebhookSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]OwnedRepositories, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Organizations != nil { + in, out := &in.Organizations, &out.Organizations + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.GithubApp != nil { + in, out := &in.GithubApp, &out.GithubApp + *out = new(GithubAppCreds) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubEventSource. +func (in *GithubEventSource) DeepCopy() *GithubEventSource { + if in == nil { + return nil + } + out := new(GithubEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitlabEventSource) DeepCopyInto(out *GitlabEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AccessToken != nil { + in, out := &in.AccessToken, &out.AccessToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Projects != nil { + in, out := &in.Projects, &out.Projects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SecretToken != nil { + in, out := &in.SecretToken, &out.SecretToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabEventSource. +func (in *GitlabEventSource) DeepCopy() *GitlabEventSource { + if in == nil { + return nil + } + out := new(GitlabEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HDFSEventSource) DeepCopyInto(out *HDFSEventSource) { + *out = *in + out.WatchPathConfig = in.WatchPathConfig + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.KrbCCacheSecret != nil { + in, out := &in.KrbCCacheSecret, &out.KrbCCacheSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.KrbKeytabSecret != nil { + in, out := &in.KrbKeytabSecret, &out.KrbKeytabSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.KrbConfigConfigMap != nil { + in, out := &in.KrbConfigConfigMap, &out.KrbConfigConfigMap + *out = new(v1.ConfigMapKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDFSEventSource. +func (in *HDFSEventSource) DeepCopy() *HDFSEventSource { + if in == nil { + return nil + } + out := new(HDFSEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPTrigger) DeepCopyInto(out *HTTPTrigger) { + *out = *in + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.BasicAuth != nil { + in, out := &in.BasicAuth, &out.BasicAuth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecureHeaders != nil { + in, out := &in.SecureHeaders, &out.SecureHeaders + *out = make([]*SecureHeader, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(SecureHeader) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPTrigger. +func (in *HTTPTrigger) DeepCopy() *HTTPTrigger { + if in == nil { + return nil + } + out := new(HTTPTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Int64OrString) DeepCopyInto(out *Int64OrString) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Int64OrString. +func (in *Int64OrString) DeepCopy() *Int64OrString { + if in == nil { + return nil + } + out := new(Int64OrString) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JetStreamBus) DeepCopyInto(out *JetStreamBus) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.ContainerTemplate != nil { + in, out := &in.ContainerTemplate, &out.ContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.ReloaderContainerTemplate != nil { + in, out := &in.ReloaderContainerTemplate, &out.ReloaderContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.MetricsContainerTemplate != nil { + in, out := &in.MetricsContainerTemplate, &out.MetricsContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(PersistenceStrategy) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Settings != nil { + in, out := &in.Settings, &out.Settings + *out = new(string) + **out = **in + } + if in.StartArgs != nil { + in, out := &in.StartArgs, &out.StartArgs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.StreamConfig != nil { + in, out := &in.StreamConfig, &out.StreamConfig + *out = new(string) + **out = **in + } + if in.MaxPayload != nil { + in, out := &in.MaxPayload, &out.MaxPayload + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JetStreamBus. +func (in *JetStreamBus) DeepCopy() *JetStreamBus { + if in == nil { + return nil + } + out := new(JetStreamBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JetStreamConfig) DeepCopyInto(out *JetStreamConfig) { + *out = *in + if in.AccessSecret != nil { + in, out := &in.AccessSecret, &out.AccessSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JetStreamConfig. +func (in *JetStreamConfig) DeepCopy() *JetStreamConfig { + if in == nil { + return nil + } + out := new(JetStreamConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *K8SResource) DeepCopyInto(out *K8SResource) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K8SResource. +func (in *K8SResource) DeepCopy() *K8SResource { + if in == nil { + return nil + } + out := new(K8SResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *K8SResourcePolicy) DeepCopyInto(out *K8SResourcePolicy) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Backoff != nil { + in, out := &in.Backoff, &out.Backoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K8SResourcePolicy. +func (in *K8SResourcePolicy) DeepCopy() *K8SResourcePolicy { + if in == nil { + return nil + } + out := new(K8SResourcePolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaBus) DeepCopyInto(out *KafkaBus) { + *out = *in + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.SASL != nil { + in, out := &in.SASL, &out.SASL + *out = new(SASLConfig) + (*in).DeepCopyInto(*out) + } + if in.ConsumerGroup != nil { + in, out := &in.ConsumerGroup, &out.ConsumerGroup + *out = new(KafkaConsumerGroup) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaBus. +func (in *KafkaBus) DeepCopy() *KafkaBus { + if in == nil { + return nil + } + out := new(KafkaBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaConsumerGroup) DeepCopyInto(out *KafkaConsumerGroup) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaConsumerGroup. +func (in *KafkaConsumerGroup) DeepCopy() *KafkaConsumerGroup { + if in == nil { + return nil + } + out := new(KafkaConsumerGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaEventSource) DeepCopyInto(out *KafkaEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ConsumerGroup != nil { + in, out := &in.ConsumerGroup, &out.ConsumerGroup + *out = new(KafkaConsumerGroup) + **out = **in + } + if in.SASL != nil { + in, out := &in.SASL, &out.SASL + *out = new(SASLConfig) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaEventSource. +func (in *KafkaEventSource) DeepCopy() *KafkaEventSource { + if in == nil { + return nil + } + out := new(KafkaEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaTrigger) DeepCopyInto(out *KafkaTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PartitioningKey != nil { + in, out := &in.PartitioningKey, &out.PartitioningKey + *out = new(string) + **out = **in + } + if in.SASL != nil { + in, out := &in.SASL, &out.SASL + *out = new(SASLConfig) + (*in).DeepCopyInto(*out) + } + if in.SchemaRegistry != nil { + in, out := &in.SchemaRegistry, &out.SchemaRegistry + *out = new(SchemaRegistryConfig) + (*in).DeepCopyInto(*out) + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecureHeaders != nil { + in, out := &in.SecureHeaders, &out.SecureHeaders + *out = make([]*SecureHeader, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(SecureHeader) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaTrigger. +func (in *KafkaTrigger) DeepCopy() *KafkaTrigger { + if in == nil { + return nil + } + out := new(KafkaTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogTrigger) DeepCopyInto(out *LogTrigger) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogTrigger. +func (in *LogTrigger) DeepCopy() *LogTrigger { + if in == nil { + return nil + } + out := new(LogTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MQTTEventSource) DeepCopyInto(out *MQTTEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MQTTEventSource. +func (in *MQTTEventSource) DeepCopy() *MQTTEventSource { + if in == nil { + return nil + } + out := new(MQTTEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Metadata) DeepCopyInto(out *Metadata) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata. +func (in *Metadata) DeepCopy() *Metadata { + if in == nil { + return nil + } + out := new(Metadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSAuth) DeepCopyInto(out *NATSAuth) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.NKey != nil { + in, out := &in.NKey, &out.NKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Credential != nil { + in, out := &in.Credential, &out.Credential + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSAuth. +func (in *NATSAuth) DeepCopy() *NATSAuth { + if in == nil { + return nil + } + out := new(NATSAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSBus) DeepCopyInto(out *NATSBus) { + *out = *in + if in.Native != nil { + in, out := &in.Native, &out.Native + *out = new(NativeStrategy) + (*in).DeepCopyInto(*out) + } + if in.Exotic != nil { + in, out := &in.Exotic, &out.Exotic + *out = new(NATSConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSBus. +func (in *NATSBus) DeepCopy() *NATSBus { + if in == nil { + return nil + } + out := new(NATSBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSConfig) DeepCopyInto(out *NATSConfig) { + *out = *in + if in.ClusterID != nil { + in, out := &in.ClusterID, &out.ClusterID + *out = new(string) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(AuthStrategy) + **out = **in + } + if in.AccessSecret != nil { + in, out := &in.AccessSecret, &out.AccessSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSConfig. +func (in *NATSConfig) DeepCopy() *NATSConfig { + if in == nil { + return nil + } + out := new(NATSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSEventsSource) DeepCopyInto(out *NATSEventsSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(NATSAuth) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.Queue != nil { + in, out := &in.Queue, &out.Queue + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSEventsSource. +func (in *NATSEventsSource) DeepCopy() *NATSEventsSource { + if in == nil { + return nil + } + out := new(NATSEventsSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSTrigger) DeepCopyInto(out *NATSTrigger) { + *out = *in + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(NATSAuth) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSTrigger. +func (in *NATSTrigger) DeepCopy() *NATSTrigger { + if in == nil { + return nil + } + out := new(NATSTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NSQEventSource) DeepCopyInto(out *NSQEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NSQEventSource. +func (in *NSQEventSource) DeepCopy() *NSQEventSource { + if in == nil { + return nil + } + out := new(NSQEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NativeStrategy) DeepCopyInto(out *NativeStrategy) { + *out = *in + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(AuthStrategy) + **out = **in + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(PersistenceStrategy) + (*in).DeepCopyInto(*out) + } + if in.ContainerTemplate != nil { + in, out := &in.ContainerTemplate, &out.ContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.MetricsContainerTemplate != nil { + in, out := &in.MetricsContainerTemplate, &out.MetricsContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.MaxAge != nil { + in, out := &in.MaxAge, &out.MaxAge + *out = new(string) + **out = **in + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.MaxMsgs != nil { + in, out := &in.MaxMsgs, &out.MaxMsgs + *out = new(uint64) + **out = **in + } + if in.MaxBytes != nil { + in, out := &in.MaxBytes, &out.MaxBytes + *out = new(string) + **out = **in + } + if in.MaxSubs != nil { + in, out := &in.MaxSubs, &out.MaxSubs + *out = new(uint64) + **out = **in + } + if in.MaxPayload != nil { + in, out := &in.MaxPayload, &out.MaxPayload + *out = new(string) + **out = **in + } + if in.RaftHeartbeatTimeout != nil { + in, out := &in.RaftHeartbeatTimeout, &out.RaftHeartbeatTimeout + *out = new(string) + **out = **in + } + if in.RaftElectionTimeout != nil { + in, out := &in.RaftElectionTimeout, &out.RaftElectionTimeout + *out = new(string) + **out = **in + } + if in.RaftLeaseTimeout != nil { + in, out := &in.RaftLeaseTimeout, &out.RaftLeaseTimeout + *out = new(string) + **out = **in + } + if in.RaftCommitTimeout != nil { + in, out := &in.RaftCommitTimeout, &out.RaftCommitTimeout + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NativeStrategy. +func (in *NativeStrategy) DeepCopy() *NativeStrategy { + if in == nil { + return nil + } + out := new(NativeStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenWhiskTrigger) DeepCopyInto(out *OpenWhiskTrigger) { + *out = *in + if in.AuthToken != nil { + in, out := &in.AuthToken, &out.AuthToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenWhiskTrigger. +func (in *OpenWhiskTrigger) DeepCopy() *OpenWhiskTrigger { + if in == nil { + return nil + } + out := new(OpenWhiskTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OwnedRepositories) DeepCopyInto(out *OwnedRepositories) { + *out = *in + if in.Names != nil { + in, out := &in.Names, &out.Names + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnedRepositories. +func (in *OwnedRepositories) DeepCopy() *OwnedRepositories { + if in == nil { + return nil + } + out := new(OwnedRepositories) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PayloadField) DeepCopyInto(out *PayloadField) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PayloadField. +func (in *PayloadField) DeepCopy() *PayloadField { + if in == nil { + return nil + } + out := new(PayloadField) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistenceStrategy) DeepCopyInto(out *PersistenceStrategy) { + *out = *in + if in.StorageClassName != nil { + in, out := &in.StorageClassName, &out.StorageClassName + *out = new(string) + **out = **in + } + if in.AccessMode != nil { + in, out := &in.AccessMode, &out.AccessMode + *out = new(v1.PersistentVolumeAccessMode) + **out = **in + } + if in.VolumeSize != nil { + in, out := &in.VolumeSize, &out.VolumeSize + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceStrategy. +func (in *PersistenceStrategy) DeepCopy() *PersistenceStrategy { + if in == nil { + return nil + } + out := new(PersistenceStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PubSubEventSource) DeepCopyInto(out *PubSubEventSource) { + *out = *in + if in.CredentialSecret != nil { + in, out := &in.CredentialSecret, &out.CredentialSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PubSubEventSource. +func (in *PubSubEventSource) DeepCopy() *PubSubEventSource { + if in == nil { + return nil + } + out := new(PubSubEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PulsarEventSource) DeepCopyInto(out *PulsarEventSource) { + *out = *in + if in.Topics != nil { + in, out := &in.Topics, &out.Topics + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLSTrustCertsSecret != nil { + in, out := &in.TLSTrustCertsSecret, &out.TLSTrustCertsSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthTokenSecret != nil { + in, out := &in.AuthTokenSecret, &out.AuthTokenSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.AuthAthenzParams != nil { + in, out := &in.AuthAthenzParams, &out.AuthAthenzParams + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthAthenzSecret != nil { + in, out := &in.AuthAthenzSecret, &out.AuthAthenzSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PulsarEventSource. +func (in *PulsarEventSource) DeepCopy() *PulsarEventSource { + if in == nil { + return nil + } + out := new(PulsarEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PulsarTrigger) DeepCopyInto(out *PulsarTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLSTrustCertsSecret != nil { + in, out := &in.TLSTrustCertsSecret, &out.TLSTrustCertsSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.AuthTokenSecret != nil { + in, out := &in.AuthTokenSecret, &out.AuthTokenSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.AuthAthenzParams != nil { + in, out := &in.AuthAthenzParams, &out.AuthAthenzParams + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthAthenzSecret != nil { + in, out := &in.AuthAthenzSecret, &out.AuthAthenzSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PulsarTrigger. +func (in *PulsarTrigger) DeepCopy() *PulsarTrigger { + if in == nil { + return nil + } + out := new(PulsarTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimit) DeepCopyInto(out *RateLimit) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit. +func (in *RateLimit) DeepCopy() *RateLimit { + if in == nil { + return nil + } + out := new(RateLimit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisEventSource) DeepCopyInto(out *RedisEventSource) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Channels != nil { + in, out := &in.Channels, &out.Channels + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisEventSource. +func (in *RedisEventSource) DeepCopy() *RedisEventSource { + if in == nil { + return nil + } + out := new(RedisEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisStreamEventSource) DeepCopyInto(out *RedisStreamEventSource) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Streams != nil { + in, out := &in.Streams, &out.Streams + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisStreamEventSource. +func (in *RedisStreamEventSource) DeepCopy() *RedisStreamEventSource { + if in == nil { + return nil + } + out := new(RedisStreamEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceEventSource) DeepCopyInto(out *ResourceEventSource) { + *out = *in + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(ResourceFilter) + (*in).DeepCopyInto(*out) + } + out.GroupVersionResource = in.GroupVersionResource + if in.EventTypes != nil { + in, out := &in.EventTypes, &out.EventTypes + *out = make([]ResourceEventType, len(*in)) + copy(*out, *in) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceEventSource. +func (in *ResourceEventSource) DeepCopy() *ResourceEventSource { + if in == nil { + return nil + } + out := new(ResourceEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]Selector, len(*in)) + copy(*out, *in) + } + if in.Fields != nil { + in, out := &in.Fields, &out.Fields + *out = make([]Selector, len(*in)) + copy(*out, *in) + } + in.CreatedBy.DeepCopyInto(&out.CreatedBy) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilter. +func (in *ResourceFilter) DeepCopy() *ResourceFilter { + if in == nil { + return nil + } + out := new(ResourceFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Artifact) DeepCopyInto(out *S3Artifact) { + *out = *in + if in.Bucket != nil { + in, out := &in.Bucket, &out.Bucket + *out = new(S3Bucket) + **out = **in + } + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(S3Filter) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CACertificate != nil { + in, out := &in.CACertificate, &out.CACertificate + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Artifact. +func (in *S3Artifact) DeepCopy() *S3Artifact { + if in == nil { + return nil + } + out := new(S3Artifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Bucket) DeepCopyInto(out *S3Bucket) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Bucket. +func (in *S3Bucket) DeepCopy() *S3Bucket { + if in == nil { + return nil + } + out := new(S3Bucket) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Filter) DeepCopyInto(out *S3Filter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Filter. +func (in *S3Filter) DeepCopy() *S3Filter { + if in == nil { + return nil + } + out := new(S3Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SASLConfig) DeepCopyInto(out *SASLConfig) { + *out = *in + if in.UserSecret != nil { + in, out := &in.UserSecret, &out.UserSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.PasswordSecret != nil { + in, out := &in.PasswordSecret, &out.PasswordSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SASLConfig. +func (in *SASLConfig) DeepCopy() *SASLConfig { + if in == nil { + return nil + } + out := new(SASLConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SFTPEventSource) DeepCopyInto(out *SFTPEventSource) { + *out = *in + out.WatchPathConfig = in.WatchPathConfig + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SSHKeySecret != nil { + in, out := &in.SSHKeySecret, &out.SSHKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFTPEventSource. +func (in *SFTPEventSource) DeepCopy() *SFTPEventSource { + if in == nil { + return nil + } + out := new(SFTPEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SNSEventSource) DeepCopyInto(out *SNSEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SNSEventSource. +func (in *SNSEventSource) DeepCopy() *SNSEventSource { + if in == nil { + return nil + } + out := new(SNSEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SQSEventSource) DeepCopyInto(out *SQSEventSource) { + *out = *in + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.SessionToken != nil { + in, out := &in.SessionToken, &out.SessionToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SQSEventSource. +func (in *SQSEventSource) DeepCopy() *SQSEventSource { + if in == nil { + return nil + } + out := new(SQSEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaRegistryConfig) DeepCopyInto(out *SchemaRegistryConfig) { + *out = *in + in.Auth.DeepCopyInto(&out.Auth) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaRegistryConfig. +func (in *SchemaRegistryConfig) DeepCopy() *SchemaRegistryConfig { + if in == nil { + return nil + } + out := new(SchemaRegistryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecureHeader) DeepCopyInto(out *SecureHeader) { + *out = *in + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(ValueFromSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecureHeader. +func (in *SecureHeader) DeepCopy() *SecureHeader { + if in == nil { + return nil + } + out := new(SecureHeader) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Selector) DeepCopyInto(out *Selector) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selector. +func (in *Selector) DeepCopy() *Selector { + if in == nil { + return nil + } + out := new(Selector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sensor) DeepCopyInto(out *Sensor) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sensor. +func (in *Sensor) DeepCopy() *Sensor { + if in == nil { + return nil + } + out := new(Sensor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Sensor) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SensorList) DeepCopyInto(out *SensorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Sensor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SensorList. +func (in *SensorList) DeepCopy() *SensorList { + if in == nil { + return nil + } + out := new(SensorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SensorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SensorSpec) DeepCopyInto(out *SensorSpec) { + *out = *in + if in.Dependencies != nil { + in, out := &in.Dependencies, &out.Dependencies + *out = make([]EventDependency, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Triggers != nil { + in, out := &in.Triggers, &out.Triggers + *out = make([]Trigger, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(Template) + (*in).DeepCopyInto(*out) + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + if in.LoggingFields != nil { + in, out := &in.LoggingFields, &out.LoggingFields + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SensorSpec. +func (in *SensorSpec) DeepCopy() *SensorSpec { + if in == nil { + return nil + } + out := new(SensorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SensorStatus) DeepCopyInto(out *SensorStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SensorStatus. +func (in *SensorStatus) DeepCopy() *SensorStatus { + if in == nil { + return nil + } + out := new(SensorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Service) DeepCopyInto(out *Service) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]v1.ServicePort, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service. +func (in *Service) DeepCopy() *Service { + if in == nil { + return nil + } + out := new(Service) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackEventSource) DeepCopyInto(out *SlackEventSource) { + *out = *in + if in.SigningSecret != nil { + in, out := &in.SigningSecret, &out.SigningSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackEventSource. +func (in *SlackEventSource) DeepCopy() *SlackEventSource { + if in == nil { + return nil + } + out := new(SlackEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackSender) DeepCopyInto(out *SlackSender) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackSender. +func (in *SlackSender) DeepCopy() *SlackSender { + if in == nil { + return nil + } + out := new(SlackSender) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackThread) DeepCopyInto(out *SlackThread) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackThread. +func (in *SlackThread) DeepCopy() *SlackThread { + if in == nil { + return nil + } + out := new(SlackThread) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackTrigger) DeepCopyInto(out *SlackTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SlackToken != nil { + in, out := &in.SlackToken, &out.SlackToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + out.Thread = in.Thread + out.Sender = in.Sender + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackTrigger. +func (in *SlackTrigger) DeepCopy() *SlackTrigger { + if in == nil { + return nil + } + out := new(SlackTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StandardK8STrigger) DeepCopyInto(out *StandardK8STrigger) { + *out = *in + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(ArtifactLocation) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StandardK8STrigger. +func (in *StandardK8STrigger) DeepCopy() *StandardK8STrigger { + if in == nil { + return nil + } + out := new(StandardK8STrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Status) DeepCopyInto(out *Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status. +func (in *Status) DeepCopy() *Status { + if in == nil { + return nil + } + out := new(Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusPolicy) DeepCopyInto(out *StatusPolicy) { + *out = *in + if in.Allow != nil { + in, out := &in.Allow, &out.Allow + *out = make([]int32, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusPolicy. +func (in *StatusPolicy) DeepCopy() *StatusPolicy { + if in == nil { + return nil + } + out := new(StatusPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageGridEventSource) DeepCopyInto(out *StorageGridEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(StorageGridFilter) + **out = **in + } + if in.AuthToken != nil { + in, out := &in.AuthToken, &out.AuthToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageGridEventSource. +func (in *StorageGridEventSource) DeepCopy() *StorageGridEventSource { + if in == nil { + return nil + } + out := new(StorageGridEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageGridFilter) DeepCopyInto(out *StorageGridFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageGridFilter. +func (in *StorageGridFilter) DeepCopy() *StorageGridFilter { + if in == nil { + return nil + } + out := new(StorageGridFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StripeEventSource) DeepCopyInto(out *StripeEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.APIKey != nil { + in, out := &in.APIKey, &out.APIKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.EventFilter != nil { + in, out := &in.EventFilter, &out.EventFilter + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StripeEventSource. +func (in *StripeEventSource) DeepCopy() *StripeEventSource { + if in == nil { + return nil + } + out := new(StripeEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSConfig) DeepCopyInto(out *TLSConfig) { + *out = *in + if in.CACertSecret != nil { + in, out := &in.CACertSecret, &out.CACertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ClientCertSecret != nil { + in, out := &in.ClientCertSecret, &out.ClientCertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ClientKeySecret != nil { + in, out := &in.ClientKeySecret, &out.ClientKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig. +func (in *TLSConfig) DeepCopy() *TLSConfig { + if in == nil { + return nil + } + out := new(TLSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Template) DeepCopyInto(out *Template) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(Container) + (*in).DeepCopyInto(*out) + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]v1.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template. +func (in *Template) DeepCopy() *Template { + if in == nil { + return nil + } + out := new(Template) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TimeFilter) DeepCopyInto(out *TimeFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeFilter. +func (in *TimeFilter) DeepCopy() *TimeFilter { + if in == nil { + return nil + } + out := new(TimeFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Trigger) DeepCopyInto(out *Trigger) { + *out = *in + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(TriggerTemplate) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Policy != nil { + in, out := &in.Policy, &out.Policy + *out = new(TriggerPolicy) + (*in).DeepCopyInto(*out) + } + if in.RetryStrategy != nil { + in, out := &in.RetryStrategy, &out.RetryStrategy + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.RateLimit != nil { + in, out := &in.RateLimit, &out.RateLimit + *out = new(RateLimit) + **out = **in + } + if in.DlqTrigger != nil { + in, out := &in.DlqTrigger, &out.DlqTrigger + *out = new(Trigger) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trigger. +func (in *Trigger) DeepCopy() *Trigger { + if in == nil { + return nil + } + out := new(Trigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerParameter) DeepCopyInto(out *TriggerParameter) { + *out = *in + if in.Src != nil { + in, out := &in.Src, &out.Src + *out = new(TriggerParameterSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerParameter. +func (in *TriggerParameter) DeepCopy() *TriggerParameter { + if in == nil { + return nil + } + out := new(TriggerParameter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerParameterSource) DeepCopyInto(out *TriggerParameterSource) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerParameterSource. +func (in *TriggerParameterSource) DeepCopy() *TriggerParameterSource { + if in == nil { + return nil + } + out := new(TriggerParameterSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerPolicy) DeepCopyInto(out *TriggerPolicy) { + *out = *in + if in.K8s != nil { + in, out := &in.K8s, &out.K8s + *out = new(K8SResourcePolicy) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(StatusPolicy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerPolicy. +func (in *TriggerPolicy) DeepCopy() *TriggerPolicy { + if in == nil { + return nil + } + out := new(TriggerPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerTemplate) DeepCopyInto(out *TriggerTemplate) { + *out = *in + if in.K8s != nil { + in, out := &in.K8s, &out.K8s + *out = new(StandardK8STrigger) + (*in).DeepCopyInto(*out) + } + if in.ArgoWorkflow != nil { + in, out := &in.ArgoWorkflow, &out.ArgoWorkflow + *out = new(ArgoWorkflowTrigger) + (*in).DeepCopyInto(*out) + } + if in.HTTP != nil { + in, out := &in.HTTP, &out.HTTP + *out = new(HTTPTrigger) + (*in).DeepCopyInto(*out) + } + if in.AWSLambda != nil { + in, out := &in.AWSLambda, &out.AWSLambda + *out = new(AWSLambdaTrigger) + (*in).DeepCopyInto(*out) + } + if in.CustomTrigger != nil { + in, out := &in.CustomTrigger, &out.CustomTrigger + *out = new(CustomTrigger) + (*in).DeepCopyInto(*out) + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = new(KafkaTrigger) + (*in).DeepCopyInto(*out) + } + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = new(NATSTrigger) + (*in).DeepCopyInto(*out) + } + if in.Slack != nil { + in, out := &in.Slack, &out.Slack + *out = new(SlackTrigger) + (*in).DeepCopyInto(*out) + } + if in.OpenWhisk != nil { + in, out := &in.OpenWhisk, &out.OpenWhisk + *out = new(OpenWhiskTrigger) + (*in).DeepCopyInto(*out) + } + if in.Log != nil { + in, out := &in.Log, &out.Log + *out = new(LogTrigger) + **out = **in + } + if in.AzureEventHubs != nil { + in, out := &in.AzureEventHubs, &out.AzureEventHubs + *out = new(AzureEventHubsTrigger) + (*in).DeepCopyInto(*out) + } + if in.Pulsar != nil { + in, out := &in.Pulsar, &out.Pulsar + *out = new(PulsarTrigger) + (*in).DeepCopyInto(*out) + } + if in.ConditionsReset != nil { + in, out := &in.ConditionsReset, &out.ConditionsReset + *out = make([]ConditionsResetCriteria, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AzureServiceBus != nil { + in, out := &in.AzureServiceBus, &out.AzureServiceBus + *out = new(AzureServiceBusTrigger) + (*in).DeepCopyInto(*out) + } + if in.Email != nil { + in, out := &in.Email, &out.Email + *out = new(EmailTrigger) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerTemplate. +func (in *TriggerTemplate) DeepCopy() *TriggerTemplate { + if in == nil { + return nil + } + out := new(TriggerTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *URLArtifact) DeepCopyInto(out *URLArtifact) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URLArtifact. +func (in *URLArtifact) DeepCopy() *URLArtifact { + if in == nil { + return nil + } + out := new(URLArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValueFromSource) DeepCopyInto(out *ValueFromSource) { + *out = *in + if in.SecretKeyRef != nil { + in, out := &in.SecretKeyRef, &out.SecretKeyRef + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ConfigMapKeyRef != nil { + in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef + *out = new(v1.ConfigMapKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFromSource. +func (in *ValueFromSource) DeepCopy() *ValueFromSource { + if in == nil { + return nil + } + out := new(ValueFromSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WatchPathConfig) DeepCopyInto(out *WatchPathConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WatchPathConfig. +func (in *WatchPathConfig) DeepCopy() *WatchPathConfig { + if in == nil { + return nil + } + out := new(WatchPathConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebhookContext) DeepCopyInto(out *WebhookContext) { + *out = *in + if in.ServerCertSecret != nil { + in, out := &in.ServerCertSecret, &out.ServerCertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ServerKeySecret != nil { + in, out := &in.ServerKeySecret, &out.ServerKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthSecret != nil { + in, out := &in.AuthSecret, &out.AuthSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.MaxPayloadSize != nil { + in, out := &in.MaxPayloadSize, &out.MaxPayloadSize + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookContext. +func (in *WebhookContext) DeepCopy() *WebhookContext { + if in == nil { + return nil + } + out := new(WebhookContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebhookEventSource) DeepCopyInto(out *WebhookEventSource) { + *out = *in + in.WebhookContext.DeepCopyInto(&out.WebhookContext) + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookEventSource. +func (in *WebhookEventSource) DeepCopy() *WebhookEventSource { + if in == nil { + return nil + } + out := new(WebhookEventSource) + in.DeepCopyInto(out) + return out +} +``` + +## `pkg/apis/events/v1alpha1/zz_generated.defaults.go` (changed lines (42, 107)) + +```go +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&EventSource{}, func(obj interface{}) { SetObjectDefaults_EventSource(obj.(*EventSource)) }) + scheme.AddTypeDefaultingFunc(&EventSourceList{}, func(obj interface{}) { SetObjectDefaults_EventSourceList(obj.(*EventSourceList)) }) + scheme.AddTypeDefaultingFunc(&Sensor{}, func(obj interface{}) { SetObjectDefaults_Sensor(obj.(*Sensor)) }) + scheme.AddTypeDefaultingFunc(&SensorList{}, func(obj interface{}) { SetObjectDefaults_SensorList(obj.(*SensorList)) }) + return nil +} + +func SetObjectDefaults_EventSource(in *EventSource) { + if in.Spec.Template != nil { + for i := range in.Spec.Template.Volumes { + a := &in.Spec.Template.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + } + if in.Spec.Service != nil { + for i := range in.Spec.Service.Ports { + a := &in.Spec.Service.Ports[i] + if a.Protocol == "" { + a.Protocol = "TCP" + } + } + } +} + +func SetObjectDefaults_EventSourceList(in *EventSourceList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_EventSource(a) + } +} + +func SetObjectDefaults_Sensor(in *Sensor) { + if in.Spec.Template != nil { + for i := range in.Spec.Template.Volumes { + a := &in.Spec.Template.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + } +} + +func SetObjectDefaults_SensorList(in *SensorList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_Sensor(a) + } +} +``` + +## `pkg/reconciler/eventsource/controller.go` (changed lines (16, 40, 69, 98)) + +```go +package eventsource + +import ( + "context" + + "go.uber.org/zap" + "k8s.io/apimachinery/pkg/api/equality" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +const ( + // ControllerName is name of the controller + ControllerName = "eventsource-controller" + + finalizerName = ControllerName +) + +type reconciler struct { + client client.Client + scheme *runtime.Scheme + + eventSourceImage string + logger *zap.SugaredLogger +} + +// NewReconciler returns a new reconciler +func NewReconciler(client client.Client, scheme *runtime.Scheme, eventSourceImage string, logger *zap.SugaredLogger) reconcile.Reconciler { + return &reconciler{client: client, scheme: scheme, eventSourceImage: eventSourceImage, logger: logger} +} + +func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + eventSource := &v1alpha1.EventSource{} + if err := r.client.Get(ctx, req.NamespacedName, eventSource); err != nil { + if apierrors.IsNotFound(err) { + r.logger.Warnw("WARNING: eventsource not found", "request", req) + return reconcile.Result{}, nil + } + r.logger.Errorw("unable to get eventsource ctl", "request", req, "error", err) + return ctrl.Result{}, err + } + log := r.logger.With("namespace", eventSource.Namespace).With("eventSource", eventSource.Name) + ctx = logging.WithLogger(ctx, log) + esCopy := eventSource.DeepCopy() + reconcileErr := r.reconcile(ctx, esCopy) + if reconcileErr != nil { + log.Errorw("reconcile error", zap.Error(reconcileErr)) + } + if r.needsUpdate(eventSource, esCopy) { + // Use a DeepCopy to update, because it will be mutated afterwards, with empty Status. + if err := r.client.Update(ctx, esCopy.DeepCopy()); err != nil { + return reconcile.Result{}, err + } + } + if err := r.client.Status().Update(ctx, esCopy); err != nil { + return reconcile.Result{}, err + } + return ctrl.Result{}, reconcileErr +} + +// reconcile does the real logic +func (r *reconciler) reconcile(ctx context.Context, eventSource *v1alpha1.EventSource) error { + log := logging.FromContext(ctx) + if !eventSource.DeletionTimestamp.IsZero() { + log.Info("deleting eventsource") + if controllerutil.ContainsFinalizer(eventSource, finalizerName) { + // Finalizer logic should be added here. + controllerutil.RemoveFinalizer(eventSource, finalizerName) + } + return nil + } + controllerutil.AddFinalizer(eventSource, finalizerName) + + eventSource.Status.InitConditions() + if err := ValidateEventSource(eventSource); err != nil { + log.Errorw("validation error", zap.Error(err)) + return err + } + args := &AdaptorArgs{ + Image: r.eventSourceImage, + EventSource: eventSource, + Labels: map[string]string{ + "controller": "eventsource-controller", + v1alpha1.LabelEventSourceName: eventSource.Name, + v1alpha1.LabelOwnerName: eventSource.Name, + }, + } + return Reconcile(r.client, args, log) +} + +func (r *reconciler) needsUpdate(old, new *v1alpha1.EventSource) bool { + if old == nil { + return true + } + if !equality.Semantic.DeepEqual(old.Finalizers, new.Finalizers) { + return true + } + return false +} +``` + +## `pkg/reconciler/eventsource/resource.go` (changed lines (11, 13, 27, 35, 162, 167, 341, 357, 358)) + +```go +package eventsource + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "sort" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + controllerscommon "github.com/argoproj/argo-events/pkg/reconciler/common" + sharedutil "github.com/argoproj/argo-events/pkg/shared/util" + "go.uber.org/zap" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// AdaptorArgs are the args needed to create a sensor deployment +type AdaptorArgs struct { + Image string + EventSource *v1alpha1.EventSource + Labels map[string]string +} + +// Reconcile does the real logic +func Reconcile(client client.Client, args *AdaptorArgs, logger *zap.SugaredLogger) error { + ctx := context.Background() + eventSource := args.EventSource + eventBus := &v1alpha1.EventBus{} + eventBusName := v1alpha1.DefaultEventBusName + if len(eventSource.Spec.EventBusName) > 0 { + eventBusName = eventSource.Spec.EventBusName + } + err := client.Get(ctx, types.NamespacedName{Namespace: eventSource.Namespace, Name: eventBusName}, eventBus) + if err != nil { + if apierrors.IsNotFound(err) { + eventSource.Status.MarkDeployFailed("EventBusNotFound", "EventBus not found.") + logger.Errorw("EventBus not found", "eventBusName", eventBusName, "error", err) + return fmt.Errorf("eventbus %s not found", eventBusName) + } + eventSource.Status.MarkDeployFailed("GetEventBusFailed", "Failed to get EventBus.") + logger.Errorw("failed to get EventBus", "eventBusName", eventBusName, "error", err) + return err + } + if !eventBus.Status.IsReady() { + eventSource.Status.MarkDeployFailed("EventBusNotReady", "EventBus not ready.") + logger.Errorw("event bus is not in ready status", "eventBusName", eventBusName, "error", err) + return fmt.Errorf("eventbus not ready") + } + + expectedDeploy, err := buildDeployment(args, eventBus) + if err != nil { + eventSource.Status.MarkDeployFailed("BuildDeploymentSpecFailed", "Failed to build Deployment spec.") + logger.Errorw("failed to build deployment spec", "error", err) + return err + } + + deploy, err := getDeployment(ctx, client, args) + if err != nil && !apierrors.IsNotFound(err) { + eventSource.Status.MarkDeployFailed("GetDeploymentFailed", "Get existing deployment failed") + logger.Errorw("error getting existing deployment", "error", err) + return err + } + if deploy != nil { + if deploy.Annotations != nil && deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] != expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] { + deploy.Spec = expectedDeploy.Spec + deploy.SetLabels(expectedDeploy.Labels) + deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] = expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] + err = client.Update(ctx, deploy) + if err != nil { + eventSource.Status.MarkDeployFailed("UpdateDeploymentFailed", "Failed to update existing deployment") + logger.Errorw("error updating existing deployment", "error", err) + return err + } + logger.Infow("deployment is updated", "deploymentName", deploy.Name) + } + } else { + err = client.Create(ctx, expectedDeploy) + if err != nil { + eventSource.Status.MarkDeployFailed("CreateDeploymentFailed", "Failed to create a deployment") + logger.Errorw("error creating a deployment", "error", err) + return err + } + logger.Infow("deployment is created", "deploymentName", expectedDeploy.Name) + } + // Service if any + existingSvc, err := getService(ctx, client, args) + if err != nil && !apierrors.IsNotFound(err) { + eventSource.Status.MarkDeployFailed("GetServiceFailed", "Failed to get existing service") + logger.Errorw("error getting existing service", "error", err) + return err + } + expectedSvc, err := buildService(args) + if err != nil { + eventSource.Status.MarkDeployFailed("BuildServiceFailed", "Failed to build service spec") + logger.Errorw("error building service spec", "error", err) + return err + } + if expectedSvc == nil { + if existingSvc != nil { + err = client.Delete(ctx, existingSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("DeleteServiceFailed", "Failed to delete existing service") + logger.Errorw("error deleting existing service", "error", err) + return err + } + logger.Infow("deleted existing service", "serviceName", existingSvc.Name) + } + } else { + if existingSvc == nil { + err = client.Create(ctx, expectedSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("CreateServiceFailed", "Failed to create a service") + logger.Errorw("error creating a service", "error", err) + return err + } + logger.Infow("service is created", "serviceName", expectedSvc.Name) + } else if existingSvc.Annotations != nil && existingSvc.Annotations[v1alpha1.AnnotationResourceSpecHash] != expectedSvc.Annotations[v1alpha1.AnnotationResourceSpecHash] { + // To avoid service updating issues such as port name change, re-create it. + err = client.Delete(ctx, existingSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("DeleteServiceFailed", "Failed to delete existing service") + logger.Errorw("error deleting existing service", "error", err) + return err + } + err = client.Create(ctx, expectedSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("RecreateServiceFailed", "Failed to re-create existing service") + logger.Errorw("error re-creating existing service", "error", err) + return err + } + logger.Infow("service is re-created", "serviceName", existingSvc.Name) + } + } + eventSource.Status.MarkDeployed() + return nil +} + +func getDeployment(ctx context.Context, cl client.Client, args *AdaptorArgs) (*appv1.Deployment, error) { + dl := &appv1.DeploymentList{} + err := cl.List(ctx, dl, &client.ListOptions{ + Namespace: args.EventSource.Namespace, + LabelSelector: labelSelector(args.Labels), + }) + if err != nil { + return nil, err + } + for _, deploy := range dl.Items { + if metav1.IsControlledBy(&deploy, args.EventSource) { + return &deploy, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") +} + +func buildDeployment(args *AdaptorArgs, eventBus *v1alpha1.EventBus) (*appv1.Deployment, error) { + deploymentSpec, err := buildDeploymentSpec(args) + if err != nil { + return nil, err + } + eventSourceCopy := &v1alpha1.EventSource{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.EventSource.Namespace, + Name: args.EventSource.Name, + }, + Spec: args.EventSource.Spec, + } + eventSourceBytes, err := json.Marshal(eventSourceCopy) + if err != nil { + return nil, fmt.Errorf("failed marshal eventsource spec") + } + busConfigBytes, err := json.Marshal(eventBus.Status.Config) + if err != nil { + return nil, fmt.Errorf("failed marshal event bus config: %v", err) + } + + env := []corev1.EnvVar{ + { + Name: v1alpha1.EnvVarEventSourceObject, + Value: base64.StdEncoding.EncodeToString(eventSourceBytes), + }, + { + Name: v1alpha1.EnvVarEventBusSubject, + Value: fmt.Sprintf("eventbus-%s", args.EventSource.Namespace), + }, + { + Name: v1alpha1.EnvVarPodName, + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, + { + Name: v1alpha1.EnvVarLeaderElection, + Value: args.EventSource.Annotations[v1alpha1.AnnotationLeaderElection], + }, + { + Name: v1alpha1.EnvVarEventBusConfig, + Value: base64.StdEncoding.EncodeToString(busConfigBytes), + }, + } + + volumes := []corev1.Volume{ + { + Name: "tmp", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }, + } + + volumeMounts := []corev1.VolumeMount{ + { + Name: "tmp", + MountPath: "/tmp", + }, + } + + var secretObjs []interface{} + var accessSecret *corev1.SecretKeySelector + var caCertSecret *corev1.SecretKeySelector + var clientCertSecret *corev1.SecretKeySelector + var clientKeySecret *corev1.SecretKeySelector + switch { + case eventBus.Status.Config.NATS != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = eventBus.Status.Config.NATS.AccessSecret + secretObjs = []interface{}{eventSourceCopy} + case eventBus.Status.Config.JetStream != nil: + tlsOptions := eventBus.Status.Config.JetStream.TLS + if tlsOptions != nil { + caCertSecret = tlsOptions.CACertSecret + clientCertSecret = tlsOptions.ClientCertSecret + clientKeySecret = tlsOptions.ClientKeySecret + } + accessSecret = eventBus.Status.Config.JetStream.AccessSecret + secretObjs = []interface{}{eventSourceCopy} + case eventBus.Status.Config.Kafka != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = nil + secretObjs = []interface{}{eventSourceCopy, eventBus} // kafka requires secrets for sasl and tls + default: + return nil, fmt.Errorf("unsupported event bus") + } + + if accessSecret != nil { + // Mount the secret as volume instead of using envFrom to gain the ability + // for the sensor deployment to auto reload when the secret changes + volumes = append(volumes, corev1.Volume{ + Name: "auth-volume", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: accessSecret.Name, + Items: []corev1.KeyToPath{ + { + Key: accessSecret.Key, + Path: "auth.yaml", + }, + }, + }, + }, + }) + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: "auth-volume", + MountPath: v1alpha1.EventBusAuthFileMountPath, + }) + } + + uniqueCertVolumeMap := make(map[string][]corev1.KeyToPath) + for _, secret := range []*corev1.SecretKeySelector{caCertSecret, clientCertSecret, clientKeySecret} { + if secret != nil { + uniqueCertVolumeMap[secret.Name] = append(uniqueCertVolumeMap[secret.Name], corev1.KeyToPath{ + Key: secret.Key, + Path: secret.Key, + }) + } + } + + // We deduplicate the certificate secret mounts to ensure every secret under the TLS config is only mounted once + // because the secrets MUST be mounted at /argo-events/secrets/ + // in order for util.GetTLSConfig to work without modification + for secretName, items := range uniqueCertVolumeMap { + // The names of volumes MUST be valid DNS_LABELs; as the secret names are user-supplied, + // we perform some input cleansing to ensure they conform + volumeName := sharedutil.ConvertToDNSLabel(secretName) + + optional := false + + volumes = append(volumes, corev1.Volume{ + Name: volumeName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: secretName, + Items: items, + Optional: &optional, + }, + }, + }) + + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: volumeName, + MountPath: fmt.Sprintf("/argo-events/secrets/%s", secretName), + }) + } + + // secrets + volSecrets, volSecretMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.SecretKeySelectorType, secretObjs...) + volumes = append(volumes, volSecrets...) + volumeMounts = append(volumeMounts, volSecretMounts...) + + // config maps + volConfigMaps, volCofigMapMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.ConfigMapKeySelectorType, eventSourceCopy) + volumeMounts = append(volumeMounts, volCofigMapMounts...) + volumes = append(volumes, volConfigMaps...) + + // Order volumes and volumemounts based on name to make the order deterministic + sort.Slice(volumes, func(i, j int) bool { + return volumes[i].Name < volumes[j].Name + }) + sort.Slice(volumeMounts, func(i, j int) bool { + return volumeMounts[i].Name < volumeMounts[j].Name + }) + + deploymentSpec.Template.Spec.Containers[0].Env = append(deploymentSpec.Template.Spec.Containers[0].Env, env...) + deploymentSpec.Template.Spec.Containers[0].VolumeMounts = append(deploymentSpec.Template.Spec.Containers[0].VolumeMounts, volumeMounts...) + deploymentSpec.Template.Spec.Volumes = append(deploymentSpec.Template.Spec.Volumes, volumes...) + + deployment := &appv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.EventSource.Namespace, + GenerateName: fmt.Sprintf("%s-eventsource-", args.EventSource.Name), + Labels: mergeLabels(args.EventSource.Labels, args.Labels), + }, + Spec: *deploymentSpec, + } + if err := controllerscommon.SetObjectMeta(args.EventSource, deployment, v1alpha1.EventSourceGroupVersionKind); err != nil { + return nil, err + } + + return deployment, nil +} + +func buildDeploymentSpec(args *AdaptorArgs) (*appv1.DeploymentSpec, error) { + eventSourceContainer := corev1.Container{ + Image: args.Image, + ImagePullPolicy: sharedutil.GetImagePullPolicy(), + Args: []string{"eventsource-service"}, + Ports: []corev1.ContainerPort{ + {Name: "metrics", ContainerPort: v1alpha1.EventSourceMetricsPort}, + }, + } + if x := args.EventSource.Spec.Template; x != nil && x.Container != nil { + x.Container.ApplyToContainer(&eventSourceContainer) + } + eventSourceContainer.Name = "main" + podTemplateLabels := make(map[string]string) + if args.EventSource.Spec.Template != nil && args.EventSource.Spec.Template.Metadata != nil && + len(args.EventSource.Spec.Template.Metadata.Labels) > 0 { + for k, v := range args.EventSource.Spec.Template.Metadata.Labels { + podTemplateLabels[k] = v + } + } + for k, v := range args.Labels { + podTemplateLabels[k] = v + } + + replicas := args.EventSource.Spec.GetReplicas() + spec := &appv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{ + MatchLabels: args.Labels, + }, + Replicas: &replicas, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: podTemplateLabels, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + eventSourceContainer, + }, + }, + }, + } + if args.EventSource.Spec.Template != nil { + if args.EventSource.Spec.Template.Metadata != nil { + spec.Template.SetAnnotations(args.EventSource.Spec.Template.Metadata.Annotations) + } + spec.Template.Spec.ServiceAccountName = args.EventSource.Spec.Template.ServiceAccountName + spec.Template.Spec.Volumes = args.EventSource.Spec.Template.Volumes + spec.Template.Spec.SecurityContext = args.EventSource.Spec.Template.SecurityContext + spec.Template.Spec.NodeSelector = args.EventSource.Spec.Template.NodeSelector + spec.Template.Spec.Tolerations = args.EventSource.Spec.Template.Tolerations + spec.Template.Spec.Affinity = args.EventSource.Spec.Template.Affinity + spec.Template.Spec.ImagePullSecrets = args.EventSource.Spec.Template.ImagePullSecrets + spec.Template.Spec.PriorityClassName = args.EventSource.Spec.Template.PriorityClassName + spec.Template.Spec.Priority = args.EventSource.Spec.Template.Priority + } + return spec, nil +} + +func getService(ctx context.Context, cl client.Client, args *AdaptorArgs) (*corev1.Service, error) { + sl := &corev1.ServiceList{} + err := cl.List(ctx, sl, &client.ListOptions{ + Namespace: args.EventSource.Namespace, + LabelSelector: labelSelector(args.Labels), + }) + if err != nil { + return nil, err + } + for _, svc := range sl.Items { + if metav1.IsControlledBy(&svc, args.EventSource) { + return &svc, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") +} + +func buildService(args *AdaptorArgs) (*corev1.Service, error) { + eventSource := args.EventSource + if eventSource.Spec.Service == nil { + return nil, nil + } + if len(eventSource.Spec.Service.Ports) == 0 { + return nil, nil + } + // Use a ports copy otherwise it will update the oririnal Ports spec in EventSource + ports := []corev1.ServicePort{} + ports = append(ports, eventSource.Spec.Service.Ports...) + + svc := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("%s-eventsource-svc", eventSource.Name), + Namespace: eventSource.Namespace, + }, + Spec: corev1.ServiceSpec{ + Ports: ports, + Type: corev1.ServiceTypeClusterIP, + ClusterIP: eventSource.Spec.Service.ClusterIP, + Selector: args.Labels, + }, + } + + labels := mergeLabels(args.EventSource.Labels, args.Labels) + annotations := make(map[string]string) + + if args.EventSource.Spec.Service.Metadata != nil { + if args.EventSource.Spec.Service.Metadata.Labels != nil { + labels = mergeLabels(args.EventSource.Spec.Service.Metadata.Labels, labels) + } + if args.EventSource.Spec.Service.Metadata.Annotations != nil { + annotations = mergeLabels(args.EventSource.Spec.Service.Metadata.Annotations, annotations) + } + } + + svc.ObjectMeta.SetLabels(labels) + svc.ObjectMeta.SetAnnotations(annotations) + + if err := controllerscommon.SetObjectMeta(eventSource, svc, v1alpha1.EventSourceGroupVersionKind); err != nil { + return nil, err + } + return svc, nil +} + +func mergeLabels(eventBusLabels, given map[string]string) map[string]string { + result := map[string]string{} + for k, v := range eventBusLabels { + result[k] = v + } + for k, v := range given { + result[k] = v + } + return result +} + +func labelSelector(labelMap map[string]string) labels.Selector { + return labels.SelectorFromSet(labelMap) +} +``` + +## `pkg/reconciler/sensor/resource.go` (changed lines (26, 319, 320)) + +```go +/* +Copyright 2018 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sensor + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "sort" + + "go.uber.org/zap" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + controllerscommon "github.com/argoproj/argo-events/pkg/reconciler/common" + sharedutil "github.com/argoproj/argo-events/pkg/shared/util" +) + +// AdaptorArgs are the args needed to create a sensor deployment +type AdaptorArgs struct { + Image string + Sensor *v1alpha1.Sensor + Labels map[string]string +} + +// Reconcile does the real logic +func Reconcile(client client.Client, eventBus *v1alpha1.EventBus, args *AdaptorArgs, logger *zap.SugaredLogger) error { + ctx := context.Background() + sensor := args.Sensor + + if eventBus == nil { + sensor.Status.MarkDeployFailed("GetEventBusFailed", "Failed to get EventBus.") + logger.Error("failed to get EventBus") + return fmt.Errorf("failed to get EventBus") + } + + eventBusName := v1alpha1.DefaultEventBusName + if len(sensor.Spec.EventBusName) > 0 { + eventBusName = sensor.Spec.EventBusName + } + if !eventBus.Status.IsReady() { + sensor.Status.MarkDeployFailed("EventBusNotReady", "EventBus not ready.") + logger.Errorw("event bus is not in ready status", "eventBusName", eventBusName) + return fmt.Errorf("eventbus not ready") + } + + expectedDeploy, err := buildDeployment(args, eventBus) + if err != nil { + sensor.Status.MarkDeployFailed("BuildDeploymentSpecFailed", "Failed to build Deployment spec.") + logger.Errorw("failed to build deployment spec", "error", err) + return err + } + deploy, err := getDeployment(ctx, client, args) + if err != nil && !apierrors.IsNotFound(err) { + sensor.Status.MarkDeployFailed("GetDeploymentFailed", "Get existing deployment failed") + logger.Errorw("error getting existing deployment", "error", err) + return err + } + if deploy != nil { + if deploy.Annotations != nil && deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] != expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] { + deploy.Spec = expectedDeploy.Spec + deploy.SetLabels(expectedDeploy.Labels) + deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] = expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] + err = client.Update(ctx, deploy) + if err != nil { + sensor.Status.MarkDeployFailed("UpdateDeploymentFailed", "Failed to update existing deployment") + logger.Errorw("error updating existing deployment", "error", err) + return err + } + logger.Infow("deployment is updated", "deploymentName", deploy.Name) + } + } else { + err = client.Create(ctx, expectedDeploy) + if err != nil { + sensor.Status.MarkDeployFailed("CreateDeploymentFailed", "Failed to create a deployment") + logger.Errorw("error creating a deployment", "error", err) + return err + } + logger.Infow("deployment is created", "deploymentName", expectedDeploy.Name) + } + sensor.Status.MarkDeployed() + return nil +} + +func getDeployment(ctx context.Context, cl client.Client, args *AdaptorArgs) (*appv1.Deployment, error) { + dl := &appv1.DeploymentList{} + err := cl.List(ctx, dl, &client.ListOptions{ + Namespace: args.Sensor.Namespace, + LabelSelector: labelSelector(args.Labels), + }) + if err != nil { + return nil, err + } + for _, deploy := range dl.Items { + if metav1.IsControlledBy(&deploy, args.Sensor) { + return &deploy, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") +} + +func buildDeployment(args *AdaptorArgs, eventBus *v1alpha1.EventBus) (*appv1.Deployment, error) { + deploymentSpec, err := buildDeploymentSpec(args) + if err != nil { + return nil, err + } + sensorCopy := &v1alpha1.Sensor{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.Sensor.Namespace, + Name: args.Sensor.Name, + }, + Spec: args.Sensor.Spec, + } + sensorBytes, err := json.Marshal(sensorCopy) + if err != nil { + return nil, fmt.Errorf("failed marshal sensor spec") + } + busConfigBytes, err := json.Marshal(eventBus.Status.Config) + if err != nil { + return nil, fmt.Errorf("failed marshal event bus config: %v", err) + } + + env := []corev1.EnvVar{ + { + Name: v1alpha1.EnvVarSensorObject, + Value: base64.StdEncoding.EncodeToString(sensorBytes), + }, + { + Name: v1alpha1.EnvVarEventBusSubject, + Value: fmt.Sprintf("eventbus-%s", args.Sensor.Namespace), + }, + { + Name: v1alpha1.EnvVarPodName, + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, + { + Name: v1alpha1.EnvVarLeaderElection, + Value: args.Sensor.Annotations[v1alpha1.AnnotationLeaderElection], + }, + { + Name: v1alpha1.EnvVarEventBusConfig, + Value: base64.StdEncoding.EncodeToString(busConfigBytes), + }, + } + + volumes := []corev1.Volume{ + { + Name: "tmp", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }, + } + + volumeMounts := []corev1.VolumeMount{ + { + Name: "tmp", + MountPath: "/tmp", + }, + } + + var secretObjs []interface{} + var accessSecret *corev1.SecretKeySelector + var caCertSecret *corev1.SecretKeySelector + var clientCertSecret *corev1.SecretKeySelector + var clientKeySecret *corev1.SecretKeySelector + switch { + case eventBus.Status.Config.NATS != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = eventBus.Status.Config.NATS.AccessSecret + secretObjs = []interface{}{sensorCopy} + case eventBus.Status.Config.JetStream != nil: + tlsOptions := eventBus.Status.Config.JetStream.TLS + if tlsOptions != nil { + caCertSecret = tlsOptions.CACertSecret + clientCertSecret = tlsOptions.ClientCertSecret + clientKeySecret = tlsOptions.ClientKeySecret + } + accessSecret = eventBus.Status.Config.JetStream.AccessSecret + secretObjs = []interface{}{sensorCopy} + case eventBus.Status.Config.Kafka != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = nil + secretObjs = []interface{}{sensorCopy, eventBus} // kafka requires secrets for sasl and tls + default: + return nil, fmt.Errorf("unsupported event bus") + } + + if accessSecret != nil { + // Mount the secret as volume instead of using envFrom to gain the ability + // for the sensor deployment to auto reload when the secret changes + volumes = append(volumes, corev1.Volume{ + Name: "auth-volume", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: accessSecret.Name, + Items: []corev1.KeyToPath{ + { + Key: accessSecret.Key, + Path: "auth.yaml", + }, + }, + }, + }, + }) + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: "auth-volume", + MountPath: v1alpha1.EventBusAuthFileMountPath, + }) + } + + uniqueCertVolumeMap := make(map[string][]corev1.KeyToPath) + for _, secret := range []*corev1.SecretKeySelector{caCertSecret, clientCertSecret, clientKeySecret} { + if secret != nil { + uniqueCertVolumeMap[secret.Name] = append(uniqueCertVolumeMap[secret.Name], corev1.KeyToPath{ + Key: secret.Key, + Path: secret.Key, + }) + } + } + + // We deduplicate the certificate secret mounts to ensure every secret under the TLS config is only mounted once + // because the secrets MUST be mounted at /argo-events/secrets/ + // in order for util.GetTLSConfig to work without modification + for secretName, items := range uniqueCertVolumeMap { + // The names of volumes MUST be valid DNS_LABELs; as the secret names are user-supplied, + // we perform some input cleansing to ensure they conform + volumeName := sharedutil.ConvertToDNSLabel(secretName) + + optional := false + + volumes = append(volumes, corev1.Volume{ + Name: volumeName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: secretName, + Items: items, + Optional: &optional, + }, + }, + }) + + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: volumeName, + MountPath: fmt.Sprintf("/argo-events/secrets/%s", secretName), + }) + } + + // secrets + volSecrets, volSecretMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.SecretKeySelectorType, secretObjs...) + volumes = append(volumes, volSecrets...) + volumeMounts = append(volumeMounts, volSecretMounts...) + + // config maps + volConfigMaps, volCofigMapMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.ConfigMapKeySelectorType, sensorCopy) + volumeMounts = append(volumeMounts, volCofigMapMounts...) + volumes = append(volumes, volConfigMaps...) + + // Order volumes and volumemounts based on name to make the order deterministic + sort.Slice(volumes, func(i, j int) bool { + return volumes[i].Name < volumes[j].Name + }) + sort.Slice(volumeMounts, func(i, j int) bool { + return volumeMounts[i].Name < volumeMounts[j].Name + }) + + deploymentSpec.Template.Spec.Containers[0].Env = append(deploymentSpec.Template.Spec.Containers[0].Env, env...) + deploymentSpec.Template.Spec.Containers[0].VolumeMounts = append(deploymentSpec.Template.Spec.Containers[0].VolumeMounts, volumeMounts...) + deploymentSpec.Template.Spec.Volumes = append(deploymentSpec.Template.Spec.Volumes, volumes...) + + deployment := &appv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.Sensor.Namespace, + GenerateName: fmt.Sprintf("%s-sensor-", args.Sensor.Name), + Labels: mergeLabels(args.Sensor.Labels, args.Labels), + }, + Spec: *deploymentSpec, + } + if err := controllerscommon.SetObjectMeta(args.Sensor, deployment, v1alpha1.SensorGroupVersionKind); err != nil { + return nil, err + } + + return deployment, nil +} + +func buildDeploymentSpec(args *AdaptorArgs) (*appv1.DeploymentSpec, error) { + replicas := args.Sensor.Spec.GetReplicas() + sensorContainer := corev1.Container{ + Image: args.Image, + ImagePullPolicy: sharedutil.GetImagePullPolicy(), + Args: []string{"sensor-service"}, + Ports: []corev1.ContainerPort{ + {Name: "metrics", ContainerPort: v1alpha1.SensorMetricsPort}, + }, + } + if x := args.Sensor.Spec.Template; x != nil && x.Container != nil { + x.Container.ApplyToContainer(&sensorContainer) + } + sensorContainer.Name = "main" + podTemplateLabels := make(map[string]string) + if args.Sensor.Spec.Template != nil && args.Sensor.Spec.Template.Metadata != nil && + len(args.Sensor.Spec.Template.Metadata.Labels) > 0 { + for k, v := range args.Sensor.Spec.Template.Metadata.Labels { + podTemplateLabels[k] = v + } + } + for k, v := range args.Labels { + podTemplateLabels[k] = v + } + spec := &appv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{ + MatchLabels: args.Labels, + }, + Replicas: &replicas, + RevisionHistoryLimit: args.Sensor.Spec.RevisionHistoryLimit, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: podTemplateLabels, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + sensorContainer, + }, + }, + }, + } + if args.Sensor.Spec.Template != nil { + if args.Sensor.Spec.Template.Metadata != nil { + spec.Template.SetAnnotations(args.Sensor.Spec.Template.Metadata.Annotations) + } + spec.Template.Spec.ServiceAccountName = args.Sensor.Spec.Template.ServiceAccountName + spec.Template.Spec.Volumes = args.Sensor.Spec.Template.Volumes + spec.Template.Spec.SecurityContext = args.Sensor.Spec.Template.SecurityContext + spec.Template.Spec.NodeSelector = args.Sensor.Spec.Template.NodeSelector + spec.Template.Spec.Tolerations = args.Sensor.Spec.Template.Tolerations + spec.Template.Spec.Affinity = args.Sensor.Spec.Template.Affinity + spec.Template.Spec.ImagePullSecrets = args.Sensor.Spec.Template.ImagePullSecrets + spec.Template.Spec.PriorityClassName = args.Sensor.Spec.Template.PriorityClassName + spec.Template.Spec.Priority = args.Sensor.Spec.Template.Priority + } + return spec, nil +} + +func mergeLabels(sensorLabels, given map[string]string) map[string]string { + result := map[string]string{} + for k, v := range sensorLabels { + result[k] = v + } + for k, v := range given { + result[k] = v + } + return result +} + +func labelSelector(labelMap map[string]string) labels.Selector { + return labels.SelectorFromSet(labelMap) +} +``` + +## `pkg/reconciler/sensor/resource_test.go` (changed lines (55,)) + +```go +/* +Copyright 2020 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sensor + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +const ( + testNamespace = "test-ns" +) + +var ( + testLabels = map[string]string{"controller": "test-controller"} + + sensorObj = &v1alpha1.Sensor{ + ObjectMeta: metav1.ObjectMeta{ + Name: "fake-sensor", + Namespace: testNamespace, + }, + Spec: v1alpha1.SensorSpec{ + Template: &v1alpha1.Template{ + ServiceAccountName: "fake-sa", + ImagePullSecrets: []corev1.LocalObjectReference{ + { + Name: "test", + }, + }, + Container: &v1alpha1.Container{ + VolumeMounts: []corev1.VolumeMount{ + { + MountPath: "/test-data", + Name: "test-data", + }, + }, + }, + Volumes: []corev1.Volume{ + { + Name: "test-data", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + }, + PriorityClassName: "test-class", + }, + Triggers: []v1alpha1.Trigger{ + { + Template: &v1alpha1.TriggerTemplate{ + Name: "fake-trigger", + K8s: &v1alpha1.StandardK8STrigger{ + Operation: "create", + Source: &v1alpha1.ArtifactLocation{}, + }, + }, + }, + }, + Dependencies: []v1alpha1.EventDependency{ + { + Name: "fake-dep", + EventSourceName: "fake-source", + EventName: "fake-one", + }, + }, + }, + } + + fakeEventBus = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + NATS: &v1alpha1.NATSBus{ + Native: &v1alpha1.NativeStrategy{ + Auth: &v1alpha1.AuthStrategyToken, + }, + }, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + NATS: &v1alpha1.NATSConfig{ + URL: "nats://xxxx", + Auth: &v1alpha1.AuthStrategyToken, + AccessSecret: &corev1.SecretKeySelector{ + Key: "test-key", + LocalObjectReference: corev1.LocalObjectReference{ + Name: "test-name", + }, + }, + }, + }, + }, + } + + fakeEventBusJetstream = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + JetStream: &v1alpha1.JetStreamBus{ + Version: "x.x.x", + }, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + JetStream: &v1alpha1.JetStreamConfig{ + URL: "nats://xxxx", + }, + }, + }, + } + + fakeEventBusJetstreamWithTLS = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + JetStream: &v1alpha1.JetStreamBus{}, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + JetStream: &v1alpha1.JetStreamConfig{ + URL: "nats://xxxx", + TLS: &v1alpha1.TLSConfig{ + CACertSecret: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "secret-0", + }, + Key: "ca.crt", + }, + ClientKeySecret: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "secret-1", + }, + Key: "tls.key", + }, + ClientCertSecret: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "secret-1", + }, + Key: "tls.crt", + }, + }, + }, + }, + }, + } + + fakeEventBusKafka = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + Kafka: &v1alpha1.KafkaBus{ + URL: "localhost:9092", + }, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + Kafka: &v1alpha1.KafkaBus{ + URL: "localhost:9092", + }, + }, + }, + } +) + +func Test_BuildDeployment(t *testing.T) { + t.Run("test build with eventbus", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + deployment, err := buildDeployment(args, fakeEventBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + volumes := deployment.Spec.Template.Spec.Volumes + assert.True(t, len(volumes) > 0) + hasAuthVolume := false + hasTmpVolume := false + for _, vol := range volumes { + if vol.Name == "auth-volume" { + hasAuthVolume = true + } + if vol.Name == "tmp" { + hasTmpVolume = true + } + } + assert.True(t, hasAuthVolume) + assert.True(t, hasTmpVolume) + assert.True(t, len(deployment.Spec.Template.Spec.ImagePullSecrets) > 0) + assert.Equal(t, deployment.Spec.Template.Spec.PriorityClassName, "test-class") + assert.Nil(t, deployment.Spec.RevisionHistoryLimit) + }) + t.Run("test revisionHistoryLimit", func(t *testing.T) { + sensorWithRevisionHistoryLimit := sensorObj.DeepCopy() + sensorWithRevisionHistoryLimit.Spec.RevisionHistoryLimit = func() *int32 { i := int32(3); return &i }() + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorWithRevisionHistoryLimit, + Labels: testLabels, + } + deployment, err := buildDeployment(args, fakeEventBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + assert.Equal(t, int32(3), *deployment.Spec.RevisionHistoryLimit) + }) + + t.Run("test kafka eventbus secrets attached", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + + // add secrets to kafka eventbus + testBus := fakeEventBusKafka.DeepCopy() + testBus.Spec.Kafka.TLS = &v1alpha1.TLSConfig{ + CACertSecret: &corev1.SecretKeySelector{Key: "cert", LocalObjectReference: corev1.LocalObjectReference{Name: "tls-secret"}}, + } + testBus.Spec.Kafka.SASL = &v1alpha1.SASLConfig{ + Mechanism: "SCRAM-SHA-512", + UserSecret: &corev1.SecretKeySelector{Key: "username", LocalObjectReference: corev1.LocalObjectReference{Name: "sasl-secret"}}, + PasswordSecret: &corev1.SecretKeySelector{Key: "password", LocalObjectReference: corev1.LocalObjectReference{Name: "sasl-secret"}}, + } + + deployment, err := buildDeployment(args, testBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + + hasSASLSecretVolume := false + hasSASLSecretVolumeMount := false + hasTLSSecretVolume := false + hasTLSSecretVolumeMount := false + for _, volume := range deployment.Spec.Template.Spec.Volumes { + if volume.Name == "secret-sasl-secret" { + hasSASLSecretVolume = true + } + if volume.Name == "secret-tls-secret" { + hasTLSSecretVolume = true + } + } + for _, volumeMount := range deployment.Spec.Template.Spec.Containers[0].VolumeMounts { + if volumeMount.Name == "secret-sasl-secret" { + hasSASLSecretVolumeMount = true + } + if volumeMount.Name == "secret-tls-secret" { + hasTLSSecretVolumeMount = true + } + } + + assert.True(t, hasSASLSecretVolume) + assert.True(t, hasSASLSecretVolumeMount) + assert.True(t, hasTLSSecretVolume) + assert.True(t, hasTLSSecretVolumeMount) + }) + + t.Run("test jetstream eventbus secrets attached", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + + deployment, err := buildDeployment(args, fakeEventBusJetstreamWithTLS.DeepCopy()) + assert.Nil(t, err) + assert.NotNil(t, deployment) + + hasCAVolume := false + hasCertVolume := false + hasCAVolumeMount := false + hasCertVolumeMount := false + for _, volume := range deployment.Spec.Template.Spec.Volumes { + if volume.Name == "secret-0" { + if hasCAVolume { + assert.Fail(t, "Secrets should be de-duplicated") + } + hasCAVolume = true + } + if volume.Name == "secret-1" { + if hasCertVolume { + assert.Fail(t, "Secrets should be de-duplicated") + } + hasCertVolume = true + } + } + for _, volumeMount := range deployment.Spec.Template.Spec.Containers[0].VolumeMounts { + if volumeMount.Name == "secret-0" { + hasCAVolumeMount = true + assert.Equal(t, volumeMount.MountPath, fmt.Sprintf("/argo-events/secrets/%s", volumeMount.Name)) + } + if volumeMount.Name == "secret-1" { + hasCertVolumeMount = true + assert.Equal(t, volumeMount.MountPath, fmt.Sprintf("/argo-events/secrets/%s", volumeMount.Name)) + } + } + + assert.True(t, hasCAVolume) + assert.True(t, hasCertVolume) + assert.True(t, hasCAVolumeMount) + assert.True(t, hasCertVolumeMount) + }) + + t.Run("test secret volume and volumemount order deterministic", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + + wantVolumeNames := []string{"test-data", "auth-volume", "tmp"} + wantVolumeMountNames := []string{"test-data", "auth-volume", "tmp"} + + deployment, err := buildDeployment(args, fakeEventBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + gotVolumes := deployment.Spec.Template.Spec.Volumes + gotVolumeMounts := deployment.Spec.Template.Spec.Containers[0].VolumeMounts + + var gotVolumeNames []string + var gotVolumeMountNames []string + + for _, v := range gotVolumes { + gotVolumeNames = append(gotVolumeNames, v.Name) + } + for _, v := range gotVolumeMounts { + gotVolumeMountNames = append(gotVolumeMountNames, v.Name) + } + + assert.Equal(t, len(gotVolumes), len(wantVolumeNames)) + assert.Equal(t, len(gotVolumeMounts), len(wantVolumeMountNames)) + + for i := range gotVolumeNames { + assert.Equal(t, gotVolumeNames[i], wantVolumeNames[i]) + } + for i := range gotVolumeMountNames { + assert.Equal(t, gotVolumeMountNames[i], wantVolumeMountNames[i]) + } + }) +} + +func TestResourceReconcile(t *testing.T) { + t.Run("test resource reconcile without eventbus", func(t *testing.T) { + cl := fake.NewClientBuilder().Build() + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + err := Reconcile(cl, nil, args, logging.NewArgoEventsLogger()) + assert.Error(t, err) + assert.False(t, sensorObj.Status.IsReady()) + }) + + for _, eb := range []*v1alpha1.EventBus{fakeEventBus, fakeEventBusJetstream, fakeEventBusKafka} { + testBus := eb.DeepCopy() + + t.Run("test resource reconcile with eventbus", func(t *testing.T) { + ctx := context.TODO() + cl := fake.NewClientBuilder().Build() + testBus.Status.MarkDeployed("test", "test") + testBus.Status.MarkConfigured() + err := cl.Create(ctx, testBus) + assert.Nil(t, err) + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + err = Reconcile(cl, testBus, args, logging.NewArgoEventsLogger()) + assert.Nil(t, err) + assert.True(t, sensorObj.Status.IsReady()) + + deployList := &appv1.DeploymentList{} + err = cl.List(ctx, deployList, &client.ListOptions{ + Namespace: testNamespace, + }) + assert.NoError(t, err) + assert.Equal(t, 1, len(deployList.Items)) + + svcList := &corev1.ServiceList{} + err = cl.List(ctx, svcList, &client.ListOptions{ + Namespace: testNamespace, + }) + assert.NoError(t, err) + assert.Equal(t, 0, len(svcList.Items)) + }) + } +} +``` + +## `pkg/sensors/triggers/standard-k8s/standard-k8s.go` (changed lines (25,)) + +```go +/* +Copyright 2020 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package standard_k8s + +import ( + "context" + "fmt" + "strconv" + "time" + + "dario.cat/mergo" + "go.uber.org/zap" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + k8stypes "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/sensors/policy" + "github.com/argoproj/argo-events/pkg/sensors/triggers" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +var clusterResources = map[string]bool{ + "namespaces": true, + "nodes": true, + "persistentvolumes": true, + "clusterroles": true, + "clusterrolebindings": true, +} + +// StandardK8STrigger implements Trigger interface for standard Kubernetes resources +type StandardK8sTrigger struct { + // K8sClient is kubernetes client + K8sClient kubernetes.Interface + // Dynamic client is Kubernetes dymalic client + DynamicClient dynamic.Interface + // Sensor object + Sensor *v1alpha1.Sensor + // Trigger definition + Trigger *v1alpha1.Trigger + // logger to log stuff + Logger *zap.SugaredLogger + + namespableDynamicClient dynamic.NamespaceableResourceInterface +} + +// NewStandardK8sTrigger returns a new StandardK8STrigger +func NewStandardK8sTrigger(k8sClient kubernetes.Interface, dynamicClient dynamic.Interface, sensor *v1alpha1.Sensor, trigger *v1alpha1.Trigger, logger *zap.SugaredLogger) *StandardK8sTrigger { + return &StandardK8sTrigger{ + K8sClient: k8sClient, + DynamicClient: dynamicClient, + Sensor: sensor, + Trigger: trigger, + Logger: logger.With(logging.LabelTriggerType, v1alpha1.TriggerTypeK8s), + } +} + +// GetTriggerType returns the type of the trigger +func (k8sTrigger *StandardK8sTrigger) GetTriggerType() v1alpha1.TriggerType { + return v1alpha1.TriggerTypeK8s +} + +// FetchResource fetches the trigger resource from external source +func (k8sTrigger *StandardK8sTrigger) FetchResource(ctx context.Context) (interface{}, error) { + trigger := k8sTrigger.Trigger + var rObj runtime.Object + + uObj, err := triggers.FetchKubernetesResource(trigger.Template.K8s.Source) + if err != nil { + return nil, err + } + + gvr := triggers.GetGroupVersionResource(uObj) + k8sTrigger.namespableDynamicClient = k8sTrigger.DynamicClient.Resource(gvr) + + if trigger.Template.K8s.LiveObject && trigger.Template.K8s.Operation == v1alpha1.Update { + objName := uObj.GetName() + if objName == "" { + return nil, fmt.Errorf("resource name must be specified for fetching live object") + } + + objNamespace := uObj.GetNamespace() + _, isClusterResource := clusterResources[gvr.Resource] + if objNamespace == "" && !isClusterResource { + return nil, fmt.Errorf("resource namespace must be specified for fetching live object") + } + rObj, err = k8sTrigger.namespableDynamicClient.Namespace(objNamespace).Get(ctx, objName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + } else { + rObj = uObj + } + return rObj, nil +} + +// ApplyResourceParameters applies parameters to the trigger resource +func (k8sTrigger *StandardK8sTrigger) ApplyResourceParameters(events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error) { + obj, ok := resource.(*unstructured.Unstructured) + if !ok { + return nil, fmt.Errorf("failed to interpret the trigger resource") + } + if err := triggers.ApplyResourceParameters(events, k8sTrigger.Trigger.Template.K8s.Parameters, obj); err != nil { + return nil, err + } + return obj, nil +} + +// Execute executes the trigger +func (k8sTrigger *StandardK8sTrigger) Execute(ctx context.Context, events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error) { + trigger := k8sTrigger.Trigger + + obj, ok := resource.(*unstructured.Unstructured) + if !ok { + return nil, fmt.Errorf("failed to interpret the trigger resource") + } + + gvr := triggers.GetGroupVersionResource(obj) + namespace := "" + if _, isClusterResource := clusterResources[gvr.Resource]; !isClusterResource { + namespace = obj.GetNamespace() + // Defaults to sensor's namespace + if namespace == "" { + namespace = k8sTrigger.Sensor.Namespace + } + } + obj.SetNamespace(namespace) + + op := v1alpha1.Create + if trigger.Template.K8s.Operation != "" { + op = trigger.Template.K8s.Operation + } + + // We might have a client from FetchResource() already, or we might not have one yet. + if k8sTrigger.namespableDynamicClient == nil { + k8sTrigger.namespableDynamicClient = k8sTrigger.DynamicClient.Resource(gvr) + } + + switch op { + case v1alpha1.Create: + k8sTrigger.Logger.Info("creating the object...") + // Add labels + labels := obj.GetLabels() + if labels == nil { + labels = make(map[string]string) + } + labels["events.argoproj.io/sensor"] = k8sTrigger.Sensor.Name + labels["events.argoproj.io/trigger"] = trigger.Template.Name + labels["events.argoproj.io/action-timestamp"] = strconv.Itoa(int(time.Now().UnixNano() / int64(time.Millisecond))) + obj.SetLabels(labels) + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Create(ctx, obj, metav1.CreateOptions{}) + + case v1alpha1.Update: + k8sTrigger.Logger.Info("updating the object...") + + oldObj, err := k8sTrigger.namespableDynamicClient.Namespace(namespace).Get(ctx, obj.GetName(), metav1.GetOptions{}) + if err != nil && apierrors.IsNotFound(err) { + k8sTrigger.Logger.Info("object not found, creating the object...") + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Create(ctx, obj, metav1.CreateOptions{}) + } else if err != nil { + return nil, fmt.Errorf("failed to retrieve existing object. err: %w", err) + } + + if err := mergo.Merge(oldObj, obj, mergo.WithOverride); err != nil { + return nil, fmt.Errorf("failed to update the object. err: %w", err) + } + + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Update(ctx, oldObj, metav1.UpdateOptions{}) + + case v1alpha1.Patch: + k8sTrigger.Logger.Info("patching the object...") + + _, err := k8sTrigger.namespableDynamicClient.Namespace(namespace).Get(ctx, obj.GetName(), metav1.GetOptions{}) + if err != nil && apierrors.IsNotFound(err) { + k8sTrigger.Logger.Info("object not found, creating the object...") + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Create(ctx, obj, metav1.CreateOptions{}) + } else if err != nil { + return nil, fmt.Errorf("failed to retrieve existing object. err: %w", err) + } + + if k8sTrigger.Trigger.Template.K8s.PatchStrategy == "" { + k8sTrigger.Trigger.Template.K8s.PatchStrategy = k8stypes.MergePatchType + } + + body, err := obj.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("failed to marshal object into JSON schema. err: %w", err) + } + + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Patch(ctx, obj.GetName(), k8sTrigger.Trigger.Template.K8s.PatchStrategy, body, metav1.PatchOptions{}) + + case v1alpha1.Delete: + k8sTrigger.Logger.Info("deleting the object...") + _, err := k8sTrigger.namespableDynamicClient.Namespace(namespace).Get(ctx, obj.GetName(), metav1.GetOptions{}) + + if err != nil && apierrors.IsNotFound(err) { + k8sTrigger.Logger.Info("object not found, nothing to delete...") + return nil, nil + } else if err != nil { + return nil, fmt.Errorf("failed to retrieve existing object. err: %w", err) + } + + err = k8sTrigger.namespableDynamicClient.Namespace(namespace).Delete(ctx, obj.GetName(), metav1.DeleteOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to delete object. err: %w", err) + } + return nil, nil + + default: + return nil, fmt.Errorf("unknown operation type %s", string(op)) + } +} + +// ApplyPolicy applies the policy on the trigger +func (k8sTrigger *StandardK8sTrigger) ApplyPolicy(ctx context.Context, resource interface{}) error { + trigger := k8sTrigger.Trigger + + if trigger.Policy == nil || trigger.Policy.K8s == nil || trigger.Policy.K8s.Labels == nil { + return nil + } + + obj, ok := resource.(*unstructured.Unstructured) + if !ok { + return fmt.Errorf("failed to interpret the trigger resource") + } + + p := policy.NewResourceLabels(trigger, k8sTrigger.namespableDynamicClient, obj) + if p == nil { + return nil + } + + err := p.ApplyPolicy(ctx) + if err != nil { + if wait.Interrupted(err) { + if trigger.Policy.K8s.ErrorOnBackoffTimeout { + return fmt.Errorf("failed to determine status of the triggered resource. setting trigger state as failed") + } + return nil + } else { + return err + } + } + return nil +} +``` + +## `pkg/webhook/validator/validator_test.go` (changed lines (97,)) + +```go +package validator + +import ( + "context" + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + fakeClient "k8s.io/client-go/kubernetes/fake" + + aev1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + fakeeventsclient "github.com/argoproj/argo-events/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +const ( + testNamespace = "test-ns" +) + +var ( + fakeK8sClient = fakeClient.NewSimpleClientset() + fakeEventsClient = fakeeventsclient.NewSimpleClientset().ArgoprojV1alpha1() +) + +func contextWithLogger(t *testing.T) context.Context { + t.Helper() + return logging.WithLogger(context.Background(), logging.NewArgoEventsLogger()) +} + +func fromSchemaGVK(gvk schema.GroupVersionKind) metav1.GroupVersionKind { + return metav1.GroupVersionKind{ + Group: gvk.Group, + Version: gvk.Version, + Kind: gvk.Kind, + } +} + +func fakeEventBus() *aev1.EventBus { + return &aev1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: aev1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: aev1.DefaultEventBusName, + }, + Spec: aev1.EventBusSpec{ + NATS: &aev1.NATSBus{ + Native: &aev1.NativeStrategy{ + Auth: &aev1.AuthStrategyToken, + }, + }, + }, + } +} + +func fakeExoticEventBus() *aev1.EventBus { + cID := "test-cluster-id" + return &aev1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: aev1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: "test-name", + }, + Spec: aev1.EventBusSpec{ + NATS: &aev1.NATSBus{ + Exotic: &aev1.NATSConfig{ + ClusterID: &cID, + URL: "nats://adsaf:1234", + }, + }, + }, + } +} + +func fakeSensor() *aev1.Sensor { + return &aev1.Sensor{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-sensor", + Namespace: testNamespace, + }, + Spec: aev1.SensorSpec{ + Template: &aev1.Template{ + ServiceAccountName: "fake-sa", + ImagePullSecrets: []corev1.LocalObjectReference{ + { + Name: "test", + }, + }, + Container: &aev1.Container{ + VolumeMounts: []corev1.VolumeMount{ + { + MountPath: "/test-data", + Name: "test-data", + }, + }, + }, + Volumes: []corev1.Volume{ + { + Name: "test-data", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + }, + }, + Triggers: []aev1.Trigger{ + { + Template: &aev1.TriggerTemplate{ + Name: "fake-trigger", + K8s: &aev1.StandardK8STrigger{ + Operation: "create", + Source: &aev1.ArtifactLocation{}, + }, + }, + }, + }, + Dependencies: []aev1.EventDependency{ + { + Name: "fake-dep", + EventSourceName: "fake-source", + EventName: "fake-one", + }, + }, + }, + } +} + +func fakeCalendarEventSourceMap(name string) map[string]aev1.CalendarEventSource { + return map[string]aev1.CalendarEventSource{name: {Schedule: "*/5 * * * *"}} +} + +func fakeCalendarEventSource() *aev1.EventSource { + return &aev1.EventSource{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: "test-es", + }, + Spec: aev1.EventSourceSpec{ + Calendar: fakeCalendarEventSourceMap("test"), + }, + } +} + +func TestGetValidator(t *testing.T) { + t.Run("test get EventBus validator", func(t *testing.T) { + byts, err := json.Marshal(fakeEventBus()) + assert.NoError(t, err) + v, err := GetValidator(contextWithLogger(t), fakeK8sClient, fakeEventsClient, fromSchemaGVK(aev1.EventBusGroupVersionKind), nil, byts) + assert.NoError(t, err) + assert.NotNil(t, v) + }) + t.Run("test get EventSource validator", func(t *testing.T) { + byts, err := json.Marshal(fakeCalendarEventSource()) + assert.NoError(t, err) + v, err := GetValidator(contextWithLogger(t), fakeK8sClient, fakeEventsClient, fromSchemaGVK(aev1.EventSourceGroupVersionKind), nil, byts) + assert.NoError(t, err) + assert.NotNil(t, v) + }) + t.Run("test get Sensor validator", func(t *testing.T) { + byts, err := json.Marshal(fakeSensor()) + assert.NoError(t, err) + v, err := GetValidator(contextWithLogger(t), fakeK8sClient, fakeEventsClient, fromSchemaGVK(aev1.SensorGroupVersionKind), nil, byts) + assert.NoError(t, err) + assert.NotNil(t, v) + }) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/pre_context.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..2b9753c336af32d2100e0617aaaddde33a5160e1 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/pre_context.md @@ -0,0 +1,75914 @@ +# Patch-overlapping Go context before the fix + +## `pkg/apis/events/openapi/openapi_generated.go` (changed lines (61, 1763, 7908, 7909, 8011, 8012)) + +```go +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +package openapi + +import ( + v1alpha1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + common "k8s.io/kube-openapi/pkg/common" + spec "k8s.io/kube-openapi/pkg/validation/spec" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPConsumeConfig": schema_pkg_apis_events_v1alpha1_AMQPConsumeConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPEventSource": schema_pkg_apis_events_v1alpha1_AMQPEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPExchangeDeclareConfig": schema_pkg_apis_events_v1alpha1_AMQPExchangeDeclareConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueBindConfig": schema_pkg_apis_events_v1alpha1_AMQPQueueBindConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueDeclareConfig": schema_pkg_apis_events_v1alpha1_AMQPQueueDeclareConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AWSLambdaTrigger": schema_pkg_apis_events_v1alpha1_AWSLambdaTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount": schema_pkg_apis_events_v1alpha1_Amount(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArgoWorkflowTrigger": schema_pkg_apis_events_v1alpha1_ArgoWorkflowTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation": schema_pkg_apis_events_v1alpha1_ArtifactLocation(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventHubsTrigger": schema_pkg_apis_events_v1alpha1_AzureEventHubsTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventsHubEventSource": schema_pkg_apis_events_v1alpha1_AzureEventsHubEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureQueueStorageEventSource": schema_pkg_apis_events_v1alpha1_AzureQueueStorageEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusEventSource": schema_pkg_apis_events_v1alpha1_AzureServiceBusEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusTrigger": schema_pkg_apis_events_v1alpha1_AzureServiceBusTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff": schema_pkg_apis_events_v1alpha1_Backoff(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth": schema_pkg_apis_events_v1alpha1_BasicAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketAuth": schema_pkg_apis_events_v1alpha1_BitbucketAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketBasicAuth": schema_pkg_apis_events_v1alpha1_BitbucketBasicAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketEventSource": schema_pkg_apis_events_v1alpha1_BitbucketEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketRepository": schema_pkg_apis_events_v1alpha1_BitbucketRepository(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerEventSource": schema_pkg_apis_events_v1alpha1_BitbucketServerEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerRepository": schema_pkg_apis_events_v1alpha1_BitbucketServerRepository(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BusConfig": schema_pkg_apis_events_v1alpha1_BusConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CalendarEventSource": schema_pkg_apis_events_v1alpha1_CalendarEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CatchupConfiguration": schema_pkg_apis_events_v1alpha1_CatchupConfiguration(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition": schema_pkg_apis_events_v1alpha1_Condition(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime": schema_pkg_apis_events_v1alpha1_ConditionsResetByTime(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria": schema_pkg_apis_events_v1alpha1_ConditionsResetCriteria(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence": schema_pkg_apis_events_v1alpha1_ConfigMapPersistence(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate": schema_pkg_apis_events_v1alpha1_ContainerTemplate(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger": schema_pkg_apis_events_v1alpha1_CustomTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter": schema_pkg_apis_events_v1alpha1_DataFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmailTrigger": schema_pkg_apis_events_v1alpha1_EmailTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmitterEventSource": schema_pkg_apis_events_v1alpha1_EmitterEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Event": schema_pkg_apis_events_v1alpha1_Event(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBus": schema_pkg_apis_events_v1alpha1_EventBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusList": schema_pkg_apis_events_v1alpha1_EventBusList(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusSpec": schema_pkg_apis_events_v1alpha1_EventBusSpec(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusStatus": schema_pkg_apis_events_v1alpha1_EventBusStatus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext": schema_pkg_apis_events_v1alpha1_EventContext(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependency": schema_pkg_apis_events_v1alpha1_EventDependency(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyFilter": schema_pkg_apis_events_v1alpha1_EventDependencyFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyTransformer": schema_pkg_apis_events_v1alpha1_EventDependencyTransformer(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventPersistence": schema_pkg_apis_events_v1alpha1_EventPersistence(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSource": schema_pkg_apis_events_v1alpha1_EventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter": schema_pkg_apis_events_v1alpha1_EventSourceFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceList": schema_pkg_apis_events_v1alpha1_EventSourceList(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceSpec": schema_pkg_apis_events_v1alpha1_EventSourceSpec(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceStatus": schema_pkg_apis_events_v1alpha1_EventSourceStatus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ExprFilter": schema_pkg_apis_events_v1alpha1_ExprFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileArtifact": schema_pkg_apis_events_v1alpha1_FileArtifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileEventSource": schema_pkg_apis_events_v1alpha1_FileEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GenericEventSource": schema_pkg_apis_events_v1alpha1_GenericEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GerritEventSource": schema_pkg_apis_events_v1alpha1_GerritEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitArtifact": schema_pkg_apis_events_v1alpha1_GitArtifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitCreds": schema_pkg_apis_events_v1alpha1_GitCreds(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitRemoteConfig": schema_pkg_apis_events_v1alpha1_GitRemoteConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubAppCreds": schema_pkg_apis_events_v1alpha1_GithubAppCreds(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubEventSource": schema_pkg_apis_events_v1alpha1_GithubEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitlabEventSource": schema_pkg_apis_events_v1alpha1_GitlabEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HDFSEventSource": schema_pkg_apis_events_v1alpha1_HDFSEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HTTPTrigger": schema_pkg_apis_events_v1alpha1_HTTPTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Int64OrString": schema_pkg_apis_events_v1alpha1_Int64OrString(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamBus": schema_pkg_apis_events_v1alpha1_JetStreamBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig": schema_pkg_apis_events_v1alpha1_JetStreamConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResource": schema_pkg_apis_events_v1alpha1_K8SResource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResourcePolicy": schema_pkg_apis_events_v1alpha1_K8SResourcePolicy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus": schema_pkg_apis_events_v1alpha1_KafkaBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup": schema_pkg_apis_events_v1alpha1_KafkaConsumerGroup(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaEventSource": schema_pkg_apis_events_v1alpha1_KafkaEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaTrigger": schema_pkg_apis_events_v1alpha1_KafkaTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.LogTrigger": schema_pkg_apis_events_v1alpha1_LogTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.MQTTEventSource": schema_pkg_apis_events_v1alpha1_MQTTEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata": schema_pkg_apis_events_v1alpha1_Metadata(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth": schema_pkg_apis_events_v1alpha1_NATSAuth(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSBus": schema_pkg_apis_events_v1alpha1_NATSBus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig": schema_pkg_apis_events_v1alpha1_NATSConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSEventsSource": schema_pkg_apis_events_v1alpha1_NATSEventsSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSTrigger": schema_pkg_apis_events_v1alpha1_NATSTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NSQEventSource": schema_pkg_apis_events_v1alpha1_NSQEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NativeStrategy": schema_pkg_apis_events_v1alpha1_NativeStrategy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OpenWhiskTrigger": schema_pkg_apis_events_v1alpha1_OpenWhiskTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OwnedRepositories": schema_pkg_apis_events_v1alpha1_OwnedRepositories(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PayloadField": schema_pkg_apis_events_v1alpha1_PayloadField(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy": schema_pkg_apis_events_v1alpha1_PersistenceStrategy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PubSubEventSource": schema_pkg_apis_events_v1alpha1_PubSubEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarEventSource": schema_pkg_apis_events_v1alpha1_PulsarEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarTrigger": schema_pkg_apis_events_v1alpha1_PulsarTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RateLimit": schema_pkg_apis_events_v1alpha1_RateLimit(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisEventSource": schema_pkg_apis_events_v1alpha1_RedisEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisStreamEventSource": schema_pkg_apis_events_v1alpha1_RedisStreamEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceEventSource": schema_pkg_apis_events_v1alpha1_ResourceEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceFilter": schema_pkg_apis_events_v1alpha1_ResourceFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact": schema_pkg_apis_events_v1alpha1_S3Artifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Bucket": schema_pkg_apis_events_v1alpha1_S3Bucket(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Filter": schema_pkg_apis_events_v1alpha1_S3Filter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig": schema_pkg_apis_events_v1alpha1_SASLConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SFTPEventSource": schema_pkg_apis_events_v1alpha1_SFTPEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SNSEventSource": schema_pkg_apis_events_v1alpha1_SNSEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SQSEventSource": schema_pkg_apis_events_v1alpha1_SQSEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SchemaRegistryConfig": schema_pkg_apis_events_v1alpha1_SchemaRegistryConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader": schema_pkg_apis_events_v1alpha1_SecureHeader(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector": schema_pkg_apis_events_v1alpha1_Selector(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Sensor": schema_pkg_apis_events_v1alpha1_Sensor(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorList": schema_pkg_apis_events_v1alpha1_SensorList(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorSpec": schema_pkg_apis_events_v1alpha1_SensorSpec(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorStatus": schema_pkg_apis_events_v1alpha1_SensorStatus(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Service": schema_pkg_apis_events_v1alpha1_Service(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackEventSource": schema_pkg_apis_events_v1alpha1_SlackEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackSender": schema_pkg_apis_events_v1alpha1_SlackSender(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackThread": schema_pkg_apis_events_v1alpha1_SlackThread(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackTrigger": schema_pkg_apis_events_v1alpha1_SlackTrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StandardK8STrigger": schema_pkg_apis_events_v1alpha1_StandardK8STrigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Status": schema_pkg_apis_events_v1alpha1_Status(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StatusPolicy": schema_pkg_apis_events_v1alpha1_StatusPolicy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridEventSource": schema_pkg_apis_events_v1alpha1_StorageGridEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridFilter": schema_pkg_apis_events_v1alpha1_StorageGridFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StripeEventSource": schema_pkg_apis_events_v1alpha1_StripeEventSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig": schema_pkg_apis_events_v1alpha1_TLSConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template": schema_pkg_apis_events_v1alpha1_Template(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TimeFilter": schema_pkg_apis_events_v1alpha1_TimeFilter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger": schema_pkg_apis_events_v1alpha1_Trigger(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter": schema_pkg_apis_events_v1alpha1_TriggerParameter(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameterSource": schema_pkg_apis_events_v1alpha1_TriggerParameterSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerPolicy": schema_pkg_apis_events_v1alpha1_TriggerPolicy(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerTemplate": schema_pkg_apis_events_v1alpha1_TriggerTemplate(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.URLArtifact": schema_pkg_apis_events_v1alpha1_URLArtifact(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ValueFromSource": schema_pkg_apis_events_v1alpha1_ValueFromSource(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig": schema_pkg_apis_events_v1alpha1_WatchPathConfig(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext": schema_pkg_apis_events_v1alpha1_WebhookContext(ref), + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookEventSource": schema_pkg_apis_events_v1alpha1_WebhookEventSource(ref), + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPConsumeConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPConsumeConfig holds the configuration to immediately starts delivering queued messages", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "consumerTag": { + SchemaProps: spec.SchemaProps{ + Description: "ConsumerTag is the identity of the consumer included in every delivery", + Type: []string{"string"}, + Format: "", + }, + }, + "autoAck": { + SchemaProps: spec.SchemaProps{ + Description: "AutoAck when true, the server will acknowledge deliveries to this consumer prior to writing the delivery to the network", + Type: []string{"boolean"}, + Format: "", + }, + }, + "exclusive": { + SchemaProps: spec.SchemaProps{ + Description: "Exclusive when true, the server will ensure that this is the sole consumer from this queue", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noLocal": { + SchemaProps: spec.SchemaProps{ + Description: "NoLocal flag is not supported by RabbitMQ", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait when true, do not wait for the server to confirm the request and immediately begin deliveries", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPEventSource refers to an event-source for AMQP stream events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL for rabbitmq service", + Type: []string{"string"}, + Format: "", + }, + }, + "exchangeName": { + SchemaProps: spec.SchemaProps{ + Description: "ExchangeName is the exchange name For more information, visit https://www.rabbitmq.com/tutorials/amqp-concepts.html", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "exchangeType": { + SchemaProps: spec.SchemaProps{ + Description: "ExchangeType is rabbitmq exchange type", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "routingKey": { + SchemaProps: spec.SchemaProps{ + Description: "Routing key for bindings", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the amqp client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "exchangeDeclare": { + SchemaProps: spec.SchemaProps{ + Description: "ExchangeDeclare holds the configuration for the exchange on the server For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.ExchangeDeclare", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPExchangeDeclareConfig"), + }, + }, + "queueDeclare": { + SchemaProps: spec.SchemaProps{ + Description: "QueueDeclare holds the configuration of a queue to hold messages and deliver to consumers. Declaring creates a queue if it doesn't already exist, or ensures that an existing queue matches the same parameters For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueDeclare", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueDeclareConfig"), + }, + }, + "queueBind": { + SchemaProps: spec.SchemaProps{ + Description: "QueueBind holds the configuration that binds an exchange to a queue so that publishings to the exchange will be routed to the queue when the publishing routing key matches the binding routing key For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueBind", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueBindConfig"), + }, + }, + "consume": { + SchemaProps: spec.SchemaProps{ + Description: "Consume holds the configuration to immediately starts delivering queued messages For more information, visit https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.Consume", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPConsumeConfig"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth hosts secret selectors for username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "urlSecret": { + SchemaProps: spec.SchemaProps{ + Description: "URLSecret is secret reference for rabbitmq service URL", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"exchangeName", "exchangeType", "routingKey"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPConsumeConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPExchangeDeclareConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueBindConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPQueueDeclareConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPExchangeDeclareConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPExchangeDeclareConfig holds the configuration for the exchange on the server", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "durable": { + SchemaProps: spec.SchemaProps{ + Description: "Durable keeps the exchange also after the server restarts", + Type: []string{"boolean"}, + Format: "", + }, + }, + "autoDelete": { + SchemaProps: spec.SchemaProps{ + Description: "AutoDelete removes the exchange when no bindings are active", + Type: []string{"boolean"}, + Format: "", + }, + }, + "internal": { + SchemaProps: spec.SchemaProps{ + Description: "Internal when true does not accept publishings", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait when true does not wait for a confirmation from the server", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPQueueBindConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPQueueBindConfig holds the configuration that binds an exchange to a queue so that publishings to the exchange will be routed to the queue when the publishing routing key matches the binding routing key", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait false and the queue could not be bound, the channel will be closed with an error", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AMQPQueueDeclareConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AMQPQueueDeclareConfig holds the configuration of a queue to hold messages and deliver to consumers. Declaring creates a queue if it doesn't already exist, or ensures that an existing queue matches the same parameters", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the queue. If empty the server auto-generates a unique name for this queue", + Type: []string{"string"}, + Format: "", + }, + }, + "durable": { + SchemaProps: spec.SchemaProps{ + Description: "Durable keeps the queue also after the server restarts", + Type: []string{"boolean"}, + Format: "", + }, + }, + "autoDelete": { + SchemaProps: spec.SchemaProps{ + Description: "AutoDelete removes the queue when no consumers are active", + Type: []string{"boolean"}, + Format: "", + }, + }, + "exclusive": { + SchemaProps: spec.SchemaProps{ + Description: "Exclusive sets the queues to be accessible only by the connection that declares them and will be deleted wgen the connection closes", + Type: []string{"boolean"}, + Format: "", + }, + }, + "noWait": { + SchemaProps: spec.SchemaProps{ + Description: "NowWait when true, the queue assumes to be declared on the server", + Type: []string{"boolean"}, + Format: "", + }, + }, + "arguments": { + SchemaProps: spec.SchemaProps{ + Description: "Arguments of a queue (also known as \"x-arguments\") used for optional features and plugins", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_AWSLambdaTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AWSLambdaTrigger refers to specification of the trigger to invoke an AWS Lambda function", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "functionName": { + SchemaProps: spec.SchemaProps{ + Description: "FunctionName refers to the name of the function to invoke.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "accessKey": { + SchemaProps: spec.SchemaProps{ + Description: "AccessKey refers K8s secret containing aws access key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "SecretKey refers K8s secret containing aws secret key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "Region is AWS region", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "invocationType": { + SchemaProps: spec.SchemaProps{ + Description: "Choose from the following options.\n\n * RequestResponse (default) - Invoke the function synchronously. Keep\n the connection open until the function returns a response or times out.\n The API response includes the function response and additional data.\n\n * Event - Invoke the function asynchronously. Send events that fail multiple\n times to the function's dead-letter queue (if it's configured). The API\n response only includes a status code.\n\n * DryRun - Validate parameter values and verify that the user or role\n has permission to invoke the function.", + Type: []string{"string"}, + Format: "", + }, + }, + "roleARN": { + SchemaProps: spec.SchemaProps{ + Description: "RoleARN is the Amazon Resource Name (ARN) of the role to assume.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"functionName", "region", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Amount(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Amount represent a numeric amount.", + Type: v1alpha1.Amount{}.OpenAPISchemaType(), + Format: v1alpha1.Amount{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ArgoWorkflowTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ArgoWorkflowTrigger is the trigger for the Argo Workflow", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source of the K8s resource file(s)", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation"), + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation refers to the type of operation performed on the argo workflow resource. Default value is Submit.", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters to pass to resolved Argo Workflow object", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "args": { + SchemaProps: spec.SchemaProps{ + Description: "Args is the list of arguments to pass to the argo CLI", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ArtifactLocation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ArtifactLocation describes the source location for an external artifact", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "s3": { + SchemaProps: spec.SchemaProps{ + Description: "S3 compliant artifact", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact"), + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline artifact is embedded in sensor spec as a string", + Type: []string{"string"}, + Format: "", + }, + }, + "file": { + SchemaProps: spec.SchemaProps{ + Description: "File artifact is artifact stored in a file", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileArtifact"), + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to fetch the artifact from", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.URLArtifact"), + }, + }, + "configmap": { + SchemaProps: spec.SchemaProps{ + Description: "Configmap that stores the artifact", + Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), + }, + }, + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git repository hosting the artifact", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitArtifact"), + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "Resource is generic template for K8s resource", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResource"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileArtifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitArtifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.URLArtifact", "k8s.io/api/core/v1.ConfigMapKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureEventHubsTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureEventHubsTrigger refers to specification of the Azure Event Hubs Trigger", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "fqdn": { + SchemaProps: spec.SchemaProps{ + Description: "FQDN refers to the namespace dns of Azure Event Hubs to be used i.e. .servicebus.windows.net", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "hubName": { + SchemaProps: spec.SchemaProps{ + Description: "HubName refers to the Azure Event Hub to send events to", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sharedAccessKeyName": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKeyName refers to the name of the Shared Access Key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sharedAccessKey": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKey refers to a K8s secret containing the primary key for the", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"fqdn", "hubName", "sharedAccessKeyName", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureEventsHubEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureEventsHubEventSource describes the event source for azure events hub More info at https://docs.microsoft.com/en-us/azure/event-hubs/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "fqdn": { + SchemaProps: spec.SchemaProps{ + Description: "FQDN of the EventHubs namespace you created More info at https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sharedAccessKeyName": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKeyName is the name you chose for your application's SAS keys. If both this field and SharedAccessKey are not provided it will try to access via Azure AD with DefaultAzureCredential, FQDN and HubName.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sharedAccessKey": { + SchemaProps: spec.SchemaProps{ + Description: "SharedAccessKey is the generated value of the key. If both this field and SharedAccessKeyName are not provided it will try to access via Azure AD with DefaultAzureCredential, FQDN and HubName.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "hubName": { + SchemaProps: spec.SchemaProps{ + Description: "Event Hub path/name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"fqdn", "hubName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureQueueStorageEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureQueueStorageEventSource describes the event source for azure queue storage more info at https://learn.microsoft.com/en-us/azure/storage/queues/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storageAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "StorageAccountName is the name of the storage account where the queue is. This field is necessary to access via Azure AD (managed identity) and it is ignored if ConnectionString is set.", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionString": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionString is the connection string to access Azure Queue Storage. If this fields is not provided it will try to access via Azure AD with StorageAccountName.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "queueName": { + SchemaProps: spec.SchemaProps{ + Description: "QueueName is the name of the queue", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "dlq": { + SchemaProps: spec.SchemaProps{ + Description: "DLQ specifies if a dead-letter queue is configured for messages that can't be processed successfully. If set to true, messages with invalid payload won't be acknowledged to allow to forward them farther to the dead-letter queue. The default value is false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "decodeMessage": { + SchemaProps: spec.SchemaProps{ + Description: "DecodeMessage specifies if all the messages should be base64 decoded. If set to true the decoding is done before the evaluation of JSONBody", + Type: []string{"boolean"}, + Format: "", + }, + }, + "waitTimeInSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "WaitTimeInSeconds is the duration (in seconds) for which the event source waits between empty results from the queue. The default value is 3 seconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"queueName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureServiceBusEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AzureServiceBusEventSource describes the event source for azure service bus More info at https://docs.microsoft.com/en-us/azure/service-bus-messaging/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "connectionString": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionString is the connection string for the Azure Service Bus. If this fields is not provided it will try to access via Azure AD with DefaultAzureCredential and FullyQualifiedNamespace.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "queueName": { + SchemaProps: spec.SchemaProps{ + Description: "QueueName is the name of the Azure Service Bus Queue", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topicName": { + SchemaProps: spec.SchemaProps{ + Description: "TopicName is the name of the Azure Service Bus Topic", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subscriptionName": { + SchemaProps: spec.SchemaProps{ + Description: "SubscriptionName is the name of the Azure Service Bus Topic Subscription", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the service bus client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "fullyQualifiedNamespace": { + SchemaProps: spec.SchemaProps{ + Description: "FullyQualifiedNamespace is the Service Bus namespace name (ex: myservicebus.servicebus.windows.net). This field is necessary to access via Azure AD (managed identity) and it is ignored if ConnectionString is set.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"queueName", "topicName", "subscriptionName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_AzureServiceBusTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "connectionString": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionString is the connection string for the Azure Service Bus", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "queueName": { + SchemaProps: spec.SchemaProps{ + Description: "QueueName is the name of the Azure Service Bus Queue", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topicName": { + SchemaProps: spec.SchemaProps{ + Description: "TopicName is the name of the Azure Service Bus Topic", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subscriptionName": { + SchemaProps: spec.SchemaProps{ + Description: "SubscriptionName is the name of the Azure Service Bus Topic Subscription", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the service bus client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"queueName", "topicName", "subscriptionName", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Backoff(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Backoff for an operation", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "duration": { + SchemaProps: spec.SchemaProps{ + Description: "The initial duration in nanoseconds or strings like \"1s\", \"3m\"", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Int64OrString"), + }, + }, + "factor": { + SchemaProps: spec.SchemaProps{ + Description: "Duration is multiplied by factor each iteration", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount"), + }, + }, + "jitter": { + SchemaProps: spec.SchemaProps{ + Description: "The amount of jitter applied each iteration", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount"), + }, + }, + "steps": { + SchemaProps: spec.SchemaProps{ + Description: "Exit with error after this many steps", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Amount", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Int64OrString"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BasicAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BasicAuth contains the reference to K8s secrets that holds the username and password", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username refers to the Kubernetes secret that holds the username required for basic auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password refers to the Kubernetes secret that holds the password required for basic auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketAuth holds the different auth strategies for connecting to Bitbucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "basic": { + SchemaProps: spec.SchemaProps{ + Description: "Basic is BasicAuth auth strategy.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketBasicAuth"), + }, + }, + "oauthToken": { + SchemaProps: spec.SchemaProps{ + Description: "OAuthToken refers to the K8s secret that holds the OAuth Bearer token.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketBasicAuth", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketBasicAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketBasicAuth holds the information required to authenticate user via basic auth mechanism", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username refers to the K8s secret that holds the username.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password refers to the K8s secret that holds the password.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"username", "password"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketEventSource describes the event source for Bitbucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the defined Bitbucket hook once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will be passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook refers to the configuration required to run an http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth information required to connect to Bitbucket.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketAuth"), + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events this webhook is subscribed to.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedOwner is the owner of the repository. Deprecated: use Repositories instead. Will be unsupported in v1.9", + Type: []string{"string"}, + Format: "", + }, + }, + "projectKey": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedProjectKey is the key of the project to which the repository relates Deprecated: use Repositories instead. Will be unsupported in v1.9", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedRepositorySlug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL Deprecated: use Repositories instead. Will be unsupported in v1.9", + Type: []string{"string"}, + Format: "", + }, + }, + "repositories": { + SchemaProps: spec.SchemaProps{ + Description: "Repositories holds a list of repositories for which integration needs to set up", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketRepository"), + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"webhook", "auth", "events"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketRepository", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketRepository(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner is the owner of the repository", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "RepositorySlug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"owner", "repositorySlug"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketServerEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BitbucketServerEventSource refers to event-source related to Bitbucket Server events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration to run a http server.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "projectKey": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedProjectKey is the key of project for which integration needs to set up. Deprecated: use Repositories instead. Will be unsupported in v1.8.", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedRepositorySlug is the slug of the repository for which integration needs to set up. Deprecated: use Repositories instead. Will be unsupported in v1.8.", + Type: []string{"string"}, + Format: "", + }, + }, + "projects": { + SchemaProps: spec.SchemaProps{ + Description: "Projects holds a list of projects for which integration needs to set up, this will add the webhook to all repositories in the project.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "repositories": { + SchemaProps: spec.SchemaProps{ + Description: "Repositories holds a list of repositories for which integration needs to set up.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerRepository"), + }, + }, + }, + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events are bitbucket event to listen to. Refer https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "skipBranchRefsChangedOnOpenPR": { + SchemaProps: spec.SchemaProps{ + Description: "SkipBranchRefsChangedOnOpenPR bypasses the event repo:refs_changed for branches whenever there's an associated open pull request. This helps in optimizing the event handling process by avoiding unnecessary triggers for branch reference changes that are already part of a pull request under review.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "oneEventPerChange": { + SchemaProps: spec.SchemaProps{ + Description: "OneEventPerChange controls whether to process each change in a repo:refs_changed webhook event as a separate event. This setting is useful when multiple tags are pushed simultaneously for the same commit, and each tag needs to independently trigger an action, such as a distinct workflow in Argo Workflows. When enabled, the BitbucketServerEventSource publishes an individual BitbucketServerEventData for each change, ensuring independent processing of each tag or reference update in a single webhook event.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "accessToken": { + SchemaProps: spec.SchemaProps{ + Description: "AccessToken is reference to K8s secret which holds the bitbucket api access information.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "webhookSecret": { + SchemaProps: spec.SchemaProps{ + Description: "WebhookSecret is reference to K8s secret which holds the bitbucket webhook secret (for HMAC validation).", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "bitbucketserverBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "BitbucketServerBaseURL is the base URL for API requests to a custom endpoint.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the Bitbucket Server hook for the project once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the bitbucketserver client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "checkInterval": { + SchemaProps: spec.SchemaProps{ + Description: "CheckInterval is a duration in which to wait before checking that the webhooks exist, e.g. 1s, 30m, 2h... (defaults to 1m)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"bitbucketserverBaseURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerRepository", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_BitbucketServerRepository(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "projectKey": { + SchemaProps: spec.SchemaProps{ + Description: "ProjectKey is the key of project for which integration needs to set up.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "repositorySlug": { + SchemaProps: spec.SchemaProps{ + Description: "RepositorySlug is the slug of the repository for which integration needs to set up.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"projectKey", "repositorySlug"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_BusConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BusConfig has the finalized configuration for EventBus", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nats": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig"), + }, + }, + "jetstream": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig"), + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_CalendarEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CalendarEventSource describes a time based dependency. One of the fields (schedule, interval, or recurrence) must be passed. Schedule takes precedence over interval; interval takes precedence over recurrence", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "schedule": { + SchemaProps: spec.SchemaProps{ + Description: "Schedule is a cron-like expression. For reference, see: https://en.wikipedia.org/wiki/Cron", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "interval": { + SchemaProps: spec.SchemaProps{ + Description: "Interval is a string that describes an interval duration, e.g. 1s, 30m, 2h...", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "exclusionDates": { + SchemaProps: spec.SchemaProps{ + Description: "ExclusionDates defines the list of DATE-TIME exceptions for recurring events.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "timezone": { + SchemaProps: spec.SchemaProps{ + Description: "Timezone in which to run the schedule", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "persistence": { + SchemaProps: spec.SchemaProps{ + Description: "Persistence hold the configuration for event persistence", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventPersistence"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventPersistence", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_CatchupConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Description: "Enabled enables to triggered the missed schedule when eventsource restarts", + Type: []string{"boolean"}, + Format: "", + }, + }, + "maxDuration": { + SchemaProps: spec.SchemaProps{ + Description: "MaxDuration holds max catchup duration", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Condition contains details about resource state", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Condition type.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Condition status, True, False or Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "Last time the condition transitioned from one status to another.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. For example, \"ImageNotFound\"", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "Human-readable message indicating details about last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ConditionsResetByTime(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "cron": { + SchemaProps: spec.SchemaProps{ + Description: "Cron is a cron-like expression. For reference, see: https://en.wikipedia.org/wiki/Cron", + Type: []string{"string"}, + Format: "", + }, + }, + "timezone": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ConditionsResetCriteria(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "byTime": { + SchemaProps: spec.SchemaProps{ + Description: "Schedule is a cron-like expression. For reference, see: https://en.wikipedia.org/wiki/Cron", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetByTime"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ConfigMapPersistence(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the configmap", + Type: []string{"string"}, + Format: "", + }, + }, + "createIfNotExist": { + SchemaProps: spec.SchemaProps{ + Description: "CreateIfNotExist will create configmap if it doesn't exists", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ContainerTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerTemplate defines customized spec for a container", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resources": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "imagePullPolicy": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecurityContext"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_CustomTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomTrigger refers to the specification of the custom trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "serverURL": { + SchemaProps: spec.SchemaProps{ + Description: "ServerURL is the url of the gRPC server that executes custom trigger", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "secure": { + SchemaProps: spec.SchemaProps{ + Description: "Secure refers to type of the connection between sensor to custom trigger gRPC", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "certSecret": { + SchemaProps: spec.SchemaProps{ + Description: "CertSecret refers to the secret that contains cert for secure connection between sensor and custom trigger gRPC server.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "serverNameOverride": { + SchemaProps: spec.SchemaProps{ + Description: "ServerNameOverride for the secure connection between sensor and custom trigger gRPC server.", + Type: []string{"string"}, + Format: "", + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "Spec is the custom trigger resource specification that custom trigger gRPC server knows how to interpret.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved custom trigger trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"serverURL", "secure", "spec", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_DataFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DataFilter describes constraints and filters for event data Regular Expressions are purposefully not a feature as they are overkill for our uses here See Rob Pike's Post: https://commandcenter.blogspot.com/2011/08/regular-expressions-in-lexing-and.html", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is the JSONPath of the event's (JSON decoded) data key Path is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type contains the JSON type of the data", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value is the allowed string values for this key Booleans are passed using strconv.ParseBool() Numbers are parsed using as float64 using strconv.ParseFloat() Strings are taken as is Nils this value is ignored", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "comparator": { + SchemaProps: spec.SchemaProps{ + Description: "Comparator compares the event data with a user given value. Can be \">=\", \">\", \"=\", \"!=\", \"<\", or \"<=\". Is optional, and if left blank treated as equality \"=\".", + Type: []string{"string"}, + Format: "", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is a go-template for extracting a string from the event's data. A Template is evaluated with provided path, type and value. The templating follows the standard go-template syntax as well as sprig's extra functions. See https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"path", "type", "value"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_EmailTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EmailTrigger refers to the specification of the email notification trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username refers to the username used to connect to the smtp server.", + Type: []string{"string"}, + Format: "", + }, + }, + "smtpPassword": { + SchemaProps: spec.SchemaProps{ + Description: "SMTPPassword refers to the Kubernetes secret that holds the smtp password used to connect to smtp server.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "host": { + SchemaProps: spec.SchemaProps{ + Description: "Host refers to the smtp host url to which email is send.", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port refers to the smtp server port to which email is send. Defaults to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "to": { + SchemaProps: spec.SchemaProps{ + Description: "To refers to the email addresses to which the emails are send.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "from": { + SchemaProps: spec.SchemaProps{ + Description: "From refers to the address from which the email is send from.", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Subject refers to the subject line for the email send.", + Type: []string{"string"}, + Format: "", + }, + }, + "body": { + SchemaProps: spec.SchemaProps{ + Description: "Body refers to the body/content of the email send.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EmitterEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EmitterEventSource describes the event source for emitter More info at https://emitter.io/develop/getting-started/", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "broker": { + SchemaProps: spec.SchemaProps{ + Description: "Broker URI to connect to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "channelKey": { + SchemaProps: spec.SchemaProps{ + Description: "ChannelKey refers to the channel key", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "channelName": { + SchemaProps: spec.SchemaProps{ + Description: "ChannelName refers to the channel name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username to use to connect to broker", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password to use to connect to broker", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the emitter client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"broker", "channelKey", "channelName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Event represents the cloudevent received from an event source.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "context": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext"), + }, + }, + "data": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "byte", + }, + }, + }, + Required: []string{"data"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBus is the definition of a eventbus resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusStatus"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusSpec", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBusStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBusList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBusList is the list of eventbus resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBus"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventBus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBusSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBusSpec refers to specification of eventbus resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nats": { + SchemaProps: spec.SchemaProps{ + Description: "NATS eventbus", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSBus"), + }, + }, + "jetstream": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamBus"), + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka eventbus", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus"), + }, + }, + "jetstreamExotic": { + SchemaProps: spec.SchemaProps{ + Description: "Exotic JetStream", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamBus", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.JetStreamConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaBus", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSBus"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventBusStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventBusStatus holds the status of the eventbus resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Config holds the fininalized configuration of EventBus", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BusConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BusConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventContext(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventContext holds the context of the cloudevent received from an event source.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Description: "ID of the event; must be non-empty and unique within the scope of the producer.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source - A URI describing the event producer.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "specversion": { + SchemaProps: spec.SchemaProps{ + Description: "SpecVersion - The version of the CloudEvents specification used by the event.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type - The type of the occurrence which has happened.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "datacontenttype": { + SchemaProps: spec.SchemaProps{ + Description: "DataContentType - A MIME (RFC2046) string describing the media type of `data`.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Subject - The subject of the event in the context of the event producer", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "time": { + SchemaProps: spec.SchemaProps{ + Description: "Time - A Timestamp when the event happened.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"id", "source", "specversion", "type", "datacontenttype", "subject", "time"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventDependency(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventDependency describes a dependency", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is a unique name of this dependency", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "eventSourceName": { + SchemaProps: spec.SchemaProps{ + Description: "EventSourceName is the name of EventSource that Sensor depends on", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "eventName": { + SchemaProps: spec.SchemaProps{ + Description: "EventName is the name of the event", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "filters": { + SchemaProps: spec.SchemaProps{ + Description: "Filters and rules governing toleration of success and constraints on the context and data of an event", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyFilter"), + }, + }, + "transform": { + SchemaProps: spec.SchemaProps{ + Description: "Transform transforms the event data", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyTransformer"), + }, + }, + "filtersLogicalOperator": { + SchemaProps: spec.SchemaProps{ + Description: "FiltersLogicalOperator defines how different filters are evaluated together. Available values: and (&&), or (||) Is optional and if left blank treated as and (&&).", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "eventSourceName", "eventName"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependencyTransformer"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventDependencyFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventDependencyFilter defines filters and constraints for a event.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "time": { + SchemaProps: spec.SchemaProps{ + Description: "Time filter on the event with escalation", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TimeFilter"), + }, + }, + "context": { + SchemaProps: spec.SchemaProps{ + Description: "Context filter constraints", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext"), + }, + }, + "data": { + SchemaProps: spec.SchemaProps{ + Description: "Data filter constraints with escalation", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter"), + }, + }, + }, + }, + }, + "exprs": { + SchemaProps: spec.SchemaProps{ + Description: "Exprs contains the list of expressions evaluated against the event payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ExprFilter"), + }, + }, + }, + }, + }, + "dataLogicalOperator": { + SchemaProps: spec.SchemaProps{ + Description: "DataLogicalOperator defines how multiple Data filters (if defined) are evaluated together. Available values: and (&&), or (||) Is optional and if left blank treated as and (&&).", + Type: []string{"string"}, + Format: "", + }, + }, + "exprLogicalOperator": { + SchemaProps: spec.SchemaProps{ + Description: "ExprLogicalOperator defines how multiple Exprs filters (if defined) are evaluated together. Available values: and (&&), or (||) Is optional and if left blank treated as and (&&).", + Type: []string{"string"}, + Format: "", + }, + }, + "script": { + SchemaProps: spec.SchemaProps{ + Description: "Script refers to a Lua script evaluated to determine the validity of an event.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.DataFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventContext", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ExprFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TimeFilter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventDependencyTransformer(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventDependencyTransformer transforms the event", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "jq": { + SchemaProps: spec.SchemaProps{ + Description: "JQ holds the jq command applied for transformation", + Type: []string{"string"}, + Format: "", + }, + }, + "script": { + SchemaProps: spec.SchemaProps{ + Description: "Script refers to a Lua script used to transform the event", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_EventPersistence(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "catchup": { + SchemaProps: spec.SchemaProps{ + Description: "Catchup enables to triggered the missed schedule when eventsource restarts", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CatchupConfiguration"), + }, + }, + "configMap": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigMap holds configmap details for persistence", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CatchupConfiguration", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConfigMapPersistence"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSource is the definition of a eventsource resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceStatus"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceSpec", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "expression": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSourceList is the list of eventsource resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSource"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSource", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSourceSpec refers to specification of event-source resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "eventBusName": { + SchemaProps: spec.SchemaProps{ + Description: "EventBusName references to a EventBus name. By default the value is \"default\"", + Type: []string{"string"}, + Format: "", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the pod specification for the event source", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template"), + }, + }, + "service": { + SchemaProps: spec.SchemaProps{ + Description: "Service is the specifications of the service to expose the event source", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Service"), + }, + }, + "minio": { + SchemaProps: spec.SchemaProps{ + Description: "Minio event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact"), + }, + }, + }, + }, + }, + "calendar": { + SchemaProps: spec.SchemaProps{ + Description: "Calendar event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CalendarEventSource"), + }, + }, + }, + }, + }, + "file": { + SchemaProps: spec.SchemaProps{ + Description: "File event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileEventSource"), + }, + }, + }, + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "Resource event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceEventSource"), + }, + }, + }, + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookEventSource"), + }, + }, + }, + }, + }, + "amqp": { + SchemaProps: spec.SchemaProps{ + Description: "AMQP event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPEventSource"), + }, + }, + }, + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaEventSource"), + }, + }, + }, + }, + }, + "mqtt": { + SchemaProps: spec.SchemaProps{ + Description: "MQTT event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.MQTTEventSource"), + }, + }, + }, + }, + }, + "nats": { + SchemaProps: spec.SchemaProps{ + Description: "NATS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSEventsSource"), + }, + }, + }, + }, + }, + "sns": { + SchemaProps: spec.SchemaProps{ + Description: "SNS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SNSEventSource"), + }, + }, + }, + }, + }, + "sqs": { + SchemaProps: spec.SchemaProps{ + Description: "SQS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SQSEventSource"), + }, + }, + }, + }, + }, + "pubSub": { + SchemaProps: spec.SchemaProps{ + Description: "PubSub event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PubSubEventSource"), + }, + }, + }, + }, + }, + "github": { + SchemaProps: spec.SchemaProps{ + Description: "Github event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubEventSource"), + }, + }, + }, + }, + }, + "gitlab": { + SchemaProps: spec.SchemaProps{ + Description: "Gitlab event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitlabEventSource"), + }, + }, + }, + }, + }, + "hdfs": { + SchemaProps: spec.SchemaProps{ + Description: "HDFS event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HDFSEventSource"), + }, + }, + }, + }, + }, + "slack": { + SchemaProps: spec.SchemaProps{ + Description: "Slack event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackEventSource"), + }, + }, + }, + }, + }, + "storageGrid": { + SchemaProps: spec.SchemaProps{ + Description: "StorageGrid event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridEventSource"), + }, + }, + }, + }, + }, + "azureEventsHub": { + SchemaProps: spec.SchemaProps{ + Description: "AzureEventsHub event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventsHubEventSource"), + }, + }, + }, + }, + }, + "stripe": { + SchemaProps: spec.SchemaProps{ + Description: "Stripe event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StripeEventSource"), + }, + }, + }, + }, + }, + "emitter": { + SchemaProps: spec.SchemaProps{ + Description: "Emitter event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmitterEventSource"), + }, + }, + }, + }, + }, + "redis": { + SchemaProps: spec.SchemaProps{ + Description: "Redis event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisEventSource"), + }, + }, + }, + }, + }, + "nsq": { + SchemaProps: spec.SchemaProps{ + Description: "NSQ event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NSQEventSource"), + }, + }, + }, + }, + }, + "pulsar": { + SchemaProps: spec.SchemaProps{ + Description: "Pulsar event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarEventSource"), + }, + }, + }, + }, + }, + "generic": { + SchemaProps: spec.SchemaProps{ + Description: "Generic event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GenericEventSource"), + }, + }, + }, + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the event source deployment replicas", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "bitbucketserver": { + SchemaProps: spec.SchemaProps{ + Description: "Bitbucket Server event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerEventSource"), + }, + }, + }, + }, + }, + "bitbucket": { + SchemaProps: spec.SchemaProps{ + Description: "Bitbucket event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketEventSource"), + }, + }, + }, + }, + }, + "redisStream": { + SchemaProps: spec.SchemaProps{ + Description: "Redis stream source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisStreamEventSource"), + }, + }, + }, + }, + }, + "azureServiceBus": { + SchemaProps: spec.SchemaProps{ + Description: "Azure Service Bus event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusEventSource"), + }, + }, + }, + }, + }, + "azureQueueStorage": { + SchemaProps: spec.SchemaProps{ + Description: "AzureQueueStorage event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureQueueStorageEventSource"), + }, + }, + }, + }, + }, + "sftp": { + SchemaProps: spec.SchemaProps{ + Description: "SFTP event sources", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SFTPEventSource"), + }, + }, + }, + }, + }, + "gerrit": { + SchemaProps: spec.SchemaProps{ + Description: "Gerrit event source", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GerritEventSource"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AMQPEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventsHubEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureQueueStorageEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BitbucketServerEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CalendarEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmitterEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.FileEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GenericEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GerritEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitlabEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HDFSEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.MQTTEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSEventsSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NSQEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PubSubEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RedisStreamEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Artifact", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SFTPEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SNSEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SQSEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Service", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StripeEventSource", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookEventSource"}, + } +} + +func schema_pkg_apis_events_v1alpha1_EventSourceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSourceStatus holds the status of the event-source resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ExprFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "expr": { + SchemaProps: spec.SchemaProps{ + Description: "Expr refers to the expression that determines the outcome of the filter.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "fields": { + SchemaProps: spec.SchemaProps{ + Description: "Fields refers to set of keys that refer to the paths within event payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PayloadField"), + }, + }, + }, + }, + }, + }, + Required: []string{"expr", "fields"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PayloadField"}, + } +} + +func schema_pkg_apis_events_v1alpha1_FileArtifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FileArtifact contains information about an artifact in a filesystem", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_FileEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FileEventSource describes an event-source for file related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "eventType": { + SchemaProps: spec.SchemaProps{ + Description: "Type of file operations to watch Refer https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more information", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "watchPathConfig": { + SchemaProps: spec.SchemaProps{ + Description: "WatchPathConfig contains configuration about the file path to watch", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig"), + }, + }, + "polling": { + SchemaProps: spec.SchemaProps{ + Description: "Use polling instead of inotify", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"eventType", "watchPathConfig"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GenericEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GenericEventSource refers to a generic event source. It can be used to implement a custom event source.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL of the gRPC server that implements the event source.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Config is the event source configuration", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "insecure": { + SchemaProps: spec.SchemaProps{ + Description: "Insecure determines the type of connection.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authSecret": { + SchemaProps: spec.SchemaProps{ + Description: "AuthSecret holds a secret selector that contains a bearer token for authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"url", "config"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GerritEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GerritEventSource refers to event-source related to gerrit events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration to run a http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "hookName": { + SchemaProps: spec.SchemaProps{ + Description: "HookName is the name of the webhook", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events are gerrit event to listen to. Refer https://gerrit-review.googlesource.com/Documentation/cmd-stream-events.html#events", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth hosts secret selectors for username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "gerritBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "GerritBaseURL is the base URL for API requests to a custom endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the Gerrit hook for the project once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "projects": { + SchemaProps: spec.SchemaProps{ + Description: "List of project namespace paths like \"whynowy/test\".", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "sslVerify": { + SchemaProps: spec.SchemaProps{ + Description: "SslVerify to enable ssl verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"hookName", "events", "gerritBaseURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitArtifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitArtifact contains information about an artifact stored in git", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Git URL", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "cloneDirectory": { + SchemaProps: spec.SchemaProps{ + Description: "Directory to clone the repository. We clone complete directory because GitArtifact is not limited to any specific Git service providers. Hence we don't use any specific git provider client.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "creds": { + SchemaProps: spec.SchemaProps{ + Description: "Creds contain reference to git username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitCreds"), + }, + }, + "sshKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "SSHKeySecret refers to the secret that contains SSH key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filePath": { + SchemaProps: spec.SchemaProps{ + Description: "Path to file that contains trigger resource definition", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "branch": { + SchemaProps: spec.SchemaProps{ + Description: "Branch to use to pull trigger resource", + Type: []string{"string"}, + Format: "", + }, + }, + "tag": { + SchemaProps: spec.SchemaProps{ + Description: "Tag to use to pull trigger resource", + Type: []string{"string"}, + Format: "", + }, + }, + "ref": { + SchemaProps: spec.SchemaProps{ + Description: "Ref to use to pull trigger resource. Will result in a shallow clone and fetch.", + Type: []string{"string"}, + Format: "", + }, + }, + "remote": { + SchemaProps: spec.SchemaProps{ + Description: "Remote to manage set of tracked repositories. Defaults to \"origin\". Refer https://git-scm.com/docs/git-remote", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitRemoteConfig"), + }, + }, + "insecureIgnoreHostKey": { + SchemaProps: spec.SchemaProps{ + Description: "Whether to ignore host key", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"url", "cloneDirectory", "filePath"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitCreds", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GitRemoteConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitCreds(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitCreds contain reference to git username and password", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitRemoteConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitRemoteConfig contains the configuration of a Git remote", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the remote to fetch from.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "urls": { + SchemaProps: spec.SchemaProps{ + Description: "URLs the URLs of a remote repository. It must be non-empty. Fetch will always use the first URL, while push will use all of them.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"name", "urls"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_GithubAppCreds(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "privateKey": { + SchemaProps: spec.SchemaProps{ + Description: "PrivateKey refers to a K8s secret containing the GitHub app private key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "appID": { + SchemaProps: spec.SchemaProps{ + Description: "AppID refers to the GitHub App ID for the application you created", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "installationID": { + SchemaProps: spec.SchemaProps{ + Description: "InstallationID refers to the Installation ID of the GitHub app you created and installed", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"privateKey", "appID", "installationID"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GithubEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GithubEventSource refers to event-source for github related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Description: "Id is the webhook's id Deprecated: This is not used at all, will be removed in v1.6", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook refers to the configuration required to run a http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedOwner refers to GitHub owner name i.e. argoproj Deprecated: use Repositories instead. Will be unsupported in v 1.6", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "repository": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedRepository refers to GitHub repo name i.e. argo-events Deprecated: use Repositories instead. Will be unsupported in v 1.6", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events refer to Github events to which the event source will subscribe", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "apiToken": { + SchemaProps: spec.SchemaProps{ + Description: "APIToken refers to a K8s secret containing github api token", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "webhookSecret": { + SchemaProps: spec.SchemaProps{ + Description: "WebhookSecret refers to K8s secret containing GitHub webhook secret https://developer.github.com/webhooks/securing/", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "insecure": { + SchemaProps: spec.SchemaProps{ + Description: "Insecure tls verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "active": { + SchemaProps: spec.SchemaProps{ + Description: "Active refers to status of the webhook for event deliveries. https://developer.github.com/webhooks/creating/#active", + Type: []string{"boolean"}, + Format: "", + }, + }, + "contentType": { + SchemaProps: spec.SchemaProps{ + Description: "ContentType of the event delivery", + Type: []string{"string"}, + Format: "", + }, + }, + "githubBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "GitHub base URL (for GitHub Enterprise)", + Type: []string{"string"}, + Format: "", + }, + }, + "githubUploadURL": { + SchemaProps: spec.SchemaProps{ + Description: "GitHub upload URL (for GitHub Enterprise)", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the GitHub hook for the repository once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "repositories": { + SchemaProps: spec.SchemaProps{ + Description: "Repositories holds the information of repositories, which uses repo owner as the key, and list of repo names as the value. Not required if Organizations is set.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OwnedRepositories"), + }, + }, + }, + }, + }, + "organizations": { + SchemaProps: spec.SchemaProps{ + Description: "Organizations holds the names of organizations (used for organization level webhooks). Not required if Repositories is set.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "githubApp": { + SchemaProps: spec.SchemaProps{ + Description: "GitHubApp holds the GitHub app credentials", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubAppCreds"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"events"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.GithubAppCreds", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OwnedRepositories", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_GitlabEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GitlabEventSource refers to event-source related to Gitlab events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration to run a http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "projectID": { + SchemaProps: spec.SchemaProps{ + Description: "DeprecatedProjectID is the id of project for which integration needs to setup Deprecated: use Projects instead. Will be unsupported in v 1.7", + Type: []string{"string"}, + Format: "", + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Description: "Events are gitlab event to listen to. Refer https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "accessToken": { + SchemaProps: spec.SchemaProps{ + Description: "AccessToken references to k8 secret which holds the gitlab api access information", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "enableSSLVerification": { + SchemaProps: spec.SchemaProps{ + Description: "EnableSSLVerification to enable ssl verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "gitlabBaseURL": { + SchemaProps: spec.SchemaProps{ + Description: "GitlabBaseURL is the base URL for API requests to a custom endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "deleteHookOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteHookOnFinish determines whether to delete the GitLab hook for the project once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "projects": { + SchemaProps: spec.SchemaProps{ + Description: "List of project IDs or project namespace paths like \"whynowy/test\". If neither a project nor a group is defined, the EventSource will not manage webhooks.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "secretToken": { + SchemaProps: spec.SchemaProps{ + Description: "SecretToken references to k8 secret which holds the Secret Token used by webhook config", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "groups": { + SchemaProps: spec.SchemaProps{ + Description: "List of group IDs or group name like \"test\". Group level hook available in Premium and Ultimate Gitlab.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"events", "gitlabBaseURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_HDFSEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HDFSEventSource refers to event-source for HDFS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "directory": { + SchemaProps: spec.SchemaProps{ + Description: "Directory to watch for events", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + "pathRegexp": { + SchemaProps: spec.SchemaProps{ + Description: "PathRegexp is regexp of relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of file operations to watch", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "checkInterval": { + SchemaProps: spec.SchemaProps{ + Description: "CheckInterval is a string that describes an interval duration to check the directory state, e.g. 1s, 30m, 2h... (defaults to 1m)", + Type: []string{"string"}, + Format: "", + }, + }, + "addresses": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "hdfsUser": { + SchemaProps: spec.SchemaProps{ + Description: "HDFSUser is the user to access HDFS file system. It is ignored if either ccache or keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "krbCCacheSecret": { + SchemaProps: spec.SchemaProps{ + Description: "KrbCCacheSecret is the secret selector for Kerberos ccache Either ccache or keytab can be set to use Kerberos.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "krbKeytabSecret": { + SchemaProps: spec.SchemaProps{ + Description: "KrbKeytabSecret is the secret selector for Kerberos keytab Either ccache or keytab can be set to use Kerberos.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "krbUsername": { + SchemaProps: spec.SchemaProps{ + Description: "KrbUsername is the Kerberos username used with Kerberos keytab It must be set if keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "krbRealm": { + SchemaProps: spec.SchemaProps{ + Description: "KrbRealm is the Kerberos realm used with Kerberos keytab It must be set if keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "krbConfigConfigMap": { + SchemaProps: spec.SchemaProps{ + Description: "KrbConfig is the configmap selector for Kerberos config as string It must be set if either ccache or keytab is used.", + Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), + }, + }, + "krbServicePrincipalName": { + SchemaProps: spec.SchemaProps{ + Description: "KrbServicePrincipalName is the principal name of Kerberos service It must be set if either ccache or keytab is used.", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"directory", "type", "addresses"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_HTTPTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HTTPTrigger is the trigger for the HTTP request", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL refers to the URL to send HTTP request to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the HTTP client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "method": { + SchemaProps: spec.SchemaProps{ + Description: "Method refers to the type of the HTTP request. Refer https://golang.org/src/net/http/method.go for more info. Default value is POST.", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the HTTP trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "timeout": { + SchemaProps: spec.SchemaProps{ + Description: "Timeout refers to the HTTP request timeout in seconds. Default value is 60 seconds.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "basicAuth": { + SchemaProps: spec.SchemaProps{ + Description: "BasicAuth configuration for the http request.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "headers": { + SchemaProps: spec.SchemaProps{ + Description: "Headers for the HTTP request.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "secureHeaders": { + SchemaProps: spec.SchemaProps{ + Description: "Secure Headers stored in Kubernetes Secrets for the HTTP requests.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader"), + }, + }, + }, + }, + }, + }, + Required: []string{"url", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Int64OrString(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: v1alpha1.Int64OrString{}.OpenAPISchemaType(), + Format: v1alpha1.Int64OrString{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_JetStreamBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JetStreamBus holds the JetStream EventBus information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream version, such as \"2.7.3\"", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream StatefulSet size", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "containerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ContainerTemplate contains customized spec for Nats JetStream container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "reloaderContainerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ReloaderContainerTemplate contains customized spec for config reloader container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "metricsContainerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "MetricsContainerTemplate contains customized spec for metrics container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "persistence": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, indicates the Redis pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "The priority value. Various system components use this field to find the priority of the Redis pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "The pod's scheduling constraints More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName to apply to the StatefulSet", + Type: []string{"string"}, + Format: "", + }, + }, + "settings": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream configuration, if not specified, global settings in controller-config will be used. See https://docs.nats.io/running-a-nats-service/configuration#jetstream. Only configure \"max_memory_store\" or \"max_file_store\", do not set \"store_dir\" as it has been hardcoded.", + Type: []string{"string"}, + Format: "", + }, + }, + "startArgs": { + SchemaProps: spec.SchemaProps{ + Description: "Optional arguments to start nats-server. For example, \"-D\" to enable debugging output, \"-DV\" to enable debugging and tracing. Check https://docs.nats.io/ for all the available arguments.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "streamConfig": { + SchemaProps: spec.SchemaProps{ + Description: "Optional configuration for the streams to be created in this JetStream service, if specified, it will be merged with the default configuration in controller-config. It accepts a YAML format configuration, available fields include, \"maxBytes\", \"maxMsgs\", \"maxAge\" (e.g. 72h), \"replicas\" (1, 3, 5), \"duplicates\" (e.g. 5m), \"retention\" (e.g.\u00a00: Limits (default), 1: Interest, 2: WorkQueue), \"Discard\" (e.g.\u00a00: DiscardOld (default), 1: DiscardNew).", + Type: []string{"string"}, + Format: "", + }, + }, + "maxPayload": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of bytes in a message payload, 0 means unlimited. Defaults to 1MB", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + } +} + +func schema_pkg_apis_events_v1alpha1_JetStreamConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "JetStream (Nats) URL", + Type: []string{"string"}, + Format: "", + }, + }, + "accessSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Secret for auth", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "streamConfig": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "SSL/TLS settings for the NATS client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_K8SResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "K8SResource represent arbitrary structured data.", + Type: v1alpha1.K8SResource{}.OpenAPISchemaType(), + Format: v1alpha1.K8SResource{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_K8SResourcePolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "K8SResourcePolicy refers to the policy used to check the state of K8s based triggers using labels", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "Labels required to identify whether a resource is in success state", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "backoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff before checking resource state", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "errorOnBackoffTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "ErrorOnBackoffTimeout determines whether sensor should transition to error state if the trigger policy is unable to determine the state of the resource", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"backoff", "errorOnBackoffTimeout"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"}, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KafkaBus holds the KafkaBus EventBus information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to kafka cluster, multiple URLs separated by comma", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic name, defaults to {namespace_name}-{eventbus_name}", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka version, sarama defaults to the oldest supported stable version", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the kafka client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "sasl": { + SchemaProps: spec.SchemaProps{ + Description: "SASL configuration for the kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig"), + }, + }, + "consumerGroup": { + SchemaProps: spec.SchemaProps{ + Description: "Consumer group for kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaConsumerGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "groupName": { + SchemaProps: spec.SchemaProps{ + Description: "The name for the consumer group to use", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "oldest": { + SchemaProps: spec.SchemaProps{ + Description: "When starting up a new group do we want to start from the oldest event (true) or the newest event (false), defaults to false", + Type: []string{"boolean"}, + Format: "", + }, + }, + "rebalanceStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "Rebalance strategy can be one of: sticky, roundrobin, range. Range is the default.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"groupName"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KafkaEventSource refers to event-source for Kafka related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to kafka cluster, multiple URLs separated by comma", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "partition": { + SchemaProps: spec.SchemaProps{ + Description: "Partition name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the kafka client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "consumerGroup": { + SchemaProps: spec.SchemaProps{ + Description: "Consumer group for kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup"), + }, + }, + "limitEventsPerSecond": { + SchemaProps: spec.SchemaProps{ + Description: "Sets a limit on how many events get read from kafka per second.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Specify what kafka version is being connected to enables certain features in sarama, defaults to 1.0.0", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sasl": { + SchemaProps: spec.SchemaProps{ + Description: "SASL configuration for the kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Yaml format Sarama config for Kafka connection. It follows the struct of sarama.Config. See https://github.com/IBM/sarama/blob/main/config.go e.g.\n\nconsumer:\n fetch:\n min: 1\nnet:\n MaxOpenRequests: 5", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"url", "topic"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaConsumerGroup", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_KafkaTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "KafkaTrigger refers to the specification of the Kafka trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL of the Kafka broker, multiple URLs separated by comma.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the topic. More info at https://kafka.apache.org/documentation/#intro_topics", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "partition": { + SchemaProps: spec.SchemaProps{ + Description: "DEPRECATED", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved Kafka trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "requiredAcks": { + SchemaProps: spec.SchemaProps{ + Description: "RequiredAcks used in producer to tell the broker how many replica acknowledgements Defaults to 1 (Only wait for the leader to ack).", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "compress": { + SchemaProps: spec.SchemaProps{ + Description: "Compress determines whether to compress message or not. Defaults to false. If set to true, compresses message using snappy compression.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "flushFrequency": { + SchemaProps: spec.SchemaProps{ + Description: "FlushFrequency refers to the frequency in milliseconds to flush batches. Defaults to 500 milliseconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the Kafka producer.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "partitioningKey": { + SchemaProps: spec.SchemaProps{ + Description: "The partitioning key for the messages put on the Kafka topic.", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Specify what kafka version is being connected to enables certain features in sarama, defaults to 1.0.0", + Type: []string{"string"}, + Format: "", + }, + }, + "sasl": { + SchemaProps: spec.SchemaProps{ + Description: "SASL configuration for the kafka client", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig"), + }, + }, + "schemaRegistry": { + SchemaProps: spec.SchemaProps{ + Description: "Schema Registry configuration to producer message with avro format", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SchemaRegistryConfig"), + }, + }, + "headers": { + SchemaProps: spec.SchemaProps{ + Description: "Headers for the Kafka Messages.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "secureHeaders": { + SchemaProps: spec.SchemaProps{ + Description: "Secure Headers stored in Kubernetes Secrets for the Kafka messages.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader"), + }, + }, + }, + }, + }, + }, + Required: []string{"url", "topic", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SASLConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SchemaRegistryConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SecureHeader", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_LogTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "intervalSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "Only print messages every interval. Useful to prevent logging too much data for busy events.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_MQTTEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MQTTEventSource refers to event-source for MQTT related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to connect to broker", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "clientId": { + SchemaProps: spec.SchemaProps{ + Description: "ClientID is the id of the client", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionBackoff holds backoff applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the mqtt client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth hosts secret selectors for username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + }, + Required: []string{"url", "topic", "clientId"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Metadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the annotations and labels of an event source pod", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "annotations": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "labels": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSAuth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSAuth refers to the auth info for NATS EventSource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "basic": { + SchemaProps: spec.SchemaProps{ + Description: "Baisc auth with username and password", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + "token": { + SchemaProps: spec.SchemaProps{ + Description: "Token used to connect", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "nkey": { + SchemaProps: spec.SchemaProps{ + Description: "NKey used to connect", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "credential": { + SchemaProps: spec.SchemaProps{ + Description: "credential used to connect", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSBus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSBus holds the NATS eventbus information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "native": { + SchemaProps: spec.SchemaProps{ + Description: "Native means to bring up a native NATS service", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NativeStrategy"), + }, + }, + "exotic": { + SchemaProps: spec.SchemaProps{ + Description: "Exotic holds an exotic NATS config", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NativeStrategy"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSConfig holds the config of NATS", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "NATS streaming url", + Type: []string{"string"}, + Format: "", + }, + }, + "clusterID": { + SchemaProps: spec.SchemaProps{ + Description: "Cluster ID for nats streaming", + Type: []string{"string"}, + Format: "", + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth strategy, default to AuthStrategyNone", + Type: []string{"string"}, + Format: "", + }, + }, + "accessSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Secret for auth", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSEventsSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSEventsSource refers to event-source for NATS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL to connect to NATS cluster", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Subject holds the name of the subject onto which messages are published", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "ConnectionBackoff holds backoff applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the nats client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "Auth information", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "queue": { + SchemaProps: spec.SchemaProps{ + Description: "Queue is the name of the queue group to subscribe as if specified. Uses QueueSubscribe logic to subscribe as queue group. If the queue is empty, uses default Subscribe logic.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"url", "subject"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NATSTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NATSTrigger refers to the specification of the NATS trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL of the NATS cluster.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subject": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the subject to put message on.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the NATS producer.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "AuthInformation", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth"), + }, + }, + }, + Required: []string{"url", "subject", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSAuth", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NSQEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NSQEventSource describes the event source for NSQ PubSub More info at https://godoc.org/github.com/nsqio/go-nsq", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostAddress": { + SchemaProps: spec.SchemaProps{ + Description: "HostAddress is the address of the host for NSQ lookup", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic to subscribe to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "channel": { + SchemaProps: spec.SchemaProps{ + Description: "Channel used for subscription", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the nsq client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"hostAddress", "topic", "channel"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"}, + } +} + +func schema_pkg_apis_events_v1alpha1_NativeStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NativeStrategy indicates to install a native NATS service", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Size is the NATS StatefulSet size", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "persistence": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy"), + }, + }, + "containerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ContainerTemplate contains customized spec for NATS container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "metricsContainerTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "MetricsContainerTemplate contains customized spec for metrics container", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate"), + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "maxAge": { + SchemaProps: spec.SchemaProps{ + Description: "Max Age of existing messages, i.e. \"72h\", “4h35m”", + Type: []string{"string"}, + Format: "", + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName to apply to NATS StatefulSet", + Type: []string{"string"}, + Format: "", + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, indicates the EventSource pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "The priority value. Various system components use this field to find the priority of the EventSource pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "The pod's scheduling constraints More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + "maxMsgs": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of messages per channel, 0 means unlimited. Defaults to 1000000", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "maxBytes": { + SchemaProps: spec.SchemaProps{ + Description: "Total size of messages per channel, 0 means unlimited. Defaults to 1GB", + Type: []string{"string"}, + Format: "", + }, + }, + "maxSubs": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of subscriptions per channel, 0 means unlimited. Defaults to 1000", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "maxPayload": { + SchemaProps: spec.SchemaProps{ + Description: "Maximum number of bytes in a message payload, 0 means unlimited. Defaults to 1MB", + Type: []string{"string"}, + Format: "", + }, + }, + "raftHeartbeatTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time in follower state without a leader before attempting an election, i.e. \"72h\", “4h35m”. Defaults to 2s", + Type: []string{"string"}, + Format: "", + }, + }, + "raftElectionTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time in candidate state without a leader before attempting an election, i.e. \"72h\", “4h35m”. Defaults to 2s", + Type: []string{"string"}, + Format: "", + }, + }, + "raftLeaseTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies how long a leader waits without being able to contact a quorum of nodes before stepping down as leader, i.e. \"72h\", “4h35m”. Defaults to 1s", + Type: []string{"string"}, + Format: "", + }, + }, + "raftCommitTimeout": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time without an Apply() operation before sending an heartbeat to ensure timely commit, i.e. \"72h\", “4h35m”. Defaults to 100ms", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ContainerTemplate", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PersistenceStrategy", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration"}, + } +} + +func schema_pkg_apis_events_v1alpha1_OpenWhiskTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "OpenWhiskTrigger refers to the specification of the OpenWhisk trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "host": { + SchemaProps: spec.SchemaProps{ + Description: "Host URL of the OpenWhisk.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version for the API. Defaults to v1.", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace for the action. Defaults to \"_\".", + Type: []string{"string"}, + Format: "", + }, + }, + "authToken": { + SchemaProps: spec.SchemaProps{ + Description: "AuthToken for authentication.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "actionName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the action/function.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + }, + Required: []string{"host", "actionName", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_OwnedRepositories(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Organization or user name", + Type: []string{"string"}, + Format: "", + }, + }, + "names": { + SchemaProps: spec.SchemaProps{ + Description: "Repository names", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_PayloadField(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PayloadField binds a value at path within the event payload against a name.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is the JSONPath of the event's (JSON decoded) data key Path is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name acts as key that holds the value at the path.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"path", "name"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_PersistenceStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PersistenceStrategy defines the strategy of persistence", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storageClassName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", + Type: []string{"string"}, + Format: "", + }, + }, + "accessMode": { + SchemaProps: spec.SchemaProps{ + Description: "Available access modes such as ReadWriteOnce, ReadWriteMany https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes", + Type: []string{"string"}, + Format: "", + }, + }, + "volumeSize": { + SchemaProps: spec.SchemaProps{ + Description: "Volume size, e.g. 10Gi", + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + +func schema_pkg_apis_events_v1alpha1_PubSubEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PubSubEventSource refers to event-source for GCP PubSub related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "projectID": { + SchemaProps: spec.SchemaProps{ + Description: "ProjectID is GCP project ID for the subscription. Required if you run Argo Events outside of GKE/GCE. (otherwise, the default value is its project)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topicProjectID": { + SchemaProps: spec.SchemaProps{ + Description: "TopicProjectID is GCP project ID for the topic. By default, it is same as ProjectID.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Topic to which the subscription should belongs. Required if you want the eventsource to create a new subscription. If you specify this field along with an existing subscription, it will be verified whether it actually belongs to the specified topic.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "subscriptionID": { + SchemaProps: spec.SchemaProps{ + Description: "SubscriptionID is ID of subscription. Required if you use existing subscription. The default value will be auto generated hash based on this eventsource setting, so the subscription might be recreated every time you update the setting, which has a possibility of event loss.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "credentialSecret": { + SchemaProps: spec.SchemaProps{ + Description: "CredentialSecret references to the secret that contains JSON credentials to access GCP. If it is missing, it implicitly uses Workload Identity to access. https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "deleteSubscriptionOnFinish": { + SchemaProps: spec.SchemaProps{ + Description: "DeleteSubscriptionOnFinish determines whether to delete the GCP PubSub subscription once the event source is stopped.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_PulsarEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PulsarEventSource describes the event source for Apache Pulsar", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "topics": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the topics to subscribe to.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of the subscription. Only \"exclusive\" and \"shared\" is supported. Defaults to exclusive.", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Configure the service URL for the Pulsar service.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "tlsTrustCertsSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Trusted TLS certificate secret.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "tlsAllowInsecureConnection": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client accept untrusted TLS certificate from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tlsValidateHostname": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client verify the validity of the host name from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the pulsar client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authTokenSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication token for the pulsar client. Either token or athenz can be set to use auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "authAthenzParams": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz parameters for the pulsar client. Refer https://github.com/apache/pulsar-client-go/blob/master/pulsar/auth/athenz.go Either token or athenz can be set to use auth.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authAthenzSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz privateKey secret for the pulsar client. AuthAthenzSecret must be set if AuthAthenzParams is used.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"topics", "url"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_PulsarTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PulsarTrigger refers to the specification of the Pulsar trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Configure the service URL for the Pulsar service.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "topic": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the topic. See https://pulsar.apache.org/docs/en/concepts-messaging/", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved Kafka trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "payload": { + SchemaProps: spec.SchemaProps{ + Description: "Payload is the list of key-value extracted from an event payload to construct the request payload.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "tlsTrustCertsSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Trusted TLS certificate secret.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "tlsAllowInsecureConnection": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client accept untrusted TLS certificate from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tlsValidateHostname": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the Pulsar client verify the validity of the host name from broker.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the pulsar client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "authTokenSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication token for the pulsar client. Either token or athenz can be set to use auth.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "connectionBackoff": { + SchemaProps: spec.SchemaProps{ + Description: "Backoff holds parameters applied to connection.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "authAthenzParams": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz parameters for the pulsar client. Refer https://github.com/apache/pulsar-client-go/blob/master/pulsar/auth/athenz.go Either token or athenz can be set to use auth.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authAthenzSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Authentication athenz privateKey secret for the pulsar client. AuthAthenzSecret must be set if AuthAthenzParams is used.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"url", "topic", "payload"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_RateLimit(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unit": { + SchemaProps: spec.SchemaProps{ + Description: "Defaults to Second", + Type: []string{"string"}, + Format: "", + }, + }, + "requestsPerUnit": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_RedisEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RedisEventSource describes an event source for the Redis PubSub. More info at https://godoc.org/github.com/go-redis/redis#example-PubSub", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostAddress": { + SchemaProps: spec.SchemaProps{ + Description: "HostAddress refers to the address of the Redis host/server", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace to use to retrieve the password from. It should only be specified if password is declared", + Type: []string{"string"}, + Format: "", + }, + }, + "db": { + SchemaProps: spec.SchemaProps{ + Description: "DB to use. If not specified, default DB 0 will be used.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "channels": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the redis client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username required for ACL style authentication if any.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"hostAddress", "channels"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_RedisStreamEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RedisStreamEventSource describes an event source for Redis streams (https://redis.io/topics/streams-intro)", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "hostAddress": { + SchemaProps: spec.SchemaProps{ + Description: "HostAddress refers to the address of the Redis host/server (master instance)", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "db": { + SchemaProps: spec.SchemaProps{ + Description: "DB to use. If not specified, default DB 0 will be used.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "streams": { + SchemaProps: spec.SchemaProps{ + Description: "Streams to look for entries. XREADGROUP is used on all streams using a single consumer group.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "maxMsgCountPerRead": { + SchemaProps: spec.SchemaProps{ + Description: "MaxMsgCountPerRead holds the maximum number of messages per stream that will be read in each XREADGROUP of all streams Example: if there are 2 streams and MaxMsgCountPerRead=10, then each XREADGROUP may read upto a total of 20 messages. Same as COUNT option in XREADGROUP(https://redis.io/topics/streams-intro). Defaults to 10", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "consumerGroup": { + SchemaProps: spec.SchemaProps{ + Description: "ConsumerGroup refers to the Redis stream consumer group that will be created on all redis streams. Messages are read through this group. Defaults to 'argo-events-cg'", + Type: []string{"string"}, + Format: "", + }, + }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS configuration for the redis client.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username required for ACL style authentication if any.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"hostAddress", "streams"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TLSConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ResourceEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceEventSource refers to a event-source for K8s resource related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace where resource is deployed", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter is applied on the metadata of the resource If you apply filter, then the internal event informer will only monitor objects that pass the filter.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceFilter"), + }, + }, + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "eventTypes": { + SchemaProps: spec.SchemaProps{ + Description: "EventTypes is the list of event type to watch. Possible values are - ADD, UPDATE and DELETE.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"namespace", "group", "version", "resource", "eventTypes"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ResourceFilter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_ResourceFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceFilter contains K8s ObjectMeta information to further filter resource event objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "prefix": { + SchemaProps: spec.SchemaProps{ + Description: "Prefix filter is applied on the resource name.", + Type: []string{"string"}, + Format: "", + }, + }, + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "Labels provide listing options to K8s API to watch resource/s. Refer https://kubernetes.io/docs/concepts/overview/working-with-objects/label-selectors/ for more info. Unlike K8s field selector, multiple values are passed as comma separated values instead of list of values. Eg: value: value1,value2. Same as K8s label selector, operator \"=\", \"==\", \"!=\", \"exists\", \"!\", \"notin\", \"in\", \"gt\" and \"lt\" are supported", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector"), + }, + }, + }, + }, + }, + "fields": { + SchemaProps: spec.SchemaProps{ + Description: "Fields provide field filters similar to K8s field selector (see https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/). Unlike K8s field selector, it supports arbitrary fileds like \"spec.serviceAccountName\", and the value could be a string or a regex. Same as K8s field selector, operator \"=\", \"==\" and \"!=\" are supported.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector"), + }, + }, + }, + }, + }, + "createdBy": { + SchemaProps: spec.SchemaProps{ + Description: "If resource is created before the specified time then the event is treated as valid.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "afterStart": { + SchemaProps: spec.SchemaProps{ + Description: "If the resource is created after the start time then the event is treated as valid.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Selector", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_events_v1alpha1_S3Artifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "S3Artifact contains information about an S3 connection and bucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "bucket": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Bucket"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "insecure": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "accessKey": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Filter"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "caCertificate": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"endpoint", "bucket", "accessKey", "secretKey"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Bucket", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.S3Filter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_S3Bucket(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "S3Bucket contains information to describe an S3 Bucket", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_S3Filter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "S3Filter represents filters to apply to bucket notifications for specifying constraints on objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "prefix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "suffix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"prefix", "suffix"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_SASLConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SASLConfig refers to SASL configuration for a client", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "mechanism": { + SchemaProps: spec.SchemaProps{ + Description: "SASLMechanism is the name of the enabled SASL mechanism. Possible values: OAUTHBEARER, PLAIN (defaults to PLAIN).", + Type: []string{"string"}, + Format: "", + }, + }, + "userSecret": { + SchemaProps: spec.SchemaProps{ + Description: "User is the authentication identity (authcid) to present for SASL/PLAIN or SASL/SCRAM authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "passwordSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Password for SASL/PLAIN authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SFTPEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SFTPEventSource describes an event-source for sftp related events.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "eventType": { + SchemaProps: spec.SchemaProps{ + Description: "Type of file operations to watch Refer https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more information", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "watchPathConfig": { + SchemaProps: spec.SchemaProps{ + Description: "WatchPathConfig contains configuration about the file path to watch", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig"), + }, + }, + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "password": { + SchemaProps: spec.SchemaProps{ + Description: "Password required for authentication if any.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sshKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "SSHKeySecret refers to the secret that contains SSH key. Key needs to contain private key and public key.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "address": { + SchemaProps: spec.SchemaProps{ + Description: "Address sftp address.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "pollIntervalDuration": { + SchemaProps: spec.SchemaProps{ + Description: "PollIntervalDuration the interval at which to poll the SFTP server defaults to 10 seconds", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"eventType", "watchPathConfig"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WatchPathConfig", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SNSEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SNSEventSource refers to event-source for AWS SNS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook configuration for http server", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "topicArn": { + SchemaProps: spec.SchemaProps{ + Description: "TopicArn", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "accessKey": { + SchemaProps: spec.SchemaProps{ + Description: "AccessKey refers K8s secret containing aws access key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "SecretKey refers K8s secret containing aws secret key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "Region is AWS region", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "roleARN": { + SchemaProps: spec.SchemaProps{ + Description: "RoleARN is the Amazon Resource Name (ARN) of the role to assume.", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "validateSignature": { + SchemaProps: spec.SchemaProps{ + Description: "ValidateSignature is boolean that can be set to true for SNS signature verification", + Type: []string{"boolean"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "Endpoint configures connection to a specific SNS endpoint instead of Amazons servers", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"topicArn", "region"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SQSEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SQSEventSource refers to event-source for AWS SQS related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "accessKey": { + SchemaProps: spec.SchemaProps{ + Description: "AccessKey refers K8s secret containing aws access key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "secretKey": { + SchemaProps: spec.SchemaProps{ + Description: "SecretKey refers K8s secret containing aws secret key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "Region is AWS region", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "queue": { + SchemaProps: spec.SchemaProps{ + Description: "Queue is AWS SQS queue to listen to for messages", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "waitTimeSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "WaitTimeSeconds is The duration (in seconds) for which the call waits for a message to arrive in the queue before returning.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "roleARN": { + SchemaProps: spec.SchemaProps{ + Description: "RoleARN is the Amazon Resource Name (ARN) of the role to assume.", + Type: []string{"string"}, + Format: "", + }, + }, + "jsonBody": { + SchemaProps: spec.SchemaProps{ + Description: "JSONBody specifies that all event body payload coming from this source will be JSON", + Type: []string{"boolean"}, + Format: "", + }, + }, + "queueAccountId": { + SchemaProps: spec.SchemaProps{ + Description: "QueueAccountID is the ID of the account that created the queue to monitor", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "dlq": { + SchemaProps: spec.SchemaProps{ + Description: "DLQ specifies if a dead-letter queue is configured for messages that can't be processed successfully. If set to true, messages with invalid payload won't be acknowledged to allow to forward them farther to the dead-letter queue. The default value is false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "Endpoint configures connection to a specific SQS endpoint instead of Amazons servers", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "sessionToken": { + SchemaProps: spec.SchemaProps{ + Description: "SessionToken refers to K8s secret containing AWS temporary credentials(STS) session token", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + Required: []string{"region", "queue", "waitTimeSeconds"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SchemaRegistryConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SchemaRegistryConfig refers to configuration for a client", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "Schema Registry URL.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "schemaId": { + SchemaProps: spec.SchemaProps{ + Description: "Schema ID", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "auth": { + SchemaProps: spec.SchemaProps{ + Description: "SchemaRegistry - basic authentication", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"), + }, + }, + }, + Required: []string{"url", "schemaId"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.BasicAuth"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SecureHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SecureHeader refers to HTTP Headers with auth tokens as values", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "valueFrom": { + SchemaProps: spec.SchemaProps{ + Description: "Values can be read from either secrets or configmaps", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ValueFromSource"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ValueFromSource"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Selector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Selector represents conditional operation to select K8s objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "Key name", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Supported operations like ==, != etc. Defaults to ==. Refer https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors for more info.", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"key", "value"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Sensor(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Sensor is the definition of a sensor resource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorStatus"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorSpec", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SensorStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SensorList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SensorList is the list of Sensor resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Sensor"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Sensor", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SensorSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SensorSpec represents desired sensor state", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dependencies": { + SchemaProps: spec.SchemaProps{ + Description: "Dependencies is a list of the events that this sensor is dependent on.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependency"), + }, + }, + }, + }, + }, + "triggers": { + SchemaProps: spec.SchemaProps{ + Description: "Triggers is a list of the things that this sensor evokes. These are the outputs from this sensor.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger"), + }, + }, + }, + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the pod specification for the sensor", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template"), + }, + }, + "errorOnFailedRound": { + SchemaProps: spec.SchemaProps{ + Description: "ErrorOnFailedRound if set to true, marks sensor state as `error` if the previous trigger round fails. Once sensor state is set to `error`, no further triggers will be processed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "eventBusName": { + SchemaProps: spec.SchemaProps{ + Description: "EventBusName references to a EventBus name. By default the value is \"default\"", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the sensor deployment replicas", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "revisionHistoryLimit": { + SchemaProps: spec.SchemaProps{ + Description: "RevisionHistoryLimit specifies how many old deployment revisions to retain", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "loggingFields": { + SchemaProps: spec.SchemaProps{ + Description: "LoggingFields add additional key-value pairs when logging happens", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"dependencies", "triggers"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventDependency", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Template", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SensorStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SensorStatus contains information about the status of a sensor.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Service(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Service holds the service information eventsource exposes", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels default={annotations: {}, labels: {}}", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "ports": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "port", + "protocol", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "port", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "The list of ports that are exposed by this ClusterIP service.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ServicePort"), + }, + }, + }, + }, + }, + "clusterIP": { + SchemaProps: spec.SchemaProps{ + Description: "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "k8s.io/api/core/v1.ServicePort"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SlackEventSource refers to event-source for Slack related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "signingSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Slack App signing secret", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "token": { + SchemaProps: spec.SchemaProps{ + Description: "Token for URL verification handshake", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration for a REST endpoint", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackSender(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "username": { + SchemaProps: spec.SchemaProps{ + Description: "Username is the Slack application's username", + Type: []string{"string"}, + Format: "", + }, + }, + "icon": { + SchemaProps: spec.SchemaProps{ + Description: "Icon is the Slack application's icon, e.g. :robot_face: or https://example.com/image.png", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackThread(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "messageAggregationKey": { + SchemaProps: spec.SchemaProps{ + Description: "MessageAggregationKey allows to aggregate the messages to a thread by some key.", + Type: []string{"string"}, + Format: "", + }, + }, + "broadcastMessageToChannel": { + SchemaProps: spec.SchemaProps{ + Description: "BroadcastMessageToChannel allows to also broadcast the message from the thread to the channel", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_SlackTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SlackTrigger refers to the specification of the slack notification trigger.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of key-value extracted from event's payload that are applied to the trigger resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "slackToken": { + SchemaProps: spec.SchemaProps{ + Description: "SlackToken refers to the Kubernetes secret that holds the slack token required to send messages.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "channel": { + SchemaProps: spec.SchemaProps{ + Description: "Channel refers to which Slack channel to send Slack message.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "Message refers to the message to send to the Slack channel.", + Type: []string{"string"}, + Format: "", + }, + }, + "attachments": { + SchemaProps: spec.SchemaProps{ + Description: "Attachments is a JSON format string that represents an array of Slack attachments according to the attachments API: https://api.slack.com/reference/messaging/attachments .", + Type: []string{"string"}, + Format: "", + }, + }, + "blocks": { + SchemaProps: spec.SchemaProps{ + Description: "Blocks is a JSON format string that represents an array of Slack blocks according to the blocks API: https://api.slack.com/reference/block-kit/blocks .", + Type: []string{"string"}, + Format: "", + }, + }, + "thread": { + SchemaProps: spec.SchemaProps{ + Description: "Thread refers to additional options for sending messages to a Slack thread.", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackThread"), + }, + }, + "sender": { + SchemaProps: spec.SchemaProps{ + Description: "Sender refers to additional configuration of the Slack application that sends the message.", + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackSender"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackSender", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackThread", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_StandardK8STrigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StandardK8STrigger is the standard Kubernetes resource trigger", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source of the K8s resource file(s)", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation"), + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation refers to the type of operation performed on the k8s resource. Default value is Create.", + Type: []string{"string"}, + Format: "", + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters that is applied to resolved K8s trigger object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "patchStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "PatchStrategy controls the K8s object patching strategy when the trigger operation is specified as patch. possible values: \"application/json-patch+json\" \"application/merge-patch+json\" \"application/strategic-merge-patch+json\" \"application/apply-patch+yaml\". Defaults to \"application/merge-patch+json\"", + Type: []string{"string"}, + Format: "", + }, + }, + "liveObject": { + SchemaProps: spec.SchemaProps{ + Description: "LiveObject specifies whether the resource should be directly fetched from K8s instead of being marshaled from the resource artifact. If set to true, the resource artifact must contain the information required to uniquely identify the resource in the cluster, that is, you must specify \"apiVersion\", \"kind\" as well as \"name\" and \"namespace\" meta data. Only valid for operation type `update`", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArtifactLocation", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Status is a common structure which can be used for Status field.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Conditions are the latest available observations of a resource's current state.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Condition"}, + } +} + +func schema_pkg_apis_events_v1alpha1_StatusPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StatusPolicy refers to the policy used to check the state of the trigger using response status", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "allow": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + }, + Required: []string{"allow"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_StorageGridEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StorageGridEventSource refers to event-source for StorageGrid related events", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration for a REST endpoint", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "events": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter on object key which caused the notification.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridFilter"), + }, + }, + "topicArn": { + SchemaProps: spec.SchemaProps{ + Description: "TopicArn", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "bucket": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the bucket to register notifications for.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "region": { + SchemaProps: spec.SchemaProps{ + Description: "S3 region. Defaults to us-east-1", + Type: []string{"string"}, + Format: "", + }, + }, + "authToken": { + SchemaProps: spec.SchemaProps{ + Description: "Auth token for storagegrid api", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "apiURL": { + SchemaProps: spec.SchemaProps{ + Description: "APIURL is the url of the storagegrid api.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"topicArn", "bucket", "authToken", "apiURL"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StorageGridFilter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_StorageGridFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StorageGridFilter represents filters to apply to bucket notifications for specifying constraints on objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "prefix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "suffix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"prefix", "suffix"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_StripeEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StripeEventSource describes the event source for stripe webhook notifications More info at https://stripe.com/docs/webhooks", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "Webhook holds configuration for a REST endpoint", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext"), + }, + }, + "createWebhook": { + SchemaProps: spec.SchemaProps{ + Description: "CreateWebhook if specified creates a new webhook programmatically.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "apiKey": { + SchemaProps: spec.SchemaProps{ + Description: "APIKey refers to K8s secret that holds Stripe API key. Used only if CreateWebhook is enabled.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "eventFilter": { + SchemaProps: spec.SchemaProps{ + Description: "EventFilter describes the type of events to listen to. If not specified, all types of events will be processed. More info at https://stripe.com/docs/api/events/list", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.WebhookContext", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TLSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TLSConfig refers to TLS configuration for a client.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "caCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "CACertSecret refers to the secret that contains the CA cert", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "clientCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ClientCertSecret refers to the secret that contains the client cert", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "clientKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "ClientKeySecret refers to the secret that contains the client key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "insecureSkipVerify": { + SchemaProps: spec.SchemaProps{ + Description: "If true, skips creation of TLSConfig with certs and creates an empty TLSConfig. (Defaults to false)", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_Template(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Template holds the information of a deployment template", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata sets the pods's metadata, i.e. annotations and labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata"), + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName is the name of the ServiceAccount to use to run sensor pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", + Type: []string{"string"}, + Format: "", + }, + }, + "container": { + SchemaProps: spec.SchemaProps{ + Description: "Container is the main container image to run in the sensor pod", + Ref: ref("k8s.io/api/core/v1.Container"), + }, + }, + "volumes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Volumes is a list of volumes that can be mounted by containers in a workflow.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Volume"), + }, + }, + }, + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, indicates the EventSource pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "The priority value. Various system components use this field to find the priority of the EventSource pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's scheduling constraints", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Metadata", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.Container", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/api/core/v1.Volume"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TimeFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TimeFilter describes a window in time. It filters out events that occur outside the time limits. In other words, only events that occur after Start and before Stop will pass this filter.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "start": { + SchemaProps: spec.SchemaProps{ + Description: "Start is the beginning of a time window in UTC. Before this time, events for this dependency are ignored. Format is hh:mm:ss.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "stop": { + SchemaProps: spec.SchemaProps{ + Description: "Stop is the end of a time window in UTC. After or equal to this time, events for this dependency are ignored and Format is hh:mm:ss. If it is smaller than Start, it is treated as next day of Start (e.g.: 22:00:00-01:00:00 means 22:00:00-25:00:00).", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"start", "stop"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_Trigger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Trigger is an action taken, output produced, an event created, a message sent", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template describes the trigger specification.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerTemplate"), + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters is the list of parameters applied to the trigger template definition", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter"), + }, + }, + }, + }, + }, + "policy": { + SchemaProps: spec.SchemaProps{ + Description: "Policy to configure backoff and execution criteria for the trigger", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerPolicy"), + }, + }, + "retryStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "Retry strategy, defaults to no retry", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff"), + }, + }, + "rateLimit": { + SchemaProps: spec.SchemaProps{ + Description: "Rate limit, default unit is Second", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RateLimit"), + }, + }, + "atLeastOnce": { + SchemaProps: spec.SchemaProps{ + Description: "AtLeastOnce determines the trigger execution semantics. Defaults to false. Trigger execution will use at-most-once semantics. If set to true, Trigger execution will switch to at-least-once semantics.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "dlqTrigger": { + SchemaProps: spec.SchemaProps{ + Description: "If the trigger fails, it will retry up to the configured number of retries. If the maximum retries are reached and the trigger is set to execute atLeastOnce, the dead letter queue (DLQ) trigger will be invoked if specified. Invoking the dead letter queue trigger helps prevent data loss.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Backoff", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.RateLimit", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.Trigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameter", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerPolicy", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerTemplate"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerParameter(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerParameter indicates a passed parameter to a service template", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "src": { + SchemaProps: spec.SchemaProps{ + Description: "Src contains a source reference to the value of the parameter from a dependency", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameterSource"), + }, + }, + "dest": { + SchemaProps: spec.SchemaProps{ + Description: "Dest is the JSONPath of a resource key. A path is a series of keys separated by a dot. The colon character can be escaped with '.' The -1 key can be used to append a value to an existing array. See https://github.com/tidwall/sjson#path-syntax for more information about how this is used.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation is what to do with the existing value at Dest, whether to 'prepend', 'overwrite', or 'append' it.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"dest"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.TriggerParameterSource"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerParameterSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerParameterSource defines the source for a parameter from a event event", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dependencyName": { + SchemaProps: spec.SchemaProps{ + Description: "DependencyName refers to the name of the dependency. The event which is stored for this dependency is used as payload for the parameterization. Make sure to refer to one of the dependencies you have defined under Dependencies list.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "contextKey": { + SchemaProps: spec.SchemaProps{ + Description: "ContextKey is the JSONPath of the event's (JSON decoded) context key ContextKey is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Type: []string{"string"}, + Format: "", + }, + }, + "contextTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ContextTemplate is a go-template for extracting a string from the event's context. If a ContextTemplate is provided with a ContextKey, the template will be evaluated first and fallback to the ContextKey. The templating follows the standard go-template syntax as well as sprig's extra functions. See https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/", + Type: []string{"string"}, + Format: "", + }, + }, + "dataKey": { + SchemaProps: spec.SchemaProps{ + Description: "DataKey is the JSONPath of the event's (JSON decoded) data key DataKey is a series of keys separated by a dot. A key may contain wildcard characters '*' and '?'. To access an array value use the index as the key. The dot and wildcard characters can be escaped with '\\\\'. See https://github.com/tidwall/gjson#path-syntax for more information on how to use this.", + Type: []string{"string"}, + Format: "", + }, + }, + "dataTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "DataTemplate is a go-template for extracting a string from the event's data. If a DataTemplate is provided with a DataKey, the template will be evaluated first and fallback to the DataKey. The templating follows the standard go-template syntax as well as sprig's extra functions. See https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value is the default literal value to use for this parameter source This is only used if the DataKey is invalid. If the DataKey is invalid and this is not defined, this param source will produce an error.", + Type: []string{"string"}, + Format: "", + }, + }, + "useRawData": { + SchemaProps: spec.SchemaProps{ + Description: "UseRawData indicates if the value in an event at data key should be used without converting to string. When true, a number, boolean, json or string parameter may be extracted. When the field is unspecified, or explicitly false, the behavior is to turn the extracted field into a string. (e.g. when set to true, the parameter 123 will resolve to the numerical type, but when false, or not provided, the string \"123\" will be resolved)", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"dependencyName"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerPolicy dictates the policy for the trigger retries", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "k8s": { + SchemaProps: spec.SchemaProps{ + Description: "K8SResourcePolicy refers to the policy used to check the state of K8s based triggers using using labels", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResourcePolicy"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status refers to the policy used to check the state of the trigger using response status", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StatusPolicy"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.K8SResourcePolicy", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StatusPolicy"}, + } +} + +func schema_pkg_apis_events_v1alpha1_TriggerTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TriggerTemplate is the template that describes trigger specification.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is a unique name of the action to take.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions is the conditions to execute the trigger. For example: \"(dep01 || dep02) && dep04\"", + Type: []string{"string"}, + Format: "", + }, + }, + "k8s": { + SchemaProps: spec.SchemaProps{ + Description: "StandardK8STrigger refers to the trigger designed to create or update a generic Kubernetes resource.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StandardK8STrigger"), + }, + }, + "argoWorkflow": { + SchemaProps: spec.SchemaProps{ + Description: "ArgoWorkflow refers to the trigger that can perform various operations on an Argo workflow.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArgoWorkflowTrigger"), + }, + }, + "http": { + SchemaProps: spec.SchemaProps{ + Description: "HTTP refers to the trigger designed to dispatch a HTTP request with on-the-fly constructable payload.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HTTPTrigger"), + }, + }, + "awsLambda": { + SchemaProps: spec.SchemaProps{ + Description: "AWSLambda refers to the trigger designed to invoke AWS Lambda function with with on-the-fly constructable payload.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AWSLambdaTrigger"), + }, + }, + "custom": { + SchemaProps: spec.SchemaProps{ + Description: "CustomTrigger refers to the trigger designed to connect to a gRPC trigger server and execute a custom trigger.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger"), + }, + }, + "kafka": { + SchemaProps: spec.SchemaProps{ + Description: "Kafka refers to the trigger designed to place messages on Kafka topic.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaTrigger"), + }, + }, + "nats": { + SchemaProps: spec.SchemaProps{ + Description: "NATS refers to the trigger designed to place message on NATS subject.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSTrigger"), + }, + }, + "slack": { + SchemaProps: spec.SchemaProps{ + Description: "Slack refers to the trigger designed to send slack notification message.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackTrigger"), + }, + }, + "openWhisk": { + SchemaProps: spec.SchemaProps{ + Description: "OpenWhisk refers to the trigger designed to invoke OpenWhisk action.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OpenWhiskTrigger"), + }, + }, + "log": { + SchemaProps: spec.SchemaProps{ + Description: "Log refers to the trigger designed to invoke log the event.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.LogTrigger"), + }, + }, + "azureEventHubs": { + SchemaProps: spec.SchemaProps{ + Description: "AzureEventHubs refers to the trigger send an event to an Azure Event Hub.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventHubsTrigger"), + }, + }, + "pulsar": { + SchemaProps: spec.SchemaProps{ + Description: "Pulsar refers to the trigger designed to place messages on Pulsar topic.", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarTrigger"), + }, + }, + "conditionsReset": { + SchemaProps: spec.SchemaProps{ + Description: "Criteria to reset the conditons", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria"), + }, + }, + }, + }, + }, + "azureServiceBus": { + SchemaProps: spec.SchemaProps{ + Description: "AzureServiceBus refers to the trigger designed to place messages on Azure Service Bus", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusTrigger"), + }, + }, + "email": { + SchemaProps: spec.SchemaProps{ + Description: "Email refers to the trigger designed to send an email notification", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmailTrigger"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AWSLambdaTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ArgoWorkflowTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureEventHubsTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.AzureServiceBusTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.ConditionsResetCriteria", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.CustomTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EmailTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.HTTPTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.KafkaTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.LogTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.NATSTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.OpenWhiskTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.PulsarTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.SlackTrigger", "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.StandardK8STrigger"}, + } +} + +func schema_pkg_apis_events_v1alpha1_URLArtifact(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "URLArtifact contains information about an artifact at an http endpoint.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is the complete URL", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "verifyCert": { + SchemaProps: spec.SchemaProps{ + Description: "VerifyCert decides whether the connection is secure or not", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"path"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_ValueFromSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ValueFromSource allows you to reference keys from either a Configmap or Secret", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretKeyRef": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "configMapKeyRef": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_WatchPathConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "directory": { + SchemaProps: spec.SchemaProps{ + Description: "Directory to watch for events", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Path is relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + "pathRegexp": { + SchemaProps: spec.SchemaProps{ + Description: "PathRegexp is regexp of relative path of object to watch with respect to the directory", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"directory"}, + }, + }, + } +} + +func schema_pkg_apis_events_v1alpha1_WebhookContext(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WebhookContext holds a general purpose REST API context", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "REST API endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "method": { + SchemaProps: spec.SchemaProps{ + Description: "Method is HTTP request method that indicates the desired action to be performed for a given resource. See RFC7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port on which HTTP server is listening for incoming events.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL is the url of the server.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "serverCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerCertPath refers the file that contains the cert.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "serverKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerKeyPath refers the file that contains private key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authSecret": { + SchemaProps: spec.SchemaProps{ + Description: "AuthSecret holds a secret selector that contains a bearer token for authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "maxPayloadSize": { + SchemaProps: spec.SchemaProps{ + Description: "MaxPayloadSize is the maximum webhook payload size that the server will accept. Requests exceeding that limit will be rejected with \"request too large\" response. Default value: 1048576 (1MB).", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"endpoint", "method", "port", "url"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_events_v1alpha1_WebhookEventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CalendarEventSource describes an HTTP based EventSource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "endpoint": { + SchemaProps: spec.SchemaProps{ + Description: "REST API endpoint", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "method": { + SchemaProps: spec.SchemaProps{ + Description: "Method is HTTP request method that indicates the desired action to be performed for a given resource. See RFC7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "Port on which HTTP server is listening for incoming events.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL is the url of the server.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "serverCertSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerCertPath refers the file that contains the cert.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "serverKeySecret": { + SchemaProps: spec.SchemaProps{ + Description: "ServerKeyPath refers the file that contains private key", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Metadata holds the user defined metadata which will passed along the event payload.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "authSecret": { + SchemaProps: spec.SchemaProps{ + Description: "AuthSecret holds a secret selector that contains a bearer token for authentication", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "maxPayloadSize": { + SchemaProps: spec.SchemaProps{ + Description: "MaxPayloadSize is the maximum webhook payload size that the server will accept. Requests exceeding that limit will be rejected with \"request too large\" response. Default value: 1048576 (1MB).", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "filter": { + SchemaProps: spec.SchemaProps{ + Description: "Filter", + Ref: ref("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter"), + }, + }, + }, + Required: []string{"endpoint", "method", "port", "url"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1.EventSourceFilter", "k8s.io/api/core/v1.SecretKeySelector"}, + } +} +``` + +## `pkg/apis/events/v1alpha1/container_template.go` (changed lines (7, 8, 9, 10)) + +```go +package v1alpha1 + +import corev1 "k8s.io/api/core/v1" + +// ContainerTemplate defines customized spec for a container +type ContainerTemplate struct { + Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"` + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,2,opt,name=imagePullPolicy,casttype=PullPolicy"` + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,3,opt,name=securityContext"` +} +``` + +## `pkg/apis/events/v1alpha1/generated.pb.go` (changed lines (864, 867, 868, 895, 896, 923, 924, 951, 952, 979, 980, 1007, 1008, 1035, 1036, 1063, 1064, 1091, 1092, 1119, 1120, 1147, 1148, 1175, 1176, 1203, 1204, 1231, 1232, 1259, 1260, 1287, 1288, 1315, 1316, 1343, 1344, 1371, 1372, 1399, 1400, 1427, 1428, 1455, 1456, 1483, 1484, 1511, 1512, 1539, 1540, 1567, 1568, 1595, 1596, 1623, 1624, 1651, 1652, 1679, 1680, 1707, 1708, 1735, 1736, 1763, 1764, 1791, 1792, 1819, 1820, 1847, 1848, 1875, 1876, 1903, 1904, 1931, 1932, 1959, 1960, 1987, 1988, 2015, 2016, 2043, 2044, 2071, 2072, 2099, 2100, 2127, 2128, 2155, 2156, 2183, 2184, 2211, 2212, 2239, 2240, 2267, 2268, 2295, 2296, 2323, 2324, 2351, 2352, 2379, 2380, 2407, 2408, 2435, 2436, 2463, 2464, 2491, 2492, 2519, 2520, 2547, 2548, 2575, 2576, 2603, 2604, 2631, 2632, 2659, 2660, 2687, 2688, 2715, 2716, 2743, 2744, 2771, 2772, 2799, 2800, 2827, 2828, 2855, 2856, 2883, 2884, 2911, 2912, 2939, 2940, 2967, 2968, 2995, 2996, 3023, 3024, 3051, 3052, 3079, 3080, 3107, 3108, 3135, 3136, 3163, 3164, 3191, 3192, 3219, 3220, 3247, 3248, 3275, 3276, 3303, 3304, 3331, 3332, 3359, 3360, 3387, 3388, 3415, 3416, 3443, 3444, 3471, 3472, 3499, 3500, 3527, 3528, 3555, 3556, 3583, 3584, 3611, 3612, 3639, 3640, 3667, 3668, 3695, 3696, 3757, 3933, 3934, 3935, 3936, 3937, 3938, 3939, 3940, 3941, 3942, 3943, 3944, 3945, 3946, 3947, 3948, 3949, 3950, 3951, 3952, 3953, 3954, 3955, 3956, 3957, 3958, 3959, 3960, 3961, 3962, 3963, 3964, 3965, 3966, 3967, 3968, 3969, 3970, 3971, 3972, 3973, 3974, 3975, 3976, 3977, 3978, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989, 3990, 3991, 3992, 3993, 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4071, 4072, 4073, 4074, 4075, 4076, 4077, 4078, 4079, 4080, 4081, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4175, 4176, 4177, 4178, 4179, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 4187, 4188, 4189, 4190, 4191, 4192, 4193, 4194, 4195, 4196, 4197, 4198, 4199, 4200, 4201, 4202, 4203, 4204, 4205, 4206, 4207, 4208, 4209, 4210, 4211, 4212, 4213, 4214, 4215, 4216, 4217, 4218, 4219, 4220, 4221, 4222, 4223, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 4234, 4235, 4236, 4237, 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 4252, 4253, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 4297, 4298, 4299, 4300, 4301, 4302, 4303, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315, 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, 4344, 4345, 4346, 4347, 4348, 4349, 4350, 4351, 4352, 4353, 4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, 4371, 4372, 4373, 4374, 4375, 4376, 4377, 4378, 4379, 4380, 4381, 4382, 4383, 4384, 4385, 4386, 4387, 4388, 4389, 4390, 4391, 4392, 4393, 4394, 4395, 4396, 4397, 4398, 4399, 4400, 4401, 4402, 4403, 4404, 4405, 4406, 4407, 4408, 4409, 4410, 4411, 4412, 4413, 4414, 4415, 4416, 4417, 4418, 4419, 4420, 4421, 4422, 4423, 4424, 4425, 4426, 4427, 4428, 4429, 4430, 4431, 4432, 4433, 4434, 4435, 4436, 4437, 4438, 4439, 4440, 4441, 4442, 4443, 4444, 4445, 4446, 4447, 4448, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4470, 4471, 4472, 4473, 4474, 4475, 4476, 4477, 4478, 4479, 4480, 4481, 4482, 4483, 4484, 4485, 4486, 4487, 4488, 4489, 4490, 4491, 4492, 4493, 4494, 4495, 4496, 4497, 4498, 4499, 4500, 4501, 4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4539, 4540, 4541, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4566, 4567, 4568, 4569, 4570, 4571, 4572, 4573, 4574, 4575, 4576, 4577, 4578, 4579, 4580, 4581, 4582, 4583, 4584, 4585, 4586, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 4607, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4626, 4627, 4628, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663, 4664, 4665, 4666, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4743, 4744, 4745, 6852, 16493, 20193, 22369, 22370, 29402, 57554, 57555)) + +```go +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: github.com/argoproj/argo-events/pkg/apis/events/v1alpha1/generated.proto + +package v1alpha1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + k8s_io_api_core_v1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func (m *AMQPConsumeConfig) Reset() { *m = AMQPConsumeConfig{} } +func (*AMQPConsumeConfig) ProtoMessage() {} +func (*AMQPConsumeConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{0} +} +func (m *AMQPConsumeConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPConsumeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPConsumeConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPConsumeConfig.Merge(m, src) +} +func (m *AMQPConsumeConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPConsumeConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPConsumeConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPConsumeConfig proto.InternalMessageInfo + +func (m *AMQPEventSource) Reset() { *m = AMQPEventSource{} } +func (*AMQPEventSource) ProtoMessage() {} +func (*AMQPEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{1} +} +func (m *AMQPEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPEventSource.Merge(m, src) +} +func (m *AMQPEventSource) XXX_Size() int { + return m.Size() +} +func (m *AMQPEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPEventSource proto.InternalMessageInfo + +func (m *AMQPExchangeDeclareConfig) Reset() { *m = AMQPExchangeDeclareConfig{} } +func (*AMQPExchangeDeclareConfig) ProtoMessage() {} +func (*AMQPExchangeDeclareConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{2} +} +func (m *AMQPExchangeDeclareConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPExchangeDeclareConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPExchangeDeclareConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPExchangeDeclareConfig.Merge(m, src) +} +func (m *AMQPExchangeDeclareConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPExchangeDeclareConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPExchangeDeclareConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPExchangeDeclareConfig proto.InternalMessageInfo + +func (m *AMQPQueueBindConfig) Reset() { *m = AMQPQueueBindConfig{} } +func (*AMQPQueueBindConfig) ProtoMessage() {} +func (*AMQPQueueBindConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{3} +} +func (m *AMQPQueueBindConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPQueueBindConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPQueueBindConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPQueueBindConfig.Merge(m, src) +} +func (m *AMQPQueueBindConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPQueueBindConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPQueueBindConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPQueueBindConfig proto.InternalMessageInfo + +func (m *AMQPQueueDeclareConfig) Reset() { *m = AMQPQueueDeclareConfig{} } +func (*AMQPQueueDeclareConfig) ProtoMessage() {} +func (*AMQPQueueDeclareConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{4} +} +func (m *AMQPQueueDeclareConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AMQPQueueDeclareConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AMQPQueueDeclareConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_AMQPQueueDeclareConfig.Merge(m, src) +} +func (m *AMQPQueueDeclareConfig) XXX_Size() int { + return m.Size() +} +func (m *AMQPQueueDeclareConfig) XXX_DiscardUnknown() { + xxx_messageInfo_AMQPQueueDeclareConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_AMQPQueueDeclareConfig proto.InternalMessageInfo + +func (m *AWSLambdaTrigger) Reset() { *m = AWSLambdaTrigger{} } +func (*AWSLambdaTrigger) ProtoMessage() {} +func (*AWSLambdaTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{5} +} +func (m *AWSLambdaTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AWSLambdaTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AWSLambdaTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_AWSLambdaTrigger.Merge(m, src) +} +func (m *AWSLambdaTrigger) XXX_Size() int { + return m.Size() +} +func (m *AWSLambdaTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_AWSLambdaTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_AWSLambdaTrigger proto.InternalMessageInfo + +func (m *Amount) Reset() { *m = Amount{} } +func (*Amount) ProtoMessage() {} +func (*Amount) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{6} +} +func (m *Amount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Amount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Amount) XXX_Merge(src proto.Message) { + xxx_messageInfo_Amount.Merge(m, src) +} +func (m *Amount) XXX_Size() int { + return m.Size() +} +func (m *Amount) XXX_DiscardUnknown() { + xxx_messageInfo_Amount.DiscardUnknown(m) +} + +var xxx_messageInfo_Amount proto.InternalMessageInfo + +func (m *ArgoWorkflowTrigger) Reset() { *m = ArgoWorkflowTrigger{} } +func (*ArgoWorkflowTrigger) ProtoMessage() {} +func (*ArgoWorkflowTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{7} +} +func (m *ArgoWorkflowTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArgoWorkflowTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ArgoWorkflowTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArgoWorkflowTrigger.Merge(m, src) +} +func (m *ArgoWorkflowTrigger) XXX_Size() int { + return m.Size() +} +func (m *ArgoWorkflowTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_ArgoWorkflowTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_ArgoWorkflowTrigger proto.InternalMessageInfo + +func (m *ArtifactLocation) Reset() { *m = ArtifactLocation{} } +func (*ArtifactLocation) ProtoMessage() {} +func (*ArtifactLocation) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{8} +} +func (m *ArtifactLocation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArtifactLocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ArtifactLocation) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArtifactLocation.Merge(m, src) +} +func (m *ArtifactLocation) XXX_Size() int { + return m.Size() +} +func (m *ArtifactLocation) XXX_DiscardUnknown() { + xxx_messageInfo_ArtifactLocation.DiscardUnknown(m) +} + +var xxx_messageInfo_ArtifactLocation proto.InternalMessageInfo + +func (m *AzureEventHubsTrigger) Reset() { *m = AzureEventHubsTrigger{} } +func (*AzureEventHubsTrigger) ProtoMessage() {} +func (*AzureEventHubsTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{9} +} +func (m *AzureEventHubsTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureEventHubsTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureEventHubsTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureEventHubsTrigger.Merge(m, src) +} +func (m *AzureEventHubsTrigger) XXX_Size() int { + return m.Size() +} +func (m *AzureEventHubsTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_AzureEventHubsTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureEventHubsTrigger proto.InternalMessageInfo + +func (m *AzureEventsHubEventSource) Reset() { *m = AzureEventsHubEventSource{} } +func (*AzureEventsHubEventSource) ProtoMessage() {} +func (*AzureEventsHubEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{10} +} +func (m *AzureEventsHubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureEventsHubEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureEventsHubEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureEventsHubEventSource.Merge(m, src) +} +func (m *AzureEventsHubEventSource) XXX_Size() int { + return m.Size() +} +func (m *AzureEventsHubEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AzureEventsHubEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureEventsHubEventSource proto.InternalMessageInfo + +func (m *AzureQueueStorageEventSource) Reset() { *m = AzureQueueStorageEventSource{} } +func (*AzureQueueStorageEventSource) ProtoMessage() {} +func (*AzureQueueStorageEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{11} +} +func (m *AzureQueueStorageEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureQueueStorageEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureQueueStorageEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureQueueStorageEventSource.Merge(m, src) +} +func (m *AzureQueueStorageEventSource) XXX_Size() int { + return m.Size() +} +func (m *AzureQueueStorageEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AzureQueueStorageEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureQueueStorageEventSource proto.InternalMessageInfo + +func (m *AzureServiceBusEventSource) Reset() { *m = AzureServiceBusEventSource{} } +func (*AzureServiceBusEventSource) ProtoMessage() {} +func (*AzureServiceBusEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{12} +} +func (m *AzureServiceBusEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureServiceBusEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureServiceBusEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureServiceBusEventSource.Merge(m, src) +} +func (m *AzureServiceBusEventSource) XXX_Size() int { + return m.Size() +} +func (m *AzureServiceBusEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_AzureServiceBusEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureServiceBusEventSource proto.InternalMessageInfo + +func (m *AzureServiceBusTrigger) Reset() { *m = AzureServiceBusTrigger{} } +func (*AzureServiceBusTrigger) ProtoMessage() {} +func (*AzureServiceBusTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{13} +} +func (m *AzureServiceBusTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AzureServiceBusTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *AzureServiceBusTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_AzureServiceBusTrigger.Merge(m, src) +} +func (m *AzureServiceBusTrigger) XXX_Size() int { + return m.Size() +} +func (m *AzureServiceBusTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_AzureServiceBusTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_AzureServiceBusTrigger proto.InternalMessageInfo + +func (m *Backoff) Reset() { *m = Backoff{} } +func (*Backoff) ProtoMessage() {} +func (*Backoff) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{14} +} +func (m *Backoff) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Backoff) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Backoff) XXX_Merge(src proto.Message) { + xxx_messageInfo_Backoff.Merge(m, src) +} +func (m *Backoff) XXX_Size() int { + return m.Size() +} +func (m *Backoff) XXX_DiscardUnknown() { + xxx_messageInfo_Backoff.DiscardUnknown(m) +} + +var xxx_messageInfo_Backoff proto.InternalMessageInfo + +func (m *BasicAuth) Reset() { *m = BasicAuth{} } +func (*BasicAuth) ProtoMessage() {} +func (*BasicAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{15} +} +func (m *BasicAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasicAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BasicAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicAuth.Merge(m, src) +} +func (m *BasicAuth) XXX_Size() int { + return m.Size() +} +func (m *BasicAuth) XXX_DiscardUnknown() { + xxx_messageInfo_BasicAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_BasicAuth proto.InternalMessageInfo + +func (m *BitbucketAuth) Reset() { *m = BitbucketAuth{} } +func (*BitbucketAuth) ProtoMessage() {} +func (*BitbucketAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{16} +} +func (m *BitbucketAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketAuth.Merge(m, src) +} +func (m *BitbucketAuth) XXX_Size() int { + return m.Size() +} +func (m *BitbucketAuth) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketAuth proto.InternalMessageInfo + +func (m *BitbucketBasicAuth) Reset() { *m = BitbucketBasicAuth{} } +func (*BitbucketBasicAuth) ProtoMessage() {} +func (*BitbucketBasicAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{17} +} +func (m *BitbucketBasicAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketBasicAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketBasicAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketBasicAuth.Merge(m, src) +} +func (m *BitbucketBasicAuth) XXX_Size() int { + return m.Size() +} +func (m *BitbucketBasicAuth) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketBasicAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketBasicAuth proto.InternalMessageInfo + +func (m *BitbucketEventSource) Reset() { *m = BitbucketEventSource{} } +func (*BitbucketEventSource) ProtoMessage() {} +func (*BitbucketEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{18} +} +func (m *BitbucketEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketEventSource.Merge(m, src) +} +func (m *BitbucketEventSource) XXX_Size() int { + return m.Size() +} +func (m *BitbucketEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketEventSource proto.InternalMessageInfo + +func (m *BitbucketRepository) Reset() { *m = BitbucketRepository{} } +func (*BitbucketRepository) ProtoMessage() {} +func (*BitbucketRepository) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{19} +} +func (m *BitbucketRepository) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketRepository) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketRepository) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketRepository.Merge(m, src) +} +func (m *BitbucketRepository) XXX_Size() int { + return m.Size() +} +func (m *BitbucketRepository) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketRepository.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketRepository proto.InternalMessageInfo + +func (m *BitbucketServerEventSource) Reset() { *m = BitbucketServerEventSource{} } +func (*BitbucketServerEventSource) ProtoMessage() {} +func (*BitbucketServerEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{20} +} +func (m *BitbucketServerEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketServerEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketServerEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketServerEventSource.Merge(m, src) +} +func (m *BitbucketServerEventSource) XXX_Size() int { + return m.Size() +} +func (m *BitbucketServerEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketServerEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketServerEventSource proto.InternalMessageInfo + +func (m *BitbucketServerRepository) Reset() { *m = BitbucketServerRepository{} } +func (*BitbucketServerRepository) ProtoMessage() {} +func (*BitbucketServerRepository) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{21} +} +func (m *BitbucketServerRepository) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BitbucketServerRepository) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BitbucketServerRepository) XXX_Merge(src proto.Message) { + xxx_messageInfo_BitbucketServerRepository.Merge(m, src) +} +func (m *BitbucketServerRepository) XXX_Size() int { + return m.Size() +} +func (m *BitbucketServerRepository) XXX_DiscardUnknown() { + xxx_messageInfo_BitbucketServerRepository.DiscardUnknown(m) +} + +var xxx_messageInfo_BitbucketServerRepository proto.InternalMessageInfo + +func (m *BusConfig) Reset() { *m = BusConfig{} } +func (*BusConfig) ProtoMessage() {} +func (*BusConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{22} +} +func (m *BusConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BusConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *BusConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_BusConfig.Merge(m, src) +} +func (m *BusConfig) XXX_Size() int { + return m.Size() +} +func (m *BusConfig) XXX_DiscardUnknown() { + xxx_messageInfo_BusConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_BusConfig proto.InternalMessageInfo + +func (m *CalendarEventSource) Reset() { *m = CalendarEventSource{} } +func (*CalendarEventSource) ProtoMessage() {} +func (*CalendarEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{23} +} +func (m *CalendarEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CalendarEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CalendarEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_CalendarEventSource.Merge(m, src) +} +func (m *CalendarEventSource) XXX_Size() int { + return m.Size() +} +func (m *CalendarEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_CalendarEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_CalendarEventSource proto.InternalMessageInfo + +func (m *CatchupConfiguration) Reset() { *m = CatchupConfiguration{} } +func (*CatchupConfiguration) ProtoMessage() {} +func (*CatchupConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{24} +} +func (m *CatchupConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CatchupConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CatchupConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_CatchupConfiguration.Merge(m, src) +} +func (m *CatchupConfiguration) XXX_Size() int { + return m.Size() +} +func (m *CatchupConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_CatchupConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_CatchupConfiguration proto.InternalMessageInfo + +func (m *Condition) Reset() { *m = Condition{} } +func (*Condition) ProtoMessage() {} +func (*Condition) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{25} +} +func (m *Condition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Condition) XXX_Merge(src proto.Message) { + xxx_messageInfo_Condition.Merge(m, src) +} +func (m *Condition) XXX_Size() int { + return m.Size() +} +func (m *Condition) XXX_DiscardUnknown() { + xxx_messageInfo_Condition.DiscardUnknown(m) +} + +var xxx_messageInfo_Condition proto.InternalMessageInfo + +func (m *ConditionsResetByTime) Reset() { *m = ConditionsResetByTime{} } +func (*ConditionsResetByTime) ProtoMessage() {} +func (*ConditionsResetByTime) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{26} +} +func (m *ConditionsResetByTime) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConditionsResetByTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConditionsResetByTime) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConditionsResetByTime.Merge(m, src) +} +func (m *ConditionsResetByTime) XXX_Size() int { + return m.Size() +} +func (m *ConditionsResetByTime) XXX_DiscardUnknown() { + xxx_messageInfo_ConditionsResetByTime.DiscardUnknown(m) +} + +var xxx_messageInfo_ConditionsResetByTime proto.InternalMessageInfo + +func (m *ConditionsResetCriteria) Reset() { *m = ConditionsResetCriteria{} } +func (*ConditionsResetCriteria) ProtoMessage() {} +func (*ConditionsResetCriteria) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{27} +} +func (m *ConditionsResetCriteria) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConditionsResetCriteria) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConditionsResetCriteria) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConditionsResetCriteria.Merge(m, src) +} +func (m *ConditionsResetCriteria) XXX_Size() int { + return m.Size() +} +func (m *ConditionsResetCriteria) XXX_DiscardUnknown() { + xxx_messageInfo_ConditionsResetCriteria.DiscardUnknown(m) +} + +var xxx_messageInfo_ConditionsResetCriteria proto.InternalMessageInfo + +func (m *ConfigMapPersistence) Reset() { *m = ConfigMapPersistence{} } +func (*ConfigMapPersistence) ProtoMessage() {} +func (*ConfigMapPersistence) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{28} +} +func (m *ConfigMapPersistence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigMapPersistence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConfigMapPersistence) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigMapPersistence.Merge(m, src) +} +func (m *ConfigMapPersistence) XXX_Size() int { + return m.Size() +} +func (m *ConfigMapPersistence) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigMapPersistence.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigMapPersistence proto.InternalMessageInfo + +func (m *ContainerTemplate) Reset() { *m = ContainerTemplate{} } +func (*ContainerTemplate) ProtoMessage() {} +func (*ContainerTemplate) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{29} +} +func (m *ContainerTemplate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContainerTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ContainerTemplate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContainerTemplate.Merge(m, src) +} +func (m *ContainerTemplate) XXX_Size() int { + return m.Size() +} +func (m *ContainerTemplate) XXX_DiscardUnknown() { + xxx_messageInfo_ContainerTemplate.DiscardUnknown(m) +} + +var xxx_messageInfo_ContainerTemplate proto.InternalMessageInfo + +func (m *CustomTrigger) Reset() { *m = CustomTrigger{} } +func (*CustomTrigger) ProtoMessage() {} +func (*CustomTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{30} +} +func (m *CustomTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CustomTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CustomTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_CustomTrigger.Merge(m, src) +} +func (m *CustomTrigger) XXX_Size() int { + return m.Size() +} +func (m *CustomTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_CustomTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_CustomTrigger proto.InternalMessageInfo + +func (m *DataFilter) Reset() { *m = DataFilter{} } +func (*DataFilter) ProtoMessage() {} +func (*DataFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{31} +} +func (m *DataFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DataFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DataFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_DataFilter.Merge(m, src) +} +func (m *DataFilter) XXX_Size() int { + return m.Size() +} +func (m *DataFilter) XXX_DiscardUnknown() { + xxx_messageInfo_DataFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_DataFilter proto.InternalMessageInfo + +func (m *EmailTrigger) Reset() { *m = EmailTrigger{} } +func (*EmailTrigger) ProtoMessage() {} +func (*EmailTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{32} +} +func (m *EmailTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmailTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EmailTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmailTrigger.Merge(m, src) +} +func (m *EmailTrigger) XXX_Size() int { + return m.Size() +} +func (m *EmailTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_EmailTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_EmailTrigger proto.InternalMessageInfo + +func (m *EmitterEventSource) Reset() { *m = EmitterEventSource{} } +func (*EmitterEventSource) ProtoMessage() {} +func (*EmitterEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{33} +} +func (m *EmitterEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmitterEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EmitterEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmitterEventSource.Merge(m, src) +} +func (m *EmitterEventSource) XXX_Size() int { + return m.Size() +} +func (m *EmitterEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_EmitterEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_EmitterEventSource proto.InternalMessageInfo + +func (m *Event) Reset() { *m = Event{} } +func (*Event) ProtoMessage() {} +func (*Event) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{34} +} +func (m *Event) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Event) XXX_Merge(src proto.Message) { + xxx_messageInfo_Event.Merge(m, src) +} +func (m *Event) XXX_Size() int { + return m.Size() +} +func (m *Event) XXX_DiscardUnknown() { + xxx_messageInfo_Event.DiscardUnknown(m) +} + +var xxx_messageInfo_Event proto.InternalMessageInfo + +func (m *EventBus) Reset() { *m = EventBus{} } +func (*EventBus) ProtoMessage() {} +func (*EventBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{35} +} +func (m *EventBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBus.Merge(m, src) +} +func (m *EventBus) XXX_Size() int { + return m.Size() +} +func (m *EventBus) XXX_DiscardUnknown() { + xxx_messageInfo_EventBus.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBus proto.InternalMessageInfo + +func (m *EventBusList) Reset() { *m = EventBusList{} } +func (*EventBusList) ProtoMessage() {} +func (*EventBusList) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{36} +} +func (m *EventBusList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBusList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBusList) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBusList.Merge(m, src) +} +func (m *EventBusList) XXX_Size() int { + return m.Size() +} +func (m *EventBusList) XXX_DiscardUnknown() { + xxx_messageInfo_EventBusList.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBusList proto.InternalMessageInfo + +func (m *EventBusSpec) Reset() { *m = EventBusSpec{} } +func (*EventBusSpec) ProtoMessage() {} +func (*EventBusSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{37} +} +func (m *EventBusSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBusSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBusSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBusSpec.Merge(m, src) +} +func (m *EventBusSpec) XXX_Size() int { + return m.Size() +} +func (m *EventBusSpec) XXX_DiscardUnknown() { + xxx_messageInfo_EventBusSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBusSpec proto.InternalMessageInfo + +func (m *EventBusStatus) Reset() { *m = EventBusStatus{} } +func (*EventBusStatus) ProtoMessage() {} +func (*EventBusStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{38} +} +func (m *EventBusStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBusStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventBusStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBusStatus.Merge(m, src) +} +func (m *EventBusStatus) XXX_Size() int { + return m.Size() +} +func (m *EventBusStatus) XXX_DiscardUnknown() { + xxx_messageInfo_EventBusStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBusStatus proto.InternalMessageInfo + +func (m *EventContext) Reset() { *m = EventContext{} } +func (*EventContext) ProtoMessage() {} +func (*EventContext) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{39} +} +func (m *EventContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventContext.Merge(m, src) +} +func (m *EventContext) XXX_Size() int { + return m.Size() +} +func (m *EventContext) XXX_DiscardUnknown() { + xxx_messageInfo_EventContext.DiscardUnknown(m) +} + +var xxx_messageInfo_EventContext proto.InternalMessageInfo + +func (m *EventDependency) Reset() { *m = EventDependency{} } +func (*EventDependency) ProtoMessage() {} +func (*EventDependency) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{40} +} +func (m *EventDependency) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDependency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventDependency) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDependency.Merge(m, src) +} +func (m *EventDependency) XXX_Size() int { + return m.Size() +} +func (m *EventDependency) XXX_DiscardUnknown() { + xxx_messageInfo_EventDependency.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDependency proto.InternalMessageInfo + +func (m *EventDependencyFilter) Reset() { *m = EventDependencyFilter{} } +func (*EventDependencyFilter) ProtoMessage() {} +func (*EventDependencyFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{41} +} +func (m *EventDependencyFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDependencyFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventDependencyFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDependencyFilter.Merge(m, src) +} +func (m *EventDependencyFilter) XXX_Size() int { + return m.Size() +} +func (m *EventDependencyFilter) XXX_DiscardUnknown() { + xxx_messageInfo_EventDependencyFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDependencyFilter proto.InternalMessageInfo + +func (m *EventDependencyTransformer) Reset() { *m = EventDependencyTransformer{} } +func (*EventDependencyTransformer) ProtoMessage() {} +func (*EventDependencyTransformer) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{42} +} +func (m *EventDependencyTransformer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDependencyTransformer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventDependencyTransformer) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDependencyTransformer.Merge(m, src) +} +func (m *EventDependencyTransformer) XXX_Size() int { + return m.Size() +} +func (m *EventDependencyTransformer) XXX_DiscardUnknown() { + xxx_messageInfo_EventDependencyTransformer.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDependencyTransformer proto.InternalMessageInfo + +func (m *EventPersistence) Reset() { *m = EventPersistence{} } +func (*EventPersistence) ProtoMessage() {} +func (*EventPersistence) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{43} +} +func (m *EventPersistence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventPersistence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventPersistence) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventPersistence.Merge(m, src) +} +func (m *EventPersistence) XXX_Size() int { + return m.Size() +} +func (m *EventPersistence) XXX_DiscardUnknown() { + xxx_messageInfo_EventPersistence.DiscardUnknown(m) +} + +var xxx_messageInfo_EventPersistence proto.InternalMessageInfo + +func (m *EventSource) Reset() { *m = EventSource{} } +func (*EventSource) ProtoMessage() {} +func (*EventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{44} +} +func (m *EventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSource.Merge(m, src) +} +func (m *EventSource) XXX_Size() int { + return m.Size() +} +func (m *EventSource) XXX_DiscardUnknown() { + xxx_messageInfo_EventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSource proto.InternalMessageInfo + +func (m *EventSourceFilter) Reset() { *m = EventSourceFilter{} } +func (*EventSourceFilter) ProtoMessage() {} +func (*EventSourceFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{45} +} +func (m *EventSourceFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceFilter.Merge(m, src) +} +func (m *EventSourceFilter) XXX_Size() int { + return m.Size() +} +func (m *EventSourceFilter) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceFilter proto.InternalMessageInfo + +func (m *EventSourceList) Reset() { *m = EventSourceList{} } +func (*EventSourceList) ProtoMessage() {} +func (*EventSourceList) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{46} +} +func (m *EventSourceList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceList) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceList.Merge(m, src) +} +func (m *EventSourceList) XXX_Size() int { + return m.Size() +} +func (m *EventSourceList) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceList.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceList proto.InternalMessageInfo + +func (m *EventSourceSpec) Reset() { *m = EventSourceSpec{} } +func (*EventSourceSpec) ProtoMessage() {} +func (*EventSourceSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{47} +} +func (m *EventSourceSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceSpec.Merge(m, src) +} +func (m *EventSourceSpec) XXX_Size() int { + return m.Size() +} +func (m *EventSourceSpec) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceSpec proto.InternalMessageInfo + +func (m *EventSourceStatus) Reset() { *m = EventSourceStatus{} } +func (*EventSourceStatus) ProtoMessage() {} +func (*EventSourceStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{48} +} +func (m *EventSourceStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSourceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventSourceStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSourceStatus.Merge(m, src) +} +func (m *EventSourceStatus) XXX_Size() int { + return m.Size() +} +func (m *EventSourceStatus) XXX_DiscardUnknown() { + xxx_messageInfo_EventSourceStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSourceStatus proto.InternalMessageInfo + +func (m *ExprFilter) Reset() { *m = ExprFilter{} } +func (*ExprFilter) ProtoMessage() {} +func (*ExprFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{49} +} +func (m *ExprFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExprFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ExprFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExprFilter.Merge(m, src) +} +func (m *ExprFilter) XXX_Size() int { + return m.Size() +} +func (m *ExprFilter) XXX_DiscardUnknown() { + xxx_messageInfo_ExprFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_ExprFilter proto.InternalMessageInfo + +func (m *FileArtifact) Reset() { *m = FileArtifact{} } +func (*FileArtifact) ProtoMessage() {} +func (*FileArtifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{50} +} +func (m *FileArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileArtifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FileArtifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileArtifact.Merge(m, src) +} +func (m *FileArtifact) XXX_Size() int { + return m.Size() +} +func (m *FileArtifact) XXX_DiscardUnknown() { + xxx_messageInfo_FileArtifact.DiscardUnknown(m) +} + +var xxx_messageInfo_FileArtifact proto.InternalMessageInfo + +func (m *FileEventSource) Reset() { *m = FileEventSource{} } +func (*FileEventSource) ProtoMessage() {} +func (*FileEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{51} +} +func (m *FileEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FileEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileEventSource.Merge(m, src) +} +func (m *FileEventSource) XXX_Size() int { + return m.Size() +} +func (m *FileEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_FileEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_FileEventSource proto.InternalMessageInfo + +func (m *GenericEventSource) Reset() { *m = GenericEventSource{} } +func (*GenericEventSource) ProtoMessage() {} +func (*GenericEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{52} +} +func (m *GenericEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenericEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GenericEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenericEventSource.Merge(m, src) +} +func (m *GenericEventSource) XXX_Size() int { + return m.Size() +} +func (m *GenericEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GenericEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GenericEventSource proto.InternalMessageInfo + +func (m *GerritEventSource) Reset() { *m = GerritEventSource{} } +func (*GerritEventSource) ProtoMessage() {} +func (*GerritEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{53} +} +func (m *GerritEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GerritEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GerritEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GerritEventSource.Merge(m, src) +} +func (m *GerritEventSource) XXX_Size() int { + return m.Size() +} +func (m *GerritEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GerritEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GerritEventSource proto.InternalMessageInfo + +func (m *GitArtifact) Reset() { *m = GitArtifact{} } +func (*GitArtifact) ProtoMessage() {} +func (*GitArtifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{54} +} +func (m *GitArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitArtifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitArtifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitArtifact.Merge(m, src) +} +func (m *GitArtifact) XXX_Size() int { + return m.Size() +} +func (m *GitArtifact) XXX_DiscardUnknown() { + xxx_messageInfo_GitArtifact.DiscardUnknown(m) +} + +var xxx_messageInfo_GitArtifact proto.InternalMessageInfo + +func (m *GitCreds) Reset() { *m = GitCreds{} } +func (*GitCreds) ProtoMessage() {} +func (*GitCreds) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{55} +} +func (m *GitCreds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitCreds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitCreds) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitCreds.Merge(m, src) +} +func (m *GitCreds) XXX_Size() int { + return m.Size() +} +func (m *GitCreds) XXX_DiscardUnknown() { + xxx_messageInfo_GitCreds.DiscardUnknown(m) +} + +var xxx_messageInfo_GitCreds proto.InternalMessageInfo + +func (m *GitRemoteConfig) Reset() { *m = GitRemoteConfig{} } +func (*GitRemoteConfig) ProtoMessage() {} +func (*GitRemoteConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{56} +} +func (m *GitRemoteConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitRemoteConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitRemoteConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitRemoteConfig.Merge(m, src) +} +func (m *GitRemoteConfig) XXX_Size() int { + return m.Size() +} +func (m *GitRemoteConfig) XXX_DiscardUnknown() { + xxx_messageInfo_GitRemoteConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_GitRemoteConfig proto.InternalMessageInfo + +func (m *GithubAppCreds) Reset() { *m = GithubAppCreds{} } +func (*GithubAppCreds) ProtoMessage() {} +func (*GithubAppCreds) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{57} +} +func (m *GithubAppCreds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GithubAppCreds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GithubAppCreds) XXX_Merge(src proto.Message) { + xxx_messageInfo_GithubAppCreds.Merge(m, src) +} +func (m *GithubAppCreds) XXX_Size() int { + return m.Size() +} +func (m *GithubAppCreds) XXX_DiscardUnknown() { + xxx_messageInfo_GithubAppCreds.DiscardUnknown(m) +} + +var xxx_messageInfo_GithubAppCreds proto.InternalMessageInfo + +func (m *GithubEventSource) Reset() { *m = GithubEventSource{} } +func (*GithubEventSource) ProtoMessage() {} +func (*GithubEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{58} +} +func (m *GithubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GithubEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GithubEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GithubEventSource.Merge(m, src) +} +func (m *GithubEventSource) XXX_Size() int { + return m.Size() +} +func (m *GithubEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GithubEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GithubEventSource proto.InternalMessageInfo + +func (m *GitlabEventSource) Reset() { *m = GitlabEventSource{} } +func (*GitlabEventSource) ProtoMessage() {} +func (*GitlabEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{59} +} +func (m *GitlabEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GitlabEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GitlabEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_GitlabEventSource.Merge(m, src) +} +func (m *GitlabEventSource) XXX_Size() int { + return m.Size() +} +func (m *GitlabEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_GitlabEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_GitlabEventSource proto.InternalMessageInfo + +func (m *HDFSEventSource) Reset() { *m = HDFSEventSource{} } +func (*HDFSEventSource) ProtoMessage() {} +func (*HDFSEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{60} +} +func (m *HDFSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HDFSEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HDFSEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_HDFSEventSource.Merge(m, src) +} +func (m *HDFSEventSource) XXX_Size() int { + return m.Size() +} +func (m *HDFSEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_HDFSEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_HDFSEventSource proto.InternalMessageInfo + +func (m *HTTPTrigger) Reset() { *m = HTTPTrigger{} } +func (*HTTPTrigger) ProtoMessage() {} +func (*HTTPTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{61} +} +func (m *HTTPTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HTTPTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPTrigger.Merge(m, src) +} +func (m *HTTPTrigger) XXX_Size() int { + return m.Size() +} +func (m *HTTPTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPTrigger proto.InternalMessageInfo + +func (m *Int64OrString) Reset() { *m = Int64OrString{} } +func (*Int64OrString) ProtoMessage() {} +func (*Int64OrString) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{62} +} +func (m *Int64OrString) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Int64OrString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Int64OrString) XXX_Merge(src proto.Message) { + xxx_messageInfo_Int64OrString.Merge(m, src) +} +func (m *Int64OrString) XXX_Size() int { + return m.Size() +} +func (m *Int64OrString) XXX_DiscardUnknown() { + xxx_messageInfo_Int64OrString.DiscardUnknown(m) +} + +var xxx_messageInfo_Int64OrString proto.InternalMessageInfo + +func (m *JetStreamBus) Reset() { *m = JetStreamBus{} } +func (*JetStreamBus) ProtoMessage() {} +func (*JetStreamBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{63} +} +func (m *JetStreamBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JetStreamBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *JetStreamBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_JetStreamBus.Merge(m, src) +} +func (m *JetStreamBus) XXX_Size() int { + return m.Size() +} +func (m *JetStreamBus) XXX_DiscardUnknown() { + xxx_messageInfo_JetStreamBus.DiscardUnknown(m) +} + +var xxx_messageInfo_JetStreamBus proto.InternalMessageInfo + +func (m *JetStreamConfig) Reset() { *m = JetStreamConfig{} } +func (*JetStreamConfig) ProtoMessage() {} +func (*JetStreamConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{64} +} +func (m *JetStreamConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *JetStreamConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *JetStreamConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_JetStreamConfig.Merge(m, src) +} +func (m *JetStreamConfig) XXX_Size() int { + return m.Size() +} +func (m *JetStreamConfig) XXX_DiscardUnknown() { + xxx_messageInfo_JetStreamConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_JetStreamConfig proto.InternalMessageInfo + +func (m *K8SResource) Reset() { *m = K8SResource{} } +func (*K8SResource) ProtoMessage() {} +func (*K8SResource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{65} +} +func (m *K8SResource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *K8SResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *K8SResource) XXX_Merge(src proto.Message) { + xxx_messageInfo_K8SResource.Merge(m, src) +} +func (m *K8SResource) XXX_Size() int { + return m.Size() +} +func (m *K8SResource) XXX_DiscardUnknown() { + xxx_messageInfo_K8SResource.DiscardUnknown(m) +} + +var xxx_messageInfo_K8SResource proto.InternalMessageInfo + +func (m *K8SResourcePolicy) Reset() { *m = K8SResourcePolicy{} } +func (*K8SResourcePolicy) ProtoMessage() {} +func (*K8SResourcePolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{66} +} +func (m *K8SResourcePolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *K8SResourcePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *K8SResourcePolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_K8SResourcePolicy.Merge(m, src) +} +func (m *K8SResourcePolicy) XXX_Size() int { + return m.Size() +} +func (m *K8SResourcePolicy) XXX_DiscardUnknown() { + xxx_messageInfo_K8SResourcePolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_K8SResourcePolicy proto.InternalMessageInfo + +func (m *KafkaBus) Reset() { *m = KafkaBus{} } +func (*KafkaBus) ProtoMessage() {} +func (*KafkaBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{67} +} +func (m *KafkaBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaBus.Merge(m, src) +} +func (m *KafkaBus) XXX_Size() int { + return m.Size() +} +func (m *KafkaBus) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaBus.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaBus proto.InternalMessageInfo + +func (m *KafkaConsumerGroup) Reset() { *m = KafkaConsumerGroup{} } +func (*KafkaConsumerGroup) ProtoMessage() {} +func (*KafkaConsumerGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{68} +} +func (m *KafkaConsumerGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaConsumerGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaConsumerGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaConsumerGroup.Merge(m, src) +} +func (m *KafkaConsumerGroup) XXX_Size() int { + return m.Size() +} +func (m *KafkaConsumerGroup) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaConsumerGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaConsumerGroup proto.InternalMessageInfo + +func (m *KafkaEventSource) Reset() { *m = KafkaEventSource{} } +func (*KafkaEventSource) ProtoMessage() {} +func (*KafkaEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{69} +} +func (m *KafkaEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaEventSource.Merge(m, src) +} +func (m *KafkaEventSource) XXX_Size() int { + return m.Size() +} +func (m *KafkaEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaEventSource proto.InternalMessageInfo + +func (m *KafkaTrigger) Reset() { *m = KafkaTrigger{} } +func (*KafkaTrigger) ProtoMessage() {} +func (*KafkaTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{70} +} +func (m *KafkaTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KafkaTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KafkaTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaTrigger.Merge(m, src) +} +func (m *KafkaTrigger) XXX_Size() int { + return m.Size() +} +func (m *KafkaTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaTrigger proto.InternalMessageInfo + +func (m *LogTrigger) Reset() { *m = LogTrigger{} } +func (*LogTrigger) ProtoMessage() {} +func (*LogTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{71} +} +func (m *LogTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LogTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LogTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogTrigger.Merge(m, src) +} +func (m *LogTrigger) XXX_Size() int { + return m.Size() +} +func (m *LogTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_LogTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_LogTrigger proto.InternalMessageInfo + +func (m *MQTTEventSource) Reset() { *m = MQTTEventSource{} } +func (*MQTTEventSource) ProtoMessage() {} +func (*MQTTEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{72} +} +func (m *MQTTEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MQTTEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MQTTEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_MQTTEventSource.Merge(m, src) +} +func (m *MQTTEventSource) XXX_Size() int { + return m.Size() +} +func (m *MQTTEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_MQTTEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_MQTTEventSource proto.InternalMessageInfo + +func (m *Metadata) Reset() { *m = Metadata{} } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{73} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *NATSAuth) Reset() { *m = NATSAuth{} } +func (*NATSAuth) ProtoMessage() {} +func (*NATSAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{74} +} +func (m *NATSAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSAuth.Merge(m, src) +} +func (m *NATSAuth) XXX_Size() int { + return m.Size() +} +func (m *NATSAuth) XXX_DiscardUnknown() { + xxx_messageInfo_NATSAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSAuth proto.InternalMessageInfo + +func (m *NATSBus) Reset() { *m = NATSBus{} } +func (*NATSBus) ProtoMessage() {} +func (*NATSBus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{75} +} +func (m *NATSBus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSBus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSBus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSBus.Merge(m, src) +} +func (m *NATSBus) XXX_Size() int { + return m.Size() +} +func (m *NATSBus) XXX_DiscardUnknown() { + xxx_messageInfo_NATSBus.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSBus proto.InternalMessageInfo + +func (m *NATSConfig) Reset() { *m = NATSConfig{} } +func (*NATSConfig) ProtoMessage() {} +func (*NATSConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{76} +} +func (m *NATSConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSConfig.Merge(m, src) +} +func (m *NATSConfig) XXX_Size() int { + return m.Size() +} +func (m *NATSConfig) XXX_DiscardUnknown() { + xxx_messageInfo_NATSConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSConfig proto.InternalMessageInfo + +func (m *NATSEventsSource) Reset() { *m = NATSEventsSource{} } +func (*NATSEventsSource) ProtoMessage() {} +func (*NATSEventsSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{77} +} +func (m *NATSEventsSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSEventsSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSEventsSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSEventsSource.Merge(m, src) +} +func (m *NATSEventsSource) XXX_Size() int { + return m.Size() +} +func (m *NATSEventsSource) XXX_DiscardUnknown() { + xxx_messageInfo_NATSEventsSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSEventsSource proto.InternalMessageInfo + +func (m *NATSTrigger) Reset() { *m = NATSTrigger{} } +func (*NATSTrigger) ProtoMessage() {} +func (*NATSTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{78} +} +func (m *NATSTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NATSTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NATSTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_NATSTrigger.Merge(m, src) +} +func (m *NATSTrigger) XXX_Size() int { + return m.Size() +} +func (m *NATSTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_NATSTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_NATSTrigger proto.InternalMessageInfo + +func (m *NSQEventSource) Reset() { *m = NSQEventSource{} } +func (*NSQEventSource) ProtoMessage() {} +func (*NSQEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{79} +} +func (m *NSQEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NSQEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NSQEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NSQEventSource.Merge(m, src) +} +func (m *NSQEventSource) XXX_Size() int { + return m.Size() +} +func (m *NSQEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_NSQEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NSQEventSource proto.InternalMessageInfo + +func (m *NativeStrategy) Reset() { *m = NativeStrategy{} } +func (*NativeStrategy) ProtoMessage() {} +func (*NativeStrategy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{80} +} +func (m *NativeStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NativeStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NativeStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_NativeStrategy.Merge(m, src) +} +func (m *NativeStrategy) XXX_Size() int { + return m.Size() +} +func (m *NativeStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_NativeStrategy.DiscardUnknown(m) +} + +var xxx_messageInfo_NativeStrategy proto.InternalMessageInfo + +func (m *OpenWhiskTrigger) Reset() { *m = OpenWhiskTrigger{} } +func (*OpenWhiskTrigger) ProtoMessage() {} +func (*OpenWhiskTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{81} +} +func (m *OpenWhiskTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OpenWhiskTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OpenWhiskTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_OpenWhiskTrigger.Merge(m, src) +} +func (m *OpenWhiskTrigger) XXX_Size() int { + return m.Size() +} +func (m *OpenWhiskTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_OpenWhiskTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_OpenWhiskTrigger proto.InternalMessageInfo + +func (m *OwnedRepositories) Reset() { *m = OwnedRepositories{} } +func (*OwnedRepositories) ProtoMessage() {} +func (*OwnedRepositories) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{82} +} +func (m *OwnedRepositories) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OwnedRepositories) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OwnedRepositories) XXX_Merge(src proto.Message) { + xxx_messageInfo_OwnedRepositories.Merge(m, src) +} +func (m *OwnedRepositories) XXX_Size() int { + return m.Size() +} +func (m *OwnedRepositories) XXX_DiscardUnknown() { + xxx_messageInfo_OwnedRepositories.DiscardUnknown(m) +} + +var xxx_messageInfo_OwnedRepositories proto.InternalMessageInfo + +func (m *PayloadField) Reset() { *m = PayloadField{} } +func (*PayloadField) ProtoMessage() {} +func (*PayloadField) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{83} +} +func (m *PayloadField) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PayloadField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PayloadField) XXX_Merge(src proto.Message) { + xxx_messageInfo_PayloadField.Merge(m, src) +} +func (m *PayloadField) XXX_Size() int { + return m.Size() +} +func (m *PayloadField) XXX_DiscardUnknown() { + xxx_messageInfo_PayloadField.DiscardUnknown(m) +} + +var xxx_messageInfo_PayloadField proto.InternalMessageInfo + +func (m *PersistenceStrategy) Reset() { *m = PersistenceStrategy{} } +func (*PersistenceStrategy) ProtoMessage() {} +func (*PersistenceStrategy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{84} +} +func (m *PersistenceStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PersistenceStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PersistenceStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_PersistenceStrategy.Merge(m, src) +} +func (m *PersistenceStrategy) XXX_Size() int { + return m.Size() +} +func (m *PersistenceStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_PersistenceStrategy.DiscardUnknown(m) +} + +var xxx_messageInfo_PersistenceStrategy proto.InternalMessageInfo + +func (m *PubSubEventSource) Reset() { *m = PubSubEventSource{} } +func (*PubSubEventSource) ProtoMessage() {} +func (*PubSubEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{85} +} +func (m *PubSubEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubSubEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PubSubEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubSubEventSource.Merge(m, src) +} +func (m *PubSubEventSource) XXX_Size() int { + return m.Size() +} +func (m *PubSubEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_PubSubEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PubSubEventSource proto.InternalMessageInfo + +func (m *PulsarEventSource) Reset() { *m = PulsarEventSource{} } +func (*PulsarEventSource) ProtoMessage() {} +func (*PulsarEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{86} +} +func (m *PulsarEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PulsarEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PulsarEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PulsarEventSource.Merge(m, src) +} +func (m *PulsarEventSource) XXX_Size() int { + return m.Size() +} +func (m *PulsarEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_PulsarEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PulsarEventSource proto.InternalMessageInfo + +func (m *PulsarTrigger) Reset() { *m = PulsarTrigger{} } +func (*PulsarTrigger) ProtoMessage() {} +func (*PulsarTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{87} +} +func (m *PulsarTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PulsarTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PulsarTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_PulsarTrigger.Merge(m, src) +} +func (m *PulsarTrigger) XXX_Size() int { + return m.Size() +} +func (m *PulsarTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_PulsarTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_PulsarTrigger proto.InternalMessageInfo + +func (m *RateLimit) Reset() { *m = RateLimit{} } +func (*RateLimit) ProtoMessage() {} +func (*RateLimit) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{88} +} +func (m *RateLimit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RateLimit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit.Merge(m, src) +} +func (m *RateLimit) XXX_Size() int { + return m.Size() +} +func (m *RateLimit) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit.DiscardUnknown(m) +} + +var xxx_messageInfo_RateLimit proto.InternalMessageInfo + +func (m *RedisEventSource) Reset() { *m = RedisEventSource{} } +func (*RedisEventSource) ProtoMessage() {} +func (*RedisEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{89} +} +func (m *RedisEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RedisEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RedisEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedisEventSource.Merge(m, src) +} +func (m *RedisEventSource) XXX_Size() int { + return m.Size() +} +func (m *RedisEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_RedisEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_RedisEventSource proto.InternalMessageInfo + +func (m *RedisStreamEventSource) Reset() { *m = RedisStreamEventSource{} } +func (*RedisStreamEventSource) ProtoMessage() {} +func (*RedisStreamEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{90} +} +func (m *RedisStreamEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RedisStreamEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RedisStreamEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedisStreamEventSource.Merge(m, src) +} +func (m *RedisStreamEventSource) XXX_Size() int { + return m.Size() +} +func (m *RedisStreamEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_RedisStreamEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_RedisStreamEventSource proto.InternalMessageInfo + +func (m *ResourceEventSource) Reset() { *m = ResourceEventSource{} } +func (*ResourceEventSource) ProtoMessage() {} +func (*ResourceEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{91} +} +func (m *ResourceEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ResourceEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceEventSource.Merge(m, src) +} +func (m *ResourceEventSource) XXX_Size() int { + return m.Size() +} +func (m *ResourceEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceEventSource proto.InternalMessageInfo + +func (m *ResourceFilter) Reset() { *m = ResourceFilter{} } +func (*ResourceFilter) ProtoMessage() {} +func (*ResourceFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{92} +} +func (m *ResourceFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ResourceFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceFilter.Merge(m, src) +} +func (m *ResourceFilter) XXX_Size() int { + return m.Size() +} +func (m *ResourceFilter) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceFilter proto.InternalMessageInfo + +func (m *S3Artifact) Reset() { *m = S3Artifact{} } +func (*S3Artifact) ProtoMessage() {} +func (*S3Artifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{93} +} +func (m *S3Artifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *S3Artifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *S3Artifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_S3Artifact.Merge(m, src) +} +func (m *S3Artifact) XXX_Size() int { + return m.Size() +} +func (m *S3Artifact) XXX_DiscardUnknown() { + xxx_messageInfo_S3Artifact.DiscardUnknown(m) +} + +var xxx_messageInfo_S3Artifact proto.InternalMessageInfo + +func (m *S3Bucket) Reset() { *m = S3Bucket{} } +func (*S3Bucket) ProtoMessage() {} +func (*S3Bucket) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{94} +} +func (m *S3Bucket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *S3Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *S3Bucket) XXX_Merge(src proto.Message) { + xxx_messageInfo_S3Bucket.Merge(m, src) +} +func (m *S3Bucket) XXX_Size() int { + return m.Size() +} +func (m *S3Bucket) XXX_DiscardUnknown() { + xxx_messageInfo_S3Bucket.DiscardUnknown(m) +} + +var xxx_messageInfo_S3Bucket proto.InternalMessageInfo + +func (m *S3Filter) Reset() { *m = S3Filter{} } +func (*S3Filter) ProtoMessage() {} +func (*S3Filter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{95} +} +func (m *S3Filter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *S3Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *S3Filter) XXX_Merge(src proto.Message) { + xxx_messageInfo_S3Filter.Merge(m, src) +} +func (m *S3Filter) XXX_Size() int { + return m.Size() +} +func (m *S3Filter) XXX_DiscardUnknown() { + xxx_messageInfo_S3Filter.DiscardUnknown(m) +} + +var xxx_messageInfo_S3Filter proto.InternalMessageInfo + +func (m *SASLConfig) Reset() { *m = SASLConfig{} } +func (*SASLConfig) ProtoMessage() {} +func (*SASLConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{96} +} +func (m *SASLConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SASLConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SASLConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_SASLConfig.Merge(m, src) +} +func (m *SASLConfig) XXX_Size() int { + return m.Size() +} +func (m *SASLConfig) XXX_DiscardUnknown() { + xxx_messageInfo_SASLConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_SASLConfig proto.InternalMessageInfo + +func (m *SFTPEventSource) Reset() { *m = SFTPEventSource{} } +func (*SFTPEventSource) ProtoMessage() {} +func (*SFTPEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{97} +} +func (m *SFTPEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SFTPEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SFTPEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SFTPEventSource.Merge(m, src) +} +func (m *SFTPEventSource) XXX_Size() int { + return m.Size() +} +func (m *SFTPEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SFTPEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SFTPEventSource proto.InternalMessageInfo + +func (m *SNSEventSource) Reset() { *m = SNSEventSource{} } +func (*SNSEventSource) ProtoMessage() {} +func (*SNSEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{98} +} +func (m *SNSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SNSEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SNSEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SNSEventSource.Merge(m, src) +} +func (m *SNSEventSource) XXX_Size() int { + return m.Size() +} +func (m *SNSEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SNSEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SNSEventSource proto.InternalMessageInfo + +func (m *SQSEventSource) Reset() { *m = SQSEventSource{} } +func (*SQSEventSource) ProtoMessage() {} +func (*SQSEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{99} +} +func (m *SQSEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SQSEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SQSEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SQSEventSource.Merge(m, src) +} +func (m *SQSEventSource) XXX_Size() int { + return m.Size() +} +func (m *SQSEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SQSEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SQSEventSource proto.InternalMessageInfo + +func (m *SchemaRegistryConfig) Reset() { *m = SchemaRegistryConfig{} } +func (*SchemaRegistryConfig) ProtoMessage() {} +func (*SchemaRegistryConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{100} +} +func (m *SchemaRegistryConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SchemaRegistryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SchemaRegistryConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_SchemaRegistryConfig.Merge(m, src) +} +func (m *SchemaRegistryConfig) XXX_Size() int { + return m.Size() +} +func (m *SchemaRegistryConfig) XXX_DiscardUnknown() { + xxx_messageInfo_SchemaRegistryConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_SchemaRegistryConfig proto.InternalMessageInfo + +func (m *SecureHeader) Reset() { *m = SecureHeader{} } +func (*SecureHeader) ProtoMessage() {} +func (*SecureHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{101} +} +func (m *SecureHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SecureHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SecureHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecureHeader.Merge(m, src) +} +func (m *SecureHeader) XXX_Size() int { + return m.Size() +} +func (m *SecureHeader) XXX_DiscardUnknown() { + xxx_messageInfo_SecureHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_SecureHeader proto.InternalMessageInfo + +func (m *Selector) Reset() { *m = Selector{} } +func (*Selector) ProtoMessage() {} +func (*Selector) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{102} +} +func (m *Selector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Selector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Selector) XXX_Merge(src proto.Message) { + xxx_messageInfo_Selector.Merge(m, src) +} +func (m *Selector) XXX_Size() int { + return m.Size() +} +func (m *Selector) XXX_DiscardUnknown() { + xxx_messageInfo_Selector.DiscardUnknown(m) +} + +var xxx_messageInfo_Selector proto.InternalMessageInfo + +func (m *Sensor) Reset() { *m = Sensor{} } +func (*Sensor) ProtoMessage() {} +func (*Sensor) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{103} +} +func (m *Sensor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sensor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Sensor) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sensor.Merge(m, src) +} +func (m *Sensor) XXX_Size() int { + return m.Size() +} +func (m *Sensor) XXX_DiscardUnknown() { + xxx_messageInfo_Sensor.DiscardUnknown(m) +} + +var xxx_messageInfo_Sensor proto.InternalMessageInfo + +func (m *SensorList) Reset() { *m = SensorList{} } +func (*SensorList) ProtoMessage() {} +func (*SensorList) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{104} +} +func (m *SensorList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SensorList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SensorList) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorList.Merge(m, src) +} +func (m *SensorList) XXX_Size() int { + return m.Size() +} +func (m *SensorList) XXX_DiscardUnknown() { + xxx_messageInfo_SensorList.DiscardUnknown(m) +} + +var xxx_messageInfo_SensorList proto.InternalMessageInfo + +func (m *SensorSpec) Reset() { *m = SensorSpec{} } +func (*SensorSpec) ProtoMessage() {} +func (*SensorSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{105} +} +func (m *SensorSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SensorSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SensorSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorSpec.Merge(m, src) +} +func (m *SensorSpec) XXX_Size() int { + return m.Size() +} +func (m *SensorSpec) XXX_DiscardUnknown() { + xxx_messageInfo_SensorSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_SensorSpec proto.InternalMessageInfo + +func (m *SensorStatus) Reset() { *m = SensorStatus{} } +func (*SensorStatus) ProtoMessage() {} +func (*SensorStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{106} +} +func (m *SensorStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SensorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SensorStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorStatus.Merge(m, src) +} +func (m *SensorStatus) XXX_Size() int { + return m.Size() +} +func (m *SensorStatus) XXX_DiscardUnknown() { + xxx_messageInfo_SensorStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_SensorStatus proto.InternalMessageInfo + +func (m *Service) Reset() { *m = Service{} } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{107} +} +func (m *Service) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_Service.Merge(m, src) +} +func (m *Service) XXX_Size() int { + return m.Size() +} +func (m *Service) XXX_DiscardUnknown() { + xxx_messageInfo_Service.DiscardUnknown(m) +} + +var xxx_messageInfo_Service proto.InternalMessageInfo + +func (m *SlackEventSource) Reset() { *m = SlackEventSource{} } +func (*SlackEventSource) ProtoMessage() {} +func (*SlackEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{108} +} +func (m *SlackEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackEventSource.Merge(m, src) +} +func (m *SlackEventSource) XXX_Size() int { + return m.Size() +} +func (m *SlackEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_SlackEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackEventSource proto.InternalMessageInfo + +func (m *SlackSender) Reset() { *m = SlackSender{} } +func (*SlackSender) ProtoMessage() {} +func (*SlackSender) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{109} +} +func (m *SlackSender) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackSender) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackSender) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackSender.Merge(m, src) +} +func (m *SlackSender) XXX_Size() int { + return m.Size() +} +func (m *SlackSender) XXX_DiscardUnknown() { + xxx_messageInfo_SlackSender.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackSender proto.InternalMessageInfo + +func (m *SlackThread) Reset() { *m = SlackThread{} } +func (*SlackThread) ProtoMessage() {} +func (*SlackThread) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{110} +} +func (m *SlackThread) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackThread) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackThread) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackThread.Merge(m, src) +} +func (m *SlackThread) XXX_Size() int { + return m.Size() +} +func (m *SlackThread) XXX_DiscardUnknown() { + xxx_messageInfo_SlackThread.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackThread proto.InternalMessageInfo + +func (m *SlackTrigger) Reset() { *m = SlackTrigger{} } +func (*SlackTrigger) ProtoMessage() {} +func (*SlackTrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{111} +} +func (m *SlackTrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlackTrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *SlackTrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlackTrigger.Merge(m, src) +} +func (m *SlackTrigger) XXX_Size() int { + return m.Size() +} +func (m *SlackTrigger) XXX_DiscardUnknown() { + xxx_messageInfo_SlackTrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_SlackTrigger proto.InternalMessageInfo + +func (m *StandardK8STrigger) Reset() { *m = StandardK8STrigger{} } +func (*StandardK8STrigger) ProtoMessage() {} +func (*StandardK8STrigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{112} +} +func (m *StandardK8STrigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StandardK8STrigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StandardK8STrigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_StandardK8STrigger.Merge(m, src) +} +func (m *StandardK8STrigger) XXX_Size() int { + return m.Size() +} +func (m *StandardK8STrigger) XXX_DiscardUnknown() { + xxx_messageInfo_StandardK8STrigger.DiscardUnknown(m) +} + +var xxx_messageInfo_StandardK8STrigger proto.InternalMessageInfo + +func (m *Status) Reset() { *m = Status{} } +func (*Status) ProtoMessage() {} +func (*Status) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{113} +} +func (m *Status) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Status) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status.Merge(m, src) +} +func (m *Status) XXX_Size() int { + return m.Size() +} +func (m *Status) XXX_DiscardUnknown() { + xxx_messageInfo_Status.DiscardUnknown(m) +} + +var xxx_messageInfo_Status proto.InternalMessageInfo + +func (m *StatusPolicy) Reset() { *m = StatusPolicy{} } +func (*StatusPolicy) ProtoMessage() {} +func (*StatusPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{114} +} +func (m *StatusPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StatusPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusPolicy.Merge(m, src) +} +func (m *StatusPolicy) XXX_Size() int { + return m.Size() +} +func (m *StatusPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_StatusPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusPolicy proto.InternalMessageInfo + +func (m *StorageGridEventSource) Reset() { *m = StorageGridEventSource{} } +func (*StorageGridEventSource) ProtoMessage() {} +func (*StorageGridEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{115} +} +func (m *StorageGridEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StorageGridEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StorageGridEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_StorageGridEventSource.Merge(m, src) +} +func (m *StorageGridEventSource) XXX_Size() int { + return m.Size() +} +func (m *StorageGridEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_StorageGridEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_StorageGridEventSource proto.InternalMessageInfo + +func (m *StorageGridFilter) Reset() { *m = StorageGridFilter{} } +func (*StorageGridFilter) ProtoMessage() {} +func (*StorageGridFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{116} +} +func (m *StorageGridFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StorageGridFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StorageGridFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_StorageGridFilter.Merge(m, src) +} +func (m *StorageGridFilter) XXX_Size() int { + return m.Size() +} +func (m *StorageGridFilter) XXX_DiscardUnknown() { + xxx_messageInfo_StorageGridFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_StorageGridFilter proto.InternalMessageInfo + +func (m *StripeEventSource) Reset() { *m = StripeEventSource{} } +func (*StripeEventSource) ProtoMessage() {} +func (*StripeEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{117} +} +func (m *StripeEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StripeEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *StripeEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_StripeEventSource.Merge(m, src) +} +func (m *StripeEventSource) XXX_Size() int { + return m.Size() +} +func (m *StripeEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_StripeEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_StripeEventSource proto.InternalMessageInfo + +func (m *TLSConfig) Reset() { *m = TLSConfig{} } +func (*TLSConfig) ProtoMessage() {} +func (*TLSConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{118} +} +func (m *TLSConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TLSConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TLSConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_TLSConfig.Merge(m, src) +} +func (m *TLSConfig) XXX_Size() int { + return m.Size() +} +func (m *TLSConfig) XXX_DiscardUnknown() { + xxx_messageInfo_TLSConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_TLSConfig proto.InternalMessageInfo + +func (m *Template) Reset() { *m = Template{} } +func (*Template) ProtoMessage() {} +func (*Template) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{119} +} +func (m *Template) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Template) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Template) XXX_Merge(src proto.Message) { + xxx_messageInfo_Template.Merge(m, src) +} +func (m *Template) XXX_Size() int { + return m.Size() +} +func (m *Template) XXX_DiscardUnknown() { + xxx_messageInfo_Template.DiscardUnknown(m) +} + +var xxx_messageInfo_Template proto.InternalMessageInfo + +func (m *TimeFilter) Reset() { *m = TimeFilter{} } +func (*TimeFilter) ProtoMessage() {} +func (*TimeFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{120} +} +func (m *TimeFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TimeFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TimeFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeFilter.Merge(m, src) +} +func (m *TimeFilter) XXX_Size() int { + return m.Size() +} +func (m *TimeFilter) XXX_DiscardUnknown() { + xxx_messageInfo_TimeFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeFilter proto.InternalMessageInfo + +func (m *Trigger) Reset() { *m = Trigger{} } +func (*Trigger) ProtoMessage() {} +func (*Trigger) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{121} +} +func (m *Trigger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Trigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Trigger) XXX_Merge(src proto.Message) { + xxx_messageInfo_Trigger.Merge(m, src) +} +func (m *Trigger) XXX_Size() int { + return m.Size() +} +func (m *Trigger) XXX_DiscardUnknown() { + xxx_messageInfo_Trigger.DiscardUnknown(m) +} + +var xxx_messageInfo_Trigger proto.InternalMessageInfo + +func (m *TriggerParameter) Reset() { *m = TriggerParameter{} } +func (*TriggerParameter) ProtoMessage() {} +func (*TriggerParameter) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{122} +} +func (m *TriggerParameter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerParameter) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerParameter.Merge(m, src) +} +func (m *TriggerParameter) XXX_Size() int { + return m.Size() +} +func (m *TriggerParameter) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerParameter.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerParameter proto.InternalMessageInfo + +func (m *TriggerParameterSource) Reset() { *m = TriggerParameterSource{} } +func (*TriggerParameterSource) ProtoMessage() {} +func (*TriggerParameterSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{123} +} +func (m *TriggerParameterSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerParameterSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerParameterSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerParameterSource.Merge(m, src) +} +func (m *TriggerParameterSource) XXX_Size() int { + return m.Size() +} +func (m *TriggerParameterSource) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerParameterSource.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerParameterSource proto.InternalMessageInfo + +func (m *TriggerPolicy) Reset() { *m = TriggerPolicy{} } +func (*TriggerPolicy) ProtoMessage() {} +func (*TriggerPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{124} +} +func (m *TriggerPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerPolicy.Merge(m, src) +} +func (m *TriggerPolicy) XXX_Size() int { + return m.Size() +} +func (m *TriggerPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerPolicy proto.InternalMessageInfo + +func (m *TriggerTemplate) Reset() { *m = TriggerTemplate{} } +func (*TriggerTemplate) ProtoMessage() {} +func (*TriggerTemplate) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{125} +} +func (m *TriggerTemplate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TriggerTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TriggerTemplate) XXX_Merge(src proto.Message) { + xxx_messageInfo_TriggerTemplate.Merge(m, src) +} +func (m *TriggerTemplate) XXX_Size() int { + return m.Size() +} +func (m *TriggerTemplate) XXX_DiscardUnknown() { + xxx_messageInfo_TriggerTemplate.DiscardUnknown(m) +} + +var xxx_messageInfo_TriggerTemplate proto.InternalMessageInfo + +func (m *URLArtifact) Reset() { *m = URLArtifact{} } +func (*URLArtifact) ProtoMessage() {} +func (*URLArtifact) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{126} +} +func (m *URLArtifact) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *URLArtifact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *URLArtifact) XXX_Merge(src proto.Message) { + xxx_messageInfo_URLArtifact.Merge(m, src) +} +func (m *URLArtifact) XXX_Size() int { + return m.Size() +} +func (m *URLArtifact) XXX_DiscardUnknown() { + xxx_messageInfo_URLArtifact.DiscardUnknown(m) +} + +var xxx_messageInfo_URLArtifact proto.InternalMessageInfo + +func (m *ValueFromSource) Reset() { *m = ValueFromSource{} } +func (*ValueFromSource) ProtoMessage() {} +func (*ValueFromSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{127} +} +func (m *ValueFromSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValueFromSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValueFromSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValueFromSource.Merge(m, src) +} +func (m *ValueFromSource) XXX_Size() int { + return m.Size() +} +func (m *ValueFromSource) XXX_DiscardUnknown() { + xxx_messageInfo_ValueFromSource.DiscardUnknown(m) +} + +var xxx_messageInfo_ValueFromSource proto.InternalMessageInfo + +func (m *WatchPathConfig) Reset() { *m = WatchPathConfig{} } +func (*WatchPathConfig) ProtoMessage() {} +func (*WatchPathConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{128} +} +func (m *WatchPathConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WatchPathConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WatchPathConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_WatchPathConfig.Merge(m, src) +} +func (m *WatchPathConfig) XXX_Size() int { + return m.Size() +} +func (m *WatchPathConfig) XXX_DiscardUnknown() { + xxx_messageInfo_WatchPathConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_WatchPathConfig proto.InternalMessageInfo + +func (m *WebhookContext) Reset() { *m = WebhookContext{} } +func (*WebhookContext) ProtoMessage() {} +func (*WebhookContext) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{129} +} +func (m *WebhookContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WebhookContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WebhookContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebhookContext.Merge(m, src) +} +func (m *WebhookContext) XXX_Size() int { + return m.Size() +} +func (m *WebhookContext) XXX_DiscardUnknown() { + xxx_messageInfo_WebhookContext.DiscardUnknown(m) +} + +var xxx_messageInfo_WebhookContext proto.InternalMessageInfo + +func (m *WebhookEventSource) Reset() { *m = WebhookEventSource{} } +func (*WebhookEventSource) ProtoMessage() {} +func (*WebhookEventSource) Descriptor() ([]byte, []int) { + return fileDescriptor_e864cc3344a263b9, []int{130} +} +func (m *WebhookEventSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WebhookEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WebhookEventSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebhookEventSource.Merge(m, src) +} +func (m *WebhookEventSource) XXX_Size() int { + return m.Size() +} +func (m *WebhookEventSource) XXX_DiscardUnknown() { + xxx_messageInfo_WebhookEventSource.DiscardUnknown(m) +} + +var xxx_messageInfo_WebhookEventSource proto.InternalMessageInfo + +func init() { + proto.RegisterType((*AMQPConsumeConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPConsumeConfig") + proto.RegisterType((*AMQPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPEventSource.MetadataEntry") + proto.RegisterType((*AMQPExchangeDeclareConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPExchangeDeclareConfig") + proto.RegisterType((*AMQPQueueBindConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPQueueBindConfig") + proto.RegisterType((*AMQPQueueDeclareConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AMQPQueueDeclareConfig") + proto.RegisterType((*AWSLambdaTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AWSLambdaTrigger") + proto.RegisterType((*Amount)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Amount") + proto.RegisterType((*ArgoWorkflowTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ArgoWorkflowTrigger") + proto.RegisterType((*ArtifactLocation)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ArtifactLocation") + proto.RegisterType((*AzureEventHubsTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureEventHubsTrigger") + proto.RegisterType((*AzureEventsHubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureEventsHubEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureEventsHubEventSource.MetadataEntry") + proto.RegisterType((*AzureQueueStorageEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureQueueStorageEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureQueueStorageEventSource.MetadataEntry") + proto.RegisterType((*AzureServiceBusEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureServiceBusEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureServiceBusEventSource.MetadataEntry") + proto.RegisterType((*AzureServiceBusTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.AzureServiceBusTrigger") + proto.RegisterType((*Backoff)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Backoff") + proto.RegisterType((*BasicAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BasicAuth") + proto.RegisterType((*BitbucketAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketAuth") + proto.RegisterType((*BitbucketBasicAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketBasicAuth") + proto.RegisterType((*BitbucketEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketEventSource.MetadataEntry") + proto.RegisterType((*BitbucketRepository)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketRepository") + proto.RegisterType((*BitbucketServerEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketServerEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketServerEventSource.MetadataEntry") + proto.RegisterType((*BitbucketServerRepository)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BitbucketServerRepository") + proto.RegisterType((*BusConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.BusConfig") + proto.RegisterType((*CalendarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CalendarEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CalendarEventSource.MetadataEntry") + proto.RegisterType((*CatchupConfiguration)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CatchupConfiguration") + proto.RegisterType((*Condition)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Condition") + proto.RegisterType((*ConditionsResetByTime)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConditionsResetByTime") + proto.RegisterType((*ConditionsResetCriteria)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConditionsResetCriteria") + proto.RegisterType((*ConfigMapPersistence)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ConfigMapPersistence") + proto.RegisterType((*ContainerTemplate)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ContainerTemplate") + proto.RegisterType((*CustomTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CustomTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.CustomTrigger.SpecEntry") + proto.RegisterType((*DataFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.DataFilter") + proto.RegisterType((*EmailTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EmailTrigger") + proto.RegisterType((*EmitterEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EmitterEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EmitterEventSource.MetadataEntry") + proto.RegisterType((*Event)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Event") + proto.RegisterType((*EventBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBus") + proto.RegisterType((*EventBusList)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBusList") + proto.RegisterType((*EventBusSpec)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBusSpec") + proto.RegisterType((*EventBusStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventBusStatus") + proto.RegisterType((*EventContext)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventContext") + proto.RegisterType((*EventDependency)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventDependency") + proto.RegisterType((*EventDependencyFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventDependencyFilter") + proto.RegisterType((*EventDependencyTransformer)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventDependencyTransformer") + proto.RegisterType((*EventPersistence)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventPersistence") + proto.RegisterType((*EventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSource") + proto.RegisterType((*EventSourceFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceFilter") + proto.RegisterType((*EventSourceList)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceList") + proto.RegisterType((*EventSourceSpec)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec") + proto.RegisterMapType((map[string]AMQPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AmqpEntry") + proto.RegisterMapType((map[string]AzureEventsHubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AzureEventsHubEntry") + proto.RegisterMapType((map[string]AzureQueueStorageEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AzureQueueStorageEntry") + proto.RegisterMapType((map[string]AzureServiceBusEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.AzureServiceBusEntry") + proto.RegisterMapType((map[string]BitbucketEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.BitbucketEntry") + proto.RegisterMapType((map[string]BitbucketServerEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.BitbucketserverEntry") + proto.RegisterMapType((map[string]CalendarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.CalendarEntry") + proto.RegisterMapType((map[string]EmitterEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.EmitterEntry") + proto.RegisterMapType((map[string]FileEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.FileEntry") + proto.RegisterMapType((map[string]GenericEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GenericEntry") + proto.RegisterMapType((map[string]GerritEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GerritEntry") + proto.RegisterMapType((map[string]GithubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GithubEntry") + proto.RegisterMapType((map[string]GitlabEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.GitlabEntry") + proto.RegisterMapType((map[string]HDFSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.HdfsEntry") + proto.RegisterMapType((map[string]KafkaEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.KafkaEntry") + proto.RegisterMapType((map[string]S3Artifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.MinioEntry") + proto.RegisterMapType((map[string]MQTTEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.MqttEntry") + proto.RegisterMapType((map[string]NATSEventsSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.NatsEntry") + proto.RegisterMapType((map[string]NSQEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.NsqEntry") + proto.RegisterMapType((map[string]PubSubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.PubSubEntry") + proto.RegisterMapType((map[string]PulsarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.PulsarEntry") + proto.RegisterMapType((map[string]RedisEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.RedisEntry") + proto.RegisterMapType((map[string]RedisStreamEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.RedisStreamEntry") + proto.RegisterMapType((map[string]ResourceEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.ResourceEntry") + proto.RegisterMapType((map[string]SFTPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SftpEntry") + proto.RegisterMapType((map[string]SlackEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SlackEntry") + proto.RegisterMapType((map[string]SNSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SnsEntry") + proto.RegisterMapType((map[string]SQSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.SqsEntry") + proto.RegisterMapType((map[string]StorageGridEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.StorageGridEntry") + proto.RegisterMapType((map[string]StripeEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.StripeEntry") + proto.RegisterMapType((map[string]WebhookEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceSpec.WebhookEntry") + proto.RegisterType((*EventSourceStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.EventSourceStatus") + proto.RegisterType((*ExprFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ExprFilter") + proto.RegisterType((*FileArtifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.FileArtifact") + proto.RegisterType((*FileEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.FileEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.FileEventSource.MetadataEntry") + proto.RegisterType((*GenericEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GenericEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GenericEventSource.MetadataEntry") + proto.RegisterType((*GerritEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GerritEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GerritEventSource.MetadataEntry") + proto.RegisterType((*GitArtifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitArtifact") + proto.RegisterType((*GitCreds)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitCreds") + proto.RegisterType((*GitRemoteConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitRemoteConfig") + proto.RegisterType((*GithubAppCreds)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GithubAppCreds") + proto.RegisterType((*GithubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GithubEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GithubEventSource.MetadataEntry") + proto.RegisterType((*GitlabEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitlabEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.GitlabEventSource.MetadataEntry") + proto.RegisterType((*HDFSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HDFSEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HDFSEventSource.MetadataEntry") + proto.RegisterType((*HTTPTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HTTPTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.HTTPTrigger.HeadersEntry") + proto.RegisterType((*Int64OrString)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Int64OrString") + proto.RegisterType((*JetStreamBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.JetStreamBus") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.JetStreamBus.NodeSelectorEntry") + proto.RegisterType((*JetStreamConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.JetStreamConfig") + proto.RegisterType((*K8SResource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.K8SResource") + proto.RegisterType((*K8SResourcePolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.K8SResourcePolicy") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.K8SResourcePolicy.LabelsEntry") + proto.RegisterType((*KafkaBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaBus") + proto.RegisterType((*KafkaConsumerGroup)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaConsumerGroup") + proto.RegisterType((*KafkaEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaEventSource.MetadataEntry") + proto.RegisterType((*KafkaTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.KafkaTrigger.HeadersEntry") + proto.RegisterType((*LogTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.LogTrigger") + proto.RegisterType((*MQTTEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.MQTTEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.MQTTEventSource.MetadataEntry") + proto.RegisterType((*Metadata)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Metadata") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Metadata.AnnotationsEntry") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Metadata.LabelsEntry") + proto.RegisterType((*NATSAuth)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSAuth") + proto.RegisterType((*NATSBus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSBus") + proto.RegisterType((*NATSConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSConfig") + proto.RegisterType((*NATSEventsSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSEventsSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSEventsSource.MetadataEntry") + proto.RegisterType((*NATSTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NATSTrigger") + proto.RegisterType((*NSQEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NSQEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NSQEventSource.MetadataEntry") + proto.RegisterType((*NativeStrategy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NativeStrategy") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.NativeStrategy.NodeSelectorEntry") + proto.RegisterType((*OpenWhiskTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.OpenWhiskTrigger") + proto.RegisterType((*OwnedRepositories)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.OwnedRepositories") + proto.RegisterType((*PayloadField)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PayloadField") + proto.RegisterType((*PersistenceStrategy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PersistenceStrategy") + proto.RegisterType((*PubSubEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PubSubEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PubSubEventSource.MetadataEntry") + proto.RegisterType((*PulsarEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarEventSource.AuthAthenzParamsEntry") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarEventSource.MetadataEntry") + proto.RegisterType((*PulsarTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarTrigger") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.PulsarTrigger.AuthAthenzParamsEntry") + proto.RegisterType((*RateLimit)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RateLimit") + proto.RegisterType((*RedisEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisEventSource.MetadataEntry") + proto.RegisterType((*RedisStreamEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisStreamEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.RedisStreamEventSource.MetadataEntry") + proto.RegisterType((*ResourceEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ResourceEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ResourceEventSource.MetadataEntry") + proto.RegisterType((*ResourceFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ResourceFilter") + proto.RegisterType((*S3Artifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Artifact") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Artifact.MetadataEntry") + proto.RegisterType((*S3Bucket)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Bucket") + proto.RegisterType((*S3Filter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.S3Filter") + proto.RegisterType((*SASLConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SASLConfig") + proto.RegisterType((*SFTPEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SFTPEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SFTPEventSource.MetadataEntry") + proto.RegisterType((*SNSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SNSEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SNSEventSource.MetadataEntry") + proto.RegisterType((*SQSEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SQSEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SQSEventSource.MetadataEntry") + proto.RegisterType((*SchemaRegistryConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SchemaRegistryConfig") + proto.RegisterType((*SecureHeader)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SecureHeader") + proto.RegisterType((*Selector)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Selector") + proto.RegisterType((*Sensor)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Sensor") + proto.RegisterType((*SensorList)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorList") + proto.RegisterType((*SensorSpec)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorSpec") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorSpec.LoggingFieldsEntry") + proto.RegisterType((*SensorStatus)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SensorStatus") + proto.RegisterType((*Service)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Service") + proto.RegisterType((*SlackEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackEventSource.MetadataEntry") + proto.RegisterType((*SlackSender)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackSender") + proto.RegisterType((*SlackThread)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackThread") + proto.RegisterType((*SlackTrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.SlackTrigger") + proto.RegisterType((*StandardK8STrigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StandardK8STrigger") + proto.RegisterType((*Status)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Status") + proto.RegisterType((*StatusPolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StatusPolicy") + proto.RegisterType((*StorageGridEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StorageGridEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StorageGridEventSource.MetadataEntry") + proto.RegisterType((*StorageGridFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StorageGridFilter") + proto.RegisterType((*StripeEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StripeEventSource") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.StripeEventSource.MetadataEntry") + proto.RegisterType((*TLSConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TLSConfig") + proto.RegisterType((*Template)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Template") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Template.NodeSelectorEntry") + proto.RegisterType((*TimeFilter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TimeFilter") + proto.RegisterType((*Trigger)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.Trigger") + proto.RegisterType((*TriggerParameter)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerParameter") + proto.RegisterType((*TriggerParameterSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerParameterSource") + proto.RegisterType((*TriggerPolicy)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerPolicy") + proto.RegisterType((*TriggerTemplate)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.TriggerTemplate") + proto.RegisterType((*URLArtifact)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.URLArtifact") + proto.RegisterType((*ValueFromSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.ValueFromSource") + proto.RegisterType((*WatchPathConfig)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WatchPathConfig") + proto.RegisterType((*WebhookContext)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WebhookContext") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WebhookContext.MetadataEntry") + proto.RegisterType((*WebhookEventSource)(nil), "github.com.argoproj.argo_events.pkg.apis.events.v1alpha1.WebhookEventSource") +} + +func init() { + proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/events/v1alpha1/generated.proto", fileDescriptor_e864cc3344a263b9) +} + +var fileDescriptor_e864cc3344a263b9 = []byte{ + // 12967 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x6c, 0x24, 0xd9, + 0x75, 0x18, 0xbc, 0xfd, 0x24, 0xfb, 0xf0, 0x35, 0x73, 0xe7, 0xb1, 0xbd, 0xe3, 0xdd, 0xe1, 0xb8, + 0x17, 0xda, 0x6f, 0xd7, 0x5e, 0x91, 0xd2, 0x4a, 0xb2, 0xc7, 0xab, 0xcf, 0x6b, 0x35, 0x5f, 0x33, + 0xdc, 0x21, 0x39, 0x9c, 0xd3, 0x9c, 0x19, 0xbd, 0xbc, 0xda, 0x62, 0xf7, 0x65, 0xb3, 0x96, 0xdd, + 0x55, 0x3d, 0x55, 0xd5, 0x9c, 0xe1, 0x06, 0x92, 0xd7, 0x96, 0xb4, 0x96, 0x64, 0x45, 0x92, 0x05, + 0xc1, 0x50, 0x02, 0xc7, 0x88, 0x61, 0x24, 0xb6, 0x93, 0x18, 0x08, 0x62, 0xc0, 0xf9, 0x1b, 0x24, + 0x48, 0x22, 0x04, 0x0e, 0x60, 0x03, 0x76, 0x6c, 0x24, 0xc1, 0x20, 0x1a, 0x39, 0x09, 0x10, 0xc0, + 0x79, 0xfc, 0x4a, 0x32, 0xf9, 0x13, 0xdc, 0x67, 0xdd, 0xaa, 0xae, 0x26, 0xd9, 0xac, 0x6e, 0xce, + 0x0e, 0xe2, 0x5f, 0x64, 0xdf, 0x73, 0xee, 0x39, 0xb7, 0xee, 0xe3, 0xdc, 0x73, 0xcf, 0x3d, 0xe7, + 0x5c, 0xb8, 0xde, 0xb4, 0x83, 0xdd, 0xee, 0xf6, 0x5c, 0xdd, 0x6d, 0xcf, 0x5b, 0x5e, 0xd3, 0xed, + 0x78, 0xee, 0x3b, 0xfc, 0x9f, 0x0f, 0xd3, 0x7d, 0xea, 0x04, 0xfe, 0x7c, 0x67, 0xaf, 0x39, 0x6f, + 0x75, 0x6c, 0x7f, 0x5e, 0xfe, 0xde, 0xff, 0xa8, 0xd5, 0xea, 0xec, 0x5a, 0x1f, 0x9d, 0x6f, 0x52, + 0x87, 0x7a, 0x56, 0x40, 0x1b, 0x73, 0x1d, 0xcf, 0x0d, 0x5c, 0x72, 0x35, 0xa4, 0x34, 0xa7, 0x28, + 0xf1, 0x7f, 0xbe, 0x20, 0x6a, 0xce, 0x75, 0xf6, 0x9a, 0x73, 0x8c, 0xd2, 0x9c, 0xfc, 0xad, 0x28, + 0x5d, 0xfa, 0xb0, 0xd1, 0x86, 0xa6, 0xdb, 0x74, 0xe7, 0x39, 0xc1, 0xed, 0xee, 0x0e, 0xff, 0xc5, + 0x7f, 0xf0, 0xff, 0x04, 0xa3, 0x4b, 0x95, 0xbd, 0xab, 0xfe, 0x9c, 0xed, 0xb2, 0x56, 0xcd, 0xd7, + 0x5d, 0x8f, 0xce, 0xef, 0xf7, 0x34, 0xe6, 0xd2, 0xc7, 0x43, 0x9c, 0xb6, 0x55, 0xdf, 0xb5, 0x1d, + 0xea, 0x1d, 0xa8, 0x4f, 0x99, 0xf7, 0xa8, 0xef, 0x76, 0xbd, 0x3a, 0x1d, 0xa8, 0x96, 0x3f, 0xdf, + 0xa6, 0x81, 0x95, 0xc4, 0x6b, 0xbe, 0x5f, 0x2d, 0xaf, 0xeb, 0x04, 0x76, 0xbb, 0x97, 0xcd, 0x4f, + 0x1d, 0x55, 0xc1, 0xaf, 0xef, 0xd2, 0xb6, 0x15, 0xaf, 0x57, 0xf9, 0xdf, 0x19, 0x38, 0x5b, 0x5d, + 0xbf, 0xb5, 0xb9, 0xe8, 0x3a, 0x7e, 0xb7, 0x4d, 0x17, 0x5d, 0x67, 0xc7, 0x6e, 0x92, 0x4f, 0xc0, + 0x44, 0x5d, 0x14, 0x78, 0x5b, 0x56, 0xb3, 0x9c, 0xb9, 0x92, 0x79, 0xb9, 0xb4, 0x70, 0xee, 0x07, + 0x0f, 0x67, 0x9f, 0x79, 0xf4, 0x70, 0x76, 0x62, 0x31, 0x04, 0xa1, 0x89, 0x47, 0x5e, 0x81, 0x31, + 0xab, 0x1b, 0xb8, 0xd5, 0xfa, 0x5e, 0x39, 0x7b, 0x25, 0xf3, 0xf2, 0xf8, 0xc2, 0x8c, 0xac, 0x32, + 0x56, 0x15, 0xc5, 0xa8, 0xe0, 0x64, 0x1e, 0x4a, 0xf4, 0x41, 0xbd, 0xd5, 0xf5, 0xed, 0x7d, 0x5a, + 0xce, 0x71, 0xe4, 0xb3, 0x12, 0xb9, 0xb4, 0xac, 0x00, 0x18, 0xe2, 0x30, 0xda, 0x8e, 0xbb, 0xe6, + 0xd6, 0xad, 0x56, 0x39, 0x1f, 0xa5, 0xbd, 0x21, 0x8a, 0x51, 0xc1, 0xc9, 0x4b, 0x50, 0x74, 0xdc, + 0xbb, 0x96, 0x1d, 0x94, 0x0b, 0x1c, 0x73, 0x5a, 0x62, 0x16, 0x37, 0x78, 0x29, 0x4a, 0x68, 0xe5, + 0xbf, 0x4c, 0xc0, 0x0c, 0xfb, 0xf6, 0x65, 0x36, 0x77, 0x6a, 0x7c, 0xf8, 0xc8, 0x0b, 0x90, 0xeb, + 0x7a, 0x2d, 0xf9, 0xc5, 0x13, 0xb2, 0x62, 0xee, 0x36, 0xae, 0x21, 0x2b, 0x27, 0x57, 0x61, 0x92, + 0x3e, 0xa8, 0xef, 0x5a, 0x4e, 0x93, 0x6e, 0x58, 0x6d, 0xca, 0x3f, 0xb3, 0xb4, 0x70, 0x5e, 0xe2, + 0x4d, 0x2e, 0x1b, 0x30, 0x8c, 0x60, 0x9a, 0x35, 0xb7, 0x0e, 0x3a, 0xe2, 0x9b, 0x13, 0x6a, 0x32, + 0x18, 0x46, 0x30, 0xc9, 0x6b, 0x00, 0x9e, 0xdb, 0x0d, 0x6c, 0xa7, 0x79, 0x83, 0x1e, 0xf0, 0x8f, + 0x2f, 0x2d, 0x10, 0x59, 0x0f, 0x50, 0x43, 0xd0, 0xc0, 0x22, 0xef, 0x67, 0xe0, 0x6c, 0xdd, 0x75, + 0x1c, 0x5a, 0x0f, 0x6c, 0xd7, 0x59, 0xb0, 0xea, 0x7b, 0xee, 0xce, 0x0e, 0xef, 0x8e, 0x89, 0xd7, + 0xaa, 0x73, 0x27, 0x5d, 0x55, 0x73, 0x92, 0xd0, 0xc2, 0x85, 0x47, 0x0f, 0x67, 0xcf, 0x2e, 0xc6, + 0xe9, 0x63, 0x2f, 0x4b, 0xf2, 0x2a, 0x8c, 0xbf, 0xe3, 0xbb, 0xce, 0x82, 0xdb, 0x38, 0x28, 0x17, + 0xf9, 0x68, 0x9c, 0x91, 0x4d, 0x1f, 0x7f, 0xb3, 0x76, 0x73, 0x83, 0x95, 0xa3, 0xc6, 0x20, 0x6f, + 0x41, 0x2e, 0x68, 0xf9, 0xe5, 0x31, 0xde, 0xce, 0xc5, 0x93, 0xb7, 0x73, 0x6b, 0xad, 0x26, 0x66, + 0xf2, 0xc2, 0x18, 0x1b, 0xbe, 0xad, 0xb5, 0x1a, 0x32, 0xc2, 0xe4, 0xab, 0x19, 0x18, 0x67, 0x4b, + 0xae, 0x61, 0x05, 0x56, 0x79, 0xfc, 0x4a, 0xee, 0xe5, 0x89, 0xd7, 0xee, 0x9e, 0x9c, 0x4b, 0x6c, + 0xee, 0xcc, 0xad, 0x4b, 0xca, 0xcb, 0x4e, 0xe0, 0x1d, 0x84, 0xdf, 0xa9, 0x8a, 0x51, 0xb3, 0x26, + 0xdf, 0xcd, 0xc0, 0x8c, 0x1a, 0xe3, 0x25, 0x5a, 0x6f, 0x59, 0x1e, 0x2d, 0x97, 0xf8, 0x47, 0xd7, + 0x52, 0x36, 0x27, 0x4a, 0x54, 0x76, 0xc2, 0xb9, 0x47, 0x0f, 0x67, 0x67, 0x62, 0x20, 0x8c, 0x37, + 0x80, 0xcd, 0x99, 0xc9, 0x7b, 0x5d, 0xda, 0xd5, 0x2d, 0x02, 0xde, 0xa2, 0xcd, 0x74, 0x2d, 0xba, + 0x65, 0x50, 0x94, 0xcd, 0x39, 0xc3, 0x26, 0xbc, 0x59, 0x8e, 0x11, 0xbe, 0xe4, 0x5d, 0x28, 0xf1, + 0xdf, 0x0b, 0xb6, 0xd3, 0x28, 0x4f, 0xf0, 0x46, 0xac, 0x0f, 0xa1, 0x11, 0x8c, 0x9c, 0x6c, 0xc1, + 0x14, 0x13, 0x33, 0xba, 0x10, 0x43, 0x76, 0xc4, 0x83, 0x31, 0x29, 0xd1, 0xca, 0x93, 0x9c, 0xf3, + 0x8d, 0x74, 0x9c, 0x23, 0x72, 0x75, 0x61, 0x82, 0xc9, 0x2b, 0x59, 0x84, 0x8a, 0x11, 0xb1, 0x20, + 0x6f, 0x75, 0x83, 0xdd, 0xf2, 0x54, 0xda, 0x69, 0xbf, 0x60, 0xf9, 0x76, 0xbd, 0xda, 0x0d, 0x76, + 0x17, 0xc6, 0x1f, 0x3d, 0x9c, 0xcd, 0xb3, 0xff, 0x90, 0x93, 0x26, 0x08, 0xa5, 0xae, 0xd7, 0xaa, + 0xd1, 0xba, 0x47, 0x83, 0xf2, 0x34, 0xe7, 0xf3, 0xa1, 0x39, 0xb1, 0x65, 0x30, 0x52, 0x73, 0x6c, + 0xcf, 0x9b, 0xdb, 0xff, 0xe8, 0x9c, 0xc0, 0xb8, 0x41, 0x0f, 0x6a, 0xb4, 0x45, 0xeb, 0x81, 0xeb, + 0x89, 0xae, 0xba, 0x8d, 0x6b, 0x02, 0x82, 0x21, 0x19, 0xe2, 0x42, 0x71, 0xc7, 0x6e, 0x05, 0xd4, + 0x2b, 0xcf, 0xa4, 0xed, 0x29, 0x63, 0x15, 0xad, 0x70, 0x92, 0x0b, 0xc0, 0xe4, 0xb5, 0xf8, 0x1f, + 0x25, 0x9b, 0x4b, 0x9f, 0x84, 0xa9, 0xc8, 0x12, 0x23, 0x67, 0x20, 0xb7, 0x47, 0x0f, 0x84, 0xb0, + 0x46, 0xf6, 0x2f, 0x39, 0x0f, 0x85, 0x7d, 0xab, 0xd5, 0x95, 0x82, 0x19, 0xc5, 0x8f, 0xd7, 0xb3, + 0x57, 0x33, 0x95, 0x3f, 0xca, 0xc0, 0x73, 0x7d, 0x57, 0x08, 0xdb, 0x5d, 0x1a, 0x5d, 0xcf, 0xda, + 0x6e, 0x51, 0x4e, 0xcd, 0xd8, 0x5d, 0x96, 0x44, 0x31, 0x2a, 0x38, 0x13, 0xc7, 0x6c, 0x13, 0x5b, + 0xa2, 0x2d, 0x1a, 0x50, 0xb9, 0xcf, 0x69, 0x71, 0x5c, 0xd5, 0x10, 0x34, 0xb0, 0x98, 0x14, 0xb4, + 0x9d, 0x80, 0x7a, 0x8e, 0xd5, 0x92, 0x9b, 0x9d, 0x96, 0x0e, 0xab, 0xb2, 0x1c, 0x35, 0x86, 0xb1, + 0x7f, 0xe5, 0x0f, 0xdd, 0xbf, 0x7e, 0x16, 0xce, 0x25, 0x4c, 0x6e, 0xa3, 0x7a, 0xe6, 0xd0, 0xea, + 0xbf, 0x95, 0x85, 0x8b, 0xc9, 0x2b, 0x94, 0x5c, 0x81, 0xbc, 0xc3, 0xb6, 0x37, 0xb1, 0x0d, 0x4e, + 0x4a, 0x02, 0x79, 0xbe, 0xad, 0x71, 0x88, 0xd9, 0x61, 0xd9, 0x81, 0x3a, 0x2c, 0x77, 0xac, 0x0e, + 0x8b, 0xa8, 0x07, 0xf9, 0x63, 0xa8, 0x07, 0xc7, 0xdc, 0xf3, 0x19, 0x61, 0xcb, 0x6b, 0x76, 0xdb, + 0x6c, 0xfe, 0xf1, 0x0d, 0xa9, 0x14, 0x12, 0xae, 0x2a, 0x00, 0x86, 0x38, 0x95, 0xc7, 0x79, 0x38, + 0x53, 0xbd, 0x5b, 0x5b, 0xb3, 0xda, 0xdb, 0x0d, 0x6b, 0xcb, 0xb3, 0x9b, 0x4d, 0xea, 0xb1, 0xcd, + 0x7c, 0xa7, 0xeb, 0xf0, 0x8d, 0x6e, 0x23, 0xec, 0x27, 0xbd, 0x99, 0xaf, 0x18, 0x30, 0x8c, 0x60, + 0xb2, 0x85, 0x68, 0xd5, 0xeb, 0xd4, 0xf7, 0xd9, 0x5e, 0x9e, 0x1d, 0x78, 0x21, 0x56, 0x55, 0x5d, + 0x0c, 0xc9, 0x30, 0x9a, 0xbe, 0x42, 0xe7, 0xfd, 0x3b, 0x18, 0x4d, 0x5d, 0x8c, 0x21, 0x19, 0xd6, + 0x9f, 0x1e, 0x6d, 0xda, 0xae, 0x23, 0x15, 0x0e, 0xdd, 0x9f, 0xc8, 0x4b, 0x51, 0x42, 0x49, 0x17, + 0xc6, 0x3a, 0xd6, 0x41, 0xcb, 0xb5, 0x1a, 0xe5, 0x02, 0xdf, 0x4f, 0xdf, 0x4c, 0xb1, 0x6b, 0x8b, + 0xde, 0xdd, 0xb4, 0x3c, 0xab, 0x4d, 0x99, 0x10, 0xd0, 0x73, 0x6a, 0x53, 0xb0, 0x40, 0xc5, 0x8b, + 0x7c, 0x09, 0xa0, 0xa3, 0xd0, 0xd8, 0x38, 0x0e, 0x9b, 0xb3, 0x9e, 0x9f, 0xba, 0xc8, 0x47, 0x83, + 0x23, 0x79, 0x1d, 0xa6, 0x6d, 0x67, 0xdf, 0xad, 0x5b, 0x6c, 0x60, 0xb9, 0x3e, 0x37, 0x26, 0xf4, + 0xb2, 0x47, 0x0f, 0x67, 0xa7, 0x57, 0x23, 0x10, 0x8c, 0x61, 0xb2, 0xa5, 0xe3, 0xb9, 0x2d, 0x5a, + 0xc5, 0x8d, 0xf2, 0x38, 0xaf, 0xa4, 0x3f, 0x13, 0x45, 0x31, 0x2a, 0x78, 0xe5, 0x15, 0x28, 0x56, + 0xdb, 0x6e, 0xd7, 0x09, 0xc8, 0xac, 0x12, 0x6c, 0x6c, 0xaa, 0x4d, 0x2e, 0x94, 0x1e, 0x3d, 0x9c, + 0x2d, 0xdc, 0x61, 0x05, 0x52, 0xc6, 0x55, 0xfe, 0x32, 0x0b, 0xe7, 0xaa, 0x5e, 0xd3, 0xbd, 0xeb, + 0x7a, 0x7b, 0x3b, 0x2d, 0xf7, 0xbe, 0x9a, 0xaa, 0x0e, 0x14, 0xc5, 0xc9, 0x84, 0xd7, 0x4c, 0xd5, + 0x4b, 0x55, 0x2f, 0xb0, 0x77, 0xac, 0x7a, 0xb0, 0x26, 0xbf, 0x46, 0x08, 0x69, 0x21, 0xb6, 0x51, + 0x72, 0x21, 0xd7, 0xa1, 0xe4, 0x76, 0xd8, 0x11, 0x83, 0xcd, 0x1d, 0xa1, 0x1e, 0xff, 0x84, 0x5a, + 0x60, 0x37, 0x15, 0xe0, 0xf1, 0xc3, 0xd9, 0x0b, 0x66, 0x63, 0x35, 0x00, 0xc3, 0xca, 0xb1, 0x31, + 0xce, 0x9d, 0xfa, 0x18, 0x3f, 0x0f, 0x79, 0xcb, 0x6b, 0xfa, 0xe5, 0xfc, 0x95, 0xdc, 0xcb, 0x25, + 0xb9, 0xa3, 0x7a, 0x4d, 0x1f, 0x79, 0x69, 0xe5, 0xfd, 0x02, 0x9c, 0x89, 0x77, 0x08, 0xf9, 0x3c, + 0x64, 0xfd, 0x8f, 0xc9, 0x8e, 0x5e, 0x3a, 0x79, 0x53, 0x6b, 0x1f, 0x53, 0x94, 0x17, 0x8a, 0x8f, + 0x1e, 0xce, 0x66, 0x6b, 0x1f, 0xc3, 0xac, 0xff, 0x31, 0x52, 0x81, 0xa2, 0xed, 0xb4, 0x6c, 0x47, + 0x1d, 0x3b, 0x78, 0xf7, 0xaf, 0xf2, 0x12, 0x94, 0x10, 0xd2, 0x80, 0xfc, 0x8e, 0xdd, 0xa2, 0x52, + 0x0c, 0xac, 0x9c, 0xbc, 0x0d, 0x2b, 0x76, 0x8b, 0xea, 0x56, 0xf0, 0x8f, 0x67, 0x25, 0xc8, 0xa9, + 0x93, 0xb7, 0xc5, 0x29, 0x29, 0xcf, 0x99, 0x2c, 0x9f, 0x9c, 0xc9, 0x6d, 0x5c, 0xd3, 0x3c, 0xc6, + 0x22, 0x07, 0xad, 0xdb, 0x50, 0xaa, 0xf3, 0xbd, 0xa8, 0x6d, 0x75, 0xe4, 0xb9, 0xe5, 0xe5, 0x24, + 0x99, 0x26, 0x36, 0xac, 0x75, 0xab, 0xd3, 0x23, 0xd6, 0x16, 0x55, 0x75, 0x0c, 0x29, 0xb1, 0x86, + 0x37, 0xed, 0x80, 0x0b, 0xfe, 0x54, 0x0d, 0xbf, 0x66, 0x07, 0xd1, 0x86, 0x5f, 0xb3, 0x03, 0x64, + 0xa4, 0x89, 0x0b, 0xe3, 0xca, 0x16, 0x20, 0xcf, 0x31, 0x29, 0xd8, 0xdc, 0xb8, 0x5a, 0x43, 0x49, + 0x6c, 0x61, 0x92, 0x69, 0x0b, 0xea, 0x17, 0x6a, 0x26, 0x95, 0xdf, 0xcf, 0xc3, 0x85, 0xea, 0xbb, + 0x5d, 0x8f, 0x72, 0x25, 0xea, 0x7a, 0x77, 0xdb, 0x57, 0x4b, 0xff, 0x0a, 0xe4, 0x77, 0xee, 0x35, + 0x9c, 0xf8, 0x2e, 0xbe, 0x72, 0x6b, 0x69, 0x03, 0x39, 0x84, 0x89, 0xa2, 0xdd, 0xee, 0xb6, 0x71, + 0x92, 0xd5, 0xa2, 0xe8, 0xba, 0x28, 0x46, 0x05, 0x27, 0x1d, 0x38, 0xe7, 0xef, 0x5a, 0x1e, 0x6d, + 0xe8, 0x2d, 0x88, 0x57, 0x1b, 0x68, 0xbb, 0x79, 0xf6, 0xd1, 0xc3, 0xd9, 0x73, 0xb5, 0x5e, 0x2a, + 0x98, 0x44, 0x9a, 0x34, 0x60, 0x26, 0x56, 0x2c, 0x27, 0xdc, 0x31, 0xb9, 0xf1, 0x53, 0x4f, 0x8c, + 0x1b, 0xc6, 0x49, 0xfe, 0x3f, 0xba, 0x81, 0x55, 0xde, 0x2b, 0xc0, 0x73, 0xe1, 0xac, 0xf1, 0xaf, + 0x77, 0xb7, 0x4d, 0x2b, 0xc8, 0xd1, 0x33, 0xa7, 0xcf, 0x74, 0xc8, 0x9e, 0xea, 0x74, 0xc8, 0x0d, + 0x7f, 0x3a, 0x18, 0x2b, 0x22, 0x7f, 0xc4, 0x8a, 0xf8, 0xb6, 0x69, 0x4c, 0x10, 0x73, 0xc7, 0x4a, + 0xb1, 0xb9, 0xf6, 0x1b, 0x8c, 0x01, 0xcc, 0x0a, 0xe1, 0x89, 0xac, 0xf8, 0x14, 0x9c, 0xc8, 0x7e, + 0xad, 0x08, 0xcf, 0xf3, 0xaf, 0xe6, 0x07, 0x90, 0x5a, 0xe0, 0x7a, 0x56, 0x93, 0x9a, 0xb3, 0xf0, + 0x4d, 0x20, 0xbe, 0x28, 0xad, 0xd6, 0xeb, 0x4c, 0x0b, 0x32, 0x74, 0xed, 0x4b, 0xb2, 0x1b, 0x48, + 0xad, 0x07, 0x03, 0x13, 0x6a, 0x91, 0x26, 0x9c, 0x09, 0x8d, 0x53, 0xb5, 0xc0, 0xb3, 0x9d, 0xe6, + 0x60, 0x93, 0xf5, 0xfc, 0xa3, 0x87, 0xb3, 0x67, 0x16, 0x63, 0x24, 0xb0, 0x87, 0x28, 0x3b, 0x60, + 0x70, 0x6b, 0x82, 0x96, 0x8e, 0xc6, 0x01, 0xe3, 0x96, 0x02, 0x60, 0x88, 0x13, 0xb1, 0x90, 0xe5, + 0x8f, 0xb4, 0x90, 0xbd, 0x00, 0xb9, 0x46, 0xeb, 0x9e, 0x3c, 0xe4, 0x68, 0xfb, 0xe4, 0xd2, 0xda, + 0x2d, 0x64, 0xe5, 0xe4, 0xbb, 0xe6, 0x9c, 0x14, 0x52, 0xa5, 0x91, 0x72, 0x4e, 0xf6, 0x19, 0x9d, + 0x13, 0x4d, 0xcb, 0xb1, 0x53, 0x99, 0x96, 0xe4, 0x93, 0x30, 0xd5, 0xa0, 0x75, 0xb7, 0x41, 0xd7, + 0xa9, 0xef, 0x5b, 0x4d, 0xca, 0xf5, 0xec, 0xf1, 0x85, 0x0b, 0xb2, 0x8d, 0x53, 0x4b, 0x26, 0x10, + 0xa3, 0xb8, 0x64, 0x11, 0xce, 0xde, 0xb7, 0xec, 0x60, 0xcb, 0x6e, 0xd3, 0x55, 0xa7, 0x46, 0xeb, + 0xae, 0xd3, 0xf0, 0xb9, 0x71, 0xae, 0x20, 0xcc, 0x9e, 0x77, 0xe3, 0x40, 0xec, 0xc5, 0x4f, 0xb7, + 0x30, 0xfe, 0xac, 0x08, 0x97, 0x78, 0xd7, 0xd7, 0xa8, 0xb7, 0x6f, 0xd7, 0xe9, 0x42, 0xd7, 0x37, + 0x97, 0x45, 0xd2, 0x54, 0xce, 0x8c, 0x7c, 0x2a, 0x67, 0x8f, 0x31, 0x95, 0xe7, 0xa1, 0x14, 0xb8, + 0x1d, 0xbb, 0x9e, 0x34, 0xf7, 0xb7, 0x14, 0x00, 0x43, 0x1c, 0xb2, 0x04, 0x67, 0xfc, 0xee, 0xb6, + 0x5f, 0xf7, 0xec, 0x8e, 0x3e, 0x4b, 0x0b, 0xb1, 0x5b, 0x96, 0xf5, 0xce, 0xd4, 0x62, 0x70, 0xec, + 0xa9, 0xa1, 0xac, 0xc6, 0x85, 0x51, 0x59, 0x8d, 0x07, 0xb3, 0x61, 0x7f, 0xc7, 0x5c, 0x82, 0x63, + 0x7c, 0x09, 0x6e, 0xa7, 0x5c, 0x82, 0x89, 0xf3, 0xe0, 0x44, 0x0b, 0x70, 0xfc, 0x74, 0x16, 0xe0, + 0x67, 0xe0, 0xd9, 0x9d, 0x6e, 0xab, 0x75, 0x70, 0xab, 0x6b, 0xb5, 0xec, 0x1d, 0x9b, 0x36, 0xd8, + 0x38, 0xf9, 0x1d, 0xab, 0x2e, 0xcc, 0xdc, 0xa5, 0x85, 0x59, 0xd9, 0xda, 0x67, 0x57, 0x92, 0xd1, + 0xb0, 0x5f, 0xfd, 0x74, 0x2b, 0xeb, 0xbd, 0x02, 0x5c, 0x8c, 0xf5, 0xa8, 0x52, 0x96, 0xff, 0x6a, + 0x55, 0x9d, 0xf2, 0xaa, 0x32, 0x14, 0xef, 0xe2, 0x13, 0x53, 0xbc, 0xc7, 0x4e, 0x5d, 0xf1, 0xfe, + 0xcb, 0x2c, 0x8c, 0xa9, 0xcb, 0xb1, 0x7b, 0x30, 0xde, 0xe8, 0x4a, 0x53, 0x89, 0x98, 0x6b, 0xd7, + 0x4e, 0xde, 0x92, 0x55, 0x27, 0xf8, 0xa9, 0x8f, 0xdf, 0xf4, 0xc4, 0x2c, 0x13, 0xa7, 0xc5, 0x25, + 0x49, 0x1c, 0x35, 0x1b, 0xd2, 0x80, 0x22, 0x3b, 0xb4, 0xba, 0x9e, 0xd4, 0x7e, 0x3e, 0x95, 0x42, + 0x34, 0x71, 0xcb, 0x94, 0x5c, 0xff, 0x9c, 0x26, 0x4a, 0xda, 0x8c, 0xcb, 0x3b, 0x76, 0xc0, 0x04, + 0x4e, 0x6e, 0x98, 0x5c, 0xde, 0xe4, 0x34, 0x51, 0xd2, 0x26, 0x2f, 0x42, 0xc1, 0x0f, 0x68, 0xc7, + 0xe7, 0x93, 0xbb, 0xb0, 0x30, 0x25, 0x7b, 0xbe, 0x50, 0x63, 0x85, 0x28, 0x60, 0x95, 0xdf, 0xcb, + 0x40, 0x49, 0xdf, 0x8b, 0x90, 0x9b, 0x30, 0xde, 0xf5, 0xa9, 0xa7, 0x8d, 0xdb, 0xc7, 0x5e, 0xdd, + 0xbc, 0x3f, 0x6f, 0xcb, 0xaa, 0xa8, 0x89, 0x30, 0x82, 0x1d, 0xcb, 0xf7, 0xef, 0xbb, 0x5e, 0x63, + 0x30, 0x7d, 0x92, 0x13, 0xdc, 0x94, 0x55, 0x51, 0x13, 0xa9, 0xfc, 0x69, 0x06, 0xa6, 0x16, 0xec, + 0x60, 0xbb, 0x5b, 0xdf, 0xa3, 0x01, 0x6f, 0x73, 0x1b, 0x0a, 0xdb, 0xec, 0x03, 0x64, 0x83, 0xd7, + 0x52, 0xdc, 0x0f, 0x29, 0xba, 0xe1, 0x45, 0x11, 0x37, 0x24, 0xf2, 0x9f, 0x28, 0xb8, 0x90, 0xdb, + 0x00, 0xae, 0xd5, 0x0d, 0x76, 0xb7, 0xdc, 0x3d, 0xea, 0x0c, 0xf6, 0x4d, 0xd3, 0x6c, 0xde, 0xdf, + 0xac, 0xaa, 0xca, 0x68, 0x10, 0xaa, 0xfc, 0x41, 0x06, 0x48, 0x2f, 0xff, 0xa7, 0x60, 0x40, 0xfe, + 0xed, 0x18, 0x9c, 0xd7, 0x0d, 0x8f, 0x1d, 0x4f, 0x1a, 0xfc, 0xb6, 0xe2, 0xba, 0xeb, 0xee, 0xdd, + 0x74, 0x56, 0x6c, 0xc7, 0xf6, 0x77, 0xe5, 0x9d, 0x8b, 0x3e, 0x9e, 0x2c, 0xf5, 0x60, 0x60, 0x42, + 0x2d, 0xf2, 0x0d, 0x53, 0x69, 0xc8, 0x72, 0xa1, 0xf4, 0xf9, 0x21, 0x8c, 0xf3, 0x49, 0xd5, 0x85, + 0xb1, 0xfb, 0x74, 0x7b, 0xd7, 0x75, 0xf7, 0xe4, 0xf2, 0xbd, 0x7e, 0xf2, 0xa6, 0xdc, 0x15, 0x84, + 0x16, 0x5d, 0x27, 0xa0, 0x0f, 0x02, 0x71, 0x01, 0x2a, 0xcb, 0x50, 0x71, 0x21, 0x54, 0x5e, 0x80, + 0xe6, 0xd3, 0xca, 0xc0, 0xc8, 0xc2, 0xe9, 0xb9, 0x04, 0xad, 0x40, 0x51, 0x54, 0xe0, 0xa7, 0x75, + 0x69, 0x3f, 0x15, 0x47, 0x6e, 0x94, 0x10, 0xf2, 0x61, 0x28, 0xb8, 0xf7, 0x1d, 0x79, 0x82, 0x2e, + 0x2d, 0x3c, 0x2b, 0xbb, 0x69, 0x66, 0x89, 0x76, 0x3c, 0x5a, 0xb7, 0x02, 0xda, 0xb8, 0xc9, 0xc0, + 0x28, 0xb0, 0xc8, 0xff, 0x0f, 0xc0, 0x5a, 0x47, 0xeb, 0xfc, 0xee, 0x45, 0xdc, 0x01, 0x3c, 0x2f, + 0xeb, 0x9c, 0x0f, 0xeb, 0x6c, 0x6a, 0x1c, 0x34, 0xf0, 0xc9, 0x75, 0x98, 0xf6, 0x68, 0xc7, 0xf5, + 0xed, 0xc0, 0xf5, 0x0e, 0x6a, 0xad, 0x6e, 0x53, 0x5e, 0x08, 0x5c, 0x91, 0x14, 0xca, 0x21, 0x05, + 0x8c, 0xe0, 0x61, 0xac, 0x1e, 0xf9, 0xe5, 0x0c, 0x4c, 0xea, 0x22, 0x9b, 0xb2, 0x03, 0x4b, 0x2e, + 0xdd, 0xb5, 0xb9, 0xee, 0xca, 0x90, 0x73, 0x78, 0xc1, 0x85, 0x06, 0x2b, 0x8c, 0x30, 0x36, 0x74, + 0x4d, 0x78, 0x0a, 0x6c, 0x10, 0xef, 0xc2, 0xb9, 0x84, 0x0f, 0x65, 0x3b, 0x8b, 0x98, 0x05, 0xc2, + 0xd8, 0xa0, 0x77, 0x96, 0xc8, 0xd8, 0xbf, 0xd1, 0x33, 0x7a, 0x42, 0x9b, 0xbb, 0x28, 0xb1, 0xa7, + 0x0f, 0x1f, 0xb3, 0xca, 0x7f, 0x9c, 0x80, 0x4b, 0x9a, 0x39, 0x53, 0x48, 0xa9, 0x67, 0x8a, 0x17, + 0x63, 0x15, 0x66, 0x4e, 0x65, 0x15, 0x46, 0xe7, 0x72, 0x36, 0xf5, 0x5c, 0xce, 0x9d, 0x70, 0x2e, + 0xbf, 0x0c, 0xe3, 0x92, 0xae, 0xba, 0x7b, 0x11, 0xa2, 0x59, 0x96, 0xa1, 0x86, 0x92, 0xbf, 0x1e, + 0x9f, 0xf5, 0xc2, 0x0a, 0x57, 0x1b, 0xc2, 0xac, 0x17, 0xe3, 0x31, 0xe0, 0xdc, 0x0f, 0x05, 0x4c, + 0xb1, 0xaf, 0x80, 0xd9, 0x83, 0x17, 0xfc, 0x3d, 0xbb, 0xb3, 0xe0, 0x59, 0x4e, 0x7d, 0x17, 0xe9, + 0x8e, 0xbf, 0xc8, 0xdd, 0x11, 0x1a, 0x37, 0x9d, 0x9b, 0x1d, 0xea, 0x6c, 0x22, 0x17, 0x22, 0xe3, + 0x0b, 0x1f, 0x92, 0xec, 0x5e, 0xa8, 0x1d, 0x86, 0x8c, 0x87, 0xd3, 0x22, 0xd7, 0xe0, 0xac, 0xeb, + 0x08, 0xab, 0xcd, 0x26, 0xf5, 0x04, 0x54, 0x1a, 0x43, 0x9e, 0x93, 0x0c, 0xce, 0xde, 0x8c, 0x23, + 0x60, 0x6f, 0x1d, 0xf2, 0x69, 0x98, 0x10, 0xf7, 0xcd, 0x42, 0x2b, 0x28, 0x0d, 0xb2, 0xb1, 0xce, + 0x3c, 0x7a, 0x38, 0x3b, 0x51, 0x0d, 0x6b, 0xa3, 0x49, 0x8a, 0xbc, 0x05, 0x53, 0x72, 0x02, 0x4a, + 0xef, 0x14, 0x18, 0x84, 0xf6, 0xd9, 0x47, 0x0f, 0x67, 0xa7, 0xee, 0x9a, 0xf5, 0x31, 0x4a, 0x8e, + 0xdc, 0x81, 0x8b, 0xdb, 0x6a, 0x50, 0x7d, 0x3e, 0xa8, 0x0b, 0x96, 0x4f, 0x6f, 0xe3, 0x1a, 0xf7, + 0x2c, 0x2a, 0x2d, 0x5c, 0x96, 0xfd, 0x70, 0x31, 0x36, 0xf4, 0x12, 0x0b, 0xfb, 0xd4, 0xee, 0xb3, + 0xfb, 0x4f, 0x9e, 0x68, 0xf7, 0x8f, 0x98, 0x0c, 0xa6, 0xd2, 0x9a, 0x0c, 0xfa, 0xcb, 0x94, 0x13, + 0x99, 0x0c, 0xa6, 0x4f, 0xc7, 0x64, 0x20, 0x8f, 0x9b, 0x33, 0xa3, 0x3a, 0x6e, 0x7e, 0x12, 0xa6, + 0xea, 0xbb, 0xb4, 0xbe, 0xc7, 0xfd, 0x6d, 0xf6, 0xad, 0x56, 0xf9, 0x0c, 0x1f, 0x7e, 0x6d, 0x13, + 0x5c, 0x34, 0x81, 0x18, 0xc5, 0x4d, 0xb7, 0xc7, 0x7c, 0x3b, 0x03, 0xcf, 0xf5, 0x95, 0x2b, 0xe4, + 0xb5, 0x88, 0xd4, 0xcd, 0x44, 0xbd, 0x3b, 0xfb, 0xc8, 0xda, 0xb4, 0x3b, 0xcf, 0x1f, 0x66, 0xa1, + 0xb4, 0xd0, 0xf5, 0xa5, 0xb3, 0xcf, 0x36, 0xe4, 0x1d, 0x2b, 0xf0, 0xd3, 0x5f, 0x5b, 0x6f, 0x54, + 0xb7, 0x54, 0xdf, 0x73, 0xd5, 0x8b, 0xfd, 0x46, 0x4e, 0x9b, 0xec, 0x43, 0xe9, 0x1d, 0x1a, 0xf8, + 0x81, 0x47, 0xad, 0xb6, 0x54, 0xcb, 0x57, 0x4f, 0xce, 0xe8, 0x4d, 0x1a, 0xd4, 0x38, 0x29, 0xd3, + 0x9d, 0x4f, 0x17, 0x62, 0xc8, 0x8a, 0xd4, 0xa1, 0xb0, 0x67, 0xed, 0xec, 0x59, 0x52, 0x91, 0x5d, + 0x48, 0x71, 0x15, 0xcb, 0xc8, 0x2c, 0x74, 0x7d, 0x71, 0x62, 0xe2, 0xbf, 0x50, 0xd0, 0xae, 0x7c, + 0xaf, 0x00, 0xe7, 0x16, 0xad, 0x16, 0x75, 0x1a, 0x56, 0x64, 0x07, 0x7f, 0x15, 0xc6, 0xfd, 0xfa, + 0x2e, 0x6d, 0x74, 0x5b, 0xea, 0xd6, 0x42, 0xaf, 0xb8, 0x9a, 0x2c, 0x47, 0x8d, 0xa1, 0x7d, 0xc4, + 0xd8, 0xdc, 0xcc, 0x46, 0xb1, 0xf5, 0xb4, 0xd4, 0x18, 0xe4, 0x75, 0x98, 0x96, 0xce, 0x4f, 0xae, + 0xb3, 0x64, 0x05, 0x54, 0x38, 0x48, 0x48, 0x07, 0x94, 0xe5, 0x08, 0x04, 0x63, 0x98, 0x8c, 0x53, + 0x60, 0xb7, 0xe9, 0xbb, 0xae, 0xa3, 0xec, 0x42, 0x9a, 0xd3, 0x96, 0x2c, 0x47, 0x8d, 0x41, 0xbe, + 0xde, 0x7b, 0xcd, 0xf5, 0xb9, 0x93, 0x77, 0x63, 0x42, 0x3f, 0x0d, 0x20, 0x95, 0xbe, 0x08, 0x13, + 0x1d, 0xea, 0xf9, 0xb6, 0x1f, 0x50, 0xa7, 0x4e, 0xe5, 0x2d, 0xd7, 0x9b, 0x29, 0x45, 0xd3, 0x66, + 0x48, 0x51, 0xec, 0x55, 0x46, 0x01, 0x9a, 0xfc, 0x4e, 0xdd, 0x8e, 0x9a, 0x4e, 0xee, 0x3c, 0x80, + 0xf3, 0x8b, 0x56, 0x50, 0xdf, 0xed, 0x76, 0xc4, 0x32, 0x51, 0x26, 0xa0, 0x57, 0x60, 0x8c, 0x3a, + 0xd6, 0x76, 0x8b, 0x36, 0xe2, 0xbe, 0x8e, 0xcb, 0xa2, 0x18, 0x15, 0x9c, 0x7c, 0x02, 0x26, 0xda, + 0xd6, 0x03, 0x65, 0x46, 0x92, 0xd3, 0x52, 0xc7, 0x01, 0xac, 0x87, 0x20, 0x34, 0xf1, 0x2a, 0x7f, + 0x96, 0x85, 0xd2, 0xa2, 0xeb, 0x34, 0x6c, 0xce, 0xef, 0xa3, 0x90, 0x0f, 0x0e, 0x3a, 0x6a, 0x09, + 0xbc, 0xa0, 0x2e, 0x93, 0xb7, 0x0e, 0x3a, 0xf4, 0x31, 0x13, 0xbc, 0x0a, 0x91, 0x3b, 0x4b, 0x71, + 0x54, 0xb2, 0x06, 0x45, 0x3f, 0xb0, 0x82, 0xae, 0x2f, 0x59, 0x7e, 0x5c, 0x79, 0x9f, 0xd5, 0x78, + 0xe9, 0xe3, 0x87, 0xb3, 0x09, 0x01, 0x1b, 0x73, 0x9a, 0x92, 0xc0, 0x42, 0x49, 0x83, 0xec, 0x03, + 0x69, 0x59, 0x7e, 0xb0, 0xe5, 0x59, 0x8e, 0x2f, 0x38, 0xd9, 0xda, 0x73, 0xe1, 0x27, 0x0c, 0x3d, + 0x43, 0x07, 0x4e, 0x84, 0xc3, 0xc6, 0x66, 0x1e, 0xd3, 0x3c, 0x58, 0x8d, 0x70, 0x5b, 0x5f, 0xeb, + 0xa1, 0x86, 0x09, 0x1c, 0x84, 0x0f, 0x9d, 0xe5, 0x27, 0xf9, 0xd0, 0xb1, 0x52, 0x94, 0x50, 0x36, + 0x20, 0x6d, 0x79, 0x51, 0x55, 0x88, 0xde, 0x39, 0xab, 0x2b, 0x2a, 0x05, 0xaf, 0x34, 0xe1, 0x82, + 0xfe, 0x4a, 0x1f, 0xa9, 0x4f, 0x83, 0x85, 0x03, 0xce, 0xeb, 0x0a, 0xe4, 0xeb, 0x9e, 0xdb, 0x73, + 0x63, 0xbf, 0xe8, 0xb9, 0x0e, 0x72, 0x48, 0x64, 0xd5, 0x67, 0x8f, 0x5a, 0xf5, 0x95, 0x6f, 0x65, + 0xe0, 0xd9, 0x18, 0xa7, 0x45, 0xcf, 0x0e, 0xa8, 0x67, 0x5b, 0xc4, 0x87, 0xe2, 0x36, 0xe7, 0x2a, + 0xb7, 0x8c, 0x9b, 0x29, 0xc4, 0x41, 0xd2, 0xc7, 0x88, 0xa5, 0x20, 0xfe, 0x47, 0xc9, 0xaa, 0xf2, + 0x25, 0x38, 0xaf, 0x7d, 0x7d, 0x8c, 0x05, 0x7a, 0x0c, 0x57, 0xd5, 0x25, 0x38, 0x53, 0xf7, 0xa8, + 0x15, 0xd0, 0xd5, 0x9d, 0x0d, 0x37, 0x58, 0x7e, 0x60, 0xfb, 0x81, 0xf4, 0x59, 0xd5, 0xe6, 0xf0, + 0xc5, 0x18, 0x1c, 0x7b, 0x6a, 0x54, 0xfe, 0x20, 0x0b, 0x67, 0xd9, 0xf9, 0xc9, 0x62, 0x33, 0x64, + 0x8b, 0xb6, 0x3b, 0x2d, 0x2b, 0xa0, 0xe4, 0x33, 0x50, 0x52, 0x8e, 0x38, 0x6a, 0x03, 0x4d, 0x74, + 0x53, 0xd2, 0x7e, 0x3b, 0xf4, 0x5e, 0xd7, 0xf6, 0x28, 0x77, 0x2d, 0x0d, 0xad, 0xf8, 0x0a, 0xea, + 0x63, 0x48, 0x8d, 0x6c, 0xc3, 0x8c, 0xdd, 0xb6, 0x9a, 0x74, 0xb3, 0xdb, 0x6a, 0x6d, 0xba, 0x2d, + 0xbb, 0xae, 0xce, 0x64, 0x57, 0x95, 0x4d, 0x62, 0x35, 0x0a, 0x7e, 0xfc, 0x70, 0xf6, 0x85, 0x84, + 0x55, 0x11, 0x22, 0x60, 0x9c, 0x20, 0xe3, 0xe1, 0xd3, 0x7a, 0xd7, 0xb3, 0x83, 0x03, 0x79, 0x36, + 0x94, 0xcb, 0xe2, 0xc5, 0x3e, 0xea, 0xb7, 0x89, 0x2a, 0x3d, 0x2a, 0xa2, 0x85, 0x18, 0x27, 0x58, + 0xf9, 0x87, 0x05, 0x98, 0x5a, 0xec, 0xfa, 0x81, 0xdb, 0x56, 0x57, 0x2d, 0xf3, 0x50, 0x12, 0xba, + 0x34, 0xd3, 0xc2, 0x33, 0xd1, 0x0b, 0x8d, 0x9a, 0x02, 0x60, 0x88, 0xc3, 0x16, 0x12, 0xa7, 0xaa, + 0x7c, 0x8d, 0xf5, 0x42, 0xe2, 0xcc, 0x29, 0x4a, 0x28, 0xb9, 0x0d, 0x50, 0xa7, 0x5e, 0x20, 0x0f, + 0x12, 0xb9, 0x81, 0x4d, 0x97, 0x8b, 0xba, 0x32, 0x1a, 0x84, 0xb8, 0x1f, 0x02, 0x6f, 0x0b, 0x9b, + 0x54, 0x37, 0xf7, 0xa9, 0xe7, 0xd9, 0x0d, 0xb5, 0x73, 0x86, 0x7e, 0x08, 0x3d, 0x18, 0x98, 0x50, + 0x8b, 0xf8, 0x90, 0xf7, 0x3b, 0xb4, 0x2e, 0x37, 0xd2, 0x5b, 0x29, 0x56, 0x8e, 0xd9, 0xa5, 0x73, + 0xb5, 0x0e, 0xad, 0x8b, 0xed, 0x53, 0xaf, 0x00, 0x56, 0x84, 0x9c, 0xd9, 0x13, 0xf7, 0x96, 0x35, + 0xae, 0x7a, 0xc6, 0x4e, 0xef, 0xaa, 0xe7, 0xd2, 0x4f, 0x43, 0x49, 0xf7, 0xcb, 0x40, 0x3b, 0xe7, + 0x5f, 0x66, 0x00, 0x96, 0xac, 0xc0, 0x12, 0xbb, 0x31, 0x13, 0x31, 0x1d, 0x2b, 0xd8, 0x8d, 0x8b, + 0x98, 0x4d, 0x2b, 0xd8, 0x45, 0x0e, 0x21, 0xaf, 0xca, 0x2d, 0x2e, 0x1b, 0xb9, 0x65, 0x53, 0x5b, + 0x1c, 0xbf, 0x25, 0x36, 0x76, 0x37, 0xed, 0xcb, 0x2b, 0x54, 0xb6, 0x1e, 0x5f, 0x5e, 0xf2, 0x29, + 0x80, 0xba, 0xdb, 0x66, 0x1d, 0x18, 0xb8, 0x9e, 0x9c, 0x68, 0xca, 0x8e, 0x02, 0x8b, 0x1a, 0xf2, + 0x38, 0xf2, 0x0b, 0x8d, 0x3a, 0x5c, 0xd8, 0x4b, 0x19, 0x25, 0xf7, 0x94, 0x50, 0xd8, 0xcb, 0x72, + 0xd4, 0x18, 0x95, 0xbf, 0xc8, 0xc1, 0xe4, 0x72, 0xdb, 0xb2, 0x5b, 0x6a, 0x85, 0x46, 0x27, 0x4c, + 0xe6, 0xd4, 0x27, 0xcc, 0xab, 0xc6, 0xad, 0x40, 0x6c, 0xaf, 0x4a, 0x30, 0xf9, 0x7f, 0x0e, 0x26, + 0xfd, 0x76, 0xd0, 0x51, 0xb6, 0xfb, 0xc1, 0x16, 0x3e, 0x0f, 0x46, 0xaa, 0xad, 0x6f, 0x6d, 0x6a, + 0xd3, 0x7f, 0x84, 0x18, 0x1b, 0xfc, 0x5d, 0xd7, 0x0f, 0xe4, 0x28, 0xe8, 0xc1, 0xbf, 0xee, 0xfa, + 0x01, 0x72, 0x08, 0x9f, 0x1e, 0xae, 0x27, 0x02, 0x0f, 0x0a, 0xc6, 0xf4, 0x70, 0xbd, 0x00, 0x39, + 0x84, 0x5c, 0x84, 0x6c, 0xe0, 0x4a, 0x9b, 0x10, 0x77, 0xe8, 0xdd, 0x72, 0x31, 0x1b, 0xb8, 0xdc, + 0xcd, 0xce, 0x73, 0xdb, 0xd2, 0x6e, 0x1c, 0xba, 0xd9, 0x79, 0x6e, 0x1b, 0x39, 0x84, 0xa9, 0x06, + 0x7e, 0x77, 0x9b, 0x9d, 0xfb, 0xe2, 0xbe, 0xe2, 0x35, 0x51, 0x8c, 0x0a, 0xce, 0x88, 0x6d, 0xbb, + 0x8d, 0x03, 0x79, 0xc1, 0xae, 0x89, 0x71, 0xef, 0x04, 0x0e, 0xa9, 0xfc, 0x8d, 0x31, 0x20, 0xcb, + 0x6d, 0x7e, 0x77, 0x66, 0x1e, 0x53, 0x5e, 0x82, 0xe2, 0xb6, 0xe7, 0xee, 0x69, 0x6b, 0xa7, 0x96, + 0xae, 0x0b, 0xbc, 0x14, 0x25, 0x94, 0x9d, 0x54, 0xeb, 0xbb, 0x96, 0xe3, 0xd0, 0x56, 0x68, 0x1f, + 0xd4, 0x03, 0xb9, 0xa8, 0x21, 0x68, 0x60, 0xf1, 0x40, 0x52, 0xf1, 0xcb, 0xb8, 0xbd, 0x0e, 0x03, + 0x49, 0x43, 0x10, 0x9a, 0x78, 0x91, 0x5b, 0xa1, 0xfc, 0xb0, 0x6f, 0x85, 0x0a, 0x43, 0xb8, 0x15, + 0xea, 0x13, 0x60, 0x59, 0x7c, 0xb2, 0x01, 0x96, 0x63, 0xc7, 0x0d, 0xb0, 0x1c, 0x1f, 0x95, 0x95, + 0xe5, 0x6b, 0xe6, 0x61, 0x51, 0xdc, 0x41, 0x7c, 0x36, 0xc5, 0x21, 0xa9, 0x67, 0xb2, 0x9e, 0xc8, + 0x82, 0xf5, 0x34, 0x5c, 0x44, 0xfc, 0x46, 0x06, 0x0a, 0x9c, 0x0d, 0x69, 0xf3, 0x08, 0x44, 0xae, + 0x8b, 0x65, 0xd2, 0x3a, 0xf1, 0x73, 0x8a, 0x11, 0xab, 0xbf, 0x52, 0xd3, 0x14, 0x0f, 0xf2, 0x3c, + 0xe4, 0xe5, 0xa5, 0x63, 0xe6, 0xe5, 0x49, 0x61, 0xb7, 0x61, 0x5b, 0x1f, 0xf2, 0xd2, 0xd7, 0xc7, + 0xbf, 0xff, 0xb7, 0x67, 0x9f, 0x79, 0xef, 0xdf, 0x5f, 0x79, 0xa6, 0xf2, 0x83, 0x2c, 0x8c, 0x73, + 0x72, 0x0b, 0x5d, 0x9f, 0xbc, 0x6d, 0x8c, 0xb2, 0x68, 0xe4, 0x47, 0x8e, 0x77, 0x8e, 0xba, 0xc9, + 0x65, 0x15, 0xeb, 0xa6, 0x50, 0x74, 0x84, 0x65, 0xc6, 0xe8, 0xed, 0x4a, 0x3d, 0x29, 0x3b, 0x94, + 0x2e, 0x58, 0xe8, 0xfa, 0x4c, 0x13, 0x48, 0x54, 0x8e, 0x3a, 0xfa, 0xac, 0x99, 0xfa, 0xb2, 0x53, + 0xf3, 0xe2, 0xf4, 0x0c, 0x35, 0x35, 0x72, 0x1e, 0xad, 0xfc, 0x69, 0x06, 0x26, 0x15, 0xea, 0x9a, + 0xed, 0x07, 0xe4, 0xf3, 0x3d, 0xdd, 0x39, 0x77, 0xbc, 0xee, 0x64, 0xb5, 0x79, 0x67, 0xea, 0x85, + 0xa0, 0x4a, 0x8c, 0xae, 0x6c, 0x42, 0xc1, 0x0e, 0x68, 0xdb, 0x97, 0xf7, 0xca, 0x0b, 0xe9, 0xbf, + 0x2f, 0xbc, 0x10, 0x5b, 0x65, 0x84, 0x51, 0xd0, 0xaf, 0xfc, 0x49, 0x2e, 0xfc, 0x2e, 0xd6, 0xc1, + 0xe4, 0x0b, 0x11, 0xcb, 0x62, 0x35, 0x9d, 0x65, 0x91, 0xf1, 0x8d, 0x9b, 0x15, 0xfd, 0x5e, 0xb3, + 0xe2, 0xca, 0x10, 0xcc, 0x8a, 0xfc, 0x13, 0x9f, 0xa8, 0x4d, 0x91, 0x09, 0xd2, 0x19, 0xcd, 0x72, + 0xf9, 0x81, 0x1b, 0xd8, 0x75, 0xb9, 0x13, 0x0e, 0xd1, 0x6e, 0xca, 0x0f, 0x70, 0xba, 0x50, 0x70, + 0xc1, 0x38, 0xdb, 0xca, 0x7f, 0xce, 0xc0, 0x74, 0x74, 0x66, 0x93, 0x5d, 0xbd, 0x66, 0x32, 0x69, + 0xfd, 0x7b, 0x0e, 0x5f, 0x2b, 0x64, 0x0f, 0x8a, 0x22, 0x7a, 0x47, 0x0e, 0x6f, 0x9a, 0xe8, 0x68, + 0x65, 0xf1, 0x0e, 0x99, 0x89, 0xdf, 0x28, 0x59, 0x54, 0xfe, 0x47, 0x56, 0x4e, 0x60, 0x29, 0x25, + 0xc9, 0x25, 0xc8, 0xda, 0x0d, 0xa9, 0x16, 0x81, 0xac, 0x94, 0x5d, 0x5d, 0xc2, 0xac, 0xdd, 0xe0, + 0x87, 0x52, 0x11, 0xe6, 0x93, 0x8d, 0xaa, 0x4d, 0xb1, 0x80, 0xb8, 0x4f, 0xc0, 0x04, 0x93, 0x33, + 0xfb, 0xd4, 0xf3, 0x6d, 0xd7, 0x89, 0xab, 0x40, 0x6c, 0x9d, 0xdc, 0x11, 0x20, 0x34, 0xf1, 0x98, + 0x3a, 0xc7, 0x8f, 0x14, 0x31, 0xbd, 0xd3, 0x38, 0x46, 0x54, 0x61, 0x86, 0xad, 0x6f, 0x2e, 0xc8, + 0x9d, 0x80, 0x23, 0x17, 0x62, 0x4e, 0x0b, 0x56, 0x60, 0x2d, 0x0a, 0x30, 0xaf, 0x17, 0xc7, 0x37, + 0xd5, 0xcb, 0xe2, 0x11, 0xea, 0xe5, 0x1a, 0xe4, 0x03, 0xbb, 0xad, 0x62, 0x9a, 0x06, 0x31, 0x9b, + 0x85, 0x6d, 0xb7, 0xdb, 0xac, 0xed, 0x76, 0x9b, 0x1a, 0xfb, 0xca, 0xb7, 0xf2, 0x30, 0xc3, 0xfb, + 0x7c, 0x89, 0x76, 0xa8, 0xd3, 0xa0, 0x4e, 0xfd, 0xe0, 0x18, 0x36, 0x9d, 0x2a, 0xcc, 0xd0, 0x70, + 0x53, 0x36, 0x5c, 0x29, 0xf5, 0xb7, 0x2f, 0x47, 0xc1, 0x18, 0xc7, 0xe7, 0x21, 0xc6, 0xac, 0x28, + 0xc9, 0xad, 0x72, 0x59, 0x01, 0x30, 0xc4, 0x21, 0xfb, 0x30, 0x26, 0x76, 0x7a, 0x5f, 0xae, 0xc4, + 0x9b, 0x29, 0x25, 0x69, 0xf8, 0xc5, 0x52, 0xab, 0xe0, 0x3b, 0xb4, 0xf8, 0xdf, 0x47, 0xc5, 0x8c, + 0xfc, 0x62, 0x06, 0x4a, 0x81, 0x67, 0x39, 0xfe, 0x8e, 0xeb, 0xb5, 0xa5, 0xf6, 0xba, 0x35, 0x34, + 0xd6, 0x5b, 0x8a, 0x32, 0x95, 0x71, 0x73, 0xba, 0x00, 0x43, 0xae, 0xc4, 0x86, 0x8b, 0xb2, 0x39, + 0x6b, 0x6e, 0xd3, 0xae, 0x5b, 0x2d, 0x11, 0xb1, 0xe9, 0x2a, 0x3f, 0x99, 0x8f, 0xaa, 0x5b, 0xd4, + 0x95, 0x44, 0xac, 0xc7, 0x0f, 0x67, 0x67, 0x62, 0x45, 0xd8, 0x87, 0x60, 0xe5, 0x77, 0x0b, 0x70, + 0x21, 0xb1, 0x7b, 0xc8, 0xb6, 0x9c, 0x82, 0xa9, 0x2f, 0xaa, 0xd8, 0x44, 0x94, 0x5d, 0x3e, 0x1e, + 0x9d, 0x98, 0xa6, 0xf6, 0x95, 0x3d, 0x05, 0xed, 0x6b, 0x47, 0x6a, 0x5f, 0x22, 0xba, 0x35, 0xc5, + 0x27, 0x85, 0xe6, 0x8a, 0x70, 0xbd, 0x84, 0x7a, 0x1c, 0xb1, 0xa1, 0x40, 0x1f, 0x74, 0x3c, 0xe1, + 0x50, 0x91, 0x8a, 0xd1, 0xf2, 0x83, 0x8e, 0x27, 0x19, 0x69, 0x2d, 0x80, 0x95, 0xf9, 0x28, 0x38, + 0x90, 0xb7, 0xe1, 0x1c, 0x63, 0x19, 0x9f, 0x27, 0x42, 0x34, 0xcd, 0xc9, 0x2a, 0xe7, 0x96, 0x7a, + 0x51, 0x92, 0x26, 0x49, 0x12, 0x29, 0xc6, 0x81, 0xb1, 0x4a, 0x9e, 0x89, 0x9a, 0xc3, 0x72, 0x2f, + 0x4a, 0x22, 0x87, 0x04, 0x52, 0x5c, 0xb6, 0x73, 0x67, 0x68, 0x79, 0x34, 0x0f, 0x65, 0x3b, 0x2f, + 0x45, 0x09, 0xad, 0xbc, 0x0d, 0x97, 0xfa, 0x2f, 0x27, 0xb6, 0x7b, 0xbc, 0x73, 0x2f, 0xbe, 0x7b, + 0xbc, 0x79, 0x0b, 0xb3, 0xef, 0xdc, 0x33, 0x38, 0x64, 0x0f, 0xe5, 0xf0, 0x7e, 0x16, 0xce, 0xc4, + 0x6f, 0xa9, 0x48, 0x17, 0xc6, 0xea, 0xe2, 0x66, 0x47, 0xae, 0x85, 0x8d, 0x34, 0x17, 0x72, 0xbd, + 0x57, 0x44, 0x72, 0xb2, 0x0a, 0x08, 0x2a, 0x5e, 0xe4, 0xaf, 0xa9, 0x98, 0xdc, 0x75, 0xab, 0x23, + 0x57, 0xc7, 0x46, 0x2a, 0xd3, 0x7f, 0x8f, 0x35, 0xdf, 0x8c, 0xdc, 0x5d, 0x0f, 0x23, 0x77, 0xd7, + 0xad, 0x4e, 0xe5, 0x8f, 0xb3, 0x30, 0x61, 0x5a, 0x2d, 0x46, 0x7f, 0x04, 0xd9, 0x8b, 0x1c, 0x41, + 0x56, 0x87, 0x72, 0x7c, 0xec, 0x7b, 0x0a, 0xf1, 0x63, 0xa7, 0x90, 0xe1, 0x9c, 0x56, 0x8f, 0x38, + 0x88, 0x5c, 0x83, 0xb3, 0x3d, 0x47, 0x5b, 0xf2, 0x1a, 0x00, 0x5b, 0x12, 0xd4, 0xf7, 0x6d, 0x7d, + 0x9f, 0xa4, 0x3b, 0x6a, 0x59, 0x43, 0xd0, 0xc0, 0xaa, 0xfc, 0xbb, 0x0c, 0x98, 0x1b, 0xee, 0x29, + 0x1c, 0x6a, 0xde, 0x89, 0x1e, 0x6a, 0x96, 0x87, 0xd2, 0x5d, 0x7d, 0xce, 0x35, 0xbf, 0xb2, 0x14, + 0xf9, 0x3a, 0x7e, 0xb4, 0xb9, 0x0a, 0x93, 0x54, 0xea, 0xc4, 0x49, 0x19, 0x40, 0x96, 0x0d, 0x18, + 0x46, 0x30, 0x49, 0xcb, 0x30, 0xcd, 0x66, 0xd3, 0x9e, 0x20, 0x94, 0x31, 0x57, 0xd8, 0xa9, 0x7a, + 0x4d, 0xbb, 0x64, 0x17, 0xc6, 0x7c, 0x11, 0xeb, 0x22, 0x27, 0x56, 0x8a, 0x53, 0x98, 0x0a, 0x9a, + 0xe1, 0xd2, 0x41, 0xfe, 0x40, 0x45, 0x9e, 0x1c, 0x40, 0xa1, 0x6d, 0x3b, 0xb6, 0x2b, 0xb7, 0x98, + 0xad, 0xa1, 0xad, 0x97, 0xb9, 0x75, 0x46, 0x56, 0x18, 0x7c, 0xf4, 0x00, 0xf1, 0x32, 0x14, 0x1c, + 0x79, 0x5a, 0xaf, 0xba, 0x74, 0x2c, 0x90, 0x37, 0x2b, 0x77, 0x87, 0xc7, 0x5e, 0xbb, 0x2c, 0x44, + 0x4d, 0x4e, 0xaa, 0x18, 0x35, 0x6b, 0xd2, 0x95, 0xc9, 0x17, 0x8a, 0x69, 0xdd, 0x10, 0xe3, 0x4d, + 0x58, 0xb1, 0x5b, 0x34, 0x76, 0xbd, 0x63, 0x64, 0x63, 0x60, 0x9f, 0x6f, 0xe4, 0x1c, 0x18, 0xf2, + 0xe7, 0xab, 0xcb, 0xc9, 0xd8, 0xe7, 0xf7, 0x66, 0x22, 0x60, 0x8a, 0xaa, 0x76, 0x59, 0x15, 0xc9, + 0xd5, 0xee, 0x0c, 0xaf, 0x19, 0xd2, 0xc9, 0x4f, 0xb4, 0x42, 0x1f, 0x53, 0x7a, 0x9c, 0x58, 0xbb, + 0x90, 0xb7, 0xda, 0xf7, 0x3a, 0xd2, 0xf6, 0x38, 0xc4, 0x21, 0xa8, 0xb6, 0xef, 0x75, 0x62, 0x43, + 0x50, 0x5d, 0xbf, 0xb5, 0x89, 0x9c, 0x1d, 0x9b, 0xfc, 0xc2, 0x26, 0x00, 0xc3, 0x9e, 0xfc, 0xdc, + 0x2a, 0x10, 0x9b, 0xfc, 0x11, 0x4b, 0x41, 0x17, 0xf2, 0xed, 0x7b, 0x41, 0x50, 0x9e, 0x18, 0xf6, + 0x17, 0xaf, 0xdf, 0x0b, 0x82, 0xd8, 0x17, 0xaf, 0xdf, 0xda, 0xda, 0x42, 0xce, 0x8e, 0xb1, 0xe5, + 0xb6, 0x9d, 0xc9, 0x61, 0xb3, 0xdd, 0xb0, 0x02, 0x3f, 0xc6, 0xd6, 0xb0, 0xf8, 0xdc, 0x83, 0x9c, + 0xef, 0xf8, 0xd2, 0x49, 0x12, 0x87, 0xc7, 0xb5, 0xe6, 0x48, 0xa6, 0x3a, 0xa6, 0xba, 0xb6, 0x51, + 0x43, 0xc6, 0x8b, 0xb3, 0xbc, 0xe7, 0x97, 0xa7, 0x87, 0xce, 0xf2, 0x5e, 0x0f, 0xcb, 0x5b, 0x8c, + 0xe5, 0x3d, 0x9f, 0x7c, 0x11, 0x8a, 0x9d, 0xee, 0x76, 0xad, 0xbb, 0x5d, 0x9e, 0xe1, 0x5c, 0x6f, + 0x0f, 0x8f, 0xeb, 0x26, 0xa7, 0x2b, 0x18, 0x6b, 0xbd, 0x40, 0x14, 0xa2, 0x64, 0xca, 0xd8, 0x0b, + 0x7e, 0xe5, 0x33, 0xc3, 0x66, 0x7f, 0x8d, 0x13, 0x8a, 0xb1, 0x17, 0x85, 0x28, 0x99, 0x4a, 0xf6, + 0x2d, 0x6b, 0xbb, 0x7c, 0x76, 0x04, 0xec, 0x5b, 0x56, 0x02, 0xfb, 0x96, 0x25, 0xd8, 0xb7, 0xac, + 0x6d, 0x36, 0xb3, 0x77, 0x1b, 0x3b, 0x7e, 0x99, 0x0c, 0x7b, 0x66, 0x5f, 0x6f, 0xec, 0xc4, 0x67, + 0xf6, 0xf5, 0xa5, 0x95, 0x1a, 0x72, 0x76, 0x4c, 0x84, 0xf8, 0x2d, 0xab, 0xbe, 0x57, 0x3e, 0x37, + 0x6c, 0x11, 0x52, 0x63, 0x64, 0x63, 0x22, 0x84, 0x97, 0xa1, 0xe0, 0x48, 0x7e, 0x35, 0x03, 0x13, + 0x32, 0x67, 0xc2, 0x35, 0xcf, 0x6e, 0x94, 0xcf, 0xa7, 0xbe, 0xb8, 0x89, 0xb7, 0x20, 0x24, 0x2e, + 0xda, 0x11, 0xda, 0xbf, 0x42, 0x08, 0x9a, 0x6d, 0x20, 0x7f, 0x2b, 0x03, 0xd3, 0x56, 0x24, 0x27, + 0x46, 0xf9, 0x02, 0x6f, 0xd6, 0xcf, 0x0f, 0x51, 0xa6, 0x47, 0x73, 0x6e, 0xf0, 0x96, 0x69, 0x1f, + 0xda, 0x28, 0x10, 0x63, 0x8d, 0x61, 0x93, 0xd4, 0x0f, 0x3c, 0xbb, 0x43, 0xcb, 0x17, 0x87, 0x3d, + 0x49, 0x6b, 0x9c, 0x6e, 0x6c, 0x92, 0x8a, 0x42, 0x94, 0x4c, 0xf9, 0x5e, 0x4b, 0xc5, 0xf5, 0x58, + 0xf9, 0xd9, 0x61, 0xef, 0xb5, 0xea, 0xde, 0x2d, 0xba, 0xd7, 0xca, 0x52, 0x54, 0x7c, 0xd9, 0x8c, + 0xf5, 0x68, 0xc3, 0xf6, 0xcb, 0xe5, 0x61, 0xcf, 0x58, 0x64, 0x64, 0x63, 0x33, 0x96, 0x97, 0xa1, + 0xe0, 0xc8, 0x64, 0xb2, 0xe3, 0xdf, 0x2b, 0x3f, 0x37, 0x6c, 0x99, 0xbc, 0xe1, 0xdf, 0x8b, 0xc9, + 0xe4, 0x8d, 0xda, 0x2d, 0x64, 0xbc, 0x84, 0x4c, 0x6e, 0xf9, 0x96, 0x57, 0xbe, 0x34, 0x7c, 0x99, + 0xcc, 0xe8, 0xf6, 0xc8, 0x64, 0x56, 0x88, 0x92, 0x29, 0x1f, 0x70, 0x9e, 0xbc, 0xd9, 0xae, 0x97, + 0x7f, 0x6c, 0xd8, 0x03, 0x7e, 0x4d, 0x10, 0x8e, 0x0d, 0xb8, 0x2c, 0x45, 0xc5, 0x97, 0xbc, 0xcc, + 0xf4, 0xcc, 0x4e, 0xcb, 0xae, 0x5b, 0x7e, 0xf9, 0x79, 0xe1, 0xed, 0x20, 0x54, 0x41, 0x51, 0x86, + 0x1a, 0x4a, 0x7e, 0x33, 0x03, 0x33, 0xb1, 0xc0, 0x89, 0xf2, 0x0b, 0xbc, 0xd5, 0x6f, 0x0d, 0xaf, + 0xd5, 0x0b, 0x51, 0x06, 0xa2, 0xf5, 0xda, 0x00, 0x1c, 0x77, 0xb9, 0x8f, 0xb7, 0x87, 0x7c, 0x3d, + 0x03, 0x25, 0x5d, 0x56, 0xbe, 0xcc, 0x5b, 0xf7, 0xe9, 0x11, 0xb4, 0x4e, 0xb4, 0x4b, 0xdb, 0x96, + 0xc3, 0x78, 0xb3, 0x90, 0x3b, 0x97, 0xc0, 0x7c, 0x66, 0x8b, 0xab, 0x98, 0xf2, 0xec, 0xb0, 0x25, + 0x30, 0x86, 0xc4, 0x63, 0x12, 0xd8, 0x80, 0xa0, 0xd9, 0x06, 0x3e, 0x86, 0x56, 0x34, 0x59, 0x42, + 0xf9, 0xca, 0xb0, 0xc7, 0x30, 0x9e, 0xdf, 0x22, 0x3a, 0x86, 0x31, 0x28, 0xc6, 0xdb, 0x43, 0x7e, + 0x37, 0x03, 0x67, 0xad, 0x78, 0x96, 0x9a, 0xf2, 0x8f, 0xf3, 0x56, 0xbe, 0x3d, 0xe4, 0x56, 0x46, + 0x12, 0xe1, 0xf0, 0x76, 0xea, 0x18, 0xaa, 0x1e, 0x38, 0xf6, 0xb6, 0x8a, 0xe9, 0x15, 0xfe, 0x4e, + 0xd0, 0x29, 0x57, 0x86, 0xad, 0x57, 0xd4, 0x76, 0x82, 0xf8, 0xd1, 0xa4, 0xb6, 0xb2, 0xb5, 0x89, + 0x9c, 0x1d, 0xd7, 0xa6, 0xa8, 0xe7, 0xd9, 0x41, 0xf9, 0xc5, 0xa1, 0x6b, 0x53, 0x9c, 0x6e, 0x5c, + 0x9b, 0xe2, 0x85, 0x28, 0x99, 0x5e, 0xfa, 0x12, 0x40, 0x78, 0x7e, 0x4f, 0x70, 0x89, 0xf8, 0xac, + 0xe9, 0x12, 0x31, 0xa4, 0xac, 0x89, 0x86, 0x63, 0xc5, 0xa5, 0x6f, 0x64, 0x60, 0x2a, 0x72, 0x82, + 0x4f, 0x68, 0x43, 0x3d, 0xda, 0x86, 0xf5, 0xa1, 0x86, 0x37, 0x98, 0x8d, 0xf9, 0xa5, 0x0c, 0x94, + 0xf4, 0x59, 0x3e, 0xa1, 0x21, 0x5f, 0x88, 0x36, 0x64, 0x35, 0x5d, 0xfa, 0xc6, 0x3e, 0x8d, 0x60, + 0x3d, 0x12, 0x39, 0xd4, 0x8f, 0xb4, 0x47, 0x34, 0xa7, 0xe4, 0xc6, 0x7c, 0x2d, 0x03, 0x93, 0xe6, + 0xd1, 0x3e, 0xa1, 0x2d, 0xdb, 0xd1, 0xb6, 0xac, 0xa5, 0x0e, 0x83, 0x3d, 0x64, 0x70, 0xf4, 0x29, + 0x7f, 0xa4, 0x83, 0x13, 0x4b, 0x1c, 0x6f, 0x36, 0xe2, 0x2b, 0x19, 0x80, 0xf0, 0xc8, 0x9f, 0xd0, + 0x8a, 0xb7, 0xa3, 0xad, 0x78, 0x33, 0xa5, 0xf7, 0xc1, 0x21, 0x7d, 0xa1, 0xcf, 0xff, 0x23, 0xed, + 0x8b, 0xf5, 0x5b, 0x5b, 0x5b, 0x7d, 0x1a, 0xf1, 0xe5, 0x0c, 0x94, 0xb4, 0x35, 0x60, 0xa4, 0x5d, + 0xb1, 0x51, 0xdd, 0xaa, 0x09, 0xd5, 0xbe, 0xb7, 0x15, 0xef, 0x65, 0x60, 0x5c, 0x59, 0x07, 0x12, + 0x1a, 0xf1, 0x56, 0xb4, 0x11, 0x29, 0xbc, 0x87, 0x6a, 0x1b, 0xb5, 0x3e, 0x1d, 0xc1, 0x9b, 0x70, + 0xef, 0x34, 0x9a, 0x70, 0xab, 0x5f, 0x13, 0xde, 0xcf, 0xc0, 0x84, 0x61, 0x3a, 0x48, 0x68, 0x85, + 0x15, 0x6d, 0x45, 0x8a, 0x0b, 0x0c, 0xc9, 0xa7, 0x7f, 0x43, 0x0c, 0x23, 0xc2, 0x48, 0x1b, 0x22, + 0xf9, 0x1c, 0xda, 0x10, 0x65, 0x4e, 0x18, 0x75, 0x43, 0x18, 0x9f, 0xfe, 0x6b, 0x55, 0x9b, 0x16, + 0x46, 0xba, 0x56, 0xaf, 0x2f, 0xad, 0xd4, 0x0e, 0x91, 0x5b, 0xa1, 0x9d, 0x61, 0xa4, 0x8b, 0x55, + 0xb0, 0x49, 0x6e, 0xc6, 0x77, 0x32, 0x70, 0x26, 0x6e, 0x6c, 0x48, 0x68, 0xcc, 0x4e, 0xb4, 0x31, + 0x9b, 0x69, 0xdc, 0x97, 0x42, 0x66, 0xc9, 0x4d, 0xfa, 0xb5, 0x0c, 0x9c, 0x4b, 0x30, 0x34, 0x24, + 0xb4, 0xca, 0x8e, 0xb6, 0xaa, 0x36, 0x82, 0x64, 0xa2, 0xf1, 0x09, 0x6c, 0x98, 0x1a, 0x46, 0x3a, + 0x81, 0x25, 0x9f, 0xfe, 0x3a, 0x80, 0x69, 0x72, 0x18, 0xa9, 0x0e, 0xd0, 0xeb, 0x53, 0x1c, 0x9f, + 0xc6, 0xa1, 0xf1, 0x61, 0xa4, 0xd3, 0x58, 0xb0, 0xe9, 0x2f, 0xf0, 0x95, 0x29, 0x62, 0xa4, 0x02, + 0x7f, 0xa3, 0x76, 0xeb, 0x50, 0x81, 0xaf, 0xed, 0x12, 0x23, 0x16, 0xf8, 0x9c, 0x4f, 0xff, 0xd9, + 0x61, 0xda, 0x27, 0x46, 0x3a, 0x3b, 0x14, 0xa3, 0xe4, 0xa6, 0x7c, 0x3f, 0x63, 0xa4, 0x82, 0x32, + 0x8c, 0x0e, 0x09, 0x4d, 0x7a, 0x27, 0xda, 0xa4, 0xad, 0x51, 0xa4, 0x73, 0x30, 0x9b, 0xf6, 0xcd, + 0x0c, 0x4c, 0x47, 0x2d, 0x0e, 0x09, 0x8d, 0x6a, 0x44, 0x1b, 0xb5, 0x31, 0xdc, 0x0c, 0x53, 0x71, + 0x39, 0x1c, 0x37, 0x39, 0x8c, 0x54, 0x0e, 0x9b, 0xcc, 0xfa, 0x0f, 0x5e, 0x92, 0xb5, 0x61, 0xa4, + 0x83, 0xd7, 0x3f, 0x7d, 0xa7, 0xd9, 0xb4, 0x5f, 0xcf, 0xc8, 0xb4, 0x94, 0x3d, 0x26, 0x86, 0x84, + 0xc6, 0xb5, 0xa2, 0x8d, 0xbb, 0x33, 0x9a, 0xf4, 0xbe, 0x71, 0x05, 0x43, 0xdb, 0x18, 0x46, 0xaa, + 0x60, 0xd4, 0x56, 0xb6, 0x36, 0x0f, 0x53, 0xb7, 0x42, 0x7b, 0xc3, 0x68, 0xd5, 0x2d, 0xc1, 0x27, + 0xb1, 0x21, 0x95, 0x2f, 0x46, 0x9c, 0x66, 0x4e, 0xdb, 0x21, 0xba, 0xf2, 0x1b, 0x19, 0x80, 0xd0, + 0x07, 0x8f, 0x5c, 0x81, 0x3c, 0x7d, 0xd0, 0xf1, 0xe2, 0xae, 0xb2, 0x0c, 0x03, 0x39, 0x84, 0x38, + 0x50, 0xdc, 0xb1, 0x69, 0xab, 0xa1, 0x5c, 0x65, 0x52, 0x38, 0x34, 0xca, 0x08, 0xcb, 0x15, 0x46, + 0x2e, 0x6c, 0x20, 0xff, 0xe9, 0xa3, 0xe4, 0x52, 0xf9, 0x08, 0x4c, 0x9a, 0x6f, 0x47, 0x1c, 0x1d, + 0x3d, 0x59, 0xf9, 0x47, 0x79, 0x98, 0x89, 0xd9, 0x2b, 0xb4, 0x77, 0xee, 0x56, 0x98, 0x39, 0x20, + 0xea, 0x9d, 0xcb, 0x1d, 0x9a, 0x43, 0x1c, 0xf2, 0xcd, 0x0c, 0xcc, 0xdc, 0xb7, 0x82, 0xfa, 0x2e, + 0x23, 0xbc, 0x68, 0xba, 0x8c, 0xa7, 0x98, 0x8f, 0x77, 0xa3, 0x04, 0x43, 0xc3, 0x64, 0x0c, 0x80, + 0x71, 0xd6, 0xe4, 0x15, 0x18, 0xeb, 0xb8, 0xad, 0x96, 0xed, 0x34, 0xe5, 0x8b, 0x47, 0x61, 0x98, + 0xaa, 0x28, 0x46, 0x05, 0x8f, 0x3e, 0x4a, 0x97, 0x4f, 0xeb, 0xbe, 0x11, 0xeb, 0xc8, 0x13, 0x05, + 0x4c, 0x15, 0x9e, 0x82, 0x80, 0xa9, 0x7f, 0x99, 0x07, 0xd2, 0xbb, 0x5b, 0x1f, 0xf5, 0x7e, 0xe3, + 0x4b, 0x91, 0x70, 0x82, 0x52, 0xbf, 0x48, 0x00, 0x91, 0x8c, 0x45, 0xc6, 0x9c, 0xf7, 0x3c, 0xd8, + 0x25, 0xca, 0x51, 0x63, 0x0c, 0x98, 0xc2, 0xfd, 0x6b, 0xbd, 0x09, 0x55, 0x3e, 0x3b, 0x4c, 0x8d, + 0x65, 0x80, 0x21, 0xbf, 0xcd, 0x9f, 0xe6, 0xda, 0x95, 0x01, 0xf3, 0xc5, 0x81, 0x03, 0xe6, 0xab, + 0xba, 0x32, 0x1a, 0x84, 0x4e, 0x3d, 0xe1, 0x7b, 0xba, 0x99, 0xf4, 0xa7, 0x45, 0x38, 0xdb, 0x23, + 0xf1, 0x4f, 0x3f, 0xfd, 0xde, 0xab, 0x30, 0xce, 0xfe, 0x6e, 0x24, 0xc4, 0x3c, 0x5f, 0x97, 0xe5, + 0xa8, 0x31, 0x8c, 0x54, 0x73, 0xb9, 0xbe, 0xa9, 0xe6, 0xac, 0x48, 0x5a, 0xcd, 0x91, 0xbc, 0x2b, + 0xf8, 0x49, 0x98, 0x12, 0x76, 0x7e, 0x95, 0x54, 0xad, 0x10, 0xcd, 0xaa, 0x75, 0xcd, 0x04, 0x62, + 0x14, 0xb7, 0x4f, 0x0a, 0xb5, 0xe2, 0x89, 0x52, 0xa8, 0xfd, 0x72, 0x6f, 0xd6, 0xf5, 0xcf, 0x0c, + 0x51, 0x01, 0x18, 0x60, 0x4d, 0x99, 0xe9, 0x0b, 0xc7, 0x0f, 0x4d, 0x5f, 0x38, 0x0f, 0x25, 0xdf, + 0x6f, 0xdd, 0xa1, 0x9e, 0xbd, 0x23, 0xc2, 0xb6, 0x8d, 0x47, 0xee, 0x6a, 0x0a, 0x80, 0x21, 0xce, + 0x53, 0x16, 0xd2, 0xfa, 0x7e, 0x81, 0x1b, 0xc8, 0xb4, 0x22, 0x70, 0x84, 0x68, 0x7e, 0x03, 0xa6, + 0xeb, 0x2d, 0xd7, 0xa1, 0x4b, 0xb6, 0xc7, 0x25, 0xcc, 0x41, 0x3c, 0xa9, 0xd9, 0x62, 0x04, 0x8a, + 0x31, 0x6c, 0x52, 0x87, 0x42, 0xdd, 0xa3, 0x0d, 0x3f, 0x7d, 0x58, 0xde, 0x35, 0x3b, 0x58, 0x64, + 0x94, 0x44, 0x58, 0x1e, 0xff, 0x17, 0x05, 0x6d, 0x9e, 0x6a, 0xc0, 0xdf, 0xe5, 0x72, 0x90, 0x8b, + 0xcc, 0xfc, 0xe0, 0xa9, 0x06, 0x6a, 0xd7, 0x75, 0x75, 0x8c, 0x10, 0x63, 0x12, 0x60, 0xc7, 0x6e, + 0x51, 0xa6, 0x45, 0xc4, 0x93, 0x36, 0xac, 0xc8, 0x72, 0xd4, 0x18, 0x22, 0x6c, 0xdf, 0x72, 0xea, + 0xbb, 0x32, 0xf0, 0xc1, 0x08, 0xdb, 0xe7, 0xe9, 0x20, 0x25, 0x94, 0x75, 0x7b, 0x60, 0x35, 0x65, + 0x20, 0x83, 0xee, 0xf6, 0x2d, 0xab, 0x89, 0xac, 0x9c, 0x81, 0x3d, 0xba, 0x23, 0xb3, 0x0b, 0x68, + 0x30, 0xd2, 0x1d, 0x64, 0xe5, 0xa4, 0x0d, 0x45, 0x8f, 0xb6, 0xdd, 0x40, 0xbd, 0x4f, 0xbb, 0x9a, + 0xaa, 0x5b, 0x91, 0x93, 0x92, 0xca, 0x14, 0x88, 0x54, 0x48, 0xac, 0x04, 0x25, 0x13, 0x52, 0x83, + 0x0b, 0x6a, 0x57, 0x5d, 0x6d, 0x3a, 0xae, 0x47, 0xaf, 0xbb, 0x3e, 0x4f, 0x8c, 0x07, 0x7c, 0x79, + 0xa8, 0xe4, 0x51, 0x17, 0x56, 0x93, 0x90, 0x30, 0xb9, 0x6e, 0xe5, 0x1f, 0x64, 0x60, 0x5c, 0x8d, + 0xe9, 0x53, 0x90, 0x70, 0xfa, 0x16, 0xcc, 0xc4, 0xba, 0xea, 0x18, 0x01, 0x71, 0xcf, 0x43, 0xbe, + 0xeb, 0xb5, 0x84, 0x8e, 0x2f, 0x1f, 0xab, 0xbb, 0x8d, 0x6b, 0x35, 0xe4, 0xa5, 0x95, 0x3f, 0xcc, + 0xc0, 0xb4, 0x30, 0x66, 0x57, 0x3b, 0x1d, 0xd1, 0x0f, 0xb7, 0x01, 0x3a, 0x9e, 0xbd, 0x6f, 0x05, + 0x54, 0xe5, 0x1d, 0x1c, 0x6c, 0xeb, 0xdf, 0xd4, 0x95, 0xd1, 0x20, 0x44, 0x5e, 0x84, 0x82, 0xd5, + 0xe9, 0xac, 0x2e, 0xf1, 0xae, 0xc8, 0x85, 0xde, 0x3b, 0x55, 0x56, 0x88, 0x02, 0xc6, 0x96, 0xba, + 0xed, 0xf8, 0x81, 0xd5, 0x6a, 0xf1, 0x70, 0x93, 0xd5, 0x25, 0xbe, 0x66, 0x73, 0xe1, 0x52, 0x5f, + 0x8d, 0x40, 0x31, 0x86, 0x5d, 0xf9, 0xfb, 0x13, 0x70, 0xb6, 0xc7, 0x36, 0x6f, 0x04, 0x6b, 0xe6, + 0x7a, 0x82, 0x35, 0x8d, 0xdd, 0x3c, 0x7b, 0x2a, 0xbb, 0xb9, 0xce, 0x23, 0x9d, 0x3b, 0x6e, 0x1e, + 0xe9, 0x30, 0x47, 0xa3, 0x8c, 0xf9, 0x4c, 0xc8, 0xbd, 0x1b, 0xe6, 0x75, 0x44, 0x03, 0xff, 0x58, + 0x89, 0xad, 0x6f, 0xc2, 0xb8, 0xd5, 0xb1, 0x45, 0xfa, 0xd6, 0xe2, 0xc0, 0xd3, 0xb4, 0xba, 0xb9, + 0x2a, 0x72, 0xb7, 0x6a, 0x22, 0xbd, 0x89, 0x5b, 0xc7, 0x86, 0x9b, 0xb8, 0xd5, 0x54, 0xc1, 0xc7, + 0x8f, 0x54, 0xc1, 0x5f, 0x82, 0xa2, 0x55, 0x0f, 0xec, 0x7d, 0x2a, 0x37, 0x52, 0x2d, 0x0d, 0xab, + 0xbc, 0x14, 0x25, 0x54, 0xbe, 0x6c, 0xaf, 0x22, 0x62, 0xb9, 0x58, 0x89, 0xbe, 0x6c, 0xaf, 0x83, + 0x65, 0x4d, 0x3c, 0xae, 0xe7, 0xf0, 0xf9, 0x12, 0x4d, 0x1e, 0x1b, 0xea, 0x39, 0x26, 0x10, 0xa3, + 0xb8, 0xa4, 0x0a, 0x33, 0xa2, 0xe0, 0x76, 0x87, 0x1d, 0x9f, 0x59, 0xf5, 0xc9, 0xe8, 0xac, 0xb8, + 0x16, 0x05, 0x63, 0x1c, 0xbf, 0x8f, 0xaa, 0x34, 0x95, 0x5e, 0x55, 0x9a, 0x4e, 0xad, 0x2a, 0xc5, + 0xd7, 0xe1, 0x00, 0xaa, 0xd2, 0x57, 0xe3, 0xf9, 0x9b, 0x85, 0xb7, 0x73, 0x0a, 0xb5, 0x86, 0x2d, + 0xaa, 0x86, 0x99, 0xa1, 0xf9, 0x58, 0x79, 0x9b, 0x7f, 0x1a, 0xa6, 0x5c, 0xaf, 0x69, 0x39, 0xf6, + 0xbb, 0x5c, 0xc2, 0xf8, 0xdc, 0xed, 0xb9, 0x24, 0xe6, 0xe8, 0x4d, 0x13, 0x80, 0x51, 0x3c, 0xd2, + 0x85, 0x52, 0x53, 0x89, 0xd5, 0xf2, 0xd9, 0xb4, 0x82, 0x25, 0x2a, 0xa1, 0x45, 0x2c, 0x9c, 0x2e, + 0xc3, 0x90, 0x93, 0xa1, 0x07, 0x92, 0xa7, 0x40, 0x0f, 0xfc, 0x3f, 0x63, 0x5c, 0x5a, 0x47, 0x2f, + 0x30, 0x4f, 0xff, 0x7c, 0xf5, 0x33, 0x50, 0x92, 0x9a, 0xb7, 0xdc, 0x9d, 0x4a, 0x0b, 0x3f, 0xa6, + 0xa3, 0x51, 0xe3, 0xd9, 0xcd, 0x57, 0x97, 0x30, 0xc4, 0x3e, 0xd6, 0x61, 0x2b, 0x96, 0x21, 0x3b, + 0x3f, 0xbc, 0x0c, 0xd9, 0x35, 0xb8, 0x20, 0xf2, 0x71, 0xd6, 0x6a, 0x6b, 0xfc, 0x20, 0x60, 0x8b, + 0xd7, 0x66, 0xe5, 0x23, 0x70, 0x5a, 0x27, 0x5a, 0x4e, 0x42, 0xc2, 0xe4, 0xba, 0x52, 0xa0, 0xb5, + 0x2c, 0x2d, 0xd0, 0x8a, 0x3d, 0x02, 0x2d, 0x04, 0x62, 0x14, 0xb7, 0x8f, 0x34, 0x1a, 0x4f, 0x2f, + 0x8d, 0x4a, 0x43, 0x90, 0x46, 0xd1, 0x79, 0x76, 0xc2, 0x83, 0x1b, 0x1c, 0x7a, 0x70, 0xfb, 0x34, + 0x4c, 0x88, 0x97, 0xb2, 0xc5, 0x58, 0x4f, 0x0c, 0x3c, 0xd6, 0xb5, 0xb0, 0x36, 0x9a, 0xa4, 0x8c, + 0x95, 0x3d, 0x79, 0x3a, 0x69, 0xb7, 0x2b, 0x50, 0x6c, 0x7a, 0x6e, 0xb7, 0x23, 0x42, 0x6a, 0xe4, + 0xd4, 0xbe, 0xc6, 0x4b, 0x50, 0x42, 0xd2, 0xad, 0xfe, 0x6f, 0x95, 0x60, 0x26, 0xe6, 0x37, 0x90, + 0x68, 0xab, 0xcd, 0x3c, 0x39, 0x5b, 0xed, 0x95, 0x48, 0xf6, 0xbe, 0xa4, 0x54, 0x1b, 0x3d, 0xc9, + 0xc3, 0x73, 0xc7, 0x4f, 0x1e, 0x4e, 0x7e, 0x12, 0x4a, 0x56, 0xa3, 0xe1, 0x51, 0xdf, 0xa7, 0xea, + 0x41, 0x03, 0xf1, 0x96, 0xbb, 0x2a, 0xc4, 0x10, 0xce, 0xad, 0x40, 0x8d, 0x1d, 0x9f, 0x9d, 0x33, + 0xe2, 0x67, 0x40, 0xd6, 0x8b, 0xac, 0x1c, 0x35, 0x06, 0x69, 0xc0, 0xcc, 0x9e, 0xb7, 0xbd, 0xb8, + 0x68, 0xd5, 0x77, 0xe9, 0x49, 0x8c, 0x78, 0x3c, 0x01, 0xcc, 0x8d, 0x28, 0x05, 0x8c, 0x93, 0x94, + 0x5c, 0x6e, 0xd0, 0x83, 0xc0, 0xda, 0x3e, 0x89, 0xae, 0xa7, 0xb8, 0x98, 0x14, 0x30, 0x4e, 0x92, + 0x69, 0x66, 0x7b, 0xde, 0xb6, 0x3a, 0x60, 0xc9, 0x03, 0xa9, 0xd6, 0xcc, 0x6e, 0x84, 0x20, 0x34, + 0xf1, 0x58, 0x87, 0xed, 0x79, 0xdb, 0x48, 0xad, 0x56, 0x5b, 0xa6, 0xbe, 0xd3, 0x1d, 0x76, 0x43, + 0x96, 0xa3, 0xc6, 0x20, 0x1d, 0x20, 0xec, 0xeb, 0xf8, 0xb8, 0xeb, 0x30, 0x73, 0x69, 0x4d, 0x39, + 0xfe, 0xfb, 0xd2, 0x17, 0x99, 0x7c, 0xbb, 0xd1, 0x43, 0x07, 0x13, 0x68, 0x93, 0xcf, 0xc0, 0xb3, + 0x7b, 0xde, 0xb6, 0xbc, 0x02, 0xdc, 0xf4, 0x6c, 0xa7, 0x6e, 0x77, 0x2c, 0x91, 0x0d, 0x6f, 0x22, + 0xfa, 0x14, 0xde, 0x8d, 0x64, 0x34, 0xec, 0x57, 0x3f, 0x7a, 0x71, 0x30, 0x99, 0xf6, 0xe2, 0x20, + 0xb6, 0x48, 0x4f, 0x74, 0x71, 0x30, 0xf5, 0x14, 0xa8, 0x23, 0x5f, 0x19, 0x83, 0x89, 0xeb, 0x5b, + 0x5b, 0x9b, 0x2a, 0xd7, 0xe5, 0x11, 0x66, 0x29, 0x23, 0x77, 0x69, 0xf6, 0x14, 0x9f, 0xa9, 0x93, + 0x89, 0xfa, 0x72, 0xa3, 0x4a, 0xd4, 0xf7, 0x12, 0x14, 0xdb, 0x34, 0xd8, 0x75, 0x1b, 0xf1, 0xdc, + 0xd4, 0xeb, 0xbc, 0x14, 0x25, 0x34, 0x96, 0x09, 0xb4, 0x70, 0xea, 0x99, 0x40, 0x5f, 0x81, 0xb1, + 0xc0, 0x6e, 0x53, 0xb7, 0x2b, 0x24, 0x5b, 0x2e, 0xec, 0xb2, 0x2d, 0x51, 0x8c, 0x0a, 0x4e, 0x3a, + 0x50, 0xda, 0x56, 0x86, 0x6a, 0x29, 0xa0, 0x86, 0x62, 0xf3, 0xe6, 0xc2, 0x5a, 0xff, 0xc4, 0x90, + 0x09, 0xf9, 0x22, 0x8c, 0xed, 0x52, 0xab, 0xc1, 0x7a, 0x66, 0x3c, 0x6d, 0x24, 0x92, 0x31, 0x25, + 0xe7, 0xae, 0x0b, 0xa2, 0xb1, 0x70, 0x1c, 0x59, 0x8a, 0x8a, 0x27, 0xf9, 0x05, 0x98, 0x12, 0xa7, + 0x5f, 0x09, 0x91, 0xea, 0xd3, 0x4a, 0x9a, 0x08, 0xff, 0x90, 0x9c, 0x38, 0xfe, 0x98, 0x25, 0x3e, + 0x46, 0xf9, 0x5d, 0x7a, 0x1d, 0x26, 0xcd, 0xa6, 0x0e, 0xfa, 0x2a, 0xc6, 0x54, 0xe4, 0xc9, 0x42, + 0xf2, 0xb2, 0x91, 0x27, 0x3e, 0xa7, 0xcf, 0x6d, 0x2a, 0x89, 0xae, 0xb9, 0x1d, 0x8b, 0xa7, 0x12, + 0x7e, 0xea, 0xe3, 0x77, 0xe4, 0x53, 0x09, 0xb9, 0xc8, 0x53, 0x09, 0xbc, 0x1c, 0x35, 0x06, 0x4f, + 0xb5, 0x12, 0x78, 0x77, 0xf4, 0xae, 0x6d, 0x86, 0xd4, 0x31, 0x4c, 0x09, 0xad, 0xfc, 0xd2, 0x34, + 0x4c, 0x9a, 0x29, 0xe0, 0xd8, 0xdc, 0x53, 0x59, 0xbb, 0x32, 0xd1, 0xec, 0x58, 0x2a, 0x63, 0x97, + 0x82, 0x47, 0x22, 0xa3, 0xb2, 0x87, 0x46, 0x46, 0x7d, 0x47, 0x24, 0x0e, 0x8d, 0xe6, 0x11, 0x4f, + 0x9f, 0xf4, 0xa3, 0x27, 0x35, 0xb9, 0x4e, 0x21, 0x1a, 0x2d, 0xc6, 0x5e, 0xe6, 0xe4, 0x77, 0x32, + 0xf0, 0x9c, 0x47, 0x99, 0xd8, 0xa1, 0x5e, 0x4f, 0x05, 0x79, 0x92, 0x19, 0x6a, 0xd3, 0x5e, 0x78, + 0xf4, 0x70, 0xf6, 0x39, 0xec, 0xc7, 0x11, 0xfb, 0x37, 0x86, 0xfc, 0x9d, 0x0c, 0x94, 0xdb, 0x34, + 0xf0, 0xec, 0xba, 0xdf, 0xdb, 0xd2, 0xc2, 0xf0, 0x5b, 0xfa, 0xfc, 0xa3, 0x87, 0xb3, 0xe5, 0xf5, + 0x3e, 0x0c, 0xb1, 0x6f, 0x53, 0xc8, 0x7b, 0x99, 0xa4, 0x97, 0x2a, 0x52, 0x84, 0x51, 0x18, 0x49, + 0x72, 0x6a, 0x81, 0x67, 0x05, 0xb4, 0x79, 0x70, 0xc4, 0x63, 0x15, 0xad, 0xc8, 0x85, 0x58, 0xca, + 0x2b, 0x11, 0xb5, 0xdd, 0x8a, 0x69, 0x9d, 0xa0, 0x03, 0x7c, 0x37, 0x03, 0x93, 0x8e, 0xdb, 0xa0, + 0x4a, 0x47, 0x92, 0x02, 0xf1, 0xd3, 0xc3, 0xc9, 0xc6, 0x38, 0xb7, 0x61, 0x90, 0x16, 0x62, 0x51, + 0xdb, 0x75, 0x4c, 0x10, 0x46, 0xda, 0x40, 0x6e, 0xc3, 0x44, 0xe0, 0xb6, 0xa8, 0x27, 0xad, 0x3a, + 0x42, 0x3c, 0x5e, 0x4e, 0x52, 0xf3, 0xb6, 0x34, 0x5a, 0xa8, 0x72, 0x86, 0x65, 0x3e, 0x9a, 0x74, + 0x08, 0xed, 0xcd, 0x9a, 0x2f, 0x34, 0xc8, 0x97, 0x92, 0x48, 0x6f, 0xba, 0x8d, 0x13, 0x25, 0xce, + 0x27, 0x0e, 0x9c, 0xd1, 0xf9, 0xfa, 0x85, 0x8e, 0xec, 0xcb, 0x24, 0x0f, 0x89, 0x9a, 0xea, 0x9a, + 0x5b, 0xb7, 0x5a, 0x22, 0x91, 0x11, 0xd2, 0x1d, 0xea, 0xf1, 0x7c, 0x4a, 0xfa, 0x85, 0x83, 0xd5, + 0x18, 0x25, 0xec, 0xa1, 0x4d, 0xae, 0xc1, 0xd9, 0x8e, 0x67, 0xbb, 0xbc, 0x09, 0x2d, 0xcb, 0x17, + 0x79, 0x6d, 0x84, 0xa1, 0x52, 0x07, 0xba, 0x6d, 0xc6, 0x11, 0xb0, 0xb7, 0x8e, 0x38, 0x48, 0x8b, + 0x42, 0xae, 0x11, 0x16, 0xd4, 0x41, 0x5a, 0x94, 0xa1, 0x86, 0x92, 0x15, 0x18, 0xb7, 0x76, 0x76, + 0x6c, 0x87, 0x61, 0x8a, 0x77, 0xa6, 0x9e, 0x4f, 0xfa, 0xb4, 0xaa, 0xc4, 0x91, 0xb6, 0x68, 0xf9, + 0x0b, 0x75, 0x5d, 0x95, 0xa1, 0xdf, 0xae, 0x9b, 0x6f, 0xfe, 0xf3, 0xb7, 0xa4, 0x62, 0x19, 0xfa, + 0xa3, 0x18, 0x98, 0x50, 0x8b, 0xb5, 0xde, 0xa7, 0x41, 0x60, 0x3b, 0x4d, 0x5f, 0xbe, 0x11, 0xc5, + 0xb9, 0xd6, 0x64, 0x19, 0x6a, 0x28, 0x3b, 0xd8, 0xf9, 0x81, 0xe5, 0x05, 0x55, 0xaf, 0xe9, 0xf3, + 0x54, 0x05, 0xf2, 0x60, 0x57, 0x53, 0x85, 0x18, 0xc2, 0xc9, 0xc7, 0x61, 0xd2, 0x37, 0x72, 0x6f, + 0x72, 0xcb, 0x5d, 0x49, 0x5e, 0x09, 0x1a, 0xe5, 0x18, 0xc1, 0x22, 0x73, 0x00, 0x6d, 0xeb, 0x81, + 0xd4, 0x0e, 0xcb, 0xe7, 0xc4, 0xfe, 0xc5, 0xd4, 0xa5, 0x75, 0x5d, 0x8a, 0x06, 0xc6, 0xa5, 0x9f, + 0x83, 0xb3, 0x3d, 0x4b, 0x65, 0xa0, 0x6d, 0xf9, 0xb7, 0xb3, 0x30, 0x13, 0x4b, 0x13, 0x7a, 0x94, + 0x86, 0xfc, 0x39, 0x98, 0x14, 0xe6, 0x2a, 0x79, 0x36, 0xcc, 0x0e, 0x7c, 0x27, 0x5a, 0x35, 0xaa, + 0x63, 0x84, 0x18, 0xb9, 0x1a, 0xeb, 0xb6, 0x5c, 0x34, 0xcf, 0xd2, 0x21, 0x5d, 0x27, 0x35, 0xe8, + 0xfc, 0x88, 0x34, 0xe8, 0xca, 0x1c, 0x4c, 0xdc, 0xb8, 0x5a, 0x53, 0xe1, 0x6d, 0x61, 0x52, 0xff, + 0x0c, 0x4f, 0xa4, 0xdc, 0x93, 0xd4, 0xbf, 0xf2, 0xad, 0x1c, 0x9c, 0x35, 0x2a, 0xc8, 0x17, 0x38, + 0x7e, 0x01, 0x8a, 0x2d, 0x6b, 0x9b, 0xb6, 0x54, 0x96, 0xfd, 0x14, 0x07, 0xb8, 0x1e, 0xe2, 0x73, + 0x6b, 0x9c, 0x72, 0x2c, 0x3e, 0x53, 0x14, 0xa2, 0x64, 0x4b, 0x76, 0x61, 0x6c, 0x5b, 0x66, 0x2f, + 0xcf, 0x0e, 0x2b, 0x7b, 0x39, 0x37, 0xc0, 0xaa, 0x9c, 0xe5, 0x8a, 0x3c, 0xb7, 0x63, 0x7a, 0x9e, + 0xeb, 0xdd, 0x54, 0xb9, 0xcb, 0xa5, 0x06, 0x2f, 0x1d, 0xac, 0x42, 0x3b, 0x66, 0x12, 0x12, 0x26, + 0xd7, 0xbd, 0xf4, 0x33, 0x30, 0x61, 0x7c, 0xe5, 0x40, 0x53, 0xfd, 0x9f, 0xe7, 0x60, 0x5c, 0x65, + 0xe0, 0x3d, 0x6a, 0x8e, 0xbf, 0x08, 0x05, 0xfe, 0xbe, 0xba, 0xb4, 0x11, 0xe9, 0x6b, 0x4d, 0xfe, + 0xfe, 0x3a, 0x0a, 0x98, 0xa9, 0x2f, 0xe6, 0x8e, 0xd0, 0x17, 0x47, 0x3c, 0x39, 0xc9, 0x36, 0xe4, + 0x7d, 0xcb, 0x6f, 0x49, 0x95, 0x28, 0x4d, 0x50, 0x6d, 0xb5, 0xb6, 0x66, 0xbe, 0xe9, 0xc6, 0x7e, + 0x23, 0xa7, 0x4d, 0xbe, 0x9a, 0x81, 0xa9, 0xba, 0xeb, 0xf8, 0xdd, 0x36, 0xf5, 0xb8, 0xc5, 0x50, + 0x6a, 0x39, 0x6b, 0x29, 0x43, 0x12, 0x17, 0x4d, 0x9a, 0xe2, 0x14, 0x12, 0x29, 0xc2, 0x28, 0x57, + 0xfe, 0xb2, 0x74, 0x6f, 0x45, 0x32, 0x0f, 0x25, 0x6e, 0xbf, 0x34, 0xd2, 0xb3, 0x69, 0xef, 0x9a, + 0x6b, 0x0a, 0x80, 0x21, 0x0e, 0x3b, 0x27, 0xb8, 0xad, 0x06, 0xd5, 0xaf, 0x03, 0xe9, 0x15, 0x73, + 0x93, 0x97, 0xa2, 0x84, 0xb2, 0x7d, 0xd2, 0xa3, 0xdb, 0x56, 0xcb, 0x32, 0x74, 0x31, 0x39, 0xe0, + 0x7a, 0x9f, 0xc4, 0x38, 0x02, 0xf6, 0xd6, 0xa9, 0xfc, 0xa7, 0x71, 0x38, 0x13, 0x0f, 0xc2, 0x3c, + 0x6a, 0x22, 0xce, 0x43, 0xa9, 0x63, 0x79, 0x81, 0x6d, 0xbc, 0xc7, 0xa5, 0xbf, 0x6a, 0x53, 0x01, + 0x30, 0xc4, 0x09, 0x67, 0x6e, 0xee, 0x90, 0x99, 0x9b, 0xfc, 0x9a, 0x41, 0xfe, 0xf4, 0x5f, 0x33, + 0x90, 0xeb, 0xa2, 0x30, 0xaa, 0x75, 0x61, 0x7a, 0x6a, 0x16, 0x8f, 0xf4, 0xd4, 0x7c, 0xbf, 0xd7, + 0xa9, 0xec, 0xd3, 0xc3, 0x8b, 0xb7, 0x1d, 0xec, 0xa2, 0x34, 0xb6, 0xd4, 0xc6, 0x9f, 0xc4, 0x52, + 0x23, 0x9b, 0x70, 0xbe, 0x65, 0xb7, 0xa5, 0x67, 0x9c, 0xbf, 0x49, 0xbd, 0x1a, 0xad, 0xbb, 0x4e, + 0x83, 0x1b, 0x5e, 0x73, 0xa1, 0xc3, 0xc2, 0x5a, 0x02, 0x0e, 0x26, 0xd6, 0x34, 0x65, 0x26, 0x1c, + 0x21, 0x33, 0x95, 0x4c, 0x9b, 0x18, 0xa1, 0x4c, 0x3b, 0xf5, 0xfb, 0x97, 0xd0, 0x21, 0x79, 0xea, + 0x30, 0x87, 0xe4, 0x74, 0x26, 0xcf, 0xbf, 0x09, 0x30, 0xc9, 0xc7, 0xfb, 0x98, 0x36, 0xcf, 0x63, + 0xed, 0x76, 0x11, 0x49, 0x94, 0xe3, 0x6a, 0xfe, 0xe1, 0x92, 0x28, 0x6a, 0x4a, 0xcc, 0x9f, 0xba, + 0x29, 0xf1, 0x2a, 0x4c, 0x7a, 0xe2, 0xf9, 0xb5, 0x46, 0xb5, 0xbe, 0xe7, 0xcb, 0xf7, 0x7a, 0x0c, + 0xff, 0x80, 0x10, 0x86, 0x11, 0x4c, 0x26, 0x35, 0xea, 0x6e, 0x9b, 0x67, 0x3b, 0x8d, 0x4b, 0x8d, + 0x45, 0x59, 0x8e, 0x1a, 0x83, 0xbc, 0x01, 0xd3, 0x3b, 0xad, 0xae, 0xbf, 0xbb, 0xc2, 0x68, 0x50, + 0xa7, 0x2e, 0xde, 0x65, 0x29, 0x84, 0xde, 0x4d, 0x2b, 0x11, 0x28, 0xc6, 0xb0, 0x47, 0xfe, 0x46, + 0x8b, 0x61, 0xd1, 0x2e, 0x9d, 0xa2, 0x45, 0xfb, 0x67, 0x61, 0x46, 0xcf, 0x05, 0xdb, 0x69, 0x2a, + 0xa7, 0xbe, 0x92, 0x38, 0x0d, 0x6f, 0x46, 0x41, 0x18, 0xc7, 0x35, 0x05, 0xc5, 0xc4, 0x31, 0x05, + 0xc5, 0xe4, 0x08, 0x05, 0xc5, 0x37, 0x32, 0x30, 0xed, 0xd7, 0x77, 0x69, 0xdb, 0x42, 0xda, 0xb4, + 0xfd, 0xc0, 0x3b, 0x90, 0x97, 0x1f, 0x29, 0x82, 0xea, 0x6a, 0x11, 0x7a, 0x92, 0x31, 0x7f, 0xd0, + 0x35, 0x0a, 0xc1, 0x18, 0x67, 0xf2, 0xa5, 0xd0, 0x0e, 0x3d, 0x9d, 0x36, 0xb9, 0x8c, 0x29, 0x27, + 0x4e, 0x6c, 0x88, 0x9e, 0x79, 0x8a, 0x0c, 0xd1, 0x37, 0x01, 0xd6, 0xdc, 0xa6, 0x92, 0x8c, 0x55, + 0x98, 0x51, 0x6f, 0xec, 0x8a, 0x1d, 0x4a, 0x44, 0x74, 0xe5, 0xc3, 0xeb, 0xe4, 0xd5, 0x28, 0x18, + 0xe3, 0xf8, 0x95, 0xdf, 0x2f, 0xc2, 0x4c, 0x2c, 0xab, 0xc5, 0x50, 0x04, 0x2e, 0x93, 0x42, 0x2d, + 0x9b, 0x3a, 0xc1, 0x6a, 0x43, 0x2a, 0x73, 0xa1, 0x14, 0x12, 0xe5, 0x4b, 0xa8, 0x31, 0x3e, 0x38, + 0x2a, 0x9d, 0xa9, 0x72, 0x15, 0x8e, 0xfb, 0x40, 0x55, 0x71, 0x54, 0xc2, 0xef, 0xab, 0xbd, 0x2a, + 0xdd, 0xdd, 0xa1, 0x25, 0x2f, 0x39, 0xd1, 0x9d, 0xe9, 0xe9, 0x3c, 0x25, 0xac, 0x83, 0x41, 0x4a, + 0x23, 0x0b, 0x06, 0x49, 0xa7, 0xa3, 0x7c, 0x23, 0x07, 0xba, 0x9f, 0x98, 0x74, 0x9d, 0xb0, 0x1c, + 0xc7, 0x0d, 0xa4, 0xe5, 0x36, 0x93, 0x56, 0xaa, 0x29, 0xca, 0x73, 0xd5, 0x90, 0x6a, 0x2c, 0x0f, + 0x9a, 0x01, 0x41, 0x93, 0x39, 0xd9, 0xd7, 0x26, 0x1a, 0x71, 0x01, 0xbc, 0x31, 0x84, 0x66, 0x1c, + 0xc3, 0x32, 0x73, 0xe9, 0x0d, 0x38, 0x13, 0x6f, 0xed, 0x20, 0x3d, 0x9a, 0xc6, 0x34, 0xf2, 0x27, + 0x59, 0x18, 0xdf, 0xa8, 0x6e, 0xd5, 0xf8, 0x2d, 0x67, 0x03, 0x0a, 0xfc, 0xca, 0x53, 0xba, 0xe8, + 0x0c, 0x65, 0xea, 0x70, 0xf3, 0x18, 0xff, 0x89, 0x82, 0x38, 0x59, 0x61, 0x22, 0x70, 0x8f, 0x3a, + 0x83, 0x99, 0x0f, 0x4b, 0x42, 0x4a, 0xee, 0x51, 0x07, 0x45, 0x75, 0xb2, 0x08, 0x79, 0x87, 0x7d, + 0xe7, 0x40, 0x8f, 0x40, 0x8a, 0x77, 0xa5, 0x98, 0xde, 0xc1, 0x2b, 0xf3, 0x87, 0x64, 0x3d, 0xda, + 0xa0, 0x4e, 0x60, 0x5b, 0xad, 0xc1, 0x7c, 0xf9, 0xc4, 0x43, 0xb2, 0xba, 0x32, 0x1a, 0x84, 0x2a, + 0x3f, 0xcc, 0xc0, 0x98, 0x7c, 0xca, 0x8a, 0xb4, 0xa0, 0xe8, 0x58, 0xdc, 0x61, 0x39, 0xb5, 0xfb, + 0xe3, 0x06, 0xa7, 0xa3, 0xaf, 0x85, 0xf8, 0xea, 0x17, 0x65, 0x28, 0x79, 0x90, 0x5d, 0x28, 0x52, + 0xf1, 0x88, 0x54, 0x76, 0x88, 0xaf, 0xfc, 0x0b, 0x3f, 0x48, 0xf1, 0x6c, 0x94, 0xa4, 0x5f, 0xf9, + 0x51, 0x06, 0x20, 0x44, 0x39, 0x6a, 0xe3, 0xfb, 0x49, 0x28, 0xd5, 0x5b, 0x5d, 0x3f, 0xa0, 0x9e, + 0x76, 0xca, 0x14, 0x4f, 0x40, 0xa8, 0x42, 0x0c, 0xe1, 0xe4, 0x55, 0x29, 0xc2, 0xc4, 0xe6, 0x57, + 0x56, 0xd2, 0xe7, 0xf1, 0xc3, 0xd9, 0x49, 0x1e, 0x88, 0xa8, 0x4c, 0x2d, 0x22, 0x34, 0x2d, 0x6e, + 0x96, 0xce, 0x0f, 0xd1, 0x2c, 0x5d, 0xf9, 0xbd, 0x22, 0x9c, 0x89, 0x27, 0x8d, 0x3a, 0xea, 0x5b, + 0x8d, 0xc7, 0x96, 0xb2, 0x47, 0x3c, 0xb6, 0x94, 0xbc, 0x79, 0xe7, 0x9e, 0xec, 0xe6, 0x9d, 0x3f, + 0xee, 0xe6, 0x3d, 0x32, 0xeb, 0x4d, 0xc4, 0x1e, 0x53, 0x4c, 0x6b, 0x8f, 0x89, 0x8f, 0xdf, 0x00, + 0xbb, 0xf7, 0xdb, 0x72, 0x26, 0xa6, 0xbe, 0x57, 0x55, 0x42, 0xb6, 0x27, 0xb0, 0xf2, 0xd4, 0xf5, + 0x83, 0x59, 0x28, 0xdc, 0xeb, 0xd2, 0x2e, 0x95, 0x4e, 0x74, 0x5c, 0xb0, 0xf2, 0xdc, 0x10, 0x28, + 0xca, 0xd3, 0xed, 0xee, 0xdf, 0xc9, 0xc3, 0x04, 0xfb, 0xd6, 0x63, 0x1a, 0x20, 0x06, 0x58, 0x2a, + 0xc6, 0x69, 0x36, 0x77, 0x8a, 0xa7, 0xd9, 0x27, 0x6d, 0xcc, 0x18, 0xf5, 0x52, 0x53, 0x33, 0xbc, + 0x38, 0xaa, 0x19, 0x5e, 0xf9, 0x51, 0x01, 0xa6, 0xa3, 0xe9, 0x87, 0xc8, 0x27, 0x60, 0x62, 0xd7, + 0xf5, 0x03, 0xe9, 0x18, 0x2b, 0x67, 0x87, 0x56, 0xd0, 0xae, 0x87, 0x20, 0x34, 0xf1, 0x8e, 0x7d, + 0x39, 0x23, 0x5f, 0x18, 0x8e, 0x5f, 0xce, 0xc8, 0x57, 0x88, 0x51, 0xc1, 0xff, 0xea, 0xe8, 0x94, + 0x3c, 0x25, 0xbe, 0xd2, 0x7b, 0x74, 0xba, 0x33, 0xac, 0xcc, 0x53, 0x1f, 0xe0, 0x93, 0x53, 0x3a, + 0xc1, 0xf7, 0xab, 0x33, 0x30, 0x1d, 0xd5, 0xcf, 0xd8, 0xa8, 0x6a, 0x5f, 0xb1, 0x0c, 0xb7, 0x0c, + 0x1a, 0x8f, 0xaa, 0xf4, 0xf8, 0x8b, 0x29, 0xa5, 0x27, 0x7b, 0x2c, 0xa5, 0x27, 0xee, 0x77, 0x94, + 0x3b, 0x7d, 0xbf, 0xa3, 0x64, 0x07, 0xb7, 0xfc, 0x93, 0x74, 0x70, 0x7b, 0x5a, 0xbc, 0xc6, 0xbe, + 0x17, 0x77, 0xa2, 0x2a, 0xa6, 0xcd, 0x0e, 0x12, 0x9d, 0x7a, 0xc3, 0x71, 0xa3, 0x1a, 0x1b, 0x92, + 0x1b, 0x95, 0xe9, 0xa0, 0x36, 0x3e, 0x72, 0x07, 0xb5, 0x04, 0xa7, 0xad, 0xd2, 0x08, 0x9c, 0xb6, + 0x2a, 0x50, 0x6c, 0x5b, 0x0f, 0xaa, 0x4d, 0x15, 0x5a, 0xca, 0x05, 0xca, 0x3a, 0x2f, 0x41, 0x09, + 0x39, 0x75, 0xc7, 0xae, 0x64, 0xef, 0xa8, 0xc9, 0x13, 0x79, 0x47, 0x25, 0x3a, 0x89, 0x4d, 0xa5, + 0x74, 0x12, 0x9b, 0x3e, 0xb6, 0x93, 0xd8, 0x4c, 0x0a, 0x27, 0xb1, 0x0f, 0xc1, 0x58, 0xdb, 0x7a, + 0xb0, 0xee, 0x4b, 0xbf, 0xae, 0xbc, 0x70, 0x53, 0x59, 0x17, 0x45, 0xa8, 0x60, 0xac, 0x61, 0x6d, + 0xeb, 0xc1, 0xc2, 0x41, 0x40, 0x7d, 0x1e, 0xd2, 0x29, 0xfd, 0xbf, 0xd6, 0x65, 0x19, 0x6a, 0xa8, + 0x24, 0x58, 0xeb, 0x6e, 0xfb, 0xdc, 0x9b, 0x2b, 0x24, 0xc8, 0x8a, 0x50, 0xc1, 0x06, 0xf5, 0xe1, + 0x22, 0x6b, 0x70, 0xde, 0xb3, 0x76, 0x82, 0xeb, 0xd4, 0xf2, 0x82, 0x6d, 0x6a, 0x05, 0xca, 0x4d, + 0xe6, 0xbc, 0xde, 0x01, 0xce, 0x63, 0x02, 0x1c, 0x13, 0x6b, 0x91, 0x55, 0x38, 0xc7, 0xca, 0x97, + 0x5b, 0x42, 0xb5, 0x50, 0xc4, 0x2e, 0x88, 0x00, 0xe4, 0x47, 0x0f, 0x67, 0xcf, 0x61, 0x2f, 0x18, + 0x93, 0xea, 0x90, 0x4f, 0xc1, 0x19, 0x56, 0xbc, 0x46, 0x2d, 0x9f, 0x2a, 0x3a, 0x17, 0x85, 0x3f, + 0x16, 0x9b, 0x89, 0x18, 0x83, 0x61, 0x0f, 0x36, 0x59, 0x84, 0xb3, 0xac, 0x6c, 0xd1, 0x6d, 0xb7, + 0x6d, 0xfd, 0x5d, 0xcf, 0x8a, 0x58, 0x2a, 0xee, 0x36, 0x11, 0x07, 0x62, 0x2f, 0x7e, 0x7a, 0x1f, + 0xb7, 0x6f, 0xe7, 0xe1, 0xcc, 0xcd, 0x0e, 0x75, 0xee, 0xee, 0xda, 0xfe, 0x9e, 0x3a, 0x91, 0x5c, + 0x81, 0x3c, 0xd3, 0x29, 0xe3, 0x29, 0x16, 0x98, 0xd2, 0x89, 0x1c, 0x62, 0xde, 0x40, 0x65, 0x8f, + 0xb8, 0x81, 0x9a, 0x87, 0x92, 0x63, 0xb5, 0xa9, 0xdf, 0xb1, 0xea, 0x3d, 0x6f, 0x0b, 0x6f, 0x28, + 0x00, 0x86, 0x38, 0x04, 0xa1, 0xc4, 0xf6, 0xef, 0x13, 0xc4, 0x8e, 0x8a, 0x50, 0x32, 0x55, 0x17, + 0x43, 0x32, 0xe4, 0x35, 0x00, 0x8b, 0x8f, 0x1f, 0x5f, 0xa3, 0x85, 0xe8, 0x43, 0x8e, 0x55, 0x0d, + 0x41, 0x03, 0xcb, 0x3c, 0x4d, 0x15, 0x9f, 0xd8, 0x69, 0x6a, 0xec, 0xb4, 0x4f, 0x53, 0x95, 0xcf, + 0xc0, 0xd9, 0x9e, 0xc8, 0x71, 0x76, 0xac, 0x10, 0x29, 0x1c, 0x32, 0xd1, 0x63, 0x45, 0x24, 0x71, + 0xc3, 0x2c, 0x14, 0xf8, 0x28, 0xca, 0xc4, 0x1b, 0xfc, 0xd8, 0xcc, 0x47, 0x18, 0x45, 0x79, 0x05, + 0x61, 0xd2, 0x4c, 0x9b, 0x77, 0x74, 0x3a, 0x3c, 0x9d, 0xec, 0x23, 0xdb, 0x2f, 0xd9, 0x47, 0xe5, + 0xfb, 0x59, 0x38, 0x97, 0xa0, 0x98, 0xb1, 0x05, 0x2a, 0x9f, 0x50, 0x0a, 0x65, 0x73, 0x26, 0x5c, + 0xa0, 0xb5, 0x18, 0x0c, 0x7b, 0xb0, 0xc9, 0x17, 0xd8, 0x9c, 0xa9, 0x53, 0xdf, 0x5f, 0x77, 0x1b, + 0xaa, 0x05, 0x3f, 0x27, 0xe6, 0x8b, 0x2a, 0x7d, 0xfc, 0x70, 0xf6, 0xc3, 0x62, 0x66, 0xce, 0x5b, + 0x1d, 0x7b, 0x9e, 0xcd, 0xcc, 0xf9, 0x7d, 0x43, 0x51, 0x0c, 0xee, 0xb8, 0xad, 0x6e, 0x9b, 0x86, + 0x15, 0xd0, 0x20, 0x49, 0xde, 0x02, 0xd8, 0xe7, 0xf0, 0x9a, 0xfd, 0xae, 0x52, 0x4f, 0x0f, 0x7d, + 0x17, 0x74, 0x4e, 0x3d, 0x2f, 0x38, 0x77, 0xab, 0x6b, 0x39, 0x01, 0x13, 0xf0, 0x5c, 0x78, 0xde, + 0xd1, 0x54, 0xd0, 0xa0, 0x58, 0xf9, 0xf5, 0x22, 0x9c, 0xed, 0xc9, 0x1f, 0xce, 0x7d, 0x15, 0x74, + 0xec, 0x77, 0xcc, 0x17, 0x2c, 0x31, 0xe2, 0xfb, 0x0d, 0x98, 0xe6, 0xc7, 0xc6, 0xcd, 0x58, 0xc4, + 0xb8, 0xbe, 0xc3, 0xdf, 0x8a, 0x40, 0x31, 0x86, 0x7d, 0x3c, 0xaf, 0xab, 0x37, 0x60, 0xda, 0xef, + 0x6e, 0x8b, 0x87, 0x7e, 0x45, 0x1a, 0x94, 0x7c, 0x94, 0x49, 0x2d, 0x02, 0xc5, 0x18, 0x36, 0x69, + 0xc2, 0x99, 0xd0, 0xb8, 0x2c, 0xad, 0x9c, 0x85, 0x41, 0x64, 0x07, 0x9f, 0x15, 0x8b, 0x31, 0x12, + 0xd8, 0x43, 0x94, 0x6c, 0xc3, 0x25, 0x11, 0xb9, 0x6d, 0x36, 0x28, 0x96, 0xb0, 0xab, 0x22, 0x1b, + 0x7d, 0x69, 0xa9, 0x2f, 0x26, 0x1e, 0x42, 0x25, 0x72, 0xd6, 0x1d, 0x3b, 0xf2, 0xac, 0x1b, 0x89, + 0x1a, 0x1f, 0x4f, 0x1b, 0x35, 0xde, 0x33, 0x61, 0x4e, 0x74, 0x1c, 0x2d, 0x3d, 0x05, 0xc7, 0xd1, + 0xbf, 0x37, 0xc1, 0x96, 0x47, 0x2c, 0xdb, 0x32, 0x53, 0x5a, 0xf9, 0x8c, 0x14, 0x17, 0x6d, 0x52, + 0x69, 0xe5, 0x53, 0xd5, 0x47, 0x09, 0x39, 0x46, 0x90, 0xb4, 0xb4, 0xe9, 0xe5, 0xfa, 0xd8, 0xf4, + 0x3a, 0x70, 0x2e, 0x68, 0xf9, 0x5b, 0x5e, 0xd7, 0x0f, 0x16, 0xa9, 0x17, 0x9c, 0xc8, 0x2c, 0xcf, + 0xf5, 0x95, 0xad, 0xb5, 0x5a, 0x9c, 0x0a, 0x26, 0x91, 0x66, 0xd3, 0x36, 0x68, 0xf9, 0xd5, 0x56, + 0xcb, 0xbd, 0xaf, 0x32, 0xc6, 0x84, 0x66, 0x17, 0x69, 0x50, 0xd1, 0xd3, 0x76, 0x6b, 0xad, 0xd6, + 0x07, 0x13, 0x0f, 0xa1, 0x42, 0xd6, 0xf9, 0x57, 0xdd, 0xb1, 0x5a, 0x76, 0xc3, 0x0a, 0x78, 0xc6, + 0x29, 0x2e, 0xbb, 0xc5, 0x9a, 0xd0, 0xf9, 0x25, 0xb6, 0xd6, 0x6a, 0x71, 0x14, 0x4c, 0xaa, 0xa7, + 0x6c, 0x38, 0x63, 0x23, 0xb4, 0xa0, 0x27, 0x98, 0xb6, 0xc6, 0x9f, 0xac, 0x69, 0xab, 0x34, 0xd8, + 0x72, 0x87, 0xf4, 0xcb, 0x3d, 0xb6, 0x00, 0x06, 0x58, 0xee, 0x0d, 0x98, 0xd1, 0x1a, 0x96, 0x9c, + 0xc1, 0x13, 0x03, 0xc7, 0xc2, 0x57, 0xa3, 0x14, 0x30, 0x4e, 0xf2, 0xf4, 0xdd, 0x10, 0x7f, 0x3b, + 0x03, 0x67, 0x58, 0x23, 0xaa, 0xc1, 0x2e, 0x75, 0xde, 0xe5, 0x5a, 0x92, 0x7a, 0x64, 0xd5, 0x1a, + 0x66, 0x47, 0x57, 0x63, 0x3c, 0x44, 0x87, 0xeb, 0xc3, 0x6c, 0x1c, 0x8c, 0x3d, 0x8d, 0x62, 0x9b, + 0x5e, 0x58, 0x26, 0x47, 0x60, 0x7a, 0xe0, 0x4d, 0xaf, 0x1a, 0x23, 0x81, 0x3d, 0x44, 0x53, 0xc9, + 0xd9, 0x4b, 0x8b, 0x70, 0x21, 0xf1, 0x53, 0x07, 0x12, 0xd6, 0xdf, 0x05, 0x98, 0x12, 0x5d, 0x38, + 0x4c, 0xbf, 0xcd, 0xa8, 0xae, 0x9d, 0x3b, 0xf5, 0x9b, 0x0b, 0xe3, 0x88, 0x91, 0x3f, 0xc5, 0x23, + 0x46, 0x9f, 0xed, 0xa7, 0xf0, 0xa4, 0xb6, 0x9f, 0xe2, 0x28, 0xb7, 0x9f, 0xb1, 0x74, 0xdb, 0xcf, + 0xc8, 0x5c, 0x4f, 0x13, 0xa4, 0x67, 0x69, 0xf8, 0xd2, 0x33, 0x79, 0x93, 0x83, 0xd3, 0xdf, 0xe4, + 0x7e, 0x2b, 0x49, 0xaa, 0x4e, 0xa4, 0x7d, 0xc5, 0x36, 0x22, 0x12, 0x46, 0x24, 0x51, 0x27, 0x47, + 0x21, 0x51, 0x87, 0x22, 0x14, 0x7f, 0x29, 0x03, 0x25, 0xb4, 0x02, 0xca, 0x63, 0x0c, 0xc8, 0x6b, + 0x90, 0xef, 0x3a, 0xb6, 0xb2, 0xda, 0x5c, 0x56, 0x5a, 0xe9, 0x6d, 0xc7, 0x0e, 0x1e, 0x3f, 0x9c, + 0x9d, 0xd6, 0x88, 0x94, 0x95, 0x20, 0xc7, 0x25, 0x55, 0x98, 0xe1, 0xbe, 0xd6, 0x3e, 0x8f, 0x43, + 0x60, 0x00, 0x19, 0xb2, 0xaf, 0x5d, 0x3c, 0x31, 0x0a, 0xc6, 0x38, 0x7e, 0xe5, 0x2b, 0x45, 0xf9, + 0xbc, 0xc5, 0x10, 0x6e, 0x2f, 0x87, 0x9d, 0x3f, 0x74, 0x70, 0xe3, 0xd3, 0x25, 0xc8, 0x36, 0xb6, + 0xb9, 0x22, 0x5e, 0x08, 0x13, 0x67, 0x2e, 0x2d, 0x60, 0xb6, 0xb1, 0x4d, 0x5e, 0x86, 0x71, 0x79, + 0x2d, 0xaa, 0x92, 0x4b, 0x72, 0xb6, 0xf2, 0xce, 0xd4, 0x47, 0x0d, 0x1d, 0xf9, 0xf5, 0xe3, 0x70, + 0x83, 0x71, 0xe2, 0xa3, 0xf7, 0x41, 0x76, 0xdd, 0x1c, 0x4c, 0x57, 0x7e, 0xd5, 0x48, 0x70, 0x0b, + 0x51, 0x37, 0xe1, 0xde, 0xec, 0xb5, 0xe9, 0x4e, 0x93, 0xff, 0xb8, 0x08, 0x17, 0x93, 0x1f, 0x5e, + 0xf9, 0xc0, 0x2c, 0x06, 0x31, 0xb7, 0x73, 0x89, 0x73, 0xfb, 0x43, 0x30, 0x26, 0x22, 0x86, 0x55, + 0x5a, 0x2e, 0x6e, 0xbf, 0x17, 0xdf, 0xe2, 0xa3, 0x82, 0x91, 0x37, 0x81, 0x88, 0xbb, 0x81, 0x45, + 0xb7, 0xeb, 0x04, 0x9b, 0xd4, 0x43, 0x6a, 0x35, 0x64, 0xf4, 0x88, 0xbe, 0x3e, 0x59, 0xef, 0xc1, + 0xc0, 0x84, 0x5a, 0x3c, 0x91, 0x58, 0x4f, 0xc8, 0xa4, 0x99, 0x48, 0xec, 0xb0, 0xe8, 0xab, 0x51, + 0x1f, 0x0e, 0xbf, 0xd9, 0x6b, 0x54, 0x79, 0x6b, 0xd8, 0x2f, 0xf2, 0x7c, 0x80, 0x2d, 0x2b, 0xa7, + 0xb9, 0x72, 0xfe, 0x38, 0x0f, 0xe7, 0x12, 0x5e, 0x46, 0x8d, 0xca, 0xee, 0xcc, 0x31, 0x64, 0x77, + 0x4b, 0x77, 0x52, 0xea, 0xbc, 0xc6, 0xaa, 0x3d, 0x87, 0xf4, 0xd0, 0x37, 0x33, 0x70, 0x9e, 0x07, + 0xcc, 0xaa, 0x1b, 0x0f, 0x59, 0x45, 0x1a, 0x72, 0x5f, 0x3f, 0xcc, 0x90, 0xeb, 0xcf, 0xb1, 0x91, + 0x65, 0xab, 0xf7, 0x5a, 0x02, 0x85, 0x30, 0x78, 0x30, 0x09, 0x8a, 0x89, 0x5c, 0xc9, 0x22, 0x80, + 0x7e, 0x00, 0x46, 0xad, 0xe1, 0x17, 0xd9, 0xd1, 0x43, 0xbf, 0x10, 0xe3, 0x3f, 0xe6, 0xc1, 0xb8, + 0x46, 0x47, 0x73, 0x83, 0x95, 0x51, 0x8d, 0x7c, 0xbd, 0xf7, 0x39, 0x8e, 0xcf, 0x0d, 0xf5, 0xb9, + 0xdb, 0xe3, 0x4f, 0xf9, 0x74, 0x73, 0xea, 0x37, 0x73, 0x30, 0x1d, 0x1d, 0x43, 0xf2, 0x12, 0x14, + 0x3b, 0x1e, 0xdd, 0xb1, 0x1f, 0xc8, 0xb9, 0x14, 0x3e, 0x2e, 0xcf, 0x4b, 0x51, 0x42, 0xc9, 0x3b, + 0x31, 0x17, 0xf7, 0x85, 0x34, 0x91, 0x3b, 0xca, 0x11, 0xba, 0x4f, 0xc2, 0x81, 0x77, 0xf4, 0x7b, + 0x44, 0xb9, 0xe1, 0xf3, 0x8a, 0xbe, 0x45, 0x44, 0x3e, 0x07, 0xa5, 0xba, 0x47, 0xad, 0x80, 0x36, + 0x16, 0x0e, 0xa4, 0xa5, 0xf1, 0x27, 0x8e, 0x37, 0x47, 0xb7, 0xec, 0x36, 0x0d, 0x97, 0xde, 0xa2, + 0x22, 0x82, 0x21, 0x3d, 0x7e, 0xbf, 0xb6, 0x13, 0x50, 0x8f, 0xa7, 0xfb, 0x90, 0xe6, 0xc4, 0xf0, + 0x7e, 0x4d, 0x43, 0xd0, 0xc0, 0xaa, 0xfc, 0x61, 0x11, 0x20, 0x7c, 0xa7, 0x9a, 0x49, 0x1c, 0xea, + 0x34, 0x3a, 0xae, 0xed, 0x28, 0x15, 0x56, 0xcf, 0x8e, 0x65, 0x59, 0x8e, 0x1a, 0x83, 0xec, 0x40, + 0x51, 0x3e, 0x56, 0x9f, 0x4d, 0xeb, 0x2e, 0x51, 0xfb, 0xd8, 0x02, 0xa7, 0x24, 0x56, 0xb9, 0xf8, + 0x1f, 0x25, 0x75, 0x36, 0x6b, 0x3c, 0xda, 0x0c, 0xd3, 0x18, 0xe8, 0xde, 0x45, 0x5e, 0x8a, 0x12, + 0x1a, 0xc9, 0xd0, 0x9d, 0x3f, 0x32, 0x43, 0x37, 0x42, 0x49, 0xdc, 0x03, 0xdd, 0xa0, 0x07, 0x83, + 0x1d, 0xbb, 0xc5, 0x15, 0xa7, 0xaa, 0x8b, 0x21, 0x19, 0x46, 0xd3, 0x57, 0xe8, 0x83, 0x65, 0xbe, + 0x14, 0x89, 0x5a, 0x54, 0x31, 0x86, 0x64, 0x8c, 0x64, 0xbf, 0x63, 0x7d, 0x93, 0xfd, 0xee, 0xc4, + 0x54, 0xc0, 0x54, 0x23, 0x71, 0x88, 0xbc, 0x7d, 0xaf, 0x37, 0x39, 0x2e, 0x0e, 0xe3, 0x81, 0xf4, + 0x01, 0x76, 0xe1, 0xb7, 0x60, 0xaa, 0x6e, 0x2d, 0x52, 0x56, 0xd1, 0xae, 0x5b, 0x01, 0x95, 0xe7, + 0xe8, 0x41, 0xd2, 0xbc, 0x2f, 0x56, 0x8d, 0xfa, 0x18, 0x25, 0x97, 0x4e, 0xe4, 0xdd, 0x80, 0x71, + 0x35, 0x93, 0xc9, 0x0b, 0x46, 0xbd, 0xd0, 0x36, 0xc6, 0x06, 0x97, 0x13, 0x39, 0xfa, 0x56, 0xf5, + 0xb3, 0x8c, 0xd8, 0x80, 0x82, 0xf3, 0x25, 0x28, 0xfa, 0xdd, 0x1d, 0x86, 0x17, 0x7b, 0x4f, 0xaa, + 0xc6, 0x4b, 0x51, 0x42, 0x2b, 0xff, 0x33, 0x03, 0x10, 0x46, 0x93, 0xb2, 0x6d, 0xbe, 0x4d, 0xd9, + 0xc9, 0xc9, 0xf6, 0xdb, 0xf1, 0x6d, 0x7e, 0x5d, 0x01, 0x30, 0xc4, 0x21, 0xb7, 0x01, 0x98, 0xe2, + 0x71, 0x92, 0x0c, 0x3b, 0xfc, 0xb6, 0xf4, 0xb6, 0xae, 0x8c, 0x06, 0x21, 0x62, 0xc1, 0xb4, 0xd2, + 0x94, 0x25, 0xe9, 0x81, 0xc2, 0x66, 0x78, 0x6c, 0xea, 0x66, 0x84, 0x00, 0xc6, 0x08, 0x56, 0xfe, + 0xee, 0x18, 0xcc, 0xc4, 0x9e, 0xf5, 0x7b, 0xea, 0x1f, 0x77, 0x33, 0xdf, 0x10, 0xc9, 0x0d, 0xfb, + 0x0d, 0x91, 0xfc, 0x30, 0x8e, 0x3d, 0xf1, 0x77, 0x6a, 0x0a, 0xc3, 0x7c, 0xa7, 0x66, 0x0d, 0xc6, + 0x64, 0xc2, 0xe2, 0xc1, 0x64, 0x2e, 0x3f, 0x5e, 0xa9, 0x63, 0x9f, 0x22, 0x31, 0xe4, 0x88, 0xcc, + 0xd8, 0x54, 0xfb, 0x20, 0x1f, 0xeb, 0x37, 0xe1, 0x7c, 0xc7, 0x6d, 0xb5, 0x54, 0x3c, 0xf1, 0x52, + 0x57, 0x38, 0x46, 0xca, 0x00, 0x0c, 0xad, 0x0f, 0x6f, 0x26, 0xe0, 0x60, 0x62, 0xcd, 0x74, 0xb2, + 0xf4, 0xdf, 0x14, 0x61, 0x3a, 0xfa, 0x04, 0xfd, 0x13, 0x79, 0x03, 0x8d, 0x5f, 0x52, 0x54, 0x3d, + 0x27, 0xfe, 0x06, 0xda, 0x96, 0x2c, 0x47, 0x8d, 0x11, 0xd5, 0x28, 0x72, 0x23, 0xd0, 0x28, 0xf2, + 0xc3, 0xd1, 0x28, 0x42, 0x7d, 0xaa, 0x70, 0xa8, 0x3e, 0xf5, 0x0a, 0x8c, 0x79, 0x6e, 0x8b, 0x56, + 0x71, 0x43, 0x9a, 0x05, 0xf4, 0x6d, 0x06, 0x8a, 0x62, 0x54, 0xf0, 0x21, 0xfb, 0xe2, 0x47, 0x87, + 0x7d, 0x80, 0x35, 0x73, 0x0d, 0xce, 0xee, 0xcb, 0x3b, 0x84, 0x9a, 0xdd, 0x74, 0xac, 0x20, 0x7c, + 0xac, 0x45, 0x7b, 0x83, 0xde, 0x89, 0x23, 0x60, 0x6f, 0x9d, 0x27, 0x72, 0xd6, 0xd7, 0x9a, 0x37, + 0x1c, 0xa5, 0x79, 0xa7, 0x5b, 0x58, 0xff, 0x64, 0x0c, 0xa6, 0x6b, 0xb7, 0x22, 0x0b, 0x2b, 0x32, + 0x73, 0x33, 0x23, 0x98, 0xb9, 0xd9, 0x61, 0xcf, 0xdc, 0xc3, 0x4f, 0x02, 0x2f, 0xaa, 0xe0, 0xb1, + 0x7c, 0xf4, 0xe2, 0xd1, 0x0c, 0x20, 0x23, 0x55, 0xb6, 0x87, 0x0b, 0x37, 0x4e, 0x95, 0x5a, 0xa1, + 0xc0, 0xf3, 0x06, 0x19, 0x1b, 0x6f, 0x04, 0x8c, 0x71, 0xfc, 0x41, 0x56, 0xc8, 0x60, 0xfe, 0x44, + 0x6f, 0xc0, 0x34, 0x6f, 0xa4, 0x74, 0x75, 0x5e, 0x6d, 0xc8, 0xfc, 0xf3, 0xda, 0x15, 0xeb, 0x96, + 0x09, 0x5d, 0xc2, 0x18, 0x76, 0x74, 0x3d, 0x96, 0x52, 0xaf, 0xc7, 0x5b, 0x27, 0x5c, 0x8f, 0x2f, + 0x40, 0xae, 0xd1, 0xba, 0x27, 0x1f, 0x4b, 0xd3, 0x3a, 0xf0, 0xd2, 0xda, 0x2d, 0x64, 0xe5, 0xc6, + 0x2a, 0x9b, 0x38, 0xfd, 0x55, 0x36, 0x79, 0xe4, 0xf9, 0x96, 0x29, 0x2d, 0xd4, 0xf7, 0x6d, 0xd7, + 0x11, 0x7e, 0xb0, 0x53, 0x83, 0x2b, 0x2d, 0x46, 0x75, 0x8c, 0x10, 0x4b, 0xb7, 0x84, 0xff, 0x55, + 0x06, 0xce, 0x27, 0x65, 0x67, 0x39, 0xea, 0x42, 0xfe, 0x55, 0x18, 0x17, 0xa9, 0x5a, 0x56, 0x1b, + 0xf2, 0x8e, 0x49, 0x7f, 0xbf, 0x20, 0xb7, 0xba, 0x84, 0x1a, 0x83, 0x50, 0x23, 0xbe, 0x79, 0x48, + 0x71, 0xf6, 0xfa, 0x9c, 0x63, 0x04, 0xde, 0xfd, 0x4e, 0x06, 0x26, 0xcd, 0x6c, 0x2a, 0xc7, 0x78, + 0x5d, 0x6e, 0x1f, 0x4a, 0xbc, 0x33, 0x56, 0x3c, 0xb7, 0x9d, 0x5e, 0xf1, 0xbe, 0xa3, 0x48, 0x89, + 0xf9, 0x23, 0xe4, 0x8f, 0x2e, 0xc4, 0x90, 0x55, 0xe5, 0x17, 0x60, 0x5c, 0x47, 0xa1, 0x1c, 0x71, + 0xbe, 0x9b, 0x87, 0x92, 0xdb, 0x91, 0xb1, 0x25, 0xf1, 0xc4, 0x78, 0x37, 0x15, 0x00, 0x43, 0x1c, + 0x26, 0xb3, 0xc4, 0x68, 0xc7, 0x5c, 0x34, 0x23, 0x49, 0x3b, 0xff, 0x69, 0x16, 0x8a, 0x35, 0xea, + 0xf8, 0xae, 0x47, 0xde, 0x36, 0x56, 0xb8, 0x10, 0xd9, 0x1f, 0x39, 0x9e, 0x29, 0x49, 0x84, 0x6e, + 0xb0, 0xc9, 0x17, 0x9a, 0x87, 0xc2, 0x32, 0x63, 0xf5, 0xee, 0x40, 0xde, 0xef, 0xd0, 0x21, 0x84, + 0xe8, 0x8b, 0x16, 0xd7, 0x3a, 0xb4, 0x1e, 0x8e, 0x26, 0xfb, 0x85, 0x9c, 0x3e, 0x71, 0xf4, 0x63, + 0xe5, 0x62, 0xa6, 0xad, 0xa4, 0xe6, 0x74, 0xf8, 0x93, 0xe5, 0x7f, 0xcc, 0x0e, 0xbf, 0x1c, 0x71, + 0xcd, 0xf6, 0x03, 0xf2, 0xf9, 0x9e, 0x8e, 0x9c, 0x3b, 0x5e, 0x47, 0xb2, 0xda, 0xbc, 0x1b, 0xf5, + 0x22, 0x52, 0x25, 0x91, 0x38, 0x9f, 0x82, 0x1d, 0xd0, 0xb6, 0xb2, 0x64, 0x7e, 0x2a, 0xed, 0xb7, + 0x85, 0x13, 0x63, 0x95, 0x91, 0x45, 0x41, 0xbd, 0xf2, 0x83, 0xa2, 0xfa, 0x26, 0xd6, 0xb1, 0xe4, + 0xcb, 0x19, 0x98, 0x6c, 0xd0, 0x0e, 0x75, 0x1a, 0xd4, 0xa9, 0xdb, 0x54, 0x65, 0x2c, 0x59, 0x4d, + 0x29, 0x60, 0x97, 0x14, 0x49, 0x23, 0x50, 0x6b, 0xc9, 0x60, 0x83, 0x11, 0xa6, 0xc4, 0x85, 0xf1, + 0x40, 0xb8, 0x05, 0xa8, 0xcf, 0xaf, 0xa6, 0xf6, 0xad, 0x31, 0x34, 0x70, 0x49, 0x1a, 0x35, 0x13, + 0xd2, 0x82, 0xf1, 0x20, 0x9a, 0xc2, 0x3e, 0x85, 0x25, 0x4c, 0x87, 0xcf, 0xf1, 0x43, 0xad, 0x0e, + 0x97, 0xd3, 0x1c, 0xc8, 0x9b, 0x40, 0x64, 0x12, 0xd8, 0x15, 0xcb, 0x6e, 0xd1, 0x06, 0xba, 0x5d, + 0xa7, 0x21, 0x2d, 0x8f, 0xfa, 0x22, 0x6e, 0xb9, 0x07, 0x03, 0x13, 0x6a, 0x91, 0xab, 0x30, 0xc9, + 0xf9, 0x2f, 0x74, 0x7d, 0x23, 0x3c, 0x42, 0x77, 0xf2, 0xb2, 0x01, 0xc3, 0x08, 0x66, 0x24, 0xd5, + 0x7f, 0xf1, 0xd0, 0x54, 0xff, 0x6b, 0x70, 0xde, 0xa3, 0xfb, 0x36, 0xdb, 0x83, 0xae, 0xdb, 0x7e, + 0xe0, 0x7a, 0x07, 0xdc, 0x17, 0x41, 0xa6, 0x83, 0x13, 0x81, 0x3c, 0x09, 0x70, 0x4c, 0xac, 0x45, + 0xbe, 0x97, 0x81, 0xa9, 0x96, 0xdb, 0x6c, 0xda, 0x4e, 0x53, 0x58, 0xb9, 0xe5, 0x15, 0xdd, 0xdd, + 0x61, 0xc8, 0x89, 0xb9, 0x35, 0x93, 0xb2, 0x50, 0x34, 0xf4, 0xa5, 0x64, 0x04, 0x86, 0xd1, 0x46, + 0x5c, 0xfa, 0x14, 0x90, 0xde, 0xba, 0x03, 0x6d, 0xae, 0x0f, 0xd8, 0x76, 0x14, 0x8a, 0x11, 0xb2, + 0xab, 0xc5, 0x93, 0x90, 0x0e, 0x69, 0x96, 0xf0, 0xe1, 0x82, 0xe9, 0xbf, 0x66, 0x60, 0x4c, 0xc6, + 0xbd, 0x45, 0xa2, 0x11, 0x33, 0x23, 0x8f, 0x46, 0x5c, 0x82, 0x42, 0xc7, 0xf5, 0x02, 0xb5, 0x4c, + 0x67, 0x93, 0x75, 0x1c, 0xf1, 0xe6, 0x8f, 0xeb, 0x05, 0xa1, 0x10, 0x62, 0xbf, 0x7c, 0x14, 0x95, + 0xd9, 0x9e, 0xa7, 0xb2, 0xa3, 0x6c, 0xc6, 0x3d, 0x3d, 0x54, 0x06, 0x95, 0xcd, 0x30, 0x83, 0xca, + 0x66, 0xe5, 0x51, 0x1e, 0xce, 0xd4, 0x5a, 0x56, 0x7d, 0xcf, 0x3c, 0x8c, 0xbc, 0x05, 0x53, 0xbe, + 0xdd, 0x74, 0x6c, 0xa7, 0x29, 0x8d, 0x45, 0x99, 0x81, 0x2d, 0xbc, 0x35, 0xb3, 0x3e, 0x46, 0xc9, + 0x0d, 0x2d, 0xb3, 0x8f, 0x61, 0x8d, 0xc8, 0x9d, 0x8a, 0x35, 0x22, 0xe2, 0x71, 0x92, 0x4f, 0xeb, + 0x71, 0x12, 0xef, 0xf7, 0x13, 0x99, 0xa6, 0x0a, 0x4f, 0x41, 0x8c, 0xc1, 0xcf, 0xc3, 0x04, 0xff, + 0xd6, 0x1a, 0xdb, 0x98, 0xa2, 0xb7, 0xea, 0x99, 0xa3, 0x6e, 0xd5, 0x99, 0x2e, 0x6a, 0xd7, 0xb5, + 0x06, 0xa7, 0xb5, 0x97, 0xd5, 0xba, 0xeb, 0x20, 0x87, 0x54, 0xfe, 0x59, 0x46, 0xd2, 0xdf, 0xda, + 0xf5, 0xa8, 0xd5, 0x20, 0x35, 0xb8, 0xd0, 0xa6, 0xbe, 0x6f, 0x35, 0x69, 0xb5, 0xd9, 0xf4, 0x68, + 0x93, 0x6b, 0x77, 0x37, 0xb4, 0xa6, 0xa8, 0xd3, 0x8a, 0xaf, 0x27, 0x21, 0x61, 0x72, 0x5d, 0xf2, + 0x05, 0x78, 0x6e, 0xdb, 0x73, 0xad, 0x46, 0xdd, 0x62, 0x0a, 0x06, 0xc7, 0xd8, 0x72, 0xa5, 0xd3, + 0x93, 0x4c, 0x0f, 0xfd, 0xe3, 0x92, 0xf0, 0x73, 0x0b, 0xfd, 0x10, 0xb1, 0x3f, 0x8d, 0xca, 0xff, + 0xca, 0xc3, 0xa4, 0xf8, 0x0a, 0xe9, 0xda, 0x1b, 0x75, 0xcb, 0xcd, 0x9c, 0xba, 0x5b, 0xee, 0x6d, + 0x00, 0x9f, 0xb7, 0x67, 0xf0, 0xa5, 0xca, 0x6f, 0x18, 0x6a, 0xba, 0x32, 0x1a, 0x84, 0x06, 0x49, + 0xbb, 0xf1, 0x0a, 0x8c, 0xc9, 0xc1, 0x90, 0x66, 0x04, 0x8d, 0x2a, 0x7b, 0x0f, 0x15, 0x9c, 0x7c, + 0x02, 0x26, 0xac, 0x20, 0xb0, 0xea, 0xbb, 0x6d, 0xf9, 0xea, 0x71, 0xc4, 0xbb, 0xa8, 0x1a, 0x82, + 0xd0, 0xc4, 0xe3, 0x4f, 0xa6, 0xb7, 0xdc, 0xfa, 0x9e, 0xdf, 0xf3, 0x64, 0x3a, 0x2f, 0x45, 0x09, + 0x25, 0x6d, 0x28, 0x06, 0x7c, 0x72, 0x49, 0x5f, 0x9b, 0xe5, 0x94, 0xab, 0x5e, 0xcc, 0xd4, 0x90, + 0x9d, 0xf8, 0x8d, 0x92, 0x09, 0x63, 0xe7, 0xf3, 0xb5, 0x22, 0x2d, 0xcf, 0x69, 0xd9, 0x89, 0x85, + 0x67, 0xec, 0x7a, 0xfc, 0x37, 0x4a, 0x26, 0x95, 0xff, 0x9e, 0x03, 0x52, 0x0b, 0x2c, 0xa7, 0x61, + 0x79, 0x8d, 0x1b, 0x57, 0x75, 0x4a, 0x1e, 0x76, 0x2a, 0x10, 0xce, 0x1c, 0x42, 0xfe, 0xa7, 0x98, + 0x7c, 0xea, 0x9a, 0x71, 0xcd, 0x15, 0xaf, 0x8d, 0x0a, 0x19, 0x23, 0xa4, 0x0e, 0x4a, 0x2e, 0x64, + 0xa3, 0xf7, 0xc0, 0xf6, 0x91, 0x9e, 0x03, 0xdb, 0xe3, 0x87, 0xb3, 0x3f, 0x76, 0xa3, 0xbb, 0x4d, + 0x3d, 0x87, 0x06, 0xd4, 0x57, 0xde, 0x0d, 0x89, 0xe7, 0xb9, 0x27, 0xed, 0xd7, 0xbe, 0x03, 0x53, + 0x1d, 0x2b, 0xa8, 0xeb, 0x8c, 0x1c, 0x72, 0x12, 0x7f, 0x4a, 0x69, 0x51, 0x9b, 0x26, 0xf0, 0xf1, + 0xc3, 0xd9, 0xff, 0x2f, 0x0c, 0xa2, 0xd4, 0x67, 0x9e, 0xf9, 0xce, 0x5e, 0x73, 0x3e, 0x38, 0xe8, + 0x50, 0x7f, 0x8e, 0xa3, 0xf3, 0x7b, 0xb0, 0x28, 0x59, 0xf2, 0x1a, 0x40, 0xcb, 0xde, 0xa7, 0xe2, + 0x04, 0x19, 0x77, 0x3b, 0x58, 0xd3, 0x10, 0x34, 0xb0, 0x2a, 0xbf, 0x98, 0x01, 0xa9, 0xfb, 0x90, + 0xfb, 0x00, 0x75, 0xd7, 0x69, 0xd8, 0x66, 0x62, 0xc5, 0xc5, 0x54, 0xc9, 0x2f, 0x04, 0xad, 0xb0, + 0x0d, 0xba, 0xc8, 0x47, 0x83, 0x55, 0x65, 0x1e, 0x26, 0x45, 0x13, 0xe4, 0xcb, 0x17, 0xb3, 0x50, + 0xb0, 0x5a, 0x2d, 0xf7, 0x3e, 0x6f, 0x43, 0x41, 0xec, 0xf7, 0xdc, 0xcd, 0x1d, 0x45, 0x79, 0xe5, + 0x2f, 0x0a, 0x70, 0x51, 0x86, 0xac, 0x5e, 0xf3, 0xec, 0xc6, 0x13, 0xbd, 0x98, 0x08, 0x9d, 0x02, + 0xb2, 0x7d, 0x9d, 0x02, 0xc2, 0x5d, 0x3a, 0xf5, 0x6b, 0x5e, 0xc6, 0x67, 0x1f, 0x6e, 0x5d, 0xd3, + 0xb7, 0x25, 0xf9, 0x23, 0x6f, 0x4b, 0x5e, 0xd2, 0xde, 0x23, 0xb1, 0x5b, 0x88, 0xbe, 0xde, 0x1f, + 0xc5, 0x43, 0x6d, 0xbe, 0x91, 0x90, 0xf5, 0xb1, 0xe1, 0x84, 0xac, 0xbf, 0x04, 0x45, 0xab, 0x63, + 0xdf, 0xc6, 0x35, 0x69, 0x7e, 0x0d, 0x5f, 0x71, 0xdf, 0x5c, 0xbd, 0x8d, 0x6b, 0x28, 0xa1, 0x51, + 0x4f, 0xc5, 0x52, 0x5a, 0x4f, 0xc5, 0xe4, 0x49, 0x76, 0x5a, 0x6e, 0x5b, 0x75, 0x38, 0xdb, 0x33, + 0xdc, 0x43, 0xf7, 0x3f, 0x78, 0x3f, 0xcf, 0xb8, 0x78, 0x76, 0x87, 0x3e, 0xd1, 0x65, 0xf4, 0x49, + 0x98, 0x12, 0xfe, 0x53, 0x12, 0x22, 0x55, 0xa9, 0xd0, 0xfd, 0xd5, 0x04, 0x62, 0x14, 0x97, 0xac, + 0xf2, 0xc9, 0x31, 0xf0, 0x5d, 0x1f, 0xc8, 0xf9, 0xc3, 0xb4, 0x3d, 0x49, 0x80, 0x7c, 0x14, 0x26, + 0x78, 0xfb, 0x45, 0x6f, 0x4b, 0xcf, 0x41, 0x9e, 0xd6, 0x68, 0x39, 0x2c, 0x46, 0x13, 0x27, 0x1a, + 0x82, 0x58, 0x48, 0x1b, 0x82, 0xd8, 0x33, 0x16, 0xa7, 0x35, 0xdb, 0xbe, 0x9c, 0x83, 0x92, 0xf6, + 0xff, 0x25, 0x9f, 0x83, 0x49, 0xe1, 0x8d, 0x73, 0x92, 0x93, 0x1f, 0xb7, 0xb8, 0x0b, 0xdf, 0x1e, + 0xe5, 0x26, 0x60, 0x12, 0xe3, 0xe1, 0xe9, 0x3c, 0x1b, 0xb5, 0xc1, 0x20, 0x3b, 0x78, 0x78, 0x7a, + 0x8c, 0x04, 0xf6, 0x10, 0x25, 0x0d, 0x98, 0x11, 0x65, 0xa1, 0xbf, 0x43, 0x6e, 0xe0, 0xa8, 0xa2, + 0xc5, 0x28, 0x05, 0x8c, 0x93, 0x24, 0x6f, 0x02, 0x51, 0xbe, 0x6c, 0xb5, 0x3d, 0xbb, 0xc3, 0x5f, + 0x53, 0x3f, 0x88, 0x5b, 0x9f, 0x56, 0x7b, 0x30, 0x30, 0xa1, 0x56, 0xe5, 0xbb, 0xe3, 0xa0, 0x0d, + 0x5c, 0xa7, 0x6c, 0x79, 0x48, 0x4e, 0x06, 0x94, 0x3d, 0x51, 0x32, 0xa0, 0x37, 0xa1, 0xa4, 0x93, + 0x6d, 0xc9, 0x2e, 0x7f, 0xa1, 0xcf, 0x23, 0xca, 0x02, 0x49, 0x26, 0x77, 0x55, 0x3f, 0x31, 0xac, + 0x4e, 0x96, 0x61, 0x4c, 0xa4, 0x71, 0x50, 0xd9, 0x14, 0x2f, 0x25, 0x51, 0x12, 0x59, 0x1f, 0x8c, + 0xcc, 0x2b, 0xa2, 0x0a, 0xaa, 0xba, 0x49, 0x69, 0x9e, 0x0a, 0x23, 0x48, 0xf3, 0xf4, 0xad, 0xe4, + 0x4c, 0x5d, 0x5b, 0xe9, 0xad, 0x9f, 0x1f, 0xac, 0x1c, 0x5d, 0x49, 0xa9, 0xaa, 0xc6, 0x4f, 0xfb, + 0x0d, 0xc2, 0x52, 0xca, 0xf4, 0x52, 0x70, 0xec, 0xf4, 0x52, 0x13, 0x27, 0x4f, 0x2f, 0x95, 0x3e, + 0x2d, 0x51, 0x0d, 0x60, 0xcb, 0x6e, 0x2b, 0xd7, 0xed, 0x17, 0xa1, 0xc0, 0x1f, 0x0f, 0x8c, 0x67, + 0x9f, 0x11, 0x3e, 0xc5, 0x02, 0x46, 0xae, 0x40, 0xde, 0x0f, 0xdc, 0x4e, 0xdc, 0x5a, 0x52, 0x0b, + 0xdc, 0x0e, 0x72, 0x48, 0xe5, 0xcb, 0x45, 0x18, 0x53, 0x27, 0x3c, 0xdf, 0xb0, 0xd6, 0xa7, 0x7e, + 0x6e, 0x5f, 0x12, 0x3d, 0xd2, 0x68, 0x1f, 0x3d, 0x96, 0x65, 0x4f, 0xfd, 0x58, 0xb6, 0x07, 0xc5, + 0x0e, 0x3f, 0x70, 0x48, 0x01, 0x75, 0x2d, 0x3d, 0x6f, 0x4e, 0x4e, 0xe8, 0x15, 0xe2, 0x7f, 0x94, + 0x2c, 0xc8, 0xbb, 0x30, 0xe5, 0xd1, 0xc0, 0x3b, 0x88, 0x9c, 0x01, 0x87, 0x12, 0x74, 0xca, 0xcd, + 0xac, 0x68, 0xd2, 0xc6, 0x28, 0x2b, 0xd2, 0x81, 0x92, 0xa7, 0xc2, 0x1d, 0xd3, 0xe7, 0x85, 0xd5, + 0x91, 0x93, 0x42, 0x64, 0xeb, 0x9f, 0x18, 0x32, 0x11, 0x56, 0x98, 0x35, 0x6a, 0xf9, 0xc1, 0x4d, + 0xf5, 0xc6, 0xed, 0xb8, 0x69, 0x85, 0xd1, 0x20, 0x34, 0xf1, 0xc8, 0x3d, 0x80, 0x46, 0xeb, 0x9e, + 0xec, 0x4c, 0x79, 0x72, 0x18, 0xc2, 0x3d, 0x15, 0xb7, 0x42, 0x2d, 0x69, 0xc2, 0x68, 0x30, 0xa9, + 0xfc, 0xb7, 0x0c, 0x9c, 0x89, 0xcf, 0x1c, 0xb2, 0x07, 0x39, 0xdf, 0x53, 0x59, 0xed, 0x37, 0x87, + 0x37, 0x25, 0xe5, 0xad, 0x36, 0x8f, 0xad, 0xaa, 0x79, 0x75, 0x64, 0x5c, 0xd8, 0x4a, 0xd5, 0x4f, + 0xcb, 0x19, 0x2b, 0x75, 0x89, 0xfa, 0x01, 0x72, 0x08, 0x59, 0x33, 0xed, 0x21, 0xc2, 0x56, 0x36, + 0x97, 0x64, 0x0f, 0x79, 0x2e, 0xce, 0x2f, 0xc9, 0x1a, 0x52, 0xf9, 0x7a, 0x0e, 0x2e, 0x26, 0x37, + 0x8c, 0xbc, 0x01, 0xd3, 0xfa, 0xd6, 0xf0, 0xc0, 0xc8, 0x11, 0xa5, 0x7d, 0x5d, 0x96, 0x22, 0x50, + 0x8c, 0x61, 0x93, 0xd7, 0xb8, 0x05, 0x81, 0x6d, 0x83, 0xca, 0xd3, 0xa8, 0x14, 0x39, 0xfc, 0x4b, + 0x08, 0x1a, 0x58, 0xa4, 0x0a, 0x33, 0xf2, 0x57, 0xe4, 0xc9, 0xeb, 0x52, 0xe8, 0xfb, 0xb3, 0x18, + 0x05, 0x63, 0x1c, 0x9f, 0xbc, 0x02, 0x63, 0x4c, 0x81, 0x51, 0x7e, 0x79, 0x86, 0x79, 0x70, 0x49, + 0x14, 0xa3, 0x82, 0x93, 0xab, 0x30, 0xc9, 0xfe, 0x8d, 0xa4, 0xf8, 0x34, 0x2e, 0xf7, 0x96, 0x0c, + 0x18, 0x46, 0x30, 0xc3, 0x57, 0x3c, 0x8b, 0x61, 0x16, 0x6c, 0xd3, 0x21, 0x80, 0x7d, 0x7c, 0xd7, + 0xa7, 0x68, 0xdd, 0x5f, 0x52, 0xef, 0x2a, 0x1b, 0xd6, 0x97, 0xdb, 0x1a, 0x82, 0x06, 0x56, 0xe5, + 0x47, 0x19, 0x98, 0x8a, 0xc8, 0x0e, 0xb2, 0x03, 0xb9, 0xbd, 0xab, 0xea, 0x7e, 0xeb, 0xc6, 0x10, + 0x9f, 0xfc, 0x14, 0xb3, 0xee, 0xc6, 0x55, 0x1f, 0x19, 0x03, 0xf2, 0x8e, 0xbe, 0x4a, 0xcb, 0xa6, + 0xbe, 0xe9, 0x37, 0x6c, 0x37, 0xd2, 0x9e, 0x17, 0xbd, 0x4c, 0xfb, 0x17, 0xd3, 0x30, 0x13, 0xdb, + 0x14, 0x8e, 0xe1, 0x59, 0xf2, 0x5a, 0xc4, 0x1c, 0xd5, 0x3b, 0x99, 0x12, 0x2c, 0x49, 0xa4, 0x29, + 0x7a, 0x2f, 0x97, 0xf6, 0x09, 0xbc, 0x5e, 0x23, 0x68, 0xac, 0xfb, 0xbe, 0x9c, 0x81, 0x49, 0x46, + 0xe9, 0xae, 0xeb, 0xed, 0xed, 0xb4, 0xdc, 0xfb, 0x52, 0x9c, 0xaf, 0xa7, 0xb1, 0x8c, 0x86, 0xd4, + 0xf4, 0x05, 0x3b, 0x7f, 0x6b, 0xc0, 0x00, 0x60, 0x84, 0x29, 0xa9, 0x43, 0x7e, 0x37, 0x08, 0x3a, + 0x52, 0xa6, 0xa7, 0x30, 0x0e, 0x5f, 0xdf, 0xda, 0xda, 0x54, 0x4c, 0x79, 0x36, 0x6e, 0x56, 0x80, + 0x9c, 0x38, 0xb9, 0x0f, 0x25, 0xeb, 0xbe, 0xbf, 0x66, 0xb5, 0xb7, 0x1b, 0x96, 0xf4, 0xea, 0x4e, + 0x63, 0x00, 0xbe, 0x5b, 0x13, 0xa4, 0x14, 0x3b, 0x61, 0xf2, 0x51, 0xa5, 0x18, 0xf2, 0x22, 0x1e, + 0x14, 0xeb, 0x5d, 0x3f, 0x70, 0xdb, 0x72, 0x27, 0x48, 0xb1, 0x3f, 0x2f, 0x72, 0x3a, 0x8a, 0xa5, + 0x08, 0x3d, 0x31, 0x8b, 0x50, 0x72, 0x22, 0x4d, 0x28, 0xec, 0x59, 0x3b, 0x7b, 0x2a, 0xed, 0xec, + 0xca, 0x70, 0x5e, 0xcb, 0x12, 0xd2, 0x82, 0x97, 0xa0, 0xa0, 0xcf, 0x86, 0xce, 0xb1, 0x02, 0x5f, + 0x3a, 0xb5, 0x2e, 0xa7, 0xcb, 0xa2, 0x1e, 0x19, 0x3a, 0x56, 0x80, 0x9c, 0x38, 0xfb, 0x1a, 0x7e, + 0xe1, 0x22, 0x23, 0x73, 0x56, 0xd2, 0x5e, 0x56, 0x98, 0x5f, 0xc3, 0x4b, 0x50, 0xd0, 0x67, 0x73, + 0xc4, 0x55, 0x69, 0x33, 0xa5, 0xaa, 0x9c, 0x62, 0x8e, 0xc4, 0x33, 0x70, 0x8a, 0x39, 0xa2, 0x4b, + 0x31, 0xe4, 0x45, 0xbe, 0x00, 0xb9, 0x96, 0xdb, 0x4c, 0xff, 0x9e, 0x5b, 0xf8, 0xce, 0x97, 0x58, + 0xe8, 0x6b, 0x6e, 0x13, 0x19, 0x65, 0xf2, 0x2b, 0x19, 0x98, 0xb6, 0xde, 0xed, 0x7a, 0xc2, 0x22, + 0x73, 0xbd, 0xbb, 0xed, 0x4b, 0xe7, 0xc3, 0x9b, 0x29, 0xd6, 0x40, 0x84, 0x9e, 0xe2, 0xcb, 0x43, + 0x66, 0xa2, 0x20, 0x8c, 0xb1, 0xe6, 0x2a, 0x2b, 0xcf, 0xf1, 0x21, 0x13, 0x1b, 0x5d, 0x1b, 0x52, + 0xae, 0x10, 0xa9, 0xb2, 0xf2, 0x22, 0x94, 0x2c, 0xc8, 0xf7, 0x32, 0x7c, 0x6b, 0x56, 0x72, 0x96, + 0xfa, 0x34, 0x90, 0xcf, 0xb7, 0xdd, 0x1a, 0xc2, 0xad, 0x80, 0x20, 0xb8, 0xe8, 0xd9, 0x01, 0xf5, + 0x6c, 0x2b, 0xb2, 0xdb, 0x9b, 0x08, 0x18, 0x6f, 0x02, 0xf9, 0x76, 0x06, 0x66, 0x78, 0xb7, 0x48, + 0x53, 0xc4, 0x42, 0x57, 0x64, 0xed, 0x4d, 0xa5, 0xa9, 0x55, 0xa3, 0x04, 0x55, 0xb7, 0x88, 0xac, + 0x32, 0x51, 0x18, 0xc6, 0xb9, 0xb3, 0x65, 0x46, 0xdb, 0x96, 0xdd, 0xe2, 0x49, 0x81, 0x53, 0x2d, + 0xb3, 0x65, 0x46, 0x26, 0xb2, 0xcc, 0x78, 0x09, 0x0a, 0xfa, 0x95, 0x3a, 0x4c, 0xdc, 0xc6, 0x35, + 0x1d, 0x23, 0x7a, 0x74, 0xc2, 0xd0, 0xd7, 0x00, 0xf6, 0xb9, 0x5d, 0x69, 0x91, 0x7a, 0xea, 0xf1, + 0x62, 0xbd, 0x87, 0xde, 0xd1, 0x10, 0x34, 0xb0, 0x2a, 0x7f, 0x96, 0x81, 0x99, 0x98, 0x1f, 0xa6, + 0xf0, 0xbf, 0x55, 0x5e, 0xe0, 0x74, 0xe7, 0x04, 0xd6, 0xc0, 0x9a, 0x51, 0x1d, 0x23, 0xc4, 0x48, + 0x93, 0x4f, 0xb3, 0x1d, 0xbb, 0xb9, 0x6e, 0x75, 0x24, 0x7d, 0xa1, 0x93, 0xbc, 0xdc, 0xc7, 0x62, + 0xa4, 0x51, 0x63, 0x76, 0xba, 0x28, 0x11, 0x8c, 0x53, 0xad, 0x7c, 0x3f, 0x03, 0xf1, 0x08, 0x2e, + 0x32, 0x0f, 0xa5, 0x86, 0xed, 0x71, 0x2a, 0x07, 0xf1, 0x80, 0xb3, 0x25, 0x05, 0xc0, 0x10, 0x47, + 0x77, 0x7a, 0xf6, 0xb0, 0x4e, 0x67, 0x7f, 0x91, 0x36, 0xe9, 0x83, 0x8e, 0x54, 0x66, 0x8d, 0xb3, + 0xa8, 0x82, 0xa0, 0x81, 0x55, 0xf9, 0xd7, 0x05, 0x98, 0x8e, 0xda, 0xc9, 0x07, 0x8c, 0x00, 0x7e, + 0x09, 0x8a, 0x6d, 0x1a, 0xec, 0xba, 0x8d, 0xb8, 0xb9, 0x7f, 0x9d, 0x97, 0xa2, 0x84, 0xf2, 0xe6, + 0xbb, 0x5e, 0x20, 0x9b, 0x15, 0x36, 0xdf, 0xf5, 0x02, 0xe4, 0x10, 0xe5, 0xb8, 0x9c, 0xef, 0xe3, + 0xb8, 0xdc, 0x84, 0x33, 0x3e, 0xf5, 0xf6, 0xa9, 0x67, 0xd8, 0x6e, 0x07, 0x4f, 0x2d, 0x5a, 0x8b, + 0x91, 0xc0, 0x1e, 0xa2, 0xa4, 0x01, 0x33, 0xa2, 0x2c, 0xb4, 0xdd, 0x16, 0x07, 0xb6, 0xdd, 0xd6, + 0xa2, 0x14, 0x30, 0x4e, 0x72, 0xc8, 0xe1, 0x32, 0xd1, 0x21, 0x1c, 0xc0, 0x8f, 0xe7, 0x36, 0x80, + 0xd5, 0x0d, 0x76, 0xe5, 0x77, 0x8e, 0x0f, 0xec, 0x63, 0x51, 0xd5, 0x95, 0xd1, 0x20, 0x44, 0x5e, + 0x87, 0xe9, 0x30, 0x7d, 0x38, 0xcf, 0xab, 0x2b, 0xde, 0x63, 0xe6, 0x7b, 0xcd, 0x7a, 0x04, 0x82, + 0x31, 0xcc, 0x94, 0xaf, 0xfa, 0x64, 0x81, 0xc8, 0xce, 0x30, 0xaf, 0x95, 0xbe, 0x96, 0x81, 0xe9, + 0xfb, 0x91, 0x3e, 0x1a, 0xfa, 0xf5, 0x92, 0x3e, 0xab, 0x46, 0xcb, 0x31, 0xc6, 0xd7, 0xb8, 0x93, + 0xcd, 0x9e, 0x8a, 0xe7, 0xd4, 0xc2, 0x5b, 0x3f, 0xf8, 0xe1, 0xe5, 0x67, 0xfe, 0xe8, 0x87, 0x97, + 0x9f, 0xf9, 0xf3, 0x1f, 0x5e, 0x7e, 0xe6, 0xbd, 0x47, 0x97, 0x33, 0x3f, 0x78, 0x74, 0x39, 0xf3, + 0x47, 0x8f, 0x2e, 0x67, 0xfe, 0xfc, 0xd1, 0xe5, 0xcc, 0x7f, 0x78, 0x74, 0x39, 0xf3, 0x9d, 0x1f, + 0x5d, 0x7e, 0xe6, 0xb3, 0x57, 0xc3, 0x56, 0xcc, 0xab, 0x56, 0xf0, 0x7f, 0x3e, 0x2c, 0xb8, 0x72, + 0x3f, 0x00, 0xd6, 0x8a, 0x79, 0xf9, 0x5b, 0xb5, 0xe2, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xda, + 0x88, 0x9a, 0xd6, 0x5c, 0x1b, 0x01, 0x00, +} + +func (m *AMQPConsumeConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPConsumeConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPConsumeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i-- + if m.NoLocal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.Exclusive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i-- + if m.AutoAck { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.ConsumerTag) + copy(dAtA[i:], m.ConsumerTag) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ConsumerTag))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AMQPEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.URLSecret != nil { + { + size, err := m.URLSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.Consume != nil { + { + size, err := m.Consume.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.QueueBind != nil { + { + size, err := m.QueueBind.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.QueueDeclare != nil { + { + size, err := m.QueueDeclare.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.ExchangeDeclare != nil { + { + size, err := m.ExchangeDeclare.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.RoutingKey) + copy(dAtA[i:], m.RoutingKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoutingKey))) + i-- + dAtA[i] = 0x22 + i -= len(m.ExchangeType) + copy(dAtA[i:], m.ExchangeType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExchangeType))) + i-- + dAtA[i] = 0x1a + i -= len(m.ExchangeName) + copy(dAtA[i:], m.ExchangeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExchangeName))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AMQPExchangeDeclareConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPExchangeDeclareConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPExchangeDeclareConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.Internal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i-- + if m.AutoDelete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i-- + if m.Durable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *AMQPQueueBindConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPQueueBindConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPQueueBindConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *AMQPQueueDeclareConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AMQPQueueDeclareConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AMQPQueueDeclareConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Arguments) + copy(dAtA[i:], m.Arguments) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Arguments))) + i-- + dAtA[i] = 0x32 + i-- + if m.NoWait { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i-- + if m.Exclusive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.AutoDelete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i-- + if m.Durable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AWSLambdaTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AWSLambdaTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AWSLambdaTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RoleARN) + copy(dAtA[i:], m.RoleARN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoleARN))) + i-- + dAtA[i] = 0x42 + if m.InvocationType != nil { + i -= len(*m.InvocationType) + copy(dAtA[i:], *m.InvocationType) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.InvocationType))) + i-- + dAtA[i] = 0x3a + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x22 + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.FunctionName) + copy(dAtA[i:], m.FunctionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FunctionName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Amount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Amount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Amount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ArgoWorkflowTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArgoWorkflowTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArgoWorkflowTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x12 + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ArtifactLocation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArtifactLocation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArtifactLocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Resource != nil { + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Git != nil { + { + size, err := m.Git.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Configmap != nil { + { + size, err := m.Configmap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.URL != nil { + { + size, err := m.URL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.File != nil { + { + size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Inline != nil { + i -= len(*m.Inline) + copy(dAtA[i:], *m.Inline) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Inline))) + i-- + dAtA[i] = 0x12 + } + if m.S3 != nil { + { + size, err := m.S3.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AzureEventHubsTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureEventHubsTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureEventHubsTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.SharedAccessKey != nil { + { + size, err := m.SharedAccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.SharedAccessKeyName != nil { + { + size, err := m.SharedAccessKeyName.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.HubName) + copy(dAtA[i:], m.HubName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HubName))) + i-- + dAtA[i] = 0x12 + i -= len(m.FQDN) + copy(dAtA[i:], m.FQDN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FQDN))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AzureEventsHubEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureEventsHubEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureEventsHubEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.HubName) + copy(dAtA[i:], m.HubName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HubName))) + i-- + dAtA[i] = 0x22 + if m.SharedAccessKey != nil { + { + size, err := m.SharedAccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.SharedAccessKeyName != nil { + { + size, err := m.SharedAccessKeyName.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.FQDN) + copy(dAtA[i:], m.FQDN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FQDN))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AzureQueueStorageEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureQueueStorageEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureQueueStorageEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.WaitTimeInSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.WaitTimeInSeconds)) + i-- + dAtA[i] = 0x48 + } + i-- + if m.DecodeMessage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + i-- + if m.DLQ { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i -= len(m.QueueName) + copy(dAtA[i:], m.QueueName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueName))) + i-- + dAtA[i] = 0x1a + if m.ConnectionString != nil { + { + size, err := m.ConnectionString.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.StorageAccountName) + copy(dAtA[i:], m.StorageAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StorageAccountName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AzureServiceBusEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureServiceBusEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureServiceBusEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.FullyQualifiedNamespace) + copy(dAtA[i:], m.FullyQualifiedNamespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FullyQualifiedNamespace))) + i-- + dAtA[i] = 0x4a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.SubscriptionName) + copy(dAtA[i:], m.SubscriptionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubscriptionName))) + i-- + dAtA[i] = 0x22 + i -= len(m.TopicName) + copy(dAtA[i:], m.TopicName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicName))) + i-- + dAtA[i] = 0x1a + i -= len(m.QueueName) + copy(dAtA[i:], m.QueueName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueName))) + i-- + dAtA[i] = 0x12 + if m.ConnectionString != nil { + { + size, err := m.ConnectionString.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AzureServiceBusTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AzureServiceBusTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AzureServiceBusTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.SubscriptionName) + copy(dAtA[i:], m.SubscriptionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubscriptionName))) + i-- + dAtA[i] = 0x22 + i -= len(m.TopicName) + copy(dAtA[i:], m.TopicName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicName))) + i-- + dAtA[i] = 0x1a + i -= len(m.QueueName) + copy(dAtA[i:], m.QueueName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueName))) + i-- + dAtA[i] = 0x12 + if m.ConnectionString != nil { + { + size, err := m.ConnectionString.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Backoff) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Backoff) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Backoff) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Steps)) + i-- + dAtA[i] = 0x20 + if m.Jitter != nil { + { + size, err := m.Jitter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Factor != nil { + { + size, err := m.Factor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Duration != nil { + { + size, err := m.Duration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BasicAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BasicAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OAuthToken != nil { + { + size, err := m.OAuthToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketBasicAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketBasicAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketBasicAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Repositories) > 0 { + for iNdEx := len(m.Repositories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Repositories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + i -= len(m.DeprecatedRepositorySlug) + copy(dAtA[i:], m.DeprecatedRepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedRepositorySlug))) + i-- + dAtA[i] = 0x42 + i -= len(m.DeprecatedProjectKey) + copy(dAtA[i:], m.DeprecatedProjectKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedProjectKey))) + i-- + dAtA[i] = 0x3a + i -= len(m.DeprecatedOwner) + copy(dAtA[i:], m.DeprecatedOwner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedOwner))) + i-- + dAtA[i] = 0x32 + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *BitbucketRepository) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketRepository) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketRepository) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RepositorySlug) + copy(dAtA[i:], m.RepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RepositorySlug))) + i-- + dAtA[i] = 0x12 + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *BitbucketServerEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketServerEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketServerEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.CheckInterval) + copy(dAtA[i:], m.CheckInterval) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CheckInterval))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + i -= len(m.BitbucketServerBaseURL) + copy(dAtA[i:], m.BitbucketServerBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.BitbucketServerBaseURL))) + i-- + dAtA[i] = 0x5a + if m.WebhookSecret != nil { + { + size, err := m.WebhookSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.AccessToken != nil { + { + size, err := m.AccessToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + i-- + if m.OneEventPerChange { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + i-- + if m.SkipBranchRefsChangedOnOpenPR { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Repositories) > 0 { + for iNdEx := len(m.Repositories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Repositories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Projects) > 0 { + for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Projects[iNdEx]) + copy(dAtA[i:], m.Projects[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Projects[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i -= len(m.DeprecatedRepositorySlug) + copy(dAtA[i:], m.DeprecatedRepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedRepositorySlug))) + i-- + dAtA[i] = 0x1a + i -= len(m.DeprecatedProjectKey) + copy(dAtA[i:], m.DeprecatedProjectKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedProjectKey))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BitbucketServerRepository) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BitbucketServerRepository) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BitbucketServerRepository) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RepositorySlug) + copy(dAtA[i:], m.RepositorySlug) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RepositorySlug))) + i-- + dAtA[i] = 0x12 + i -= len(m.ProjectKey) + copy(dAtA[i:], m.ProjectKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ProjectKey))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *BusConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BusConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BusConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Kafka != nil { + { + size, err := m.Kafka.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.JetStream != nil { + { + size, err := m.JetStream.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NATS != nil { + { + size, err := m.NATS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CalendarEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CalendarEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CalendarEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Persistence != nil { + { + size, err := m.Persistence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Timezone) + copy(dAtA[i:], m.Timezone) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Timezone))) + i-- + dAtA[i] = 0x22 + if len(m.ExclusionDates) > 0 { + for iNdEx := len(m.ExclusionDates) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExclusionDates[iNdEx]) + copy(dAtA[i:], m.ExclusionDates[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExclusionDates[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Interval) + copy(dAtA[i:], m.Interval) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Interval))) + i-- + dAtA[i] = 0x12 + i -= len(m.Schedule) + copy(dAtA[i:], m.Schedule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Schedule))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CatchupConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CatchupConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CatchupConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.MaxDuration) + copy(dAtA[i:], m.MaxDuration) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MaxDuration))) + i-- + dAtA[i] = 0x12 + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *Condition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Condition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Condition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x22 + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x12 + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ConditionsResetByTime) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConditionsResetByTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConditionsResetByTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Timezone) + copy(dAtA[i:], m.Timezone) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Timezone))) + i-- + dAtA[i] = 0x12 + i -= len(m.Cron) + copy(dAtA[i:], m.Cron) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Cron))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ConditionsResetCriteria) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConditionsResetCriteria) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConditionsResetCriteria) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ByTime != nil { + { + size, err := m.ByTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigMapPersistence) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigMapPersistence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigMapPersistence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.CreateIfNotExist { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ContainerTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.ImagePullPolicy) + copy(dAtA[i:], m.ImagePullPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ImagePullPolicy))) + i-- + dAtA[i] = 0x12 + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CustomTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CustomTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CustomTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Spec) > 0 { + keysForSpec := make([]string, 0, len(m.Spec)) + for k := range m.Spec { + keysForSpec = append(keysForSpec, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSpec) + for iNdEx := len(keysForSpec) - 1; iNdEx >= 0; iNdEx-- { + v := m.Spec[string(keysForSpec[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForSpec[iNdEx]) + copy(dAtA[i:], keysForSpec[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSpec[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.ServerNameOverride) + copy(dAtA[i:], m.ServerNameOverride) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServerNameOverride))) + i-- + dAtA[i] = 0x22 + if m.CertSecret != nil { + { + size, err := m.CertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i-- + if m.Secure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.ServerURL) + copy(dAtA[i:], m.ServerURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServerURL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DataFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DataFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DataFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Template) + copy(dAtA[i:], m.Template) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Template))) + i-- + dAtA[i] = 0x2a + i -= len(m.Comparator) + copy(dAtA[i:], m.Comparator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Comparator))) + i-- + dAtA[i] = 0x22 + if len(m.Value) > 0 { + for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Value[iNdEx]) + copy(dAtA[i:], m.Value[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EmailTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EmailTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EmailTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0x4a + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x42 + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0x3a + if len(m.To) > 0 { + for iNdEx := len(m.To) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.To[iNdEx]) + copy(dAtA[i:], m.To[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.To[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x28 + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0x22 + if m.SMTPPassword != nil { + { + size, err := m.SMTPPassword.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *EmitterEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EmitterEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EmitterEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.ChannelName) + copy(dAtA[i:], m.ChannelName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ChannelName))) + i-- + dAtA[i] = 0x1a + i -= len(m.ChannelKey) + copy(dAtA[i:], m.ChannelKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ChannelKey))) + i-- + dAtA[i] = 0x12 + i -= len(m.Broker) + copy(dAtA[i:], m.Broker) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Broker))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Event) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Data != nil { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if m.Context != nil { + { + size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventBusList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBusList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBusList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventBusSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBusSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBusSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.JetStreamExotic != nil { + { + size, err := m.JetStreamExotic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Kafka != nil { + { + size, err := m.Kafka.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.JetStream != nil { + { + size, err := m.JetStream.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NATS != nil { + { + size, err := m.NATS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBusStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBusStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBusStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Time.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x32 + i -= len(m.DataContentType) + copy(dAtA[i:], m.DataContentType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataContentType))) + i-- + dAtA[i] = 0x2a + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x22 + i -= len(m.SpecVersion) + copy(dAtA[i:], m.SpecVersion) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SpecVersion))) + i-- + dAtA[i] = 0x1a + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x12 + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventDependency) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventDependency) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDependency) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.FiltersLogicalOperator) + copy(dAtA[i:], m.FiltersLogicalOperator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FiltersLogicalOperator))) + i-- + dAtA[i] = 0x32 + if m.Transform != nil { + { + size, err := m.Transform.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Filters != nil { + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.EventName) + copy(dAtA[i:], m.EventName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventName))) + i-- + dAtA[i] = 0x1a + i -= len(m.EventSourceName) + copy(dAtA[i:], m.EventSourceName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventSourceName))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventDependencyFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventDependencyFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDependencyFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Script) + copy(dAtA[i:], m.Script) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Script))) + i-- + dAtA[i] = 0x3a + i -= len(m.ExprLogicalOperator) + copy(dAtA[i:], m.ExprLogicalOperator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ExprLogicalOperator))) + i-- + dAtA[i] = 0x32 + i -= len(m.DataLogicalOperator) + copy(dAtA[i:], m.DataLogicalOperator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataLogicalOperator))) + i-- + dAtA[i] = 0x2a + if len(m.Exprs) > 0 { + for iNdEx := len(m.Exprs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exprs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Context != nil { + { + size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Time != nil { + { + size, err := m.Time.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventDependencyTransformer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventDependencyTransformer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDependencyTransformer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Script) + copy(dAtA[i:], m.Script) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Script))) + i-- + dAtA[i] = 0x12 + i -= len(m.JQ) + copy(dAtA[i:], m.JQ) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.JQ))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventPersistence) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventPersistence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventPersistence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConfigMap != nil { + { + size, err := m.ConfigMap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Catchup != nil { + { + size, err := m.Catchup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Gerrit) > 0 { + keysForGerrit := make([]string, 0, len(m.Gerrit)) + for k := range m.Gerrit { + keysForGerrit = append(keysForGerrit, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGerrit) + for iNdEx := len(keysForGerrit) - 1; iNdEx >= 0; iNdEx-- { + v := m.Gerrit[string(keysForGerrit[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGerrit[iNdEx]) + copy(dAtA[i:], keysForGerrit[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGerrit[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a + } + } + if len(m.SFTP) > 0 { + keysForSFTP := make([]string, 0, len(m.SFTP)) + for k := range m.SFTP { + keysForSFTP = append(keysForSFTP, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSFTP) + for iNdEx := len(keysForSFTP) - 1; iNdEx >= 0; iNdEx-- { + v := m.SFTP[string(keysForSFTP[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSFTP[iNdEx]) + copy(dAtA[i:], keysForSFTP[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSFTP[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + } + if len(m.AzureQueueStorage) > 0 { + keysForAzureQueueStorage := make([]string, 0, len(m.AzureQueueStorage)) + for k := range m.AzureQueueStorage { + keysForAzureQueueStorage = append(keysForAzureQueueStorage, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureQueueStorage) + for iNdEx := len(keysForAzureQueueStorage) - 1; iNdEx >= 0; iNdEx-- { + v := m.AzureQueueStorage[string(keysForAzureQueueStorage[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAzureQueueStorage[iNdEx]) + copy(dAtA[i:], keysForAzureQueueStorage[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAzureQueueStorage[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } + } + if len(m.AzureServiceBus) > 0 { + keysForAzureServiceBus := make([]string, 0, len(m.AzureServiceBus)) + for k := range m.AzureServiceBus { + keysForAzureServiceBus = append(keysForAzureServiceBus, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureServiceBus) + for iNdEx := len(keysForAzureServiceBus) - 1; iNdEx >= 0; iNdEx-- { + v := m.AzureServiceBus[string(keysForAzureServiceBus[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAzureServiceBus[iNdEx]) + copy(dAtA[i:], keysForAzureServiceBus[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAzureServiceBus[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + } + if len(m.RedisStream) > 0 { + keysForRedisStream := make([]string, 0, len(m.RedisStream)) + for k := range m.RedisStream { + keysForRedisStream = append(keysForRedisStream, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedisStream) + for iNdEx := len(keysForRedisStream) - 1; iNdEx >= 0; iNdEx-- { + v := m.RedisStream[string(keysForRedisStream[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForRedisStream[iNdEx]) + copy(dAtA[i:], keysForRedisStream[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForRedisStream[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + } + if len(m.Bitbucket) > 0 { + keysForBitbucket := make([]string, 0, len(m.Bitbucket)) + for k := range m.Bitbucket { + keysForBitbucket = append(keysForBitbucket, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucket) + for iNdEx := len(keysForBitbucket) - 1; iNdEx >= 0; iNdEx-- { + v := m.Bitbucket[string(keysForBitbucket[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForBitbucket[iNdEx]) + copy(dAtA[i:], keysForBitbucket[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForBitbucket[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + } + if len(m.BitbucketServer) > 0 { + keysForBitbucketServer := make([]string, 0, len(m.BitbucketServer)) + for k := range m.BitbucketServer { + keysForBitbucketServer = append(keysForBitbucketServer, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucketServer) + for iNdEx := len(keysForBitbucketServer) - 1; iNdEx >= 0; iNdEx-- { + v := m.BitbucketServer[string(keysForBitbucketServer[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForBitbucketServer[iNdEx]) + copy(dAtA[i:], keysForBitbucketServer[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForBitbucketServer[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + } + if m.Replicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Replicas)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe0 + } + if len(m.Generic) > 0 { + keysForGeneric := make([]string, 0, len(m.Generic)) + for k := range m.Generic { + keysForGeneric = append(keysForGeneric, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGeneric) + for iNdEx := len(keysForGeneric) - 1; iNdEx >= 0; iNdEx-- { + v := m.Generic[string(keysForGeneric[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGeneric[iNdEx]) + copy(dAtA[i:], keysForGeneric[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGeneric[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + } + if len(m.Pulsar) > 0 { + keysForPulsar := make([]string, 0, len(m.Pulsar)) + for k := range m.Pulsar { + keysForPulsar = append(keysForPulsar, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPulsar) + for iNdEx := len(keysForPulsar) - 1; iNdEx >= 0; iNdEx-- { + v := m.Pulsar[string(keysForPulsar[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForPulsar[iNdEx]) + copy(dAtA[i:], keysForPulsar[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForPulsar[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + } + if len(m.NSQ) > 0 { + keysForNSQ := make([]string, 0, len(m.NSQ)) + for k := range m.NSQ { + keysForNSQ = append(keysForNSQ, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNSQ) + for iNdEx := len(keysForNSQ) - 1; iNdEx >= 0; iNdEx-- { + v := m.NSQ[string(keysForNSQ[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForNSQ[iNdEx]) + copy(dAtA[i:], keysForNSQ[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNSQ[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + } + if len(m.Redis) > 0 { + keysForRedis := make([]string, 0, len(m.Redis)) + for k := range m.Redis { + keysForRedis = append(keysForRedis, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedis) + for iNdEx := len(keysForRedis) - 1; iNdEx >= 0; iNdEx-- { + v := m.Redis[string(keysForRedis[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForRedis[iNdEx]) + copy(dAtA[i:], keysForRedis[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForRedis[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + } + if len(m.Emitter) > 0 { + keysForEmitter := make([]string, 0, len(m.Emitter)) + for k := range m.Emitter { + keysForEmitter = append(keysForEmitter, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForEmitter) + for iNdEx := len(keysForEmitter) - 1; iNdEx >= 0; iNdEx-- { + v := m.Emitter[string(keysForEmitter[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForEmitter[iNdEx]) + copy(dAtA[i:], keysForEmitter[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForEmitter[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + } + if len(m.Stripe) > 0 { + keysForStripe := make([]string, 0, len(m.Stripe)) + for k := range m.Stripe { + keysForStripe = append(keysForStripe, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStripe) + for iNdEx := len(keysForStripe) - 1; iNdEx >= 0; iNdEx-- { + v := m.Stripe[string(keysForStripe[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForStripe[iNdEx]) + copy(dAtA[i:], keysForStripe[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForStripe[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + } + if len(m.AzureEventsHub) > 0 { + keysForAzureEventsHub := make([]string, 0, len(m.AzureEventsHub)) + for k := range m.AzureEventsHub { + keysForAzureEventsHub = append(keysForAzureEventsHub, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureEventsHub) + for iNdEx := len(keysForAzureEventsHub) - 1; iNdEx >= 0; iNdEx-- { + v := m.AzureEventsHub[string(keysForAzureEventsHub[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAzureEventsHub[iNdEx]) + copy(dAtA[i:], keysForAzureEventsHub[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAzureEventsHub[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + } + if len(m.StorageGrid) > 0 { + keysForStorageGrid := make([]string, 0, len(m.StorageGrid)) + for k := range m.StorageGrid { + keysForStorageGrid = append(keysForStorageGrid, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStorageGrid) + for iNdEx := len(keysForStorageGrid) - 1; iNdEx >= 0; iNdEx-- { + v := m.StorageGrid[string(keysForStorageGrid[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForStorageGrid[iNdEx]) + copy(dAtA[i:], keysForStorageGrid[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForStorageGrid[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + } + if len(m.Slack) > 0 { + keysForSlack := make([]string, 0, len(m.Slack)) + for k := range m.Slack { + keysForSlack = append(keysForSlack, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSlack) + for iNdEx := len(keysForSlack) - 1; iNdEx >= 0; iNdEx-- { + v := m.Slack[string(keysForSlack[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSlack[iNdEx]) + copy(dAtA[i:], keysForSlack[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSlack[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + } + if len(m.HDFS) > 0 { + keysForHDFS := make([]string, 0, len(m.HDFS)) + for k := range m.HDFS { + keysForHDFS = append(keysForHDFS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHDFS) + for iNdEx := len(keysForHDFS) - 1; iNdEx >= 0; iNdEx-- { + v := m.HDFS[string(keysForHDFS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForHDFS[iNdEx]) + copy(dAtA[i:], keysForHDFS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForHDFS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + } + if len(m.Gitlab) > 0 { + keysForGitlab := make([]string, 0, len(m.Gitlab)) + for k := range m.Gitlab { + keysForGitlab = append(keysForGitlab, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGitlab) + for iNdEx := len(keysForGitlab) - 1; iNdEx >= 0; iNdEx-- { + v := m.Gitlab[string(keysForGitlab[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGitlab[iNdEx]) + copy(dAtA[i:], keysForGitlab[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGitlab[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } + if len(m.Github) > 0 { + keysForGithub := make([]string, 0, len(m.Github)) + for k := range m.Github { + keysForGithub = append(keysForGithub, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGithub) + for iNdEx := len(keysForGithub) - 1; iNdEx >= 0; iNdEx-- { + v := m.Github[string(keysForGithub[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForGithub[iNdEx]) + copy(dAtA[i:], keysForGithub[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForGithub[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if len(m.PubSub) > 0 { + keysForPubSub := make([]string, 0, len(m.PubSub)) + for k := range m.PubSub { + keysForPubSub = append(keysForPubSub, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPubSub) + for iNdEx := len(keysForPubSub) - 1; iNdEx >= 0; iNdEx-- { + v := m.PubSub[string(keysForPubSub[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForPubSub[iNdEx]) + copy(dAtA[i:], keysForPubSub[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForPubSub[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x7a + } + } + if len(m.SQS) > 0 { + keysForSQS := make([]string, 0, len(m.SQS)) + for k := range m.SQS { + keysForSQS = append(keysForSQS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSQS) + for iNdEx := len(keysForSQS) - 1; iNdEx >= 0; iNdEx-- { + v := m.SQS[string(keysForSQS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSQS[iNdEx]) + copy(dAtA[i:], keysForSQS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSQS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + if len(m.SNS) > 0 { + keysForSNS := make([]string, 0, len(m.SNS)) + for k := range m.SNS { + keysForSNS = append(keysForSNS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSNS) + for iNdEx := len(keysForSNS) - 1; iNdEx >= 0; iNdEx-- { + v := m.SNS[string(keysForSNS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForSNS[iNdEx]) + copy(dAtA[i:], keysForSNS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSNS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + if len(m.NATS) > 0 { + keysForNATS := make([]string, 0, len(m.NATS)) + for k := range m.NATS { + keysForNATS = append(keysForNATS, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNATS) + for iNdEx := len(keysForNATS) - 1; iNdEx >= 0; iNdEx-- { + v := m.NATS[string(keysForNATS[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForNATS[iNdEx]) + copy(dAtA[i:], keysForNATS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNATS[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x62 + } + } + if len(m.MQTT) > 0 { + keysForMQTT := make([]string, 0, len(m.MQTT)) + for k := range m.MQTT { + keysForMQTT = append(keysForMQTT, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMQTT) + for iNdEx := len(keysForMQTT) - 1; iNdEx >= 0; iNdEx-- { + v := m.MQTT[string(keysForMQTT[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForMQTT[iNdEx]) + copy(dAtA[i:], keysForMQTT[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMQTT[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a + } + } + if len(m.Kafka) > 0 { + keysForKafka := make([]string, 0, len(m.Kafka)) + for k := range m.Kafka { + keysForKafka = append(keysForKafka, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForKafka) + for iNdEx := len(keysForKafka) - 1; iNdEx >= 0; iNdEx-- { + v := m.Kafka[string(keysForKafka[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForKafka[iNdEx]) + copy(dAtA[i:], keysForKafka[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForKafka[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + if len(m.AMQP) > 0 { + keysForAMQP := make([]string, 0, len(m.AMQP)) + for k := range m.AMQP { + keysForAMQP = append(keysForAMQP, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAMQP) + for iNdEx := len(keysForAMQP) - 1; iNdEx >= 0; iNdEx-- { + v := m.AMQP[string(keysForAMQP[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAMQP[iNdEx]) + copy(dAtA[i:], keysForAMQP[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAMQP[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if len(m.Webhook) > 0 { + keysForWebhook := make([]string, 0, len(m.Webhook)) + for k := range m.Webhook { + keysForWebhook = append(keysForWebhook, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForWebhook) + for iNdEx := len(keysForWebhook) - 1; iNdEx >= 0; iNdEx-- { + v := m.Webhook[string(keysForWebhook[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForWebhook[iNdEx]) + copy(dAtA[i:], keysForWebhook[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForWebhook[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Resource) > 0 { + keysForResource := make([]string, 0, len(m.Resource)) + for k := range m.Resource { + keysForResource = append(keysForResource, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForResource) + for iNdEx := len(keysForResource) - 1; iNdEx >= 0; iNdEx-- { + v := m.Resource[string(keysForResource[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForResource[iNdEx]) + copy(dAtA[i:], keysForResource[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForResource[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if len(m.File) > 0 { + keysForFile := make([]string, 0, len(m.File)) + for k := range m.File { + keysForFile = append(keysForFile, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForFile) + for iNdEx := len(keysForFile) - 1; iNdEx >= 0; iNdEx-- { + v := m.File[string(keysForFile[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForFile[iNdEx]) + copy(dAtA[i:], keysForFile[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForFile[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Calendar) > 0 { + keysForCalendar := make([]string, 0, len(m.Calendar)) + for k := range m.Calendar { + keysForCalendar = append(keysForCalendar, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCalendar) + for iNdEx := len(keysForCalendar) - 1; iNdEx >= 0; iNdEx-- { + v := m.Calendar[string(keysForCalendar[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForCalendar[iNdEx]) + copy(dAtA[i:], keysForCalendar[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForCalendar[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Minio) > 0 { + keysForMinio := make([]string, 0, len(m.Minio)) + for k := range m.Minio { + keysForMinio = append(keysForMinio, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMinio) + for iNdEx := len(keysForMinio) - 1; iNdEx >= 0; iNdEx-- { + v := m.Minio[string(keysForMinio[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForMinio[iNdEx]) + copy(dAtA[i:], keysForMinio[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMinio[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Template != nil { + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.EventBusName) + copy(dAtA[i:], m.EventBusName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventBusName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventSourceStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventSourceStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSourceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ExprFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExprFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExprFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fields) > 0 { + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Expr) + copy(dAtA[i:], m.Expr) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expr))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FileArtifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileArtifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileArtifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FileEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + i-- + if m.Polling { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + { + size, err := m.WatchPathConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.EventType) + copy(dAtA[i:], m.EventType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventType))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GenericEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenericEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.AuthSecret != nil { + { + size, err := m.AuthSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i-- + if m.Insecure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GerritEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GerritEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GerritEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + i-- + if m.SslVerify { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + if len(m.Projects) > 0 { + for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Projects[iNdEx]) + copy(dAtA[i:], m.Projects[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Projects[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + i -= len(m.GerritBaseURL) + copy(dAtA[i:], m.GerritBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GerritBaseURL))) + i-- + dAtA[i] = 0x2a + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.HookName) + copy(dAtA[i:], m.HookName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HookName))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GitArtifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitArtifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitArtifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.InsecureIgnoreHostKey { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + if m.Remote != nil { + { + size, err := m.Remote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0x42 + i -= len(m.Tag) + copy(dAtA[i:], m.Tag) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Tag))) + i-- + dAtA[i] = 0x3a + i -= len(m.Branch) + copy(dAtA[i:], m.Branch) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Branch))) + i-- + dAtA[i] = 0x32 + i -= len(m.FilePath) + copy(dAtA[i:], m.FilePath) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.FilePath))) + i-- + dAtA[i] = 0x2a + if m.SSHKeySecret != nil { + { + size, err := m.SSHKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Creds != nil { + { + size, err := m.Creds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.CloneDirectory) + copy(dAtA[i:], m.CloneDirectory) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CloneDirectory))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GitCreds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitCreds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitCreds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GitRemoteConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitRemoteConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitRemoteConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.URLS) > 0 { + for iNdEx := len(m.URLS) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.URLS[iNdEx]) + copy(dAtA[i:], m.URLS[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URLS[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GithubAppCreds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GithubAppCreds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GithubAppCreds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.InstallationID)) + i-- + dAtA[i] = 0x18 + i = encodeVarintGenerated(dAtA, i, uint64(m.AppID)) + i-- + dAtA[i] = 0x10 + if m.PrivateKey != nil { + { + size, err := m.PrivateKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GithubEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GithubEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GithubEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if m.GithubApp != nil { + { + size, err := m.GithubApp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Organizations) > 0 { + for iNdEx := len(m.Organizations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Organizations[iNdEx]) + copy(dAtA[i:], m.Organizations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Organizations[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if len(m.Repositories) > 0 { + for iNdEx := len(m.Repositories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Repositories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + i -= len(m.GithubUploadURL) + copy(dAtA[i:], m.GithubUploadURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GithubUploadURL))) + i-- + dAtA[i] = 0x62 + i -= len(m.GithubBaseURL) + copy(dAtA[i:], m.GithubBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GithubBaseURL))) + i-- + dAtA[i] = 0x5a + i -= len(m.ContentType) + copy(dAtA[i:], m.ContentType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContentType))) + i-- + dAtA[i] = 0x52 + i-- + if m.Active { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + i-- + if m.Insecure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + if m.WebhookSecret != nil { + { + size, err := m.WebhookSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.APIToken != nil { + { + size, err := m.APIToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.DeprecatedRepository) + copy(dAtA[i:], m.DeprecatedRepository) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedRepository))) + i-- + dAtA[i] = 0x22 + i -= len(m.DeprecatedOwner) + copy(dAtA[i:], m.DeprecatedOwner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedOwner))) + i-- + dAtA[i] = 0x1a + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *GitlabEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GitlabEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GitlabEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Groups[iNdEx]) + copy(dAtA[i:], m.Groups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Groups[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.SecretToken != nil { + { + size, err := m.SecretToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if len(m.Projects) > 0 { + for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Projects[iNdEx]) + copy(dAtA[i:], m.Projects[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Projects[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + i-- + if m.DeleteHookOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + i -= len(m.GitlabBaseURL) + copy(dAtA[i:], m.GitlabBaseURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GitlabBaseURL))) + i-- + dAtA[i] = 0x32 + i-- + if m.EnableSSLVerification { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.AccessToken != nil { + { + size, err := m.AccessToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.DeprecatedProjectID) + copy(dAtA[i:], m.DeprecatedProjectID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeprecatedProjectID))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HDFSEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HDFSEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HDFSEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x62 + } + } + i -= len(m.KrbServicePrincipalName) + copy(dAtA[i:], m.KrbServicePrincipalName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KrbServicePrincipalName))) + i-- + dAtA[i] = 0x5a + if m.KrbConfigConfigMap != nil { + { + size, err := m.KrbConfigConfigMap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + i -= len(m.KrbRealm) + copy(dAtA[i:], m.KrbRealm) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KrbRealm))) + i-- + dAtA[i] = 0x4a + i -= len(m.KrbUsername) + copy(dAtA[i:], m.KrbUsername) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.KrbUsername))) + i-- + dAtA[i] = 0x42 + if m.KrbKeytabSecret != nil { + { + size, err := m.KrbKeytabSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.KrbCCacheSecret != nil { + { + size, err := m.KrbCCacheSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + i -= len(m.HDFSUser) + copy(dAtA[i:], m.HDFSUser) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HDFSUser))) + i-- + dAtA[i] = 0x2a + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i -= len(m.CheckInterval) + copy(dAtA[i:], m.CheckInterval) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CheckInterval))) + i-- + dAtA[i] = 0x1a + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + { + size, err := m.WatchPathConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *HTTPTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SecureHeaders) > 0 { + for iNdEx := len(m.SecureHeaders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SecureHeaders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.Headers) > 0 { + keysForHeaders := make([]string, 0, len(m.Headers)) + for k := range m.Headers { + keysForHeaders = append(keysForHeaders, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + for iNdEx := len(keysForHeaders) - 1; iNdEx >= 0; iNdEx-- { + v := m.Headers[string(keysForHeaders[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForHeaders[iNdEx]) + copy(dAtA[i:], keysForHeaders[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForHeaders[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.BasicAuth != nil { + { + size, err := m.BasicAuth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Timeout)) + i-- + dAtA[i] = 0x30 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x22 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Int64OrString) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Int64OrString) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Int64OrString) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.StrVal) + copy(dAtA[i:], m.StrVal) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StrVal))) + i-- + dAtA[i] = 0x1a + i = encodeVarintGenerated(dAtA, i, uint64(m.Int64Val)) + i-- + dAtA[i] = 0x10 + i = encodeVarintGenerated(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *JetStreamBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JetStreamBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JetStreamBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxPayload != nil { + i -= len(*m.MaxPayload) + copy(dAtA[i:], *m.MaxPayload) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxPayload))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.StreamConfig != nil { + i -= len(*m.StreamConfig) + copy(dAtA[i:], *m.StreamConfig) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StreamConfig))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.StartArgs) > 0 { + for iNdEx := len(m.StartArgs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.StartArgs[iNdEx]) + copy(dAtA[i:], m.StartArgs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StartArgs[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } + if m.Settings != nil { + i -= len(*m.Settings) + copy(dAtA[i:], *m.Settings) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Settings))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x7a + if m.Affinity != nil { + { + size, err := m.Affinity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x68 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x62 + if len(m.ImagePullSecrets) > 0 { + for iNdEx := len(m.ImagePullSecrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImagePullSecrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeSelector[string(keysForNodeSelector[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForNodeSelector[iNdEx]) + copy(dAtA[i:], keysForNodeSelector[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeSelector[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Persistence != nil { + { + size, err := m.Persistence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.MetricsContainerTemplate != nil { + { + size, err := m.MetricsContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ReloaderContainerTemplate != nil { + { + size, err := m.ReloaderContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ContainerTemplate != nil { + { + size, err := m.ContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Replicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Replicas)) + i-- + dAtA[i] = 0x10 + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *JetStreamConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JetStreamConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JetStreamConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.StreamConfig) + copy(dAtA[i:], m.StreamConfig) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StreamConfig))) + i-- + dAtA[i] = 0x1a + if m.AccessSecret != nil { + { + size, err := m.AccessSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *K8SResource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *K8SResource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *K8SResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *K8SResourcePolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *K8SResourcePolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *K8SResourcePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.ErrorOnBackoffTimeout { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + if m.Backoff != nil { + { + size, err := m.Backoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Labels) > 0 { + keysForLabels := make([]string, 0, len(m.Labels)) + for k := range m.Labels { + keysForLabels = append(keysForLabels, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + for iNdEx := len(keysForLabels) - 1; iNdEx >= 0; iNdEx-- { + v := m.Labels[string(keysForLabels[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForLabels[iNdEx]) + copy(dAtA[i:], keysForLabels[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLabels[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *KafkaBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConsumerGroup != nil { + { + size, err := m.ConsumerGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.SASL != nil { + { + size, err := m.SASL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *KafkaConsumerGroup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaConsumerGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaConsumerGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.RebalanceStrategy) + copy(dAtA[i:], m.RebalanceStrategy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RebalanceStrategy))) + i-- + dAtA[i] = 0x1a + i-- + if m.Oldest { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.GroupName) + copy(dAtA[i:], m.GroupName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.GroupName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *KafkaEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0x6a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.SASL != nil { + { + size, err := m.SASL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x52 + i = encodeVarintGenerated(dAtA, i, uint64(m.LimitEventsPerSecond)) + i-- + dAtA[i] = 0x48 + if m.ConsumerGroup != nil { + { + size, err := m.ConsumerGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x1a + i -= len(m.Partition) + copy(dAtA[i:], m.Partition) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Partition))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *KafkaTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KafkaTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KafkaTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SecureHeaders) > 0 { + for iNdEx := len(m.SecureHeaders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SecureHeaders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + } + if len(m.Headers) > 0 { + keysForHeaders := make([]string, 0, len(m.Headers)) + for k := range m.Headers { + keysForHeaders = append(keysForHeaders, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + for iNdEx := len(keysForHeaders) - 1; iNdEx >= 0; iNdEx-- { + v := m.Headers[string(keysForHeaders[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForHeaders[iNdEx]) + copy(dAtA[i:], keysForHeaders[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForHeaders[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + if m.SchemaRegistry != nil { + { + size, err := m.SchemaRegistry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.SASL != nil { + { + size, err := m.SASL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x5a + if m.PartitioningKey != nil { + i -= len(*m.PartitioningKey) + copy(dAtA[i:], *m.PartitioningKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PartitioningKey))) + i-- + dAtA[i] = 0x52 + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.FlushFrequency)) + i-- + dAtA[i] = 0x38 + i-- + if m.Compress { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + i = encodeVarintGenerated(dAtA, i, uint64(m.RequiredAcks)) + i-- + dAtA[i] = 0x28 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Partition)) + i-- + dAtA[i] = 0x18 + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *LogTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.IntervalSeconds)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *MQTTEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MQTTEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MQTTEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x1a + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + keysForLabels := make([]string, 0, len(m.Labels)) + for k := range m.Labels { + keysForLabels = append(keysForLabels, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + for iNdEx := len(keysForLabels) - 1; iNdEx >= 0; iNdEx-- { + v := m.Labels[string(keysForLabels[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForLabels[iNdEx]) + copy(dAtA[i:], keysForLabels[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLabels[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Annotations) > 0 { + keysForAnnotations := make([]string, 0, len(m.Annotations)) + for k := range m.Annotations { + keysForAnnotations = append(keysForAnnotations, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + for iNdEx := len(keysForAnnotations) - 1; iNdEx >= 0; iNdEx-- { + v := m.Annotations[string(keysForAnnotations[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAnnotations[iNdEx]) + copy(dAtA[i:], keysForAnnotations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAnnotations[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *NATSAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Credential != nil { + { + size, err := m.Credential.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.NKey != nil { + { + size, err := m.NKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NATSBus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSBus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSBus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exotic != nil { + { + size, err := m.Exotic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Native != nil { + { + size, err := m.Native.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NATSConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccessSecret != nil { + { + size, err := m.AccessSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Auth != nil { + i -= len(*m.Auth) + copy(dAtA[i:], *m.Auth) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Auth))) + i-- + dAtA[i] = 0x1a + } + if m.ClusterID != nil { + i -= len(*m.ClusterID) + copy(dAtA[i:], *m.ClusterID) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ClusterID))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NATSEventsSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSEventsSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSEventsSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Queue != nil { + i -= len(*m.Queue) + copy(dAtA[i:], *m.Queue) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Queue))) + i-- + dAtA[i] = 0x4a + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NATSTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NATSTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NATSTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NSQEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NSQEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NSQEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Channel))) + i-- + dAtA[i] = 0x1a + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.HostAddress) + copy(dAtA[i:], m.HostAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HostAddress))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NativeStrategy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NativeStrategy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NativeStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RaftCommitTimeout != nil { + i -= len(*m.RaftCommitTimeout) + copy(dAtA[i:], *m.RaftCommitTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftCommitTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.RaftLeaseTimeout != nil { + i -= len(*m.RaftLeaseTimeout) + copy(dAtA[i:], *m.RaftLeaseTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftLeaseTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.RaftElectionTimeout != nil { + i -= len(*m.RaftElectionTimeout) + copy(dAtA[i:], *m.RaftElectionTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftElectionTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.RaftHeartbeatTimeout != nil { + i -= len(*m.RaftHeartbeatTimeout) + copy(dAtA[i:], *m.RaftHeartbeatTimeout) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.RaftHeartbeatTimeout))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.MaxPayload != nil { + i -= len(*m.MaxPayload) + copy(dAtA[i:], *m.MaxPayload) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxPayload))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.MaxSubs != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxSubs)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.MaxBytes != nil { + i -= len(*m.MaxBytes) + copy(dAtA[i:], *m.MaxBytes) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxBytes))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.MaxMsgs != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxMsgs)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.Affinity != nil { + { + size, err := m.Affinity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x70 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x6a + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x62 + if len(m.ImagePullSecrets) > 0 { + for iNdEx := len(m.ImagePullSecrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImagePullSecrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if m.MaxAge != nil { + i -= len(*m.MaxAge) + copy(dAtA[i:], *m.MaxAge) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MaxAge))) + i-- + dAtA[i] = 0x52 + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeSelector[string(keysForNodeSelector[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForNodeSelector[iNdEx]) + copy(dAtA[i:], keysForNodeSelector[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeSelector[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.MetricsContainerTemplate != nil { + { + size, err := m.MetricsContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ContainerTemplate != nil { + { + size, err := m.ContainerTemplate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Persistence != nil { + { + size, err := m.Persistence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Auth != nil { + i -= len(*m.Auth) + copy(dAtA[i:], *m.Auth) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Auth))) + i-- + dAtA[i] = 0x12 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Replicas)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *OpenWhiskTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OpenWhiskTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OpenWhiskTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + i -= len(m.ActionName) + copy(dAtA[i:], m.ActionName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ActionName))) + i-- + dAtA[i] = 0x2a + if m.AuthToken != nil { + { + size, err := m.AuthToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x1a + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *OwnedRepositories) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OwnedRepositories) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OwnedRepositories) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PayloadField) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PayloadField) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PayloadField) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PersistenceStrategy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PersistenceStrategy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PersistenceStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VolumeSize != nil { + { + size, err := m.VolumeSize.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.AccessMode != nil { + i -= len(*m.AccessMode) + copy(dAtA[i:], *m.AccessMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.AccessMode))) + i-- + dAtA[i] = 0x12 + } + if m.StorageClassName != nil { + i -= len(*m.StorageClassName) + copy(dAtA[i:], *m.StorageClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StorageClassName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PubSubEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PubSubEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubSubEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + i-- + if m.DeleteSubscriptionOnFinish { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.CredentialSecret != nil { + { + size, err := m.CredentialSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.SubscriptionID) + copy(dAtA[i:], m.SubscriptionID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubscriptionID))) + i-- + dAtA[i] = 0x22 + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x1a + i -= len(m.TopicProjectID) + copy(dAtA[i:], m.TopicProjectID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicProjectID))) + i-- + dAtA[i] = 0x12 + i -= len(m.ProjectID) + copy(dAtA[i:], m.ProjectID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ProjectID))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PulsarEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PulsarEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PulsarEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuthAthenzSecret != nil { + { + size, err := m.AuthAthenzSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if len(m.AuthAthenzParams) > 0 { + keysForAuthAthenzParams := make([]string, 0, len(m.AuthAthenzParams)) + for k := range m.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + for iNdEx := len(keysForAuthAthenzParams) - 1; iNdEx >= 0; iNdEx-- { + v := m.AuthAthenzParams[string(keysForAuthAthenzParams[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAuthAthenzParams[iNdEx]) + copy(dAtA[i:], keysForAuthAthenzParams[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAuthAthenzParams[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.AuthTokenSecret != nil { + { + size, err := m.AuthTokenSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i-- + if m.TLSValidateHostname { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + i-- + if m.TLSAllowInsecureConnection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + if m.TLSTrustCertsSecret != nil { + { + size, err := m.TLSTrustCertsSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x1a + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + if len(m.Topics) > 0 { + for iNdEx := len(m.Topics) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Topics[iNdEx]) + copy(dAtA[i:], m.Topics[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topics[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PulsarTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PulsarTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PulsarTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuthAthenzSecret != nil { + { + size, err := m.AuthAthenzSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.AuthAthenzParams) > 0 { + keysForAuthAthenzParams := make([]string, 0, len(m.AuthAthenzParams)) + for k := range m.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + for iNdEx := len(keysForAuthAthenzParams) - 1; iNdEx >= 0; iNdEx-- { + v := m.AuthAthenzParams[string(keysForAuthAthenzParams[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAuthAthenzParams[iNdEx]) + copy(dAtA[i:], keysForAuthAthenzParams[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAuthAthenzParams[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a + } + } + if m.ConnectionBackoff != nil { + { + size, err := m.ConnectionBackoff.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.AuthTokenSecret != nil { + { + size, err := m.AuthTokenSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + i-- + if m.TLSValidateHostname { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + i-- + if m.TLSAllowInsecureConnection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.TLSTrustCertsSecret != nil { + { + size, err := m.TLSTrustCertsSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Payload) > 0 { + for iNdEx := len(m.Payload) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payload[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Topic) + copy(dAtA[i:], m.Topic) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Topic))) + i-- + dAtA[i] = 0x12 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RateLimit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RateLimit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.RequestsPerUnit)) + i-- + dAtA[i] = 0x10 + i -= len(m.Unit) + copy(dAtA[i:], m.Unit) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Unit))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RedisEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedisEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedisEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x52 + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Channels[iNdEx]) + copy(dAtA[i:], m.Channels[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Channels[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.DB)) + i-- + dAtA[i] = 0x20 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x1a + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.HostAddress) + copy(dAtA[i:], m.HostAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HostAddress))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *RedisStreamEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedisStreamEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedisStreamEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x52 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.TLS != nil { + { + size, err := m.TLS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i -= len(m.ConsumerGroup) + copy(dAtA[i:], m.ConsumerGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ConsumerGroup))) + i-- + dAtA[i] = 0x32 + i = encodeVarintGenerated(dAtA, i, uint64(m.MaxMsgCountPerRead)) + i-- + dAtA[i] = 0x28 + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Streams[iNdEx]) + copy(dAtA[i:], m.Streams[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Streams[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.DB)) + i-- + dAtA[i] = 0x18 + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.HostAddress) + copy(dAtA[i:], m.HostAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HostAddress))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.EventTypes) > 0 { + for iNdEx := len(m.EventTypes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EventTypes[iNdEx]) + copy(dAtA[i:], m.EventTypes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventTypes[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + { + size, err := m.GroupVersionResource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.AfterStart { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + { + size, err := m.CreatedBy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Fields) > 0 { + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *S3Artifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *S3Artifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *S3Artifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CACertificate != nil { + { + size, err := m.CACertificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i-- + if m.Insecure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x1a + if m.Bucket != nil { + { + size, err := m.Bucket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *S3Bucket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *S3Bucket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *S3Bucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *S3Filter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *S3Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *S3Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Suffix) + copy(dAtA[i:], m.Suffix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Suffix))) + i-- + dAtA[i] = 0x12 + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SASLConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SASLConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SASLConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PasswordSecret != nil { + { + size, err := m.PasswordSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.UserSecret != nil { + { + size, err := m.UserSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Mechanism) + copy(dAtA[i:], m.Mechanism) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Mechanism))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SFTPEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SFTPEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SFTPEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.PollIntervalDuration) + copy(dAtA[i:], m.PollIntervalDuration) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PollIntervalDuration))) + i-- + dAtA[i] = 0x4a + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.SSHKeySecret != nil { + { + size, err := m.SSHKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Password != nil { + { + size, err := m.Password.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Username != nil { + { + size, err := m.Username.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.WatchPathConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.EventType) + copy(dAtA[i:], m.EventType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventType))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SNSEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SNSEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SNSEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x52 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + i-- + if m.ValidateSignature { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + i -= len(m.RoleARN) + copy(dAtA[i:], m.RoleARN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoleARN))) + i-- + dAtA[i] = 0x32 + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x2a + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.TopicArn) + copy(dAtA[i:], m.TopicArn) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicArn))) + i-- + dAtA[i] = 0x12 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SQSEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SQSEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SQSEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SessionToken != nil { + { + size, err := m.SessionToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x62 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + i-- + if m.DLQ { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + i -= len(m.QueueAccountID) + copy(dAtA[i:], m.QueueAccountID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.QueueAccountID))) + i-- + dAtA[i] = 0x42 + i-- + if m.JSONBody { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + i -= len(m.RoleARN) + copy(dAtA[i:], m.RoleARN) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RoleARN))) + i-- + dAtA[i] = 0x32 + i = encodeVarintGenerated(dAtA, i, uint64(m.WaitTimeSeconds)) + i-- + dAtA[i] = 0x28 + i -= len(m.Queue) + copy(dAtA[i:], m.Queue) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Queue))) + i-- + dAtA[i] = 0x22 + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x1a + if m.SecretKey != nil { + { + size, err := m.SecretKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AccessKey != nil { + { + size, err := m.AccessKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SchemaRegistryConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SchemaRegistryConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SchemaRegistryConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + i = encodeVarintGenerated(dAtA, i, uint64(m.SchemaID)) + i-- + dAtA[i] = 0x10 + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SecureHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecureHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecureHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValueFrom != nil { + { + size, err := m.ValueFrom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Selector) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Selector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Selector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x12 + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Sensor) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sensor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sensor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SensorList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SensorList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SensorList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SensorSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SensorSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SensorSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LoggingFields) > 0 { + keysForLoggingFields := make([]string, 0, len(m.LoggingFields)) + for k := range m.LoggingFields { + keysForLoggingFields = append(keysForLoggingFields, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLoggingFields) + for iNdEx := len(keysForLoggingFields) - 1; iNdEx >= 0; iNdEx-- { + v := m.LoggingFields[string(keysForLoggingFields[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForLoggingFields[iNdEx]) + copy(dAtA[i:], keysForLoggingFields[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForLoggingFields[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.RevisionHistoryLimit != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.RevisionHistoryLimit)) + i-- + dAtA[i] = 0x38 + } + if m.Replicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Replicas)) + i-- + dAtA[i] = 0x30 + } + i -= len(m.EventBusName) + copy(dAtA[i:], m.EventBusName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventBusName))) + i-- + dAtA[i] = 0x2a + i-- + if m.ErrorOnFailedRound { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if m.Template != nil { + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Triggers) > 0 { + for iNdEx := len(m.Triggers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Triggers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Dependencies) > 0 { + for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SensorStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SensorStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SensorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Service) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Service) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.ClusterIP) + copy(dAtA[i:], m.ClusterIP) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ClusterIP))) + i-- + dAtA[i] = 0x1a + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlackEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SigningSecret != nil { + { + size, err := m.SigningSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlackSender) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackSender) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackSender) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x12 + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SlackThread) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackThread) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackThread) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.BroadcastMessageToChannel { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.MessageAggregationKey) + copy(dAtA[i:], m.MessageAggregationKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.MessageAggregationKey))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SlackTrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlackTrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlackTrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Sender.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.Thread.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + i -= len(m.Blocks) + copy(dAtA[i:], m.Blocks) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Blocks))) + i-- + dAtA[i] = 0x32 + i -= len(m.Attachments) + copy(dAtA[i:], m.Attachments) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Attachments))) + i-- + dAtA[i] = 0x2a + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x22 + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Channel))) + i-- + dAtA[i] = 0x1a + if m.SlackToken != nil { + { + size, err := m.SlackToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StandardK8STrigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StandardK8STrigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StandardK8STrigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.LiveObject { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + i -= len(m.PatchStrategy) + copy(dAtA[i:], m.PatchStrategy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PatchStrategy))) + i-- + dAtA[i] = 0x22 + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x12 + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Status) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Status) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StatusPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Allow) > 0 { + for iNdEx := len(m.Allow) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintGenerated(dAtA, i, uint64(m.Allow[iNdEx])) + i-- + dAtA[i] = 0x8 + } + } + return len(dAtA) - i, nil +} + +func (m *StorageGridEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageGridEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageGridEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + i -= len(m.APIURL) + copy(dAtA[i:], m.APIURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIURL))) + i-- + dAtA[i] = 0x42 + if m.AuthToken != nil { + { + size, err := m.AuthToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x32 + i -= len(m.Bucket) + copy(dAtA[i:], m.Bucket) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Bucket))) + i-- + dAtA[i] = 0x2a + i -= len(m.TopicArn) + copy(dAtA[i:], m.TopicArn) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TopicArn))) + i-- + dAtA[i] = 0x22 + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Events[iNdEx]) + copy(dAtA[i:], m.Events[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Events[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StorageGridFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageGridFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageGridFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Suffix) + copy(dAtA[i:], m.Suffix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Suffix))) + i-- + dAtA[i] = 0x12 + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StripeEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StripeEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StripeEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.EventFilter) > 0 { + for iNdEx := len(m.EventFilter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EventFilter[iNdEx]) + copy(dAtA[i:], m.EventFilter[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EventFilter[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.APIKey != nil { + { + size, err := m.APIKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i-- + if m.CreateWebhook { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + if m.Webhook != nil { + { + size, err := m.Webhook.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TLSConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TLSConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.InsecureSkipVerify { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if m.ClientKeySecret != nil { + { + size, err := m.ClientKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClientCertSecret != nil { + { + size, err := m.ClientCertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.CACertSecret != nil { + { + size, err := m.CACertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Template) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Template) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Template) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Affinity != nil { + { + size, err := m.Affinity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x50 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x4a + if len(m.ImagePullSecrets) > 0 { + for iNdEx := len(m.ImagePullSecrets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImagePullSecrets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeSelector[string(keysForNodeSelector[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForNodeSelector[iNdEx]) + copy(dAtA[i:], keysForNodeSelector[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeSelector[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Volumes) > 0 { + for iNdEx := len(m.Volumes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Volumes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Container != nil { + { + size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x12 + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TimeFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TimeFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TimeFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Stop) + copy(dAtA[i:], m.Stop) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Stop))) + i-- + dAtA[i] = 0x12 + i -= len(m.Start) + copy(dAtA[i:], m.Start) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Start))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Trigger) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Trigger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Trigger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DlqTrigger != nil { + { + size, err := m.DlqTrigger.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + i-- + if m.AtLeastOnce { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + if m.RateLimit != nil { + { + size, err := m.RateLimit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.RetryStrategy != nil { + { + size, err := m.RetryStrategy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Policy != nil { + { + size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parameters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Template != nil { + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TriggerParameter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerParameter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerParameter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0x1a + i -= len(m.Dest) + copy(dAtA[i:], m.Dest) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Dest))) + i-- + dAtA[i] = 0x12 + if m.Src != nil { + { + size, err := m.Src.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TriggerParameterSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerParameterSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerParameterSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.UseRawData { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if m.Value != nil { + i -= len(*m.Value) + copy(dAtA[i:], *m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Value))) + i-- + dAtA[i] = 0x32 + } + i -= len(m.DataTemplate) + copy(dAtA[i:], m.DataTemplate) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataTemplate))) + i-- + dAtA[i] = 0x2a + i -= len(m.DataKey) + copy(dAtA[i:], m.DataKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DataKey))) + i-- + dAtA[i] = 0x22 + i -= len(m.ContextTemplate) + copy(dAtA[i:], m.ContextTemplate) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContextTemplate))) + i-- + dAtA[i] = 0x1a + i -= len(m.ContextKey) + copy(dAtA[i:], m.ContextKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ContextKey))) + i-- + dAtA[i] = 0x12 + i -= len(m.DependencyName) + copy(dAtA[i:], m.DependencyName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DependencyName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TriggerPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.K8s != nil { + { + size, err := m.K8s.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TriggerTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TriggerTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TriggerTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Email != nil { + { + size, err := m.Email.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.AzureServiceBus != nil { + { + size, err := m.AzureServiceBus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.ConditionsReset) > 0 { + for iNdEx := len(m.ConditionsReset) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConditionsReset[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + } + if m.Pulsar != nil { + { + size, err := m.Pulsar.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.AzureEventHubs != nil { + { + size, err := m.AzureEventHubs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.Log != nil { + { + size, err := m.Log.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.OpenWhisk != nil { + { + size, err := m.OpenWhisk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.Slack != nil { + { + size, err := m.Slack.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.NATS != nil { + { + size, err := m.NATS.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Kafka != nil { + { + size, err := m.Kafka.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.CustomTrigger != nil { + { + size, err := m.CustomTrigger.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.AWSLambda != nil { + { + size, err := m.AWSLambda.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.HTTP != nil { + { + size, err := m.HTTP.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ArgoWorkflow != nil { + { + size, err := m.ArgoWorkflow.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.K8s != nil { + { + size, err := m.K8s.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i -= len(m.Conditions) + copy(dAtA[i:], m.Conditions) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Conditions))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *URLArtifact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *URLArtifact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *URLArtifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.VerifyCert { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ValueFromSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValueFromSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueFromSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConfigMapKeyRef != nil { + { + size, err := m.ConfigMapKeyRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SecretKeyRef != nil { + { + size, err := m.SecretKeyRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WatchPathConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WatchPathConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchPathConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.PathRegexp) + copy(dAtA[i:], m.PathRegexp) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PathRegexp))) + i-- + dAtA[i] = 0x1a + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + i -= len(m.Directory) + copy(dAtA[i:], m.Directory) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Directory))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WebhookContext) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WebhookContext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WebhookContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxPayloadSize != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxPayloadSize)) + i-- + dAtA[i] = 0x48 + } + if m.AuthSecret != nil { + { + size, err := m.AuthSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Metadata) > 0 { + keysForMetadata := make([]string, 0, len(m.Metadata)) + for k := range m.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := m.Metadata[string(keysForMetadata[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForMetadata[iNdEx]) + copy(dAtA[i:], keysForMetadata[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForMetadata[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.ServerKeySecret != nil { + { + size, err := m.ServerKeySecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.ServerCertSecret != nil { + { + size, err := m.ServerCertSecret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x22 + i -= len(m.Port) + copy(dAtA[i:], m.Port) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Port))) + i-- + dAtA[i] = 0x1a + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x12 + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WebhookEventSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WebhookEventSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WebhookEventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.WebhookContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AMQPConsumeConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerTag) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + n += 2 + n += 2 + return n +} + +func (m *AMQPEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ExchangeName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ExchangeType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RoutingKey) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.ExchangeDeclare != nil { + l = m.ExchangeDeclare.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.QueueDeclare != nil { + l = m.QueueDeclare.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.QueueBind != nil { + l = m.QueueBind.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Consume != nil { + l = m.Consume.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.URLSecret != nil { + l = m.URLSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *AMQPExchangeDeclareConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + n += 2 + n += 2 + n += 2 + return n +} + +func (m *AMQPQueueBindConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} + +func (m *AMQPQueueDeclareConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + n += 2 + n += 2 + l = len(m.Arguments) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AWSLambdaTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FunctionName) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.InvocationType != nil { + l = len(*m.InvocationType) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.RoleARN) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Amount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ArgoWorkflowTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ArtifactLocation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.S3 != nil { + l = m.S3.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Inline != nil { + l = len(*m.Inline) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.File != nil { + l = m.File.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.URL != nil { + l = m.URL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Configmap != nil { + l = m.Configmap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Git != nil { + l = m.Git.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Resource != nil { + l = m.Resource.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *AzureEventHubsTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FQDN) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.HubName) + n += 1 + l + sovGenerated(uint64(l)) + if m.SharedAccessKeyName != nil { + l = m.SharedAccessKeyName.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SharedAccessKey != nil { + l = m.SharedAccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *AzureEventsHubEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FQDN) + n += 1 + l + sovGenerated(uint64(l)) + if m.SharedAccessKeyName != nil { + l = m.SharedAccessKeyName.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SharedAccessKey != nil { + l = m.SharedAccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.HubName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *AzureQueueStorageEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StorageAccountName) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionString != nil { + l = m.ConnectionString.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.QueueName) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.WaitTimeInSeconds != nil { + n += 1 + sovGenerated(uint64(*m.WaitTimeInSeconds)) + } + return n +} + +func (m *AzureServiceBusEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConnectionString != nil { + l = m.ConnectionString.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.QueueName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TopicName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SubscriptionName) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.FullyQualifiedNamespace) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *AzureServiceBusTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConnectionString != nil { + l = m.ConnectionString.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.QueueName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TopicName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SubscriptionName) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *Backoff) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Duration != nil { + l = m.Duration.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Factor != nil { + l = m.Factor.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Jitter != nil { + l = m.Jitter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.Steps)) + return n +} + +func (m *BasicAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.OAuthToken != nil { + l = m.OAuthToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketBasicAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.DeprecatedOwner) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedProjectKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedRepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Repositories) > 0 { + for _, e := range m.Repositories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *BitbucketRepository) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *BitbucketServerEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.DeprecatedProjectKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedRepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Repositories) > 0 { + for _, e := range m.Repositories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + n += 2 + if m.AccessToken != nil { + l = m.AccessToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WebhookSecret != nil { + l = m.WebhookSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.BitbucketServerBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.CheckInterval) + n += 2 + l + sovGenerated(uint64(l)) + return n +} + +func (m *BitbucketServerRepository) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RepositorySlug) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *BusConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NATS != nil { + l = m.NATS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.JetStream != nil { + l = m.JetStream.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Kafka != nil { + l = m.Kafka.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CalendarEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Schedule) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Interval) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.ExclusionDates) > 0 { + for _, s := range m.ExclusionDates { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Timezone) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CatchupConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + l = len(m.MaxDuration) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Condition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ConditionsResetByTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cron) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Timezone) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ConditionsResetCriteria) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ByTime != nil { + l = m.ByTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ConfigMapPersistence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *ContainerTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Resources.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ImagePullPolicy) + n += 1 + l + sovGenerated(uint64(l)) + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CustomTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServerURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.CertSecret != nil { + l = m.CertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ServerNameOverride) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Spec) > 0 { + for k, v := range m.Spec { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DataFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Value) > 0 { + for _, s := range m.Value { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Comparator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Template) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EmailTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + if m.SMTPPassword != nil { + l = m.SMTPPassword.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Host) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Port)) + if len(m.To) > 0 { + for _, s := range m.To { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.From) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Body) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EmitterEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Broker) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ChannelKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ChannelName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *Event) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EventBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventBusList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *EventBusSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NATS != nil { + l = m.NATS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.JetStream != nil { + l = m.JetStream.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Kafka != nil { + l = m.Kafka.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.JetStreamExotic != nil { + l = m.JetStreamExotic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EventBusStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Config.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Source) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SpecVersion) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DataContentType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventDependency) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.EventSourceName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.EventName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Filters != nil { + l = m.Filters.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Transform != nil { + l = m.Transform.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.FiltersLogicalOperator) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventDependencyFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Time != nil { + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Data) > 0 { + for _, e := range m.Data { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Exprs) > 0 { + for _, e := range m.Exprs { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.DataLogicalOperator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ExprLogicalOperator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Script) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventDependencyTransformer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.JQ) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Script) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventPersistence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Catchup != nil { + l = m.Catchup.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConfigMap != nil { + l = m.ConfigMap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventSourceFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expression) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EventSourceList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *EventSourceSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EventBusName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Minio) > 0 { + for k, v := range m.Minio { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Calendar) > 0 { + for k, v := range m.Calendar { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.File) > 0 { + for k, v := range m.File { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Resource) > 0 { + for k, v := range m.Resource { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Webhook) > 0 { + for k, v := range m.Webhook { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AMQP) > 0 { + for k, v := range m.AMQP { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Kafka) > 0 { + for k, v := range m.Kafka { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.MQTT) > 0 { + for k, v := range m.MQTT { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.NATS) > 0 { + for k, v := range m.NATS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SNS) > 0 { + for k, v := range m.SNS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SQS) > 0 { + for k, v := range m.SQS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.PubSub) > 0 { + for k, v := range m.PubSub { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Github) > 0 { + for k, v := range m.Github { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Gitlab) > 0 { + for k, v := range m.Gitlab { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.HDFS) > 0 { + for k, v := range m.HDFS { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Slack) > 0 { + for k, v := range m.Slack { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.StorageGrid) > 0 { + for k, v := range m.StorageGrid { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AzureEventsHub) > 0 { + for k, v := range m.AzureEventsHub { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Stripe) > 0 { + for k, v := range m.Stripe { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Emitter) > 0 { + for k, v := range m.Emitter { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Redis) > 0 { + for k, v := range m.Redis { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.NSQ) > 0 { + for k, v := range m.NSQ { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Pulsar) > 0 { + for k, v := range m.Pulsar { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Generic) > 0 { + for k, v := range m.Generic { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Replicas != nil { + n += 2 + sovGenerated(uint64(*m.Replicas)) + } + if len(m.BitbucketServer) > 0 { + for k, v := range m.BitbucketServer { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Bitbucket) > 0 { + for k, v := range m.Bitbucket { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.RedisStream) > 0 { + for k, v := range m.RedisStream { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AzureServiceBus) > 0 { + for k, v := range m.AzureServiceBus { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.AzureQueueStorage) > 0 { + for k, v := range m.AzureQueueStorage { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SFTP) > 0 { + for k, v := range m.SFTP { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Gerrit) > 0 { + for k, v := range m.Gerrit { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *EventSourceStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ExprFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expr) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Fields) > 0 { + for _, e := range m.Fields { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *FileArtifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *FileEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EventType) + n += 1 + l + sovGenerated(uint64(l)) + l = m.WatchPathConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GenericEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Config) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthSecret != nil { + l = m.AuthSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GerritEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.HookName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.GerritBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GitArtifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.CloneDirectory) + n += 1 + l + sovGenerated(uint64(l)) + if m.Creds != nil { + l = m.Creds.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SSHKeySecret != nil { + l = m.SSHKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.FilePath) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Branch) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Tag) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Ref) + n += 1 + l + sovGenerated(uint64(l)) + if m.Remote != nil { + l = m.Remote.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *GitCreds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GitRemoteConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.URLS) > 0 { + for _, s := range m.URLS { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *GithubAppCreds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PrivateKey != nil { + l = m.PrivateKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.AppID)) + n += 1 + sovGenerated(uint64(m.InstallationID)) + return n +} + +func (m *GithubEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.ID)) + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.DeprecatedOwner) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeprecatedRepository) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.APIToken != nil { + l = m.APIToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WebhookSecret != nil { + l = m.WebhookSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + l = len(m.ContentType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.GithubBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.GithubUploadURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Repositories) > 0 { + for _, e := range m.Repositories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Organizations) > 0 { + for _, s := range m.Organizations { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if m.GithubApp != nil { + l = m.GithubApp.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GitlabEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.DeprecatedProjectID) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.AccessToken != nil { + l = m.AccessToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + l = len(m.GitlabBaseURL) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SecretToken != nil { + l = m.SecretToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Groups) > 0 { + for _, s := range m.Groups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *HDFSEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.WatchPathConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.CheckInterval) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.HDFSUser) + n += 1 + l + sovGenerated(uint64(l)) + if m.KrbCCacheSecret != nil { + l = m.KrbCCacheSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.KrbKeytabSecret != nil { + l = m.KrbKeytabSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.KrbUsername) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.KrbRealm) + n += 1 + l + sovGenerated(uint64(l)) + if m.KrbConfigConfigMap != nil { + l = m.KrbConfigConfigMap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.KrbServicePrincipalName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *HTTPTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Method) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 1 + sovGenerated(uint64(m.Timeout)) + if m.BasicAuth != nil { + l = m.BasicAuth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Headers) > 0 { + for k, v := range m.Headers { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SecureHeaders) > 0 { + for _, e := range m.SecureHeaders { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *Int64OrString) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Type)) + n += 1 + sovGenerated(uint64(m.Int64Val)) + l = len(m.StrVal) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *JetStreamBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.Replicas != nil { + n += 1 + sovGenerated(uint64(*m.Replicas)) + } + if m.ContainerTemplate != nil { + l = m.ContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ReloaderContainerTemplate != nil { + l = m.ReloaderContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MetricsContainerTemplate != nil { + l = m.MetricsContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ImagePullSecrets) > 0 { + for _, e := range m.ImagePullSecrets { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.Affinity != nil { + l = m.Affinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Settings != nil { + l = len(*m.Settings) + n += 2 + l + sovGenerated(uint64(l)) + } + if len(m.StartArgs) > 0 { + for _, s := range m.StartArgs { + l = len(s) + n += 2 + l + sovGenerated(uint64(l)) + } + } + if m.StreamConfig != nil { + l = len(*m.StreamConfig) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.MaxPayload != nil { + l = len(*m.MaxPayload) + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *JetStreamConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessSecret != nil { + l = m.AccessSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.StreamConfig) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *K8SResource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *K8SResourcePolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Backoff != nil { + l = m.Backoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *KafkaBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SASL != nil { + l = m.SASL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConsumerGroup != nil { + l = m.ConsumerGroup.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *KafkaConsumerGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GroupName) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + l = len(m.RebalanceStrategy) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *KafkaEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Partition) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.ConsumerGroup != nil { + l = m.ConsumerGroup.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.LimitEventsPerSecond)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.SASL != nil { + l = m.SASL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Config) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *KafkaTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Partition)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 1 + sovGenerated(uint64(m.RequiredAcks)) + n += 2 + n += 1 + sovGenerated(uint64(m.FlushFrequency)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.PartitioningKey != nil { + l = len(*m.PartitioningKey) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if m.SASL != nil { + l = m.SASL.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SchemaRegistry != nil { + l = m.SchemaRegistry.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Headers) > 0 { + for k, v := range m.Headers { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.SecureHeaders) > 0 { + for _, e := range m.SecureHeaders { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *LogTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.IntervalSeconds)) + return n +} + +func (m *MQTTEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ClientID) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *NATSAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NKey != nil { + l = m.NKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Credential != nil { + l = m.Credential.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSBus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Native != nil { + l = m.Native.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Exotic != nil { + l = m.Exotic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.ClusterID != nil { + l = len(*m.ClusterID) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = len(*m.Auth) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AccessSecret != nil { + l = m.AccessSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSEventsSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Queue != nil { + l = len(*m.Queue) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NATSTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Subject) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NSQEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostAddress) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Channel) + n += 1 + l + sovGenerated(uint64(l)) + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NativeStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Replicas)) + if m.Auth != nil { + l = len(*m.Auth) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ContainerTemplate != nil { + l = m.ContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MetricsContainerTemplate != nil { + l = m.MetricsContainerTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxAge != nil { + l = len(*m.MaxAge) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ImagePullSecrets) > 0 { + for _, e := range m.ImagePullSecrets { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.Affinity != nil { + l = m.Affinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxMsgs != nil { + n += 2 + sovGenerated(uint64(*m.MaxMsgs)) + } + if m.MaxBytes != nil { + l = len(*m.MaxBytes) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.MaxSubs != nil { + n += 2 + sovGenerated(uint64(*m.MaxSubs)) + } + if m.MaxPayload != nil { + l = len(*m.MaxPayload) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftHeartbeatTimeout != nil { + l = len(*m.RaftHeartbeatTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftElectionTimeout != nil { + l = len(*m.RaftElectionTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftLeaseTimeout != nil { + l = len(*m.RaftLeaseTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + if m.RaftCommitTimeout != nil { + l = len(*m.RaftCommitTimeout) + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *OpenWhiskTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Host) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + if m.AuthToken != nil { + l = m.AuthToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ActionName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *OwnedRepositories) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PayloadField) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PersistenceStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StorageClassName != nil { + l = len(*m.StorageClassName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AccessMode != nil { + l = len(*m.AccessMode) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.VolumeSize != nil { + l = m.VolumeSize.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PubSubEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TopicProjectID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.SubscriptionID) + n += 1 + l + sovGenerated(uint64(l)) + if m.CredentialSecret != nil { + l = m.CredentialSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PulsarEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topics) > 0 { + for _, s := range m.Topics { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLSTrustCertsSecret != nil { + l = m.TLSTrustCertsSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthTokenSecret != nil { + l = m.AuthTokenSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.AuthAthenzParams) > 0 { + for k, v := range m.AuthAthenzParams { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthAthenzSecret != nil { + l = m.AuthAthenzSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PulsarTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Topic) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Payload) > 0 { + for _, e := range m.Payload { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLSTrustCertsSecret != nil { + l = m.TLSTrustCertsSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + n += 2 + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AuthTokenSecret != nil { + l = m.AuthTokenSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConnectionBackoff != nil { + l = m.ConnectionBackoff.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.AuthAthenzParams) > 0 { + for k, v := range m.AuthAthenzParams { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthAthenzSecret != nil { + l = m.AuthAthenzSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *RateLimit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Unit) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.RequestsPerUnit)) + return n +} + +func (m *RedisEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostAddress) + n += 1 + l + sovGenerated(uint64(l)) + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.DB)) + if len(m.Channels) > 0 { + for _, s := range m.Channels { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *RedisStreamEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostAddress) + n += 1 + l + sovGenerated(uint64(l)) + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 1 + sovGenerated(uint64(m.DB)) + if len(m.Streams) > 0 { + for _, s := range m.Streams { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 1 + sovGenerated(uint64(m.MaxMsgCountPerRead)) + l = len(m.ConsumerGroup) + n += 1 + l + sovGenerated(uint64(l)) + if m.TLS != nil { + l = m.TLS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ResourceEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.GroupVersionResource.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.EventTypes) > 0 { + for _, s := range m.EventTypes { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *ResourceFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Fields) > 0 { + for _, e := range m.Fields { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.CreatedBy.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *S3Artifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + if m.Bucket != nil { + l = m.Bucket.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.CACertificate != nil { + l = m.CACertificate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *S3Bucket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *S3Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Suffix) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SASLConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Mechanism) + n += 1 + l + sovGenerated(uint64(l)) + if m.UserSecret != nil { + l = m.UserSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.PasswordSecret != nil { + l = m.PasswordSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SFTPEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EventType) + n += 1 + l + sovGenerated(uint64(l)) + l = m.WatchPathConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.Username != nil { + l = m.Username.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Password != nil { + l = m.Password.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SSHKeySecret != nil { + l = m.SSHKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PollIntervalDuration) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SNSEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.TopicArn) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.RoleARN) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 2 + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SQSEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccessKey != nil { + l = m.AccessKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SecretKey != nil { + l = m.SecretKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Queue) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.WaitTimeSeconds)) + l = len(m.RoleARN) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + l = len(m.QueueAccountID) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + n += 2 + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + if m.SessionToken != nil { + l = m.SessionToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SchemaRegistryConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.SchemaID)) + l = m.Auth.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SecureHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ValueFrom != nil { + l = m.ValueFrom.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *Selector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Sensor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SensorList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *SensorSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Dependencies) > 0 { + for _, e := range m.Dependencies { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Triggers) > 0 { + for _, e := range m.Triggers { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + l = len(m.EventBusName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Replicas != nil { + n += 1 + sovGenerated(uint64(*m.Replicas)) + } + if m.RevisionHistoryLimit != nil { + n += 1 + sovGenerated(uint64(*m.RevisionHistoryLimit)) + } + if len(m.LoggingFields) > 0 { + for k, v := range m.LoggingFields { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *SensorStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Service) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.ClusterIP) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SlackEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SigningSecret != nil { + l = m.SigningSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SlackSender) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Icon) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *SlackThread) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MessageAggregationKey) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *SlackTrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SlackToken != nil { + l = m.SlackToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Channel) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Attachments) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Blocks) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Thread.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Sender.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *StandardK8STrigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.PatchStrategy) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *Status) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *StatusPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allow) > 0 { + for _, e := range m.Allow { + n += 1 + sovGenerated(uint64(e)) + } + } + return n +} + +func (m *StorageGridEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Events) > 0 { + for _, s := range m.Events { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.TopicArn) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Bucket) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Region) + n += 1 + l + sovGenerated(uint64(l)) + if m.AuthToken != nil { + l = m.AuthToken.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.APIURL) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *StorageGridFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Suffix) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *StripeEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Webhook != nil { + l = m.Webhook.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.APIKey != nil { + l = m.APIKey.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.EventFilter) > 0 { + for _, s := range m.EventFilter { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *TLSConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CACertSecret != nil { + l = m.CACertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ClientCertSecret != nil { + l = m.ClientCertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ClientKeySecret != nil { + l = m.ClientKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *Template) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.ImagePullSecrets) > 0 { + for _, e := range m.ImagePullSecrets { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.Affinity != nil { + l = m.Affinity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TimeFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Start) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Stop) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Trigger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Policy != nil { + l = m.Policy.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.RetryStrategy != nil { + l = m.RetryStrategy.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.RateLimit != nil { + l = m.RateLimit.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + if m.DlqTrigger != nil { + l = m.DlqTrigger.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TriggerParameter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Src != nil { + l = m.Src.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Dest) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Operation) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *TriggerParameterSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DependencyName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ContextKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ContextTemplate) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DataKey) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DataTemplate) + n += 1 + l + sovGenerated(uint64(l)) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovGenerated(uint64(l)) + } + n += 2 + return n +} + +func (m *TriggerPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.K8s != nil { + l = m.K8s.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TriggerTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Conditions) + n += 1 + l + sovGenerated(uint64(l)) + if m.K8s != nil { + l = m.K8s.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ArgoWorkflow != nil { + l = m.ArgoWorkflow.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.HTTP != nil { + l = m.HTTP.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AWSLambda != nil { + l = m.AWSLambda.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.CustomTrigger != nil { + l = m.CustomTrigger.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Kafka != nil { + l = m.Kafka.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NATS != nil { + l = m.NATS.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Slack != nil { + l = m.Slack.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.OpenWhisk != nil { + l = m.OpenWhisk.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Log != nil { + l = m.Log.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AzureEventHubs != nil { + l = m.AzureEventHubs.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Pulsar != nil { + l = m.Pulsar.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ConditionsReset) > 0 { + for _, e := range m.ConditionsReset { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.AzureServiceBus != nil { + l = m.AzureServiceBus.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + if m.Email != nil { + l = m.Email.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *URLArtifact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *ValueFromSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SecretKeyRef != nil { + l = m.SecretKeyRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ConfigMapKeyRef != nil { + l = m.ConfigMapKeyRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WatchPathConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Directory) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PathRegexp) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *WebhookContext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Endpoint) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Method) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Port) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) + if m.ServerCertSecret != nil { + l = m.ServerCertSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ServerKeySecret != nil { + l = m.ServerKeySecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AuthSecret != nil { + l = m.AuthSecret.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.MaxPayloadSize != nil { + n += 1 + sovGenerated(uint64(*m.MaxPayloadSize)) + } + return n +} + +func (m *WebhookEventSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.WebhookContext.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AMQPConsumeConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPConsumeConfig{`, + `ConsumerTag:` + fmt.Sprintf("%v", this.ConsumerTag) + `,`, + `AutoAck:` + fmt.Sprintf("%v", this.AutoAck) + `,`, + `Exclusive:` + fmt.Sprintf("%v", this.Exclusive) + `,`, + `NoLocal:` + fmt.Sprintf("%v", this.NoLocal) + `,`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AMQPEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `ExchangeName:` + fmt.Sprintf("%v", this.ExchangeName) + `,`, + `ExchangeType:` + fmt.Sprintf("%v", this.ExchangeType) + `,`, + `RoutingKey:` + fmt.Sprintf("%v", this.RoutingKey) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `ExchangeDeclare:` + strings.Replace(this.ExchangeDeclare.String(), "AMQPExchangeDeclareConfig", "AMQPExchangeDeclareConfig", 1) + `,`, + `QueueDeclare:` + strings.Replace(this.QueueDeclare.String(), "AMQPQueueDeclareConfig", "AMQPQueueDeclareConfig", 1) + `,`, + `QueueBind:` + strings.Replace(this.QueueBind.String(), "AMQPQueueBindConfig", "AMQPQueueBindConfig", 1) + `,`, + `Consume:` + strings.Replace(this.Consume.String(), "AMQPConsumeConfig", "AMQPConsumeConfig", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `URLSecret:` + strings.Replace(fmt.Sprintf("%v", this.URLSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPExchangeDeclareConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPExchangeDeclareConfig{`, + `Durable:` + fmt.Sprintf("%v", this.Durable) + `,`, + `AutoDelete:` + fmt.Sprintf("%v", this.AutoDelete) + `,`, + `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPQueueBindConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPQueueBindConfig{`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `}`, + }, "") + return s +} +func (this *AMQPQueueDeclareConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AMQPQueueDeclareConfig{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Durable:` + fmt.Sprintf("%v", this.Durable) + `,`, + `AutoDelete:` + fmt.Sprintf("%v", this.AutoDelete) + `,`, + `Exclusive:` + fmt.Sprintf("%v", this.Exclusive) + `,`, + `NoWait:` + fmt.Sprintf("%v", this.NoWait) + `,`, + `Arguments:` + fmt.Sprintf("%v", this.Arguments) + `,`, + `}`, + }, "") + return s +} +func (this *AWSLambdaTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&AWSLambdaTrigger{`, + `FunctionName:` + fmt.Sprintf("%v", this.FunctionName) + `,`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `InvocationType:` + valueToStringGenerated(this.InvocationType) + `,`, + `RoleARN:` + fmt.Sprintf("%v", this.RoleARN) + `,`, + `}`, + }, "") + return s +} +func (this *Amount) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Amount{`, + `Value:` + valueToStringGenerated(this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *ArgoWorkflowTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&ArgoWorkflowTrigger{`, + `Source:` + strings.Replace(this.Source.String(), "ArtifactLocation", "ArtifactLocation", 1) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Args:` + fmt.Sprintf("%v", this.Args) + `,`, + `}`, + }, "") + return s +} +func (this *ArtifactLocation) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ArtifactLocation{`, + `S3:` + strings.Replace(this.S3.String(), "S3Artifact", "S3Artifact", 1) + `,`, + `Inline:` + valueToStringGenerated(this.Inline) + `,`, + `File:` + strings.Replace(this.File.String(), "FileArtifact", "FileArtifact", 1) + `,`, + `URL:` + strings.Replace(this.URL.String(), "URLArtifact", "URLArtifact", 1) + `,`, + `Configmap:` + strings.Replace(fmt.Sprintf("%v", this.Configmap), "ConfigMapKeySelector", "v1.ConfigMapKeySelector", 1) + `,`, + `Git:` + strings.Replace(this.Git.String(), "GitArtifact", "GitArtifact", 1) + `,`, + `Resource:` + strings.Replace(this.Resource.String(), "K8SResource", "K8SResource", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AzureEventHubsTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&AzureEventHubsTrigger{`, + `FQDN:` + fmt.Sprintf("%v", this.FQDN) + `,`, + `HubName:` + fmt.Sprintf("%v", this.HubName) + `,`, + `SharedAccessKeyName:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKeyName), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SharedAccessKey:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `}`, + }, "") + return s +} +func (this *AzureEventsHubEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AzureEventsHubEventSource{`, + `FQDN:` + fmt.Sprintf("%v", this.FQDN) + `,`, + `SharedAccessKeyName:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKeyName), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SharedAccessKey:` + strings.Replace(fmt.Sprintf("%v", this.SharedAccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `HubName:` + fmt.Sprintf("%v", this.HubName) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AzureQueueStorageEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AzureQueueStorageEventSource{`, + `StorageAccountName:` + fmt.Sprintf("%v", this.StorageAccountName) + `,`, + `ConnectionString:` + strings.Replace(fmt.Sprintf("%v", this.ConnectionString), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `QueueName:` + fmt.Sprintf("%v", this.QueueName) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `DLQ:` + fmt.Sprintf("%v", this.DLQ) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `DecodeMessage:` + fmt.Sprintf("%v", this.DecodeMessage) + `,`, + `WaitTimeInSeconds:` + valueToStringGenerated(this.WaitTimeInSeconds) + `,`, + `}`, + }, "") + return s +} +func (this *AzureServiceBusEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&AzureServiceBusEventSource{`, + `ConnectionString:` + strings.Replace(fmt.Sprintf("%v", this.ConnectionString), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `QueueName:` + fmt.Sprintf("%v", this.QueueName) + `,`, + `TopicName:` + fmt.Sprintf("%v", this.TopicName) + `,`, + `SubscriptionName:` + fmt.Sprintf("%v", this.SubscriptionName) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `FullyQualifiedNamespace:` + fmt.Sprintf("%v", this.FullyQualifiedNamespace) + `,`, + `}`, + }, "") + return s +} +func (this *AzureServiceBusTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&AzureServiceBusTrigger{`, + `ConnectionString:` + strings.Replace(fmt.Sprintf("%v", this.ConnectionString), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `QueueName:` + fmt.Sprintf("%v", this.QueueName) + `,`, + `TopicName:` + fmt.Sprintf("%v", this.TopicName) + `,`, + `SubscriptionName:` + fmt.Sprintf("%v", this.SubscriptionName) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `}`, + }, "") + return s +} +func (this *Backoff) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Backoff{`, + `Duration:` + strings.Replace(this.Duration.String(), "Int64OrString", "Int64OrString", 1) + `,`, + `Factor:` + strings.Replace(this.Factor.String(), "Amount", "Amount", 1) + `,`, + `Jitter:` + strings.Replace(this.Jitter.String(), "Amount", "Amount", 1) + `,`, + `Steps:` + fmt.Sprintf("%v", this.Steps) + `,`, + `}`, + }, "") + return s +} +func (this *BasicAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BasicAuth{`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketAuth{`, + `Basic:` + strings.Replace(this.Basic.String(), "BitbucketBasicAuth", "BitbucketBasicAuth", 1) + `,`, + `OAuthToken:` + strings.Replace(fmt.Sprintf("%v", this.OAuthToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketBasicAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketBasicAuth{`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketEventSource) String() string { + if this == nil { + return "nil" + } + repeatedStringForRepositories := "[]BitbucketRepository{" + for _, f := range this.Repositories { + repeatedStringForRepositories += strings.Replace(strings.Replace(f.String(), "BitbucketRepository", "BitbucketRepository", 1), `&`, ``, 1) + "," + } + repeatedStringForRepositories += "}" + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&BitbucketEventSource{`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BitbucketAuth", "BitbucketAuth", 1) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `DeprecatedOwner:` + fmt.Sprintf("%v", this.DeprecatedOwner) + `,`, + `DeprecatedProjectKey:` + fmt.Sprintf("%v", this.DeprecatedProjectKey) + `,`, + `DeprecatedRepositorySlug:` + fmt.Sprintf("%v", this.DeprecatedRepositorySlug) + `,`, + `Repositories:` + repeatedStringForRepositories + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketRepository) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketRepository{`, + `Owner:` + fmt.Sprintf("%v", this.Owner) + `,`, + `RepositorySlug:` + fmt.Sprintf("%v", this.RepositorySlug) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketServerEventSource) String() string { + if this == nil { + return "nil" + } + repeatedStringForRepositories := "[]BitbucketServerRepository{" + for _, f := range this.Repositories { + repeatedStringForRepositories += strings.Replace(strings.Replace(f.String(), "BitbucketServerRepository", "BitbucketServerRepository", 1), `&`, ``, 1) + "," + } + repeatedStringForRepositories += "}" + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&BitbucketServerEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `DeprecatedProjectKey:` + fmt.Sprintf("%v", this.DeprecatedProjectKey) + `,`, + `DeprecatedRepositorySlug:` + fmt.Sprintf("%v", this.DeprecatedRepositorySlug) + `,`, + `Projects:` + fmt.Sprintf("%v", this.Projects) + `,`, + `Repositories:` + repeatedStringForRepositories + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `SkipBranchRefsChangedOnOpenPR:` + fmt.Sprintf("%v", this.SkipBranchRefsChangedOnOpenPR) + `,`, + `OneEventPerChange:` + fmt.Sprintf("%v", this.OneEventPerChange) + `,`, + `AccessToken:` + strings.Replace(fmt.Sprintf("%v", this.AccessToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `WebhookSecret:` + strings.Replace(fmt.Sprintf("%v", this.WebhookSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `BitbucketServerBaseURL:` + fmt.Sprintf("%v", this.BitbucketServerBaseURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `CheckInterval:` + fmt.Sprintf("%v", this.CheckInterval) + `,`, + `}`, + }, "") + return s +} +func (this *BitbucketServerRepository) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BitbucketServerRepository{`, + `ProjectKey:` + fmt.Sprintf("%v", this.ProjectKey) + `,`, + `RepositorySlug:` + fmt.Sprintf("%v", this.RepositorySlug) + `,`, + `}`, + }, "") + return s +} +func (this *BusConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BusConfig{`, + `NATS:` + strings.Replace(this.NATS.String(), "NATSConfig", "NATSConfig", 1) + `,`, + `JetStream:` + strings.Replace(this.JetStream.String(), "JetStreamConfig", "JetStreamConfig", 1) + `,`, + `Kafka:` + strings.Replace(this.Kafka.String(), "KafkaBus", "KafkaBus", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CalendarEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&CalendarEventSource{`, + `Schedule:` + fmt.Sprintf("%v", this.Schedule) + `,`, + `Interval:` + fmt.Sprintf("%v", this.Interval) + `,`, + `ExclusionDates:` + fmt.Sprintf("%v", this.ExclusionDates) + `,`, + `Timezone:` + fmt.Sprintf("%v", this.Timezone) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Persistence:` + strings.Replace(this.Persistence.String(), "EventPersistence", "EventPersistence", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CatchupConfiguration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CatchupConfiguration{`, + `Enabled:` + fmt.Sprintf("%v", this.Enabled) + `,`, + `MaxDuration:` + fmt.Sprintf("%v", this.MaxDuration) + `,`, + `}`, + }, "") + return s +} +func (this *Condition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Condition{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v11.Time", 1), `&`, ``, 1) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *ConditionsResetByTime) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConditionsResetByTime{`, + `Cron:` + fmt.Sprintf("%v", this.Cron) + `,`, + `Timezone:` + fmt.Sprintf("%v", this.Timezone) + `,`, + `}`, + }, "") + return s +} +func (this *ConditionsResetCriteria) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConditionsResetCriteria{`, + `ByTime:` + strings.Replace(this.ByTime.String(), "ConditionsResetByTime", "ConditionsResetByTime", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ConfigMapPersistence) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConfigMapPersistence{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `CreateIfNotExist:` + fmt.Sprintf("%v", this.CreateIfNotExist) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerTemplate) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ContainerTemplate{`, + `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "v1.ResourceRequirements", 1), `&`, ``, 1) + `,`, + `ImagePullPolicy:` + fmt.Sprintf("%v", this.ImagePullPolicy) + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "SecurityContext", "v1.SecurityContext", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CustomTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + keysForSpec := make([]string, 0, len(this.Spec)) + for k := range this.Spec { + keysForSpec = append(keysForSpec, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSpec) + mapStringForSpec := "map[string]string{" + for _, k := range keysForSpec { + mapStringForSpec += fmt.Sprintf("%v: %v,", k, this.Spec[k]) + } + mapStringForSpec += "}" + s := strings.Join([]string{`&CustomTrigger{`, + `ServerURL:` + fmt.Sprintf("%v", this.ServerURL) + `,`, + `Secure:` + fmt.Sprintf("%v", this.Secure) + `,`, + `CertSecret:` + strings.Replace(fmt.Sprintf("%v", this.CertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ServerNameOverride:` + fmt.Sprintf("%v", this.ServerNameOverride) + `,`, + `Spec:` + mapStringForSpec + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `}`, + }, "") + return s +} +func (this *DataFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DataFilter{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `Comparator:` + fmt.Sprintf("%v", this.Comparator) + `,`, + `Template:` + fmt.Sprintf("%v", this.Template) + `,`, + `}`, + }, "") + return s +} +func (this *EmailTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&EmailTrigger{`, + `Parameters:` + repeatedStringForParameters + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `SMTPPassword:` + strings.Replace(fmt.Sprintf("%v", this.SMTPPassword), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Host:` + fmt.Sprintf("%v", this.Host) + `,`, + `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + `To:` + fmt.Sprintf("%v", this.To) + `,`, + `From:` + fmt.Sprintf("%v", this.From) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `Body:` + fmt.Sprintf("%v", this.Body) + `,`, + `}`, + }, "") + return s +} +func (this *EmitterEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&EmitterEventSource{`, + `Broker:` + fmt.Sprintf("%v", this.Broker) + `,`, + `ChannelKey:` + fmt.Sprintf("%v", this.ChannelKey) + `,`, + `ChannelName:` + fmt.Sprintf("%v", this.ChannelName) + `,`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventBus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventBus{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "EventBusSpec", "EventBusSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "EventBusStatus", "EventBusStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventBusList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]EventBus{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EventBus", "EventBus", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&EventBusList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *EventBusSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventBusSpec{`, + `NATS:` + strings.Replace(this.NATS.String(), "NATSBus", "NATSBus", 1) + `,`, + `JetStream:` + strings.Replace(this.JetStream.String(), "JetStreamBus", "JetStreamBus", 1) + `,`, + `Kafka:` + strings.Replace(this.Kafka.String(), "KafkaBus", "KafkaBus", 1) + `,`, + `JetStreamExotic:` + strings.Replace(this.JetStreamExotic.String(), "JetStreamConfig", "JetStreamConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventBusStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventBusStatus{`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "Status", 1), `&`, ``, 1) + `,`, + `Config:` + strings.Replace(strings.Replace(this.Config.String(), "BusConfig", "BusConfig", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventDependency) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventDependency{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `EventSourceName:` + fmt.Sprintf("%v", this.EventSourceName) + `,`, + `EventName:` + fmt.Sprintf("%v", this.EventName) + `,`, + `Filters:` + strings.Replace(this.Filters.String(), "EventDependencyFilter", "EventDependencyFilter", 1) + `,`, + `Transform:` + strings.Replace(this.Transform.String(), "EventDependencyTransformer", "EventDependencyTransformer", 1) + `,`, + `FiltersLogicalOperator:` + fmt.Sprintf("%v", this.FiltersLogicalOperator) + `,`, + `}`, + }, "") + return s +} +func (this *EventDependencyFilter) String() string { + if this == nil { + return "nil" + } + repeatedStringForData := "[]DataFilter{" + for _, f := range this.Data { + repeatedStringForData += strings.Replace(strings.Replace(f.String(), "DataFilter", "DataFilter", 1), `&`, ``, 1) + "," + } + repeatedStringForData += "}" + repeatedStringForExprs := "[]ExprFilter{" + for _, f := range this.Exprs { + repeatedStringForExprs += strings.Replace(strings.Replace(f.String(), "ExprFilter", "ExprFilter", 1), `&`, ``, 1) + "," + } + repeatedStringForExprs += "}" + s := strings.Join([]string{`&EventDependencyFilter{`, + `Time:` + strings.Replace(this.Time.String(), "TimeFilter", "TimeFilter", 1) + `,`, + `Context:` + strings.Replace(fmt.Sprintf("%v", this.Context), "EventContext", "EventContext", 1) + `,`, + `Data:` + repeatedStringForData + `,`, + `Exprs:` + repeatedStringForExprs + `,`, + `DataLogicalOperator:` + fmt.Sprintf("%v", this.DataLogicalOperator) + `,`, + `ExprLogicalOperator:` + fmt.Sprintf("%v", this.ExprLogicalOperator) + `,`, + `Script:` + fmt.Sprintf("%v", this.Script) + `,`, + `}`, + }, "") + return s +} +func (this *EventDependencyTransformer) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventDependencyTransformer{`, + `JQ:` + fmt.Sprintf("%v", this.JQ) + `,`, + `Script:` + fmt.Sprintf("%v", this.Script) + `,`, + `}`, + }, "") + return s +} +func (this *EventPersistence) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventPersistence{`, + `Catchup:` + strings.Replace(this.Catchup.String(), "CatchupConfiguration", "CatchupConfiguration", 1) + `,`, + `ConfigMap:` + strings.Replace(this.ConfigMap.String(), "ConfigMapPersistence", "ConfigMapPersistence", 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventSource{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "EventSourceSpec", "EventSourceSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "EventSourceStatus", "EventSourceStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventSourceFilter{`, + `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]EventSource{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EventSource", "EventSource", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&EventSourceList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceSpec) String() string { + if this == nil { + return "nil" + } + keysForMinio := make([]string, 0, len(this.Minio)) + for k := range this.Minio { + keysForMinio = append(keysForMinio, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMinio) + mapStringForMinio := "map[string]S3Artifact{" + for _, k := range keysForMinio { + mapStringForMinio += fmt.Sprintf("%v: %v,", k, this.Minio[k]) + } + mapStringForMinio += "}" + keysForCalendar := make([]string, 0, len(this.Calendar)) + for k := range this.Calendar { + keysForCalendar = append(keysForCalendar, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCalendar) + mapStringForCalendar := "map[string]CalendarEventSource{" + for _, k := range keysForCalendar { + mapStringForCalendar += fmt.Sprintf("%v: %v,", k, this.Calendar[k]) + } + mapStringForCalendar += "}" + keysForFile := make([]string, 0, len(this.File)) + for k := range this.File { + keysForFile = append(keysForFile, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForFile) + mapStringForFile := "map[string]FileEventSource{" + for _, k := range keysForFile { + mapStringForFile += fmt.Sprintf("%v: %v,", k, this.File[k]) + } + mapStringForFile += "}" + keysForResource := make([]string, 0, len(this.Resource)) + for k := range this.Resource { + keysForResource = append(keysForResource, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForResource) + mapStringForResource := "map[string]ResourceEventSource{" + for _, k := range keysForResource { + mapStringForResource += fmt.Sprintf("%v: %v,", k, this.Resource[k]) + } + mapStringForResource += "}" + keysForWebhook := make([]string, 0, len(this.Webhook)) + for k := range this.Webhook { + keysForWebhook = append(keysForWebhook, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForWebhook) + mapStringForWebhook := "map[string]WebhookEventSource{" + for _, k := range keysForWebhook { + mapStringForWebhook += fmt.Sprintf("%v: %v,", k, this.Webhook[k]) + } + mapStringForWebhook += "}" + keysForAMQP := make([]string, 0, len(this.AMQP)) + for k := range this.AMQP { + keysForAMQP = append(keysForAMQP, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAMQP) + mapStringForAMQP := "map[string]AMQPEventSource{" + for _, k := range keysForAMQP { + mapStringForAMQP += fmt.Sprintf("%v: %v,", k, this.AMQP[k]) + } + mapStringForAMQP += "}" + keysForKafka := make([]string, 0, len(this.Kafka)) + for k := range this.Kafka { + keysForKafka = append(keysForKafka, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForKafka) + mapStringForKafka := "map[string]KafkaEventSource{" + for _, k := range keysForKafka { + mapStringForKafka += fmt.Sprintf("%v: %v,", k, this.Kafka[k]) + } + mapStringForKafka += "}" + keysForMQTT := make([]string, 0, len(this.MQTT)) + for k := range this.MQTT { + keysForMQTT = append(keysForMQTT, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMQTT) + mapStringForMQTT := "map[string]MQTTEventSource{" + for _, k := range keysForMQTT { + mapStringForMQTT += fmt.Sprintf("%v: %v,", k, this.MQTT[k]) + } + mapStringForMQTT += "}" + keysForNATS := make([]string, 0, len(this.NATS)) + for k := range this.NATS { + keysForNATS = append(keysForNATS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNATS) + mapStringForNATS := "map[string]NATSEventsSource{" + for _, k := range keysForNATS { + mapStringForNATS += fmt.Sprintf("%v: %v,", k, this.NATS[k]) + } + mapStringForNATS += "}" + keysForSNS := make([]string, 0, len(this.SNS)) + for k := range this.SNS { + keysForSNS = append(keysForSNS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSNS) + mapStringForSNS := "map[string]SNSEventSource{" + for _, k := range keysForSNS { + mapStringForSNS += fmt.Sprintf("%v: %v,", k, this.SNS[k]) + } + mapStringForSNS += "}" + keysForSQS := make([]string, 0, len(this.SQS)) + for k := range this.SQS { + keysForSQS = append(keysForSQS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSQS) + mapStringForSQS := "map[string]SQSEventSource{" + for _, k := range keysForSQS { + mapStringForSQS += fmt.Sprintf("%v: %v,", k, this.SQS[k]) + } + mapStringForSQS += "}" + keysForPubSub := make([]string, 0, len(this.PubSub)) + for k := range this.PubSub { + keysForPubSub = append(keysForPubSub, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPubSub) + mapStringForPubSub := "map[string]PubSubEventSource{" + for _, k := range keysForPubSub { + mapStringForPubSub += fmt.Sprintf("%v: %v,", k, this.PubSub[k]) + } + mapStringForPubSub += "}" + keysForGithub := make([]string, 0, len(this.Github)) + for k := range this.Github { + keysForGithub = append(keysForGithub, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGithub) + mapStringForGithub := "map[string]GithubEventSource{" + for _, k := range keysForGithub { + mapStringForGithub += fmt.Sprintf("%v: %v,", k, this.Github[k]) + } + mapStringForGithub += "}" + keysForGitlab := make([]string, 0, len(this.Gitlab)) + for k := range this.Gitlab { + keysForGitlab = append(keysForGitlab, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGitlab) + mapStringForGitlab := "map[string]GitlabEventSource{" + for _, k := range keysForGitlab { + mapStringForGitlab += fmt.Sprintf("%v: %v,", k, this.Gitlab[k]) + } + mapStringForGitlab += "}" + keysForHDFS := make([]string, 0, len(this.HDFS)) + for k := range this.HDFS { + keysForHDFS = append(keysForHDFS, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHDFS) + mapStringForHDFS := "map[string]HDFSEventSource{" + for _, k := range keysForHDFS { + mapStringForHDFS += fmt.Sprintf("%v: %v,", k, this.HDFS[k]) + } + mapStringForHDFS += "}" + keysForSlack := make([]string, 0, len(this.Slack)) + for k := range this.Slack { + keysForSlack = append(keysForSlack, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSlack) + mapStringForSlack := "map[string]SlackEventSource{" + for _, k := range keysForSlack { + mapStringForSlack += fmt.Sprintf("%v: %v,", k, this.Slack[k]) + } + mapStringForSlack += "}" + keysForStorageGrid := make([]string, 0, len(this.StorageGrid)) + for k := range this.StorageGrid { + keysForStorageGrid = append(keysForStorageGrid, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStorageGrid) + mapStringForStorageGrid := "map[string]StorageGridEventSource{" + for _, k := range keysForStorageGrid { + mapStringForStorageGrid += fmt.Sprintf("%v: %v,", k, this.StorageGrid[k]) + } + mapStringForStorageGrid += "}" + keysForAzureEventsHub := make([]string, 0, len(this.AzureEventsHub)) + for k := range this.AzureEventsHub { + keysForAzureEventsHub = append(keysForAzureEventsHub, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureEventsHub) + mapStringForAzureEventsHub := "map[string]AzureEventsHubEventSource{" + for _, k := range keysForAzureEventsHub { + mapStringForAzureEventsHub += fmt.Sprintf("%v: %v,", k, this.AzureEventsHub[k]) + } + mapStringForAzureEventsHub += "}" + keysForStripe := make([]string, 0, len(this.Stripe)) + for k := range this.Stripe { + keysForStripe = append(keysForStripe, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForStripe) + mapStringForStripe := "map[string]StripeEventSource{" + for _, k := range keysForStripe { + mapStringForStripe += fmt.Sprintf("%v: %v,", k, this.Stripe[k]) + } + mapStringForStripe += "}" + keysForEmitter := make([]string, 0, len(this.Emitter)) + for k := range this.Emitter { + keysForEmitter = append(keysForEmitter, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForEmitter) + mapStringForEmitter := "map[string]EmitterEventSource{" + for _, k := range keysForEmitter { + mapStringForEmitter += fmt.Sprintf("%v: %v,", k, this.Emitter[k]) + } + mapStringForEmitter += "}" + keysForRedis := make([]string, 0, len(this.Redis)) + for k := range this.Redis { + keysForRedis = append(keysForRedis, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedis) + mapStringForRedis := "map[string]RedisEventSource{" + for _, k := range keysForRedis { + mapStringForRedis += fmt.Sprintf("%v: %v,", k, this.Redis[k]) + } + mapStringForRedis += "}" + keysForNSQ := make([]string, 0, len(this.NSQ)) + for k := range this.NSQ { + keysForNSQ = append(keysForNSQ, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNSQ) + mapStringForNSQ := "map[string]NSQEventSource{" + for _, k := range keysForNSQ { + mapStringForNSQ += fmt.Sprintf("%v: %v,", k, this.NSQ[k]) + } + mapStringForNSQ += "}" + keysForPulsar := make([]string, 0, len(this.Pulsar)) + for k := range this.Pulsar { + keysForPulsar = append(keysForPulsar, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForPulsar) + mapStringForPulsar := "map[string]PulsarEventSource{" + for _, k := range keysForPulsar { + mapStringForPulsar += fmt.Sprintf("%v: %v,", k, this.Pulsar[k]) + } + mapStringForPulsar += "}" + keysForGeneric := make([]string, 0, len(this.Generic)) + for k := range this.Generic { + keysForGeneric = append(keysForGeneric, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGeneric) + mapStringForGeneric := "map[string]GenericEventSource{" + for _, k := range keysForGeneric { + mapStringForGeneric += fmt.Sprintf("%v: %v,", k, this.Generic[k]) + } + mapStringForGeneric += "}" + keysForBitbucketServer := make([]string, 0, len(this.BitbucketServer)) + for k := range this.BitbucketServer { + keysForBitbucketServer = append(keysForBitbucketServer, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucketServer) + mapStringForBitbucketServer := "map[string]BitbucketServerEventSource{" + for _, k := range keysForBitbucketServer { + mapStringForBitbucketServer += fmt.Sprintf("%v: %v,", k, this.BitbucketServer[k]) + } + mapStringForBitbucketServer += "}" + keysForBitbucket := make([]string, 0, len(this.Bitbucket)) + for k := range this.Bitbucket { + keysForBitbucket = append(keysForBitbucket, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForBitbucket) + mapStringForBitbucket := "map[string]BitbucketEventSource{" + for _, k := range keysForBitbucket { + mapStringForBitbucket += fmt.Sprintf("%v: %v,", k, this.Bitbucket[k]) + } + mapStringForBitbucket += "}" + keysForRedisStream := make([]string, 0, len(this.RedisStream)) + for k := range this.RedisStream { + keysForRedisStream = append(keysForRedisStream, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForRedisStream) + mapStringForRedisStream := "map[string]RedisStreamEventSource{" + for _, k := range keysForRedisStream { + mapStringForRedisStream += fmt.Sprintf("%v: %v,", k, this.RedisStream[k]) + } + mapStringForRedisStream += "}" + keysForAzureServiceBus := make([]string, 0, len(this.AzureServiceBus)) + for k := range this.AzureServiceBus { + keysForAzureServiceBus = append(keysForAzureServiceBus, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureServiceBus) + mapStringForAzureServiceBus := "map[string]AzureServiceBusEventSource{" + for _, k := range keysForAzureServiceBus { + mapStringForAzureServiceBus += fmt.Sprintf("%v: %v,", k, this.AzureServiceBus[k]) + } + mapStringForAzureServiceBus += "}" + keysForAzureQueueStorage := make([]string, 0, len(this.AzureQueueStorage)) + for k := range this.AzureQueueStorage { + keysForAzureQueueStorage = append(keysForAzureQueueStorage, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAzureQueueStorage) + mapStringForAzureQueueStorage := "map[string]AzureQueueStorageEventSource{" + for _, k := range keysForAzureQueueStorage { + mapStringForAzureQueueStorage += fmt.Sprintf("%v: %v,", k, this.AzureQueueStorage[k]) + } + mapStringForAzureQueueStorage += "}" + keysForSFTP := make([]string, 0, len(this.SFTP)) + for k := range this.SFTP { + keysForSFTP = append(keysForSFTP, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForSFTP) + mapStringForSFTP := "map[string]SFTPEventSource{" + for _, k := range keysForSFTP { + mapStringForSFTP += fmt.Sprintf("%v: %v,", k, this.SFTP[k]) + } + mapStringForSFTP += "}" + keysForGerrit := make([]string, 0, len(this.Gerrit)) + for k := range this.Gerrit { + keysForGerrit = append(keysForGerrit, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForGerrit) + mapStringForGerrit := "map[string]GerritEventSource{" + for _, k := range keysForGerrit { + mapStringForGerrit += fmt.Sprintf("%v: %v,", k, this.Gerrit[k]) + } + mapStringForGerrit += "}" + s := strings.Join([]string{`&EventSourceSpec{`, + `EventBusName:` + fmt.Sprintf("%v", this.EventBusName) + `,`, + `Template:` + strings.Replace(this.Template.String(), "Template", "Template", 1) + `,`, + `Service:` + strings.Replace(this.Service.String(), "Service", "Service", 1) + `,`, + `Minio:` + mapStringForMinio + `,`, + `Calendar:` + mapStringForCalendar + `,`, + `File:` + mapStringForFile + `,`, + `Resource:` + mapStringForResource + `,`, + `Webhook:` + mapStringForWebhook + `,`, + `AMQP:` + mapStringForAMQP + `,`, + `Kafka:` + mapStringForKafka + `,`, + `MQTT:` + mapStringForMQTT + `,`, + `NATS:` + mapStringForNATS + `,`, + `SNS:` + mapStringForSNS + `,`, + `SQS:` + mapStringForSQS + `,`, + `PubSub:` + mapStringForPubSub + `,`, + `Github:` + mapStringForGithub + `,`, + `Gitlab:` + mapStringForGitlab + `,`, + `HDFS:` + mapStringForHDFS + `,`, + `Slack:` + mapStringForSlack + `,`, + `StorageGrid:` + mapStringForStorageGrid + `,`, + `AzureEventsHub:` + mapStringForAzureEventsHub + `,`, + `Stripe:` + mapStringForStripe + `,`, + `Emitter:` + mapStringForEmitter + `,`, + `Redis:` + mapStringForRedis + `,`, + `NSQ:` + mapStringForNSQ + `,`, + `Pulsar:` + mapStringForPulsar + `,`, + `Generic:` + mapStringForGeneric + `,`, + `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, + `BitbucketServer:` + mapStringForBitbucketServer + `,`, + `Bitbucket:` + mapStringForBitbucket + `,`, + `RedisStream:` + mapStringForRedisStream + `,`, + `AzureServiceBus:` + mapStringForAzureServiceBus + `,`, + `AzureQueueStorage:` + mapStringForAzureQueueStorage + `,`, + `SFTP:` + mapStringForSFTP + `,`, + `Gerrit:` + mapStringForGerrit + `,`, + `}`, + }, "") + return s +} +func (this *EventSourceStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EventSourceStatus{`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "Status", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ExprFilter) String() string { + if this == nil { + return "nil" + } + repeatedStringForFields := "[]PayloadField{" + for _, f := range this.Fields { + repeatedStringForFields += strings.Replace(strings.Replace(f.String(), "PayloadField", "PayloadField", 1), `&`, ``, 1) + "," + } + repeatedStringForFields += "}" + s := strings.Join([]string{`&ExprFilter{`, + `Expr:` + fmt.Sprintf("%v", this.Expr) + `,`, + `Fields:` + repeatedStringForFields + `,`, + `}`, + }, "") + return s +} +func (this *FileArtifact) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileArtifact{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `}`, + }, "") + return s +} +func (this *FileEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&FileEventSource{`, + `EventType:` + fmt.Sprintf("%v", this.EventType) + `,`, + `WatchPathConfig:` + strings.Replace(strings.Replace(this.WatchPathConfig.String(), "WatchPathConfig", "WatchPathConfig", 1), `&`, ``, 1) + `,`, + `Polling:` + fmt.Sprintf("%v", this.Polling) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GenericEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GenericEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Config:` + fmt.Sprintf("%v", this.Config) + `,`, + `Insecure:` + fmt.Sprintf("%v", this.Insecure) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `AuthSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GerritEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GerritEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `HookName:` + fmt.Sprintf("%v", this.HookName) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `GerritBaseURL:` + fmt.Sprintf("%v", this.GerritBaseURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Projects:` + fmt.Sprintf("%v", this.Projects) + `,`, + `SslVerify:` + fmt.Sprintf("%v", this.SslVerify) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GitArtifact) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GitArtifact{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `CloneDirectory:` + fmt.Sprintf("%v", this.CloneDirectory) + `,`, + `Creds:` + strings.Replace(this.Creds.String(), "GitCreds", "GitCreds", 1) + `,`, + `SSHKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.SSHKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `FilePath:` + fmt.Sprintf("%v", this.FilePath) + `,`, + `Branch:` + fmt.Sprintf("%v", this.Branch) + `,`, + `Tag:` + fmt.Sprintf("%v", this.Tag) + `,`, + `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`, + `Remote:` + strings.Replace(this.Remote.String(), "GitRemoteConfig", "GitRemoteConfig", 1) + `,`, + `InsecureIgnoreHostKey:` + fmt.Sprintf("%v", this.InsecureIgnoreHostKey) + `,`, + `}`, + }, "") + return s +} +func (this *GitCreds) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GitCreds{`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GitRemoteConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GitRemoteConfig{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `URLS:` + fmt.Sprintf("%v", this.URLS) + `,`, + `}`, + }, "") + return s +} +func (this *GithubAppCreds) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GithubAppCreds{`, + `PrivateKey:` + strings.Replace(fmt.Sprintf("%v", this.PrivateKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `AppID:` + fmt.Sprintf("%v", this.AppID) + `,`, + `InstallationID:` + fmt.Sprintf("%v", this.InstallationID) + `,`, + `}`, + }, "") + return s +} +func (this *GithubEventSource) String() string { + if this == nil { + return "nil" + } + repeatedStringForRepositories := "[]OwnedRepositories{" + for _, f := range this.Repositories { + repeatedStringForRepositories += strings.Replace(strings.Replace(f.String(), "OwnedRepositories", "OwnedRepositories", 1), `&`, ``, 1) + "," + } + repeatedStringForRepositories += "}" + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GithubEventSource{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `DeprecatedOwner:` + fmt.Sprintf("%v", this.DeprecatedOwner) + `,`, + `DeprecatedRepository:` + fmt.Sprintf("%v", this.DeprecatedRepository) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `APIToken:` + strings.Replace(fmt.Sprintf("%v", this.APIToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `WebhookSecret:` + strings.Replace(fmt.Sprintf("%v", this.WebhookSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Insecure:` + fmt.Sprintf("%v", this.Insecure) + `,`, + `Active:` + fmt.Sprintf("%v", this.Active) + `,`, + `ContentType:` + fmt.Sprintf("%v", this.ContentType) + `,`, + `GithubBaseURL:` + fmt.Sprintf("%v", this.GithubBaseURL) + `,`, + `GithubUploadURL:` + fmt.Sprintf("%v", this.GithubUploadURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Repositories:` + repeatedStringForRepositories + `,`, + `Organizations:` + fmt.Sprintf("%v", this.Organizations) + `,`, + `GithubApp:` + strings.Replace(this.GithubApp.String(), "GithubAppCreds", "GithubAppCreds", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GitlabEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&GitlabEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `DeprecatedProjectID:` + fmt.Sprintf("%v", this.DeprecatedProjectID) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `AccessToken:` + strings.Replace(fmt.Sprintf("%v", this.AccessToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `EnableSSLVerification:` + fmt.Sprintf("%v", this.EnableSSLVerification) + `,`, + `GitlabBaseURL:` + fmt.Sprintf("%v", this.GitlabBaseURL) + `,`, + `DeleteHookOnFinish:` + fmt.Sprintf("%v", this.DeleteHookOnFinish) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Projects:` + fmt.Sprintf("%v", this.Projects) + `,`, + `SecretToken:` + strings.Replace(fmt.Sprintf("%v", this.SecretToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, + `}`, + }, "") + return s +} +func (this *HDFSEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&HDFSEventSource{`, + `WatchPathConfig:` + strings.Replace(strings.Replace(this.WatchPathConfig.String(), "WatchPathConfig", "WatchPathConfig", 1), `&`, ``, 1) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `CheckInterval:` + fmt.Sprintf("%v", this.CheckInterval) + `,`, + `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, + `HDFSUser:` + fmt.Sprintf("%v", this.HDFSUser) + `,`, + `KrbCCacheSecret:` + strings.Replace(fmt.Sprintf("%v", this.KrbCCacheSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `KrbKeytabSecret:` + strings.Replace(fmt.Sprintf("%v", this.KrbKeytabSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `KrbUsername:` + fmt.Sprintf("%v", this.KrbUsername) + `,`, + `KrbRealm:` + fmt.Sprintf("%v", this.KrbRealm) + `,`, + `KrbConfigConfigMap:` + strings.Replace(fmt.Sprintf("%v", this.KrbConfigConfigMap), "ConfigMapKeySelector", "v1.ConfigMapKeySelector", 1) + `,`, + `KrbServicePrincipalName:` + fmt.Sprintf("%v", this.KrbServicePrincipalName) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *HTTPTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForSecureHeaders := "[]*SecureHeader{" + for _, f := range this.SecureHeaders { + repeatedStringForSecureHeaders += strings.Replace(f.String(), "SecureHeader", "SecureHeader", 1) + "," + } + repeatedStringForSecureHeaders += "}" + keysForHeaders := make([]string, 0, len(this.Headers)) + for k := range this.Headers { + keysForHeaders = append(keysForHeaders, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + mapStringForHeaders := "map[string]string{" + for _, k := range keysForHeaders { + mapStringForHeaders += fmt.Sprintf("%v: %v,", k, this.Headers[k]) + } + mapStringForHeaders += "}" + s := strings.Join([]string{`&HTTPTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Method:` + fmt.Sprintf("%v", this.Method) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, + `BasicAuth:` + strings.Replace(this.BasicAuth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `Headers:` + mapStringForHeaders + `,`, + `SecureHeaders:` + repeatedStringForSecureHeaders + `,`, + `}`, + }, "") + return s +} +func (this *Int64OrString) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Int64OrString{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Int64Val:` + fmt.Sprintf("%v", this.Int64Val) + `,`, + `StrVal:` + fmt.Sprintf("%v", this.StrVal) + `,`, + `}`, + }, "") + return s +} +func (this *JetStreamBus) String() string { + if this == nil { + return "nil" + } + repeatedStringForTolerations := "[]Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForTolerations += "}" + repeatedStringForImagePullSecrets := "[]LocalObjectReference{" + for _, f := range this.ImagePullSecrets { + repeatedStringForImagePullSecrets += fmt.Sprintf("%v", f) + "," + } + repeatedStringForImagePullSecrets += "}" + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&JetStreamBus{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, + `ContainerTemplate:` + strings.Replace(this.ContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `ReloaderContainerTemplate:` + strings.Replace(this.ReloaderContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `MetricsContainerTemplate:` + strings.Replace(this.MetricsContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `Persistence:` + strings.Replace(this.Persistence.String(), "PersistenceStrategy", "PersistenceStrategy", 1) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `ImagePullSecrets:` + repeatedStringForImagePullSecrets + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `Affinity:` + strings.Replace(fmt.Sprintf("%v", this.Affinity), "Affinity", "v1.Affinity", 1) + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `Settings:` + valueToStringGenerated(this.Settings) + `,`, + `StartArgs:` + fmt.Sprintf("%v", this.StartArgs) + `,`, + `StreamConfig:` + valueToStringGenerated(this.StreamConfig) + `,`, + `MaxPayload:` + valueToStringGenerated(this.MaxPayload) + `,`, + `}`, + }, "") + return s +} +func (this *JetStreamConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&JetStreamConfig{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `AccessSecret:` + strings.Replace(fmt.Sprintf("%v", this.AccessSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `StreamConfig:` + fmt.Sprintf("%v", this.StreamConfig) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *K8SResource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&K8SResource{`, + `Value:` + valueToStringGenerated(this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *K8SResourcePolicy) String() string { + if this == nil { + return "nil" + } + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + s := strings.Join([]string{`&K8SResourcePolicy{`, + `Labels:` + mapStringForLabels + `,`, + `Backoff:` + strings.Replace(this.Backoff.String(), "Backoff", "Backoff", 1) + `,`, + `ErrorOnBackoffTimeout:` + fmt.Sprintf("%v", this.ErrorOnBackoffTimeout) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaBus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&KafkaBus{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `SASL:` + strings.Replace(this.SASL.String(), "SASLConfig", "SASLConfig", 1) + `,`, + `ConsumerGroup:` + strings.Replace(this.ConsumerGroup.String(), "KafkaConsumerGroup", "KafkaConsumerGroup", 1) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaConsumerGroup) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&KafkaConsumerGroup{`, + `GroupName:` + fmt.Sprintf("%v", this.GroupName) + `,`, + `Oldest:` + fmt.Sprintf("%v", this.Oldest) + `,`, + `RebalanceStrategy:` + fmt.Sprintf("%v", this.RebalanceStrategy) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&KafkaEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Partition:` + fmt.Sprintf("%v", this.Partition) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `ConsumerGroup:` + strings.Replace(this.ConsumerGroup.String(), "KafkaConsumerGroup", "KafkaConsumerGroup", 1) + `,`, + `LimitEventsPerSecond:` + fmt.Sprintf("%v", this.LimitEventsPerSecond) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `SASL:` + strings.Replace(this.SASL.String(), "SASLConfig", "SASLConfig", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Config:` + fmt.Sprintf("%v", this.Config) + `,`, + `}`, + }, "") + return s +} +func (this *KafkaTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForSecureHeaders := "[]*SecureHeader{" + for _, f := range this.SecureHeaders { + repeatedStringForSecureHeaders += strings.Replace(f.String(), "SecureHeader", "SecureHeader", 1) + "," + } + repeatedStringForSecureHeaders += "}" + keysForHeaders := make([]string, 0, len(this.Headers)) + for k := range this.Headers { + keysForHeaders = append(keysForHeaders, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForHeaders) + mapStringForHeaders := "map[string]string{" + for _, k := range keysForHeaders { + mapStringForHeaders += fmt.Sprintf("%v: %v,", k, this.Headers[k]) + } + mapStringForHeaders += "}" + s := strings.Join([]string{`&KafkaTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Partition:` + fmt.Sprintf("%v", this.Partition) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `RequiredAcks:` + fmt.Sprintf("%v", this.RequiredAcks) + `,`, + `Compress:` + fmt.Sprintf("%v", this.Compress) + `,`, + `FlushFrequency:` + fmt.Sprintf("%v", this.FlushFrequency) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `PartitioningKey:` + valueToStringGenerated(this.PartitioningKey) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `SASL:` + strings.Replace(this.SASL.String(), "SASLConfig", "SASLConfig", 1) + `,`, + `SchemaRegistry:` + strings.Replace(this.SchemaRegistry.String(), "SchemaRegistryConfig", "SchemaRegistryConfig", 1) + `,`, + `Headers:` + mapStringForHeaders + `,`, + `SecureHeaders:` + repeatedStringForSecureHeaders + `,`, + `}`, + }, "") + return s +} +func (this *LogTrigger) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LogTrigger{`, + `IntervalSeconds:` + fmt.Sprintf("%v", this.IntervalSeconds) + `,`, + `}`, + }, "") + return s +} +func (this *MQTTEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&MQTTEventSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `ClientID:` + fmt.Sprintf("%v", this.ClientID) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Metadata) String() string { + if this == nil { + return "nil" + } + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + s := strings.Join([]string{`&Metadata{`, + `Annotations:` + mapStringForAnnotations + `,`, + `Labels:` + mapStringForLabels + `,`, + `}`, + }, "") + return s +} +func (this *NATSAuth) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NATSAuth{`, + `Basic:` + strings.Replace(this.Basic.String(), "BasicAuth", "BasicAuth", 1) + `,`, + `Token:` + strings.Replace(fmt.Sprintf("%v", this.Token), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `NKey:` + strings.Replace(fmt.Sprintf("%v", this.NKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Credential:` + strings.Replace(fmt.Sprintf("%v", this.Credential), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NATSBus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NATSBus{`, + `Native:` + strings.Replace(this.Native.String(), "NativeStrategy", "NativeStrategy", 1) + `,`, + `Exotic:` + strings.Replace(this.Exotic.String(), "NATSConfig", "NATSConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NATSConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NATSConfig{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `ClusterID:` + valueToStringGenerated(this.ClusterID) + `,`, + `Auth:` + valueToStringGenerated(this.Auth) + `,`, + `AccessSecret:` + strings.Replace(fmt.Sprintf("%v", this.AccessSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NATSEventsSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&NATSEventsSource{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "NATSAuth", "NATSAuth", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Queue:` + valueToStringGenerated(this.Queue) + `,`, + `}`, + }, "") + return s +} +func (this *NATSTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&NATSTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "NATSAuth", "NATSAuth", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NSQEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&NSQEventSource{`, + `HostAddress:` + fmt.Sprintf("%v", this.HostAddress) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Channel:` + fmt.Sprintf("%v", this.Channel) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NativeStrategy) String() string { + if this == nil { + return "nil" + } + repeatedStringForTolerations := "[]Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForTolerations += "}" + repeatedStringForImagePullSecrets := "[]LocalObjectReference{" + for _, f := range this.ImagePullSecrets { + repeatedStringForImagePullSecrets += fmt.Sprintf("%v", f) + "," + } + repeatedStringForImagePullSecrets += "}" + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&NativeStrategy{`, + `Replicas:` + fmt.Sprintf("%v", this.Replicas) + `,`, + `Auth:` + valueToStringGenerated(this.Auth) + `,`, + `Persistence:` + strings.Replace(this.Persistence.String(), "PersistenceStrategy", "PersistenceStrategy", 1) + `,`, + `ContainerTemplate:` + strings.Replace(this.ContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `MetricsContainerTemplate:` + strings.Replace(this.MetricsContainerTemplate.String(), "ContainerTemplate", "ContainerTemplate", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `MaxAge:` + valueToStringGenerated(this.MaxAge) + `,`, + `ImagePullSecrets:` + repeatedStringForImagePullSecrets + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `Affinity:` + strings.Replace(fmt.Sprintf("%v", this.Affinity), "Affinity", "v1.Affinity", 1) + `,`, + `MaxMsgs:` + valueToStringGenerated(this.MaxMsgs) + `,`, + `MaxBytes:` + valueToStringGenerated(this.MaxBytes) + `,`, + `MaxSubs:` + valueToStringGenerated(this.MaxSubs) + `,`, + `MaxPayload:` + valueToStringGenerated(this.MaxPayload) + `,`, + `RaftHeartbeatTimeout:` + valueToStringGenerated(this.RaftHeartbeatTimeout) + `,`, + `RaftElectionTimeout:` + valueToStringGenerated(this.RaftElectionTimeout) + `,`, + `RaftLeaseTimeout:` + valueToStringGenerated(this.RaftLeaseTimeout) + `,`, + `RaftCommitTimeout:` + valueToStringGenerated(this.RaftCommitTimeout) + `,`, + `}`, + }, "") + return s +} +func (this *OpenWhiskTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&OpenWhiskTrigger{`, + `Host:` + fmt.Sprintf("%v", this.Host) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `AuthToken:` + strings.Replace(fmt.Sprintf("%v", this.AuthToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ActionName:` + fmt.Sprintf("%v", this.ActionName) + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `}`, + }, "") + return s +} +func (this *OwnedRepositories) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&OwnedRepositories{`, + `Owner:` + fmt.Sprintf("%v", this.Owner) + `,`, + `Names:` + fmt.Sprintf("%v", this.Names) + `,`, + `}`, + }, "") + return s +} +func (this *PayloadField) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PayloadField{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *PersistenceStrategy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PersistenceStrategy{`, + `StorageClassName:` + valueToStringGenerated(this.StorageClassName) + `,`, + `AccessMode:` + valueToStringGenerated(this.AccessMode) + `,`, + `VolumeSize:` + strings.Replace(fmt.Sprintf("%v", this.VolumeSize), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PubSubEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&PubSubEventSource{`, + `ProjectID:` + fmt.Sprintf("%v", this.ProjectID) + `,`, + `TopicProjectID:` + fmt.Sprintf("%v", this.TopicProjectID) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `SubscriptionID:` + fmt.Sprintf("%v", this.SubscriptionID) + `,`, + `CredentialSecret:` + strings.Replace(fmt.Sprintf("%v", this.CredentialSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `DeleteSubscriptionOnFinish:` + fmt.Sprintf("%v", this.DeleteSubscriptionOnFinish) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PulsarEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + keysForAuthAthenzParams := make([]string, 0, len(this.AuthAthenzParams)) + for k := range this.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + mapStringForAuthAthenzParams := "map[string]string{" + for _, k := range keysForAuthAthenzParams { + mapStringForAuthAthenzParams += fmt.Sprintf("%v: %v,", k, this.AuthAthenzParams[k]) + } + mapStringForAuthAthenzParams += "}" + s := strings.Join([]string{`&PulsarEventSource{`, + `Topics:` + fmt.Sprintf("%v", this.Topics) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `TLSTrustCertsSecret:` + strings.Replace(fmt.Sprintf("%v", this.TLSTrustCertsSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `TLSAllowInsecureConnection:` + fmt.Sprintf("%v", this.TLSAllowInsecureConnection) + `,`, + `TLSValidateHostname:` + fmt.Sprintf("%v", this.TLSValidateHostname) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `AuthTokenSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthTokenSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `AuthAthenzParams:` + mapStringForAuthAthenzParams + `,`, + `AuthAthenzSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthAthenzSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PulsarTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + repeatedStringForPayload := "[]TriggerParameter{" + for _, f := range this.Payload { + repeatedStringForPayload += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForPayload += "}" + keysForAuthAthenzParams := make([]string, 0, len(this.AuthAthenzParams)) + for k := range this.AuthAthenzParams { + keysForAuthAthenzParams = append(keysForAuthAthenzParams, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAuthAthenzParams) + mapStringForAuthAthenzParams := "map[string]string{" + for _, k := range keysForAuthAthenzParams { + mapStringForAuthAthenzParams += fmt.Sprintf("%v: %v,", k, this.AuthAthenzParams[k]) + } + mapStringForAuthAthenzParams += "}" + s := strings.Join([]string{`&PulsarTrigger{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Payload:` + repeatedStringForPayload + `,`, + `TLSTrustCertsSecret:` + strings.Replace(fmt.Sprintf("%v", this.TLSTrustCertsSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `TLSAllowInsecureConnection:` + fmt.Sprintf("%v", this.TLSAllowInsecureConnection) + `,`, + `TLSValidateHostname:` + fmt.Sprintf("%v", this.TLSValidateHostname) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `AuthTokenSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthTokenSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ConnectionBackoff:` + strings.Replace(this.ConnectionBackoff.String(), "Backoff", "Backoff", 1) + `,`, + `AuthAthenzParams:` + mapStringForAuthAthenzParams + `,`, + `AuthAthenzSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthAthenzSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RateLimit) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RateLimit{`, + `Unit:` + fmt.Sprintf("%v", this.Unit) + `,`, + `RequestsPerUnit:` + fmt.Sprintf("%v", this.RequestsPerUnit) + `,`, + `}`, + }, "") + return s +} +func (this *RedisEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&RedisEventSource{`, + `HostAddress:` + fmt.Sprintf("%v", this.HostAddress) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `DB:` + fmt.Sprintf("%v", this.DB) + `,`, + `Channels:` + fmt.Sprintf("%v", this.Channels) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `}`, + }, "") + return s +} +func (this *RedisStreamEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&RedisStreamEventSource{`, + `HostAddress:` + fmt.Sprintf("%v", this.HostAddress) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `DB:` + fmt.Sprintf("%v", this.DB) + `,`, + `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, + `MaxMsgCountPerRead:` + fmt.Sprintf("%v", this.MaxMsgCountPerRead) + `,`, + `ConsumerGroup:` + fmt.Sprintf("%v", this.ConsumerGroup) + `,`, + `TLS:` + strings.Replace(this.TLS.String(), "TLSConfig", "TLSConfig", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&ResourceEventSource{`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "ResourceFilter", "ResourceFilter", 1) + `,`, + `GroupVersionResource:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.GroupVersionResource), "GroupVersionResource", "v11.GroupVersionResource", 1), `&`, ``, 1) + `,`, + `EventTypes:` + fmt.Sprintf("%v", this.EventTypes) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *ResourceFilter) String() string { + if this == nil { + return "nil" + } + repeatedStringForLabels := "[]Selector{" + for _, f := range this.Labels { + repeatedStringForLabels += strings.Replace(strings.Replace(f.String(), "Selector", "Selector", 1), `&`, ``, 1) + "," + } + repeatedStringForLabels += "}" + repeatedStringForFields := "[]Selector{" + for _, f := range this.Fields { + repeatedStringForFields += strings.Replace(strings.Replace(f.String(), "Selector", "Selector", 1), `&`, ``, 1) + "," + } + repeatedStringForFields += "}" + s := strings.Join([]string{`&ResourceFilter{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Labels:` + repeatedStringForLabels + `,`, + `Fields:` + repeatedStringForFields + `,`, + `CreatedBy:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedBy), "Time", "v11.Time", 1), `&`, ``, 1) + `,`, + `AfterStart:` + fmt.Sprintf("%v", this.AfterStart) + `,`, + `}`, + }, "") + return s +} +func (this *S3Artifact) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&S3Artifact{`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `Bucket:` + strings.Replace(this.Bucket.String(), "S3Bucket", "S3Bucket", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `Insecure:` + fmt.Sprintf("%v", this.Insecure) + `,`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "S3Filter", "S3Filter", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `CACertificate:` + strings.Replace(fmt.Sprintf("%v", this.CACertificate), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *S3Bucket) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&S3Bucket{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *S3Filter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&S3Filter{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Suffix:` + fmt.Sprintf("%v", this.Suffix) + `,`, + `}`, + }, "") + return s +} +func (this *SASLConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SASLConfig{`, + `Mechanism:` + fmt.Sprintf("%v", this.Mechanism) + `,`, + `UserSecret:` + strings.Replace(fmt.Sprintf("%v", this.UserSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `PasswordSecret:` + strings.Replace(fmt.Sprintf("%v", this.PasswordSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SFTPEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SFTPEventSource{`, + `EventType:` + fmt.Sprintf("%v", this.EventType) + `,`, + `WatchPathConfig:` + strings.Replace(strings.Replace(this.WatchPathConfig.String(), "WatchPathConfig", "WatchPathConfig", 1), `&`, ``, 1) + `,`, + `Username:` + strings.Replace(fmt.Sprintf("%v", this.Username), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Password:` + strings.Replace(fmt.Sprintf("%v", this.Password), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SSHKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.SSHKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Address:` + strings.Replace(fmt.Sprintf("%v", this.Address), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `PollIntervalDuration:` + fmt.Sprintf("%v", this.PollIntervalDuration) + `,`, + `}`, + }, "") + return s +} +func (this *SNSEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SNSEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `TopicArn:` + fmt.Sprintf("%v", this.TopicArn) + `,`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `RoleARN:` + fmt.Sprintf("%v", this.RoleARN) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `ValidateSignature:` + fmt.Sprintf("%v", this.ValidateSignature) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `}`, + }, "") + return s +} +func (this *SQSEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SQSEventSource{`, + `AccessKey:` + strings.Replace(fmt.Sprintf("%v", this.AccessKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `SecretKey:` + strings.Replace(fmt.Sprintf("%v", this.SecretKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `Queue:` + fmt.Sprintf("%v", this.Queue) + `,`, + `WaitTimeSeconds:` + fmt.Sprintf("%v", this.WaitTimeSeconds) + `,`, + `RoleARN:` + fmt.Sprintf("%v", this.RoleARN) + `,`, + `JSONBody:` + fmt.Sprintf("%v", this.JSONBody) + `,`, + `QueueAccountID:` + fmt.Sprintf("%v", this.QueueAccountID) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `DLQ:` + fmt.Sprintf("%v", this.DLQ) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `SessionToken:` + strings.Replace(fmt.Sprintf("%v", this.SessionToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SchemaRegistryConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchemaRegistryConfig{`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `SchemaID:` + fmt.Sprintf("%v", this.SchemaID) + `,`, + `Auth:` + strings.Replace(strings.Replace(this.Auth.String(), "BasicAuth", "BasicAuth", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *SecureHeader) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SecureHeader{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ValueFrom:` + strings.Replace(this.ValueFrom.String(), "ValueFromSource", "ValueFromSource", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Selector) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Selector{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *Sensor) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Sensor{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "SensorSpec", "SensorSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "SensorStatus", "SensorStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *SensorList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]Sensor{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Sensor", "Sensor", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&SensorList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *SensorSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForDependencies := "[]EventDependency{" + for _, f := range this.Dependencies { + repeatedStringForDependencies += strings.Replace(strings.Replace(f.String(), "EventDependency", "EventDependency", 1), `&`, ``, 1) + "," + } + repeatedStringForDependencies += "}" + repeatedStringForTriggers := "[]Trigger{" + for _, f := range this.Triggers { + repeatedStringForTriggers += strings.Replace(strings.Replace(f.String(), "Trigger", "Trigger", 1), `&`, ``, 1) + "," + } + repeatedStringForTriggers += "}" + keysForLoggingFields := make([]string, 0, len(this.LoggingFields)) + for k := range this.LoggingFields { + keysForLoggingFields = append(keysForLoggingFields, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLoggingFields) + mapStringForLoggingFields := "map[string]string{" + for _, k := range keysForLoggingFields { + mapStringForLoggingFields += fmt.Sprintf("%v: %v,", k, this.LoggingFields[k]) + } + mapStringForLoggingFields += "}" + s := strings.Join([]string{`&SensorSpec{`, + `Dependencies:` + repeatedStringForDependencies + `,`, + `Triggers:` + repeatedStringForTriggers + `,`, + `Template:` + strings.Replace(this.Template.String(), "Template", "Template", 1) + `,`, + `ErrorOnFailedRound:` + fmt.Sprintf("%v", this.ErrorOnFailedRound) + `,`, + `EventBusName:` + fmt.Sprintf("%v", this.EventBusName) + `,`, + `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, + `RevisionHistoryLimit:` + valueToStringGenerated(this.RevisionHistoryLimit) + `,`, + `LoggingFields:` + mapStringForLoggingFields + `,`, + `}`, + }, "") + return s +} +func (this *SensorStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SensorStatus{`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "Status", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *Service) String() string { + if this == nil { + return "nil" + } + repeatedStringForPorts := "[]ServicePort{" + for _, f := range this.Ports { + repeatedStringForPorts += fmt.Sprintf("%v", f) + "," + } + repeatedStringForPorts += "}" + s := strings.Join([]string{`&Service{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, + `ClusterIP:` + fmt.Sprintf("%v", this.ClusterIP) + `,`, + `}`, + }, "") + return s +} +func (this *SlackEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&SlackEventSource{`, + `SigningSecret:` + strings.Replace(fmt.Sprintf("%v", this.SigningSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Token:` + strings.Replace(fmt.Sprintf("%v", this.Token), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SlackSender) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SlackSender{`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `Icon:` + fmt.Sprintf("%v", this.Icon) + `,`, + `}`, + }, "") + return s +} +func (this *SlackThread) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SlackThread{`, + `MessageAggregationKey:` + fmt.Sprintf("%v", this.MessageAggregationKey) + `,`, + `BroadcastMessageToChannel:` + fmt.Sprintf("%v", this.BroadcastMessageToChannel) + `,`, + `}`, + }, "") + return s +} +func (this *SlackTrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&SlackTrigger{`, + `Parameters:` + repeatedStringForParameters + `,`, + `SlackToken:` + strings.Replace(fmt.Sprintf("%v", this.SlackToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Channel:` + fmt.Sprintf("%v", this.Channel) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `Attachments:` + fmt.Sprintf("%v", this.Attachments) + `,`, + `Blocks:` + fmt.Sprintf("%v", this.Blocks) + `,`, + `Thread:` + strings.Replace(strings.Replace(this.Thread.String(), "SlackThread", "SlackThread", 1), `&`, ``, 1) + `,`, + `Sender:` + strings.Replace(strings.Replace(this.Sender.String(), "SlackSender", "SlackSender", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *StandardK8STrigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&StandardK8STrigger{`, + `Source:` + strings.Replace(this.Source.String(), "ArtifactLocation", "ArtifactLocation", 1) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `PatchStrategy:` + fmt.Sprintf("%v", this.PatchStrategy) + `,`, + `LiveObject:` + fmt.Sprintf("%v", this.LiveObject) + `,`, + `}`, + }, "") + return s +} +func (this *Status) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "Condition", "Condition", 1), `&`, ``, 1) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&Status{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *StatusPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StatusPolicy{`, + `Allow:` + fmt.Sprintf("%v", this.Allow) + `,`, + `}`, + }, "") + return s +} +func (this *StorageGridEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&StorageGridEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `Events:` + fmt.Sprintf("%v", this.Events) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "StorageGridFilter", "StorageGridFilter", 1) + `,`, + `TopicArn:` + fmt.Sprintf("%v", this.TopicArn) + `,`, + `Bucket:` + fmt.Sprintf("%v", this.Bucket) + `,`, + `Region:` + fmt.Sprintf("%v", this.Region) + `,`, + `AuthToken:` + strings.Replace(fmt.Sprintf("%v", this.AuthToken), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `APIURL:` + fmt.Sprintf("%v", this.APIURL) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *StorageGridFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StorageGridFilter{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Suffix:` + fmt.Sprintf("%v", this.Suffix) + `,`, + `}`, + }, "") + return s +} +func (this *StripeEventSource) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&StripeEventSource{`, + `Webhook:` + strings.Replace(this.Webhook.String(), "WebhookContext", "WebhookContext", 1) + `,`, + `CreateWebhook:` + fmt.Sprintf("%v", this.CreateWebhook) + `,`, + `APIKey:` + strings.Replace(fmt.Sprintf("%v", this.APIKey), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `EventFilter:` + fmt.Sprintf("%v", this.EventFilter) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *TLSConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TLSConfig{`, + `CACertSecret:` + strings.Replace(fmt.Sprintf("%v", this.CACertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ClientCertSecret:` + strings.Replace(fmt.Sprintf("%v", this.ClientCertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ClientKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.ClientKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `InsecureSkipVerify:` + fmt.Sprintf("%v", this.InsecureSkipVerify) + `,`, + `}`, + }, "") + return s +} +func (this *Template) String() string { + if this == nil { + return "nil" + } + repeatedStringForVolumes := "[]Volume{" + for _, f := range this.Volumes { + repeatedStringForVolumes += fmt.Sprintf("%v", f) + "," + } + repeatedStringForVolumes += "}" + repeatedStringForTolerations := "[]Toleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForTolerations += "}" + repeatedStringForImagePullSecrets := "[]LocalObjectReference{" + for _, f := range this.ImagePullSecrets { + repeatedStringForImagePullSecrets += fmt.Sprintf("%v", f) + "," + } + repeatedStringForImagePullSecrets += "}" + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&Template{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "Metadata", "Metadata", 1) + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "Container", "v1.Container", 1) + `,`, + `Volumes:` + repeatedStringForVolumes + `,`, + `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "PodSecurityContext", "v1.PodSecurityContext", 1) + `,`, + `NodeSelector:` + mapStringForNodeSelector + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `ImagePullSecrets:` + repeatedStringForImagePullSecrets + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `Affinity:` + strings.Replace(fmt.Sprintf("%v", this.Affinity), "Affinity", "v1.Affinity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TimeFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TimeFilter{`, + `Start:` + fmt.Sprintf("%v", this.Start) + `,`, + `Stop:` + fmt.Sprintf("%v", this.Stop) + `,`, + `}`, + }, "") + return s +} +func (this *Trigger) String() string { + if this == nil { + return "nil" + } + repeatedStringForParameters := "[]TriggerParameter{" + for _, f := range this.Parameters { + repeatedStringForParameters += strings.Replace(strings.Replace(f.String(), "TriggerParameter", "TriggerParameter", 1), `&`, ``, 1) + "," + } + repeatedStringForParameters += "}" + s := strings.Join([]string{`&Trigger{`, + `Template:` + strings.Replace(this.Template.String(), "TriggerTemplate", "TriggerTemplate", 1) + `,`, + `Parameters:` + repeatedStringForParameters + `,`, + `Policy:` + strings.Replace(this.Policy.String(), "TriggerPolicy", "TriggerPolicy", 1) + `,`, + `RetryStrategy:` + strings.Replace(this.RetryStrategy.String(), "Backoff", "Backoff", 1) + `,`, + `RateLimit:` + strings.Replace(this.RateLimit.String(), "RateLimit", "RateLimit", 1) + `,`, + `AtLeastOnce:` + fmt.Sprintf("%v", this.AtLeastOnce) + `,`, + `DlqTrigger:` + strings.Replace(this.DlqTrigger.String(), "Trigger", "Trigger", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerParameter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TriggerParameter{`, + `Src:` + strings.Replace(this.Src.String(), "TriggerParameterSource", "TriggerParameterSource", 1) + `,`, + `Dest:` + fmt.Sprintf("%v", this.Dest) + `,`, + `Operation:` + fmt.Sprintf("%v", this.Operation) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerParameterSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TriggerParameterSource{`, + `DependencyName:` + fmt.Sprintf("%v", this.DependencyName) + `,`, + `ContextKey:` + fmt.Sprintf("%v", this.ContextKey) + `,`, + `ContextTemplate:` + fmt.Sprintf("%v", this.ContextTemplate) + `,`, + `DataKey:` + fmt.Sprintf("%v", this.DataKey) + `,`, + `DataTemplate:` + fmt.Sprintf("%v", this.DataTemplate) + `,`, + `Value:` + valueToStringGenerated(this.Value) + `,`, + `UseRawData:` + fmt.Sprintf("%v", this.UseRawData) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TriggerPolicy{`, + `K8s:` + strings.Replace(this.K8s.String(), "K8SResourcePolicy", "K8SResourcePolicy", 1) + `,`, + `Status:` + strings.Replace(this.Status.String(), "StatusPolicy", "StatusPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TriggerTemplate) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditionsReset := "[]ConditionsResetCriteria{" + for _, f := range this.ConditionsReset { + repeatedStringForConditionsReset += strings.Replace(strings.Replace(f.String(), "ConditionsResetCriteria", "ConditionsResetCriteria", 1), `&`, ``, 1) + "," + } + repeatedStringForConditionsReset += "}" + s := strings.Join([]string{`&TriggerTemplate{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Conditions:` + fmt.Sprintf("%v", this.Conditions) + `,`, + `K8s:` + strings.Replace(this.K8s.String(), "StandardK8STrigger", "StandardK8STrigger", 1) + `,`, + `ArgoWorkflow:` + strings.Replace(this.ArgoWorkflow.String(), "ArgoWorkflowTrigger", "ArgoWorkflowTrigger", 1) + `,`, + `HTTP:` + strings.Replace(this.HTTP.String(), "HTTPTrigger", "HTTPTrigger", 1) + `,`, + `AWSLambda:` + strings.Replace(this.AWSLambda.String(), "AWSLambdaTrigger", "AWSLambdaTrigger", 1) + `,`, + `CustomTrigger:` + strings.Replace(this.CustomTrigger.String(), "CustomTrigger", "CustomTrigger", 1) + `,`, + `Kafka:` + strings.Replace(this.Kafka.String(), "KafkaTrigger", "KafkaTrigger", 1) + `,`, + `NATS:` + strings.Replace(this.NATS.String(), "NATSTrigger", "NATSTrigger", 1) + `,`, + `Slack:` + strings.Replace(this.Slack.String(), "SlackTrigger", "SlackTrigger", 1) + `,`, + `OpenWhisk:` + strings.Replace(this.OpenWhisk.String(), "OpenWhiskTrigger", "OpenWhiskTrigger", 1) + `,`, + `Log:` + strings.Replace(this.Log.String(), "LogTrigger", "LogTrigger", 1) + `,`, + `AzureEventHubs:` + strings.Replace(this.AzureEventHubs.String(), "AzureEventHubsTrigger", "AzureEventHubsTrigger", 1) + `,`, + `Pulsar:` + strings.Replace(this.Pulsar.String(), "PulsarTrigger", "PulsarTrigger", 1) + `,`, + `ConditionsReset:` + repeatedStringForConditionsReset + `,`, + `AzureServiceBus:` + strings.Replace(this.AzureServiceBus.String(), "AzureServiceBusTrigger", "AzureServiceBusTrigger", 1) + `,`, + `Email:` + strings.Replace(this.Email.String(), "EmailTrigger", "EmailTrigger", 1) + `,`, + `}`, + }, "") + return s +} +func (this *URLArtifact) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&URLArtifact{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `VerifyCert:` + fmt.Sprintf("%v", this.VerifyCert) + `,`, + `}`, + }, "") + return s +} +func (this *ValueFromSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ValueFromSource{`, + `SecretKeyRef:` + strings.Replace(fmt.Sprintf("%v", this.SecretKeyRef), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ConfigMapKeyRef:` + strings.Replace(fmt.Sprintf("%v", this.ConfigMapKeyRef), "ConfigMapKeySelector", "v1.ConfigMapKeySelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *WatchPathConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WatchPathConfig{`, + `Directory:` + fmt.Sprintf("%v", this.Directory) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `PathRegexp:` + fmt.Sprintf("%v", this.PathRegexp) + `,`, + `}`, + }, "") + return s +} +func (this *WebhookContext) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&WebhookContext{`, + `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, + `Method:` + fmt.Sprintf("%v", this.Method) + `,`, + `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `ServerCertSecret:` + strings.Replace(fmt.Sprintf("%v", this.ServerCertSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `ServerKeySecret:` + strings.Replace(fmt.Sprintf("%v", this.ServerKeySecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `AuthSecret:` + strings.Replace(fmt.Sprintf("%v", this.AuthSecret), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, + `MaxPayloadSize:` + valueToStringGenerated(this.MaxPayloadSize) + `,`, + `}`, + }, "") + return s +} +func (this *WebhookEventSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WebhookEventSource{`, + `WebhookContext:` + strings.Replace(strings.Replace(this.WebhookContext.String(), "WebhookContext", "WebhookContext", 1), `&`, ``, 1) + `,`, + `Filter:` + strings.Replace(this.Filter.String(), "EventSourceFilter", "EventSourceFilter", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AMQPConsumeConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPConsumeConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPConsumeConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerTag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerTag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoAck", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AutoAck = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exclusive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exclusive = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoLocal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoLocal = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoutingKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoutingKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeDeclare", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExchangeDeclare == nil { + m.ExchangeDeclare = &AMQPExchangeDeclareConfig{} + } + if err := m.ExchangeDeclare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueDeclare", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueueDeclare == nil { + m.QueueDeclare = &AMQPQueueDeclareConfig{} + } + if err := m.QueueDeclare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueBind", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueueBind == nil { + m.QueueBind = &AMQPQueueBindConfig{} + } + if err := m.QueueBind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consume", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Consume == nil { + m.Consume = &AMQPConsumeConfig{} + } + if err := m.Consume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BasicAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URLSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.URLSecret == nil { + m.URLSecret = &v1.SecretKeySelector{} + } + if err := m.URLSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPExchangeDeclareConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPExchangeDeclareConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPExchangeDeclareConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Durable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Durable = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoDelete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AutoDelete = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Internal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Internal = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPQueueBindConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPQueueBindConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPQueueBindConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AMQPQueueDeclareConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AMQPQueueDeclareConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AMQPQueueDeclareConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Durable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Durable = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoDelete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AutoDelete = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exclusive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exclusive = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWait", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoWait = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Arguments", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Arguments = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AWSLambdaTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AWSLambdaTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AWSLambdaTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunctionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FunctionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvocationType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.InvocationType = &s + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoleARN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoleARN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Amount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Amount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Amount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArgoWorkflowTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArgoWorkflowTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArgoWorkflowTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &ArtifactLocation{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = ArgoWorkflowOperation(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArtifactLocation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArtifactLocation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArtifactLocation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field S3", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.S3 == nil { + m.S3 = &S3Artifact{} + } + if err := m.S3.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inline", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Inline = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.File == nil { + m.File = &FileArtifact{} + } + if err := m.File.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.URL == nil { + m.URL = &URLArtifact{} + } + if err := m.URL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configmap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Configmap == nil { + m.Configmap = &v1.ConfigMapKeySelector{} + } + if err := m.Configmap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Git", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Git == nil { + m.Git = &GitArtifact{} + } + if err := m.Git.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resource == nil { + m.Resource = &K8SResource{} + } + if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureEventHubsTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureEventHubsTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureEventHubsTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FQDN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FQDN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HubName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HubName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKeyName", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKeyName == nil { + m.SharedAccessKeyName = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKeyName.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKey == nil { + m.SharedAccessKey = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureEventsHubEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureEventsHubEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureEventsHubEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FQDN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FQDN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKeyName", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKeyName == nil { + m.SharedAccessKeyName = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKeyName.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedAccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SharedAccessKey == nil { + m.SharedAccessKey = &v1.SecretKeySelector{} + } + if err := m.SharedAccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HubName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HubName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureQueueStorageEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureQueueStorageEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureQueueStorageEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StorageAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionString", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionString == nil { + m.ConnectionString = &v1.SecretKeySelector{} + } + if err := m.ConnectionString.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DLQ", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DLQ = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DecodeMessage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DecodeMessage = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WaitTimeInSeconds", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WaitTimeInSeconds = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureServiceBusEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureServiceBusEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureServiceBusEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionString", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionString == nil { + m.ConnectionString = &v1.SecretKeySelector{} + } + if err := m.ConnectionString.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubscriptionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FullyQualifiedNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FullyQualifiedNamespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AzureServiceBusTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AzureServiceBusTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AzureServiceBusTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionString", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionString == nil { + m.ConnectionString = &v1.SecretKeySelector{} + } + if err := m.ConnectionString.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubscriptionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Backoff) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Backoff: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Backoff: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Duration == nil { + m.Duration = &Int64OrString{} + } + if err := m.Duration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Factor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Factor == nil { + m.Factor = &Amount{} + } + if err := m.Factor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Jitter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Jitter == nil { + m.Jitter = &Amount{} + } + if err := m.Jitter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Steps", wireType) + } + m.Steps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Steps |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasicAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BasicAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &BitbucketBasicAuth{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OAuthToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OAuthToken == nil { + m.OAuthToken = &v1.SecretKeySelector{} + } + if err := m.OAuthToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketBasicAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketBasicAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketBasicAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BitbucketAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedProjectKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedProjectKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedRepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedRepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repositories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Repositories = append(m.Repositories, BitbucketRepository{}) + if err := m.Repositories[len(m.Repositories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketRepository) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketRepository: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketRepository: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketServerEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketServerEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketServerEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedProjectKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedProjectKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedRepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedRepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repositories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Repositories = append(m.Repositories, BitbucketServerRepository{}) + if err := m.Repositories[len(m.Repositories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipBranchRefsChangedOnOpenPR", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipBranchRefsChangedOnOpenPR = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OneEventPerChange", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OneEventPerChange = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessToken == nil { + m.AccessToken = &v1.SecretKeySelector{} + } + if err := m.AccessToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebhookSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WebhookSecret == nil { + m.WebhookSecret = &v1.SecretKeySelector{} + } + if err := m.WebhookSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BitbucketServerBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BitbucketServerBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckInterval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CheckInterval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BitbucketServerRepository) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BitbucketServerRepository: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BitbucketServerRepository: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProjectKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepositorySlug", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepositorySlug = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BusConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BusConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BusConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = &NATSConfig{} + } + if err := m.NATS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JetStream", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JetStream == nil { + m.JetStream = &JetStreamConfig{} + } + if err := m.JetStream.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = &KafkaBus{} + } + if err := m.Kafka.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CalendarEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CalendarEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CalendarEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schedule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schedule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Interval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExclusionDates", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExclusionDates = append(m.ExclusionDates, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timezone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timezone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &EventPersistence{} + } + if err := m.Persistence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CatchupConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CatchupConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CatchupConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDuration", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MaxDuration = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Condition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Condition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Condition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = ConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConditionsResetByTime) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConditionsResetByTime: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConditionsResetByTime: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cron", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cron = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timezone", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timezone = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConditionsResetCriteria) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConditionsResetCriteria: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConditionsResetCriteria: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ByTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ByTime == nil { + m.ByTime = &ConditionsResetByTime{} + } + if err := m.ByTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigMapPersistence) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigMapPersistence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigMapPersistence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateIfNotExist", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CreateIfNotExist = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContainerTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullPolicy = k8s_io_api_core_v1.PullPolicy(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.SecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CustomTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CustomTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CustomTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServerURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Secure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Secure = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CertSecret == nil { + m.CertSecret = &v1.SecretKeySelector{} + } + if err := m.CertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerNameOverride", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServerNameOverride = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Spec == nil { + m.Spec = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Spec[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DataFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DataFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DataFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = JSONType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Comparator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Comparator = Comparator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Template = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EmailTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EmailTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EmailTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SMTPPassword", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SMTPPassword == nil { + m.SMTPPassword = &v1.SecretKeySelector{} + } + if err := m.SMTPPassword.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = append(m.To, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Body = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EmitterEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EmitterEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EmitterEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Broker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Broker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Event) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Event: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &EventContext{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBusList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBusList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBusList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, EventBus{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBusSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBusSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBusSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = &NATSBus{} + } + if err := m.NATS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JetStream", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JetStream == nil { + m.JetStream = &JetStreamBus{} + } + if err := m.JetStream.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = &KafkaBus{} + } + if err := m.Kafka.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JetStreamExotic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JetStreamExotic == nil { + m.JetStreamExotic = &JetStreamConfig{} + } + if err := m.JetStreamExotic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBusStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBusStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBusStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpecVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpecVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataContentType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataContentType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDependency) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventDependency: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDependency: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventSourceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventSourceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filters == nil { + m.Filters = &EventDependencyFilter{} + } + if err := m.Filters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transform", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Transform == nil { + m.Transform = &EventDependencyTransformer{} + } + if err := m.Transform.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FiltersLogicalOperator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FiltersLogicalOperator = LogicalOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDependencyFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventDependencyFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDependencyFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Time == nil { + m.Time = &TimeFilter{} + } + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &EventContext{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, DataFilter{}) + if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exprs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Exprs = append(m.Exprs, ExprFilter{}) + if err := m.Exprs[len(m.Exprs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataLogicalOperator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataLogicalOperator = LogicalOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExprLogicalOperator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExprLogicalOperator = LogicalOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Script", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Script = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDependencyTransformer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventDependencyTransformer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDependencyTransformer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JQ", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.JQ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Script", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Script = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventPersistence) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventPersistence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventPersistence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Catchup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Catchup == nil { + m.Catchup = &CatchupConfiguration{} + } + if err := m.Catchup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigMap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConfigMap == nil { + m.ConfigMap = &ConfigMapPersistence{} + } + if err := m.ConfigMap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expression = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, EventSource{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventBusName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventBusName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Template == nil { + m.Template = &Template{} + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Service == nil { + m.Service = &Service{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minio", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Minio == nil { + m.Minio = make(map[string]S3Artifact) + } + var mapkey string + mapvalue := &S3Artifact{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &S3Artifact{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Minio[mapkey] = *mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Calendar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Calendar == nil { + m.Calendar = make(map[string]CalendarEventSource) + } + var mapkey string + mapvalue := &CalendarEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &CalendarEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Calendar[mapkey] = *mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.File == nil { + m.File = make(map[string]FileEventSource) + } + var mapkey string + mapvalue := &FileEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &FileEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.File[mapkey] = *mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resource == nil { + m.Resource = make(map[string]ResourceEventSource) + } + var mapkey string + mapvalue := &ResourceEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ResourceEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Resource[mapkey] = *mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = make(map[string]WebhookEventSource) + } + var mapkey string + mapvalue := &WebhookEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &WebhookEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Webhook[mapkey] = *mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AMQP", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AMQP == nil { + m.AMQP = make(map[string]AMQPEventSource) + } + var mapkey string + mapvalue := &AMQPEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AMQPEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AMQP[mapkey] = *mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = make(map[string]KafkaEventSource) + } + var mapkey string + mapvalue := &KafkaEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KafkaEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Kafka[mapkey] = *mapvalue + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MQTT", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MQTT == nil { + m.MQTT = make(map[string]MQTTEventSource) + } + var mapkey string + mapvalue := &MQTTEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &MQTTEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.MQTT[mapkey] = *mapvalue + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = make(map[string]NATSEventsSource) + } + var mapkey string + mapvalue := &NATSEventsSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &NATSEventsSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NATS[mapkey] = *mapvalue + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SNS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SNS == nil { + m.SNS = make(map[string]SNSEventSource) + } + var mapkey string + mapvalue := &SNSEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SNSEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SNS[mapkey] = *mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SQS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SQS == nil { + m.SQS = make(map[string]SQSEventSource) + } + var mapkey string + mapvalue := &SQSEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SQSEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SQS[mapkey] = *mapvalue + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubSub", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubSub == nil { + m.PubSub = make(map[string]PubSubEventSource) + } + var mapkey string + mapvalue := &PubSubEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &PubSubEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.PubSub[mapkey] = *mapvalue + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Github", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Github == nil { + m.Github = make(map[string]GithubEventSource) + } + var mapkey string + mapvalue := &GithubEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GithubEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Github[mapkey] = *mapvalue + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gitlab", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gitlab == nil { + m.Gitlab = make(map[string]GitlabEventSource) + } + var mapkey string + mapvalue := &GitlabEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GitlabEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Gitlab[mapkey] = *mapvalue + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HDFS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HDFS == nil { + m.HDFS = make(map[string]HDFSEventSource) + } + var mapkey string + mapvalue := &HDFSEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &HDFSEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.HDFS[mapkey] = *mapvalue + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Slack", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Slack == nil { + m.Slack = make(map[string]SlackEventSource) + } + var mapkey string + mapvalue := &SlackEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SlackEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Slack[mapkey] = *mapvalue + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageGrid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StorageGrid == nil { + m.StorageGrid = make(map[string]StorageGridEventSource) + } + var mapkey string + mapvalue := &StorageGridEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StorageGridEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.StorageGrid[mapkey] = *mapvalue + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureEventsHub", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureEventsHub == nil { + m.AzureEventsHub = make(map[string]AzureEventsHubEventSource) + } + var mapkey string + mapvalue := &AzureEventsHubEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AzureEventsHubEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AzureEventsHub[mapkey] = *mapvalue + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stripe", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stripe == nil { + m.Stripe = make(map[string]StripeEventSource) + } + var mapkey string + mapvalue := &StripeEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StripeEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Stripe[mapkey] = *mapvalue + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Emitter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Emitter == nil { + m.Emitter = make(map[string]EmitterEventSource) + } + var mapkey string + mapvalue := &EmitterEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &EmitterEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Emitter[mapkey] = *mapvalue + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Redis", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Redis == nil { + m.Redis = make(map[string]RedisEventSource) + } + var mapkey string + mapvalue := &RedisEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &RedisEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Redis[mapkey] = *mapvalue + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NSQ", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NSQ == nil { + m.NSQ = make(map[string]NSQEventSource) + } + var mapkey string + mapvalue := &NSQEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &NSQEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NSQ[mapkey] = *mapvalue + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pulsar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pulsar == nil { + m.Pulsar = make(map[string]PulsarEventSource) + } + var mapkey string + mapvalue := &PulsarEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &PulsarEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Pulsar[mapkey] = *mapvalue + iNdEx = postIndex + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Generic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Generic == nil { + m.Generic = make(map[string]GenericEventSource) + } + var mapkey string + mapvalue := &GenericEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GenericEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Generic[mapkey] = *mapvalue + iNdEx = postIndex + case 28: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Replicas = &v + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BitbucketServer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BitbucketServer == nil { + m.BitbucketServer = make(map[string]BitbucketServerEventSource) + } + var mapkey string + mapvalue := &BitbucketServerEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &BitbucketServerEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.BitbucketServer[mapkey] = *mapvalue + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bitbucket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bitbucket == nil { + m.Bitbucket = make(map[string]BitbucketEventSource) + } + var mapkey string + mapvalue := &BitbucketEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &BitbucketEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Bitbucket[mapkey] = *mapvalue + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedisStream", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RedisStream == nil { + m.RedisStream = make(map[string]RedisStreamEventSource) + } + var mapkey string + mapvalue := &RedisStreamEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &RedisStreamEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.RedisStream[mapkey] = *mapvalue + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureServiceBus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureServiceBus == nil { + m.AzureServiceBus = make(map[string]AzureServiceBusEventSource) + } + var mapkey string + mapvalue := &AzureServiceBusEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AzureServiceBusEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AzureServiceBus[mapkey] = *mapvalue + iNdEx = postIndex + case 33: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureQueueStorage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureQueueStorage == nil { + m.AzureQueueStorage = make(map[string]AzureQueueStorageEventSource) + } + var mapkey string + mapvalue := &AzureQueueStorageEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AzureQueueStorageEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AzureQueueStorage[mapkey] = *mapvalue + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SFTP", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SFTP == nil { + m.SFTP = make(map[string]SFTPEventSource) + } + var mapkey string + mapvalue := &SFTPEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &SFTPEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SFTP[mapkey] = *mapvalue + iNdEx = postIndex + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gerrit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gerrit == nil { + m.Gerrit = make(map[string]GerritEventSource) + } + var mapkey string + mapvalue := &GerritEventSource{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &GerritEventSource{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Gerrit[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSourceStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventSourceStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSourceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExprFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExprFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExprFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fields = append(m.Fields, PayloadField{}) + if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FileArtifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileArtifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileArtifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FileEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchPathConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WatchPathConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Polling", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Polling = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenericEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenericEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenericEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Insecure = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSecret == nil { + m.AuthSecret = &v1.SecretKeySelector{} + } + if err := m.AuthSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GerritEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GerritEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GerritEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HookName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HookName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BasicAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GerritBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GerritBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SslVerify", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SslVerify = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitArtifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitArtifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitArtifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CloneDirectory", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CloneDirectory = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Creds == nil { + m.Creds = &GitCreds{} + } + if err := m.Creds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SSHKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SSHKeySecret == nil { + m.SSHKeySecret = &v1.SecretKeySelector{} + } + if err := m.SSHKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FilePath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FilePath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Branch", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Branch = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ref = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Remote == nil { + m.Remote = &GitRemoteConfig{} + } + if err := m.Remote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InsecureIgnoreHostKey", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.InsecureIgnoreHostKey = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitCreds) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitCreds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitCreds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitRemoteConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitRemoteConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitRemoteConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URLS", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URLS = append(m.URLS, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GithubAppCreds) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GithubAppCreds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GithubAppCreds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrivateKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PrivateKey == nil { + m.PrivateKey = &v1.SecretKeySelector{} + } + if err := m.PrivateKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppID", wireType) + } + m.AppID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppID |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InstallationID", wireType) + } + m.InstallationID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InstallationID |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GithubEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GithubEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GithubEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedRepository", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedRepository = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.APIToken == nil { + m.APIToken = &v1.SecretKeySelector{} + } + if err := m.APIToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebhookSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WebhookSecret == nil { + m.WebhookSecret = &v1.SecretKeySelector{} + } + if err := m.WebhookSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Insecure = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Active = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContentType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContentType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GithubBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GithubBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GithubUploadURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GithubUploadURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Repositories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Repositories = append(m.Repositories, OwnedRepositories{}) + if err := m.Repositories[len(m.Repositories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Organizations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Organizations = append(m.Organizations, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GithubApp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GithubApp == nil { + m.GithubApp = &GithubAppCreds{} + } + if err := m.GithubApp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GitlabEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GitlabEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GitlabEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedProjectID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedProjectID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessToken == nil { + m.AccessToken = &v1.SecretKeySelector{} + } + if err := m.AccessToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableSSLVerification", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableSSLVerification = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GitlabBaseURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GitlabBaseURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteHookOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteHookOnFinish = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretToken == nil { + m.SecretToken = &v1.SecretKeySelector{} + } + if err := m.SecretToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HDFSEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HDFSEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HDFSEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchPathConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WatchPathConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckInterval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CheckInterval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HDFSUser", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HDFSUser = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbCCacheSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KrbCCacheSecret == nil { + m.KrbCCacheSecret = &v1.SecretKeySelector{} + } + if err := m.KrbCCacheSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbKeytabSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KrbKeytabSecret == nil { + m.KrbKeytabSecret = &v1.SecretKeySelector{} + } + if err := m.KrbKeytabSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbUsername", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KrbUsername = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbRealm", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KrbRealm = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbConfigConfigMap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KrbConfigConfigMap == nil { + m.KrbConfigConfigMap = &v1.ConfigMapKeySelector{} + } + if err := m.KrbConfigConfigMap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KrbServicePrincipalName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KrbServicePrincipalName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + m.Timeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timeout |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasicAuth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BasicAuth == nil { + m.BasicAuth = &BasicAuth{} + } + if err := m.BasicAuth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Headers[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecureHeaders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecureHeaders = append(m.SecureHeaders, &SecureHeader{}) + if err := m.SecureHeaders[len(m.SecureHeaders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Int64OrString) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Int64OrString: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Int64OrString: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Int64Val", wireType) + } + m.Int64Val = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Int64Val |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StrVal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StrVal = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JetStreamBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JetStreamBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JetStreamBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Replicas = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContainerTemplate == nil { + m.ContainerTemplate = &ContainerTemplate{} + } + if err := m.ContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReloaderContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ReloaderContainerTemplate == nil { + m.ReloaderContainerTemplate = &ContainerTemplate{} + } + if err := m.ReloaderContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricsContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetricsContainerTemplate == nil { + m.MetricsContainerTemplate = &ContainerTemplate{} + } + if err := m.MetricsContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &PersistenceStrategy{} + } + if err := m.Persistence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NodeSelector[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, v1.Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.PodSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecrets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullSecrets = append(m.ImagePullSecrets, v1.LocalObjectReference{}) + if err := m.ImagePullSecrets[len(m.ImagePullSecrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Affinity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Affinity == nil { + m.Affinity = &v1.Affinity{} + } + if err := m.Affinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Settings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Settings = &s + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartArgs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartArgs = append(m.StartArgs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.StreamConfig = &s + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPayload", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxPayload = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JetStreamConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JetStreamConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JetStreamConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessSecret == nil { + m.AccessSecret = &v1.SecretKeySelector{} + } + if err := m.AccessSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StreamConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *K8SResource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: K8SResource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: K8SResource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *K8SResourcePolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: K8SResourcePolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: K8SResourcePolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Backoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Backoff == nil { + m.Backoff = &Backoff{} + } + if err := m.Backoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorOnBackoffTimeout", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ErrorOnBackoffTimeout = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SASL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SASL == nil { + m.SASL = &SASLConfig{} + } + if err := m.SASL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerGroup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsumerGroup == nil { + m.ConsumerGroup = &KafkaConsumerGroup{} + } + if err := m.ConsumerGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaConsumerGroup) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaConsumerGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaConsumerGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Oldest", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Oldest = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RebalanceStrategy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RebalanceStrategy = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Partition = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerGroup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsumerGroup == nil { + m.ConsumerGroup = &KafkaConsumerGroup{} + } + if err := m.ConsumerGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitEventsPerSecond", wireType) + } + m.LimitEventsPerSecond = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitEventsPerSecond |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SASL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SASL == nil { + m.SASL = &SASLConfig{} + } + if err := m.SASL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KafkaTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KafkaTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KafkaTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Partition", wireType) + } + m.Partition = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Partition |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequiredAcks", wireType) + } + m.RequiredAcks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequiredAcks |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Compress", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Compress = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FlushFrequency", wireType) + } + m.FlushFrequency = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FlushFrequency |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitioningKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.PartitioningKey = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SASL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SASL == nil { + m.SASL = &SASLConfig{} + } + if err := m.SASL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaRegistry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchemaRegistry == nil { + m.SchemaRegistry = &SchemaRegistryConfig{} + } + if err := m.SchemaRegistry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Headers[mapkey] = mapvalue + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecureHeaders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecureHeaders = append(m.SecureHeaders, &SecureHeader{}) + if err := m.SecureHeaders[len(m.SecureHeaders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LogTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) + } + m.IntervalSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IntervalSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MQTTEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MQTTEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MQTTEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &BasicAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &BasicAuth{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Token == nil { + m.Token = &v1.SecretKeySelector{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NKey == nil { + m.NKey = &v1.SecretKeySelector{} + } + if err := m.NKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credential", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Credential == nil { + m.Credential = &v1.SecretKeySelector{} + } + if err := m.Credential.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSBus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSBus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSBus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Native", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Native == nil { + m.Native = &NativeStrategy{} + } + if err := m.Native.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exotic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exotic == nil { + m.Exotic = &NATSConfig{} + } + if err := m.Exotic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ClusterID = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := AuthStrategy(dAtA[iNdEx:postIndex]) + m.Auth = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessSecret == nil { + m.AccessSecret = &v1.SecretKeySelector{} + } + if err := m.AccessSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSEventsSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSEventsSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSEventsSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &NATSAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Queue = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NATSTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NATSTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NATSTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &NATSAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NSQEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NSQEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NSQEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NativeStrategy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NativeStrategy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NativeStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + m.Replicas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Replicas |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := AuthStrategy(dAtA[iNdEx:postIndex]) + m.Auth = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &PersistenceStrategy{} + } + if err := m.Persistence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContainerTemplate == nil { + m.ContainerTemplate = &ContainerTemplate{} + } + if err := m.ContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetricsContainerTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetricsContainerTemplate == nil { + m.MetricsContainerTemplate = &ContainerTemplate{} + } + if err := m.MetricsContainerTemplate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NodeSelector[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, v1.Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.PodSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAge", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxAge = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecrets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullSecrets = append(m.ImagePullSecrets, v1.LocalObjectReference{}) + if err := m.ImagePullSecrets[len(m.ImagePullSecrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Affinity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Affinity == nil { + m.Affinity = &v1.Affinity{} + } + if err := m.Affinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxMsgs", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxMsgs = &v + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxBytes = &s + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxSubs", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxSubs = &v + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPayload", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.MaxPayload = &s + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftHeartbeatTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftHeartbeatTimeout = &s + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftElectionTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftElectionTimeout = &s + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftLeaseTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftLeaseTimeout = &s + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftCommitTimeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.RaftCommitTimeout = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OpenWhiskTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OpenWhiskTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OpenWhiskTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthToken == nil { + m.AuthToken = &v1.SecretKeySelector{} + } + if err := m.AuthToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActionName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActionName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OwnedRepositories) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OwnedRepositories: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OwnedRepositories: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PayloadField) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PayloadField: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PayloadField: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PersistenceStrategy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PersistenceStrategy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PersistenceStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.StorageClassName = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeAccessMode(dAtA[iNdEx:postIndex]) + m.AccessMode = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeSize", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VolumeSize == nil { + m.VolumeSize = &resource.Quantity{} + } + if err := m.VolumeSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubSubEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PubSubEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubSubEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProjectID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicProjectID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicProjectID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubscriptionID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CredentialSecret == nil { + m.CredentialSecret = &v1.SecretKeySelector{} + } + if err := m.CredentialSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteSubscriptionOnFinish", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DeleteSubscriptionOnFinish = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PulsarEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PulsarEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PulsarEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topics", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topics = append(m.Topics, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSTrustCertsSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLSTrustCertsSecret == nil { + m.TLSTrustCertsSecret = &v1.SecretKeySelector{} + } + if err := m.TLSTrustCertsSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSAllowInsecureConnection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSAllowInsecureConnection = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSValidateHostname", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSValidateHostname = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthTokenSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthTokenSecret == nil { + m.AuthTokenSecret = &v1.SecretKeySelector{} + } + if err := m.AuthTokenSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzParams == nil { + m.AuthAthenzParams = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AuthAthenzParams[mapkey] = mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzSecret == nil { + m.AuthAthenzSecret = &v1.SecretKeySelector{} + } + if err := m.AuthAthenzSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PulsarTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PulsarTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PulsarTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topic = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload, TriggerParameter{}) + if err := m.Payload[len(m.Payload)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSTrustCertsSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLSTrustCertsSecret == nil { + m.TLSTrustCertsSecret = &v1.SecretKeySelector{} + } + if err := m.TLSTrustCertsSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSAllowInsecureConnection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSAllowInsecureConnection = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSValidateHostname", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TLSValidateHostname = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthTokenSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthTokenSecret == nil { + m.AuthTokenSecret = &v1.SecretKeySelector{} + } + if err := m.AuthTokenSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionBackoff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionBackoff == nil { + m.ConnectionBackoff = &Backoff{} + } + if err := m.ConnectionBackoff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzParams == nil { + m.AuthAthenzParams = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AuthAthenzParams[mapkey] = mapvalue + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthAthenzSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthAthenzSecret == nil { + m.AuthAthenzSecret = &v1.SecretKeySelector{} + } + if err := m.AuthAthenzSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RateLimit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RateLimit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RateLimit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Unit = RateLimiteUnit(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestsPerUnit", wireType) + } + m.RequestsPerUnit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequestsPerUnit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RedisEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RedisEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RedisEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DB", wireType) + } + m.DB = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DB |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channels = append(m.Channels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RedisStreamEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RedisStreamEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RedisStreamEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DB", wireType) + } + m.DB = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DB |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Streams = append(m.Streams, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxMsgCountPerRead", wireType) + } + m.MaxMsgCountPerRead = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxMsgCountPerRead |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerGroup = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TLS == nil { + m.TLS = &TLSConfig{} + } + if err := m.TLS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &ResourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupVersionResource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GroupVersionResource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventTypes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventTypes = append(m.EventTypes, ResourceEventType(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, Selector{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fields = append(m.Fields, Selector{}) + if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedBy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CreatedBy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AfterStart", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AfterStart = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *S3Artifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: S3Artifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: S3Artifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bucket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bucket == nil { + m.Bucket = &S3Bucket{} + } + if err := m.Bucket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Insecure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Insecure = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &S3Filter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CACertificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CACertificate == nil { + m.CACertificate = &v1.SecretKeySelector{} + } + if err := m.CACertificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *S3Bucket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: S3Bucket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: S3Bucket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *S3Filter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: S3Filter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: S3Filter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Suffix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Suffix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SASLConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SASLConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SASLConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mechanism", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mechanism = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UserSecret == nil { + m.UserSecret = &v1.SecretKeySelector{} + } + if err := m.UserSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PasswordSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PasswordSecret == nil { + m.PasswordSecret = &v1.SecretKeySelector{} + } + if err := m.PasswordSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SFTPEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SFTPEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SFTPEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WatchPathConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WatchPathConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Username == nil { + m.Username = &v1.SecretKeySelector{} + } + if err := m.Username.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Password == nil { + m.Password = &v1.SecretKeySelector{} + } + if err := m.Password.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SSHKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SSHKeySecret == nil { + m.SSHKeySecret = &v1.SecretKeySelector{} + } + if err := m.SSHKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1.SecretKeySelector{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PollIntervalDuration", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PollIntervalDuration = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SNSEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SNSEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SNSEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicArn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicArn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoleARN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoleARN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidateSignature", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ValidateSignature = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SQSEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SQSEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SQSEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccessKey == nil { + m.AccessKey = &v1.SecretKeySelector{} + } + if err := m.AccessKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKey == nil { + m.SecretKey = &v1.SecretKeySelector{} + } + if err := m.SecretKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Queue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WaitTimeSeconds", wireType) + } + m.WaitTimeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WaitTimeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoleARN", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoleARN = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field JSONBody", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.JSONBody = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueAccountID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueueAccountID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DLQ", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DLQ = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SessionToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SessionToken == nil { + m.SessionToken = &v1.SecretKeySelector{} + } + if err := m.SessionToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SchemaRegistryConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SchemaRegistryConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SchemaRegistryConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaID", wireType) + } + m.SchemaID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaID |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecureHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecureHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecureHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValueFrom == nil { + m.ValueFrom = &ValueFromSource{} + } + if err := m.ValueFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Selector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Selector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Selector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Sensor) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sensor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sensor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SensorList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SensorList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SensorList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, Sensor{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SensorSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SensorSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SensorSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dependencies = append(m.Dependencies, EventDependency{}) + if err := m.Dependencies[len(m.Dependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Triggers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Triggers = append(m.Triggers, Trigger{}) + if err := m.Triggers[len(m.Triggers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Template == nil { + m.Template = &Template{} + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorOnFailedRound", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ErrorOnFailedRound = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventBusName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventBusName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Replicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Replicas = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevisionHistoryLimit", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RevisionHistoryLimit = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoggingFields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LoggingFields == nil { + m.LoggingFields = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.LoggingFields[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SensorStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SensorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SensorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Service) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, v1.ServicePort{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClusterIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigningSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SigningSecret == nil { + m.SigningSecret = &v1.SecretKeySelector{} + } + if err := m.SigningSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Token == nil { + m.Token = &v1.SecretKeySelector{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackSender) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackSender: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackSender: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackThread) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackThread: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackThread: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageAggregationKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageAggregationKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BroadcastMessageToChannel", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BroadcastMessageToChannel = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlackTrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlackTrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlackTrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlackToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlackToken == nil { + m.SlackToken = &v1.SecretKeySelector{} + } + if err := m.SlackToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attachments = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocks = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Thread", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Thread.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Sender.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StandardK8STrigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StandardK8STrigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StandardK8STrigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &ArtifactLocation{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = KubernetesResourceOperation(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PatchStrategy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PatchStrategy = k8s_io_apimachinery_pkg_types.PatchType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LiveObject", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LiveObject = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Status) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Status: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Allow = append(m.Allow, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Allow) == 0 { + m.Allow = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Allow = append(m.Allow, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Allow", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageGridEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageGridEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageGridEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &StorageGridFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopicArn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TopicArn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bucket", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bucket = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthToken == nil { + m.AuthToken = &v1.SecretKeySelector{} + } + if err := m.AuthToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageGridFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageGridFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageGridFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Suffix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Suffix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StripeEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StripeEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StripeEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhook", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Webhook == nil { + m.Webhook = &WebhookContext{} + } + if err := m.Webhook.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateWebhook", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CreateWebhook = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.APIKey == nil { + m.APIKey = &v1.SecretKeySelector{} + } + if err := m.APIKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventFilter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventFilter = append(m.EventFilter, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TLSConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TLSConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TLSConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CACertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CACertSecret == nil { + m.CACertSecret = &v1.SecretKeySelector{} + } + if err := m.CACertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientCertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientCertSecret == nil { + m.ClientCertSecret = &v1.SecretKeySelector{} + } + if err := m.ClientCertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientKeySecret == nil { + m.ClientKeySecret = &v1.SecretKeySelector{} + } + if err := m.ClientKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InsecureSkipVerify", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.InsecureSkipVerify = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Template) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Template: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Template: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &v1.Container{} + } + if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, v1.Volume{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &v1.PodSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.NodeSelector[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, v1.Toleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePullSecrets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImagePullSecrets = append(m.ImagePullSecrets, v1.LocalObjectReference{}) + if err := m.ImagePullSecrets[len(m.ImagePullSecrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Affinity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Affinity == nil { + m.Affinity = &v1.Affinity{} + } + if err := m.Affinity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimeFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TimeFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimeFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Start = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stop", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stop = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Trigger) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Trigger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Trigger: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Template == nil { + m.Template = &TriggerTemplate{} + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, TriggerParameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Policy == nil { + m.Policy = &TriggerPolicy{} + } + if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetryStrategy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RetryStrategy == nil { + m.RetryStrategy = &Backoff{} + } + if err := m.RetryStrategy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RateLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RateLimit == nil { + m.RateLimit = &RateLimit{} + } + if err := m.RateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AtLeastOnce", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AtLeastOnce = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DlqTrigger", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DlqTrigger == nil { + m.DlqTrigger = &Trigger{} + } + if err := m.DlqTrigger.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerParameter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerParameter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerParameter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Src", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Src == nil { + m.Src = &TriggerParameterSource{} + } + if err := m.Src.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dest", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dest = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operation = TriggerParameterOperation(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerParameterSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerParameterSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerParameterSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DependencyName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DependencyName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContextKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextTemplate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContextTemplate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataTemplate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataTemplate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UseRawData", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UseRawData = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field K8s", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.K8s == nil { + m.K8s = &K8SResourcePolicy{} + } + if err := m.K8s.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &StatusPolicy{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TriggerTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TriggerTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TriggerTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field K8s", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.K8s == nil { + m.K8s = &StandardK8STrigger{} + } + if err := m.K8s.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArgoWorkflow", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ArgoWorkflow == nil { + m.ArgoWorkflow = &ArgoWorkflowTrigger{} + } + if err := m.ArgoWorkflow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HTTP", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HTTP == nil { + m.HTTP = &HTTPTrigger{} + } + if err := m.HTTP.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AWSLambda", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AWSLambda == nil { + m.AWSLambda = &AWSLambdaTrigger{} + } + if err := m.AWSLambda.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CustomTrigger", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CustomTrigger == nil { + m.CustomTrigger = &CustomTrigger{} + } + if err := m.CustomTrigger.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kafka", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kafka == nil { + m.Kafka = &KafkaTrigger{} + } + if err := m.Kafka.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NATS", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NATS == nil { + m.NATS = &NATSTrigger{} + } + if err := m.NATS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Slack", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Slack == nil { + m.Slack = &SlackTrigger{} + } + if err := m.Slack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OpenWhisk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OpenWhisk == nil { + m.OpenWhisk = &OpenWhiskTrigger{} + } + if err := m.OpenWhisk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Log == nil { + m.Log = &LogTrigger{} + } + if err := m.Log.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureEventHubs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureEventHubs == nil { + m.AzureEventHubs = &AzureEventHubsTrigger{} + } + if err := m.AzureEventHubs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pulsar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pulsar == nil { + m.Pulsar = &PulsarTrigger{} + } + if err := m.Pulsar.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConditionsReset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConditionsReset = append(m.ConditionsReset, ConditionsResetCriteria{}) + if err := m.ConditionsReset[len(m.ConditionsReset)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AzureServiceBus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AzureServiceBus == nil { + m.AzureServiceBus = &AzureServiceBusTrigger{} + } + if err := m.AzureServiceBus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Email", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Email == nil { + m.Email = &EmailTrigger{} + } + if err := m.Email.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *URLArtifact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: URLArtifact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: URLArtifact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyCert", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VerifyCert = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValueFromSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValueFromSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValueFromSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecretKeyRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecretKeyRef == nil { + m.SecretKeyRef = &v1.SecretKeySelector{} + } + if err := m.SecretKeyRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigMapKeyRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConfigMapKeyRef == nil { + m.ConfigMapKeyRef = &v1.ConfigMapKeySelector{} + } + if err := m.ConfigMapKeyRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WatchPathConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WatchPathConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WatchPathConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Directory", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Directory = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PathRegexp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PathRegexp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WebhookContext) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WebhookContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WebhookContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Port = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerCertSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServerCertSecret == nil { + m.ServerCertSecret = &v1.SecretKeySelector{} + } + if err := m.ServerCertSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerKeySecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServerKeySecret == nil { + m.ServerKeySecret = &v1.SecretKeySelector{} + } + if err := m.ServerKeySecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSecret", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSecret == nil { + m.AuthSecret = &v1.SecretKeySelector{} + } + if err := m.AuthSecret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPayloadSize", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxPayloadSize = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WebhookEventSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WebhookEventSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WebhookEventSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebhookContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WebhookContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EventSourceFilter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) +``` + +## `pkg/apis/events/v1alpha1/template.go` (changed lines (3, 4, 15, 16, 62)) + +```go +package v1alpha1 + +import corev1 "k8s.io/api/core/v1" + +// Template holds the information of a deployment template +type Template struct { + // Metadata sets the pods's metadata, i.e. annotations and labels + Metadata *Metadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // ServiceAccountName is the name of the ServiceAccount to use to run sensor pod. + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ + // +optional + ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,2,opt,name=serviceAccountName"` + // Container is the main container image to run in the sensor pod + // +optional + Container *corev1.Container `json:"container,omitempty" protobuf:"bytes,3,opt,name=container"` + // Volumes is a list of volumes that can be mounted by containers in a workflow. + // +patchStrategy=merge + // +patchMergeKey=name + // +optional + Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,4,rep,name=volumes"` + // SecurityContext holds pod-level security attributes and common container settings. + // Optional: Defaults to empty. See type description for default values of each field. + // +optional + SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,5,opt,name=securityContext"` + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,6,rep,name=nodeSelector"` + // If specified, the pod's tolerations. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,7,rep,name=tolerations"` + // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. + // If specified, these secrets will be passed to individual puller implementations for them to use. For example, + // in the case of docker, only DockerConfig type secrets are honored. + // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,8,rep,name=imagePullSecrets"` + // If specified, indicates the EventSource pod's priority. "system-node-critical" + // and "system-cluster-critical" are two special keywords which indicate the + // highest priorities with the former being the highest priority. Any other + // name must be defined by creating a PriorityClass object with that name. + // If not specified, the pod priority will be default or zero if there is no + // default. + // More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ + // +optional + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,9,opt,name=priorityClassName"` + // The priority value. Various system components use this field to find the + // priority of the EventSource pod. When Priority Admission Controller is enabled, + // it prevents users from setting this field. The admission controller populates + // this field from PriorityClassName. + // The higher the value, the higher the priority. + // More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ + // +optional + Priority *int32 `json:"priority,omitempty" protobuf:"bytes,10,opt,name=priority"` + // If specified, the pod's scheduling constraints + // +optional + Affinity *corev1.Affinity `json:"affinity,omitempty" protobuf:"bytes,11,opt,name=affinity"` +} +``` + +## `pkg/apis/events/v1alpha1/zz_generated.deepcopy.go` (changed lines (912, 4143, 4144)) + +```go +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPConsumeConfig) DeepCopyInto(out *AMQPConsumeConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPConsumeConfig. +func (in *AMQPConsumeConfig) DeepCopy() *AMQPConsumeConfig { + if in == nil { + return nil + } + out := new(AMQPConsumeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPEventSource) DeepCopyInto(out *AMQPEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExchangeDeclare != nil { + in, out := &in.ExchangeDeclare, &out.ExchangeDeclare + *out = new(AMQPExchangeDeclareConfig) + **out = **in + } + if in.QueueDeclare != nil { + in, out := &in.QueueDeclare, &out.QueueDeclare + *out = new(AMQPQueueDeclareConfig) + **out = **in + } + if in.QueueBind != nil { + in, out := &in.QueueBind, &out.QueueBind + *out = new(AMQPQueueBindConfig) + **out = **in + } + if in.Consume != nil { + in, out := &in.Consume, &out.Consume + *out = new(AMQPConsumeConfig) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.URLSecret != nil { + in, out := &in.URLSecret, &out.URLSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPEventSource. +func (in *AMQPEventSource) DeepCopy() *AMQPEventSource { + if in == nil { + return nil + } + out := new(AMQPEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPExchangeDeclareConfig) DeepCopyInto(out *AMQPExchangeDeclareConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPExchangeDeclareConfig. +func (in *AMQPExchangeDeclareConfig) DeepCopy() *AMQPExchangeDeclareConfig { + if in == nil { + return nil + } + out := new(AMQPExchangeDeclareConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPQueueBindConfig) DeepCopyInto(out *AMQPQueueBindConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPQueueBindConfig. +func (in *AMQPQueueBindConfig) DeepCopy() *AMQPQueueBindConfig { + if in == nil { + return nil + } + out := new(AMQPQueueBindConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMQPQueueDeclareConfig) DeepCopyInto(out *AMQPQueueDeclareConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMQPQueueDeclareConfig. +func (in *AMQPQueueDeclareConfig) DeepCopy() *AMQPQueueDeclareConfig { + if in == nil { + return nil + } + out := new(AMQPQueueDeclareConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLambdaTrigger) DeepCopyInto(out *AWSLambdaTrigger) { + *out = *in + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InvocationType != nil { + in, out := &in.InvocationType, &out.InvocationType + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLambdaTrigger. +func (in *AWSLambdaTrigger) DeepCopy() *AWSLambdaTrigger { + if in == nil { + return nil + } + out := new(AWSLambdaTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Amount) DeepCopyInto(out *Amount) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Amount. +func (in *Amount) DeepCopy() *Amount { + if in == nil { + return nil + } + out := new(Amount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArgoWorkflowTrigger) DeepCopyInto(out *ArgoWorkflowTrigger) { + *out = *in + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(ArtifactLocation) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoWorkflowTrigger. +func (in *ArgoWorkflowTrigger) DeepCopy() *ArgoWorkflowTrigger { + if in == nil { + return nil + } + out := new(ArgoWorkflowTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ArtifactLocation) DeepCopyInto(out *ArtifactLocation) { + *out = *in + if in.S3 != nil { + in, out := &in.S3, &out.S3 + *out = new(S3Artifact) + (*in).DeepCopyInto(*out) + } + if in.Inline != nil { + in, out := &in.Inline, &out.Inline + *out = new(string) + **out = **in + } + if in.File != nil { + in, out := &in.File, &out.File + *out = new(FileArtifact) + **out = **in + } + if in.URL != nil { + in, out := &in.URL, &out.URL + *out = new(URLArtifact) + **out = **in + } + if in.Configmap != nil { + in, out := &in.Configmap, &out.Configmap + *out = new(v1.ConfigMapKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitArtifact) + (*in).DeepCopyInto(*out) + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = new(K8SResource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactLocation. +func (in *ArtifactLocation) DeepCopy() *ArtifactLocation { + if in == nil { + return nil + } + out := new(ArtifactLocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureEventHubsTrigger) DeepCopyInto(out *AzureEventHubsTrigger) { + *out = *in + if in.SharedAccessKeyName != nil { + in, out := &in.SharedAccessKeyName, &out.SharedAccessKeyName + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SharedAccessKey != nil { + in, out := &in.SharedAccessKey, &out.SharedAccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureEventHubsTrigger. +func (in *AzureEventHubsTrigger) DeepCopy() *AzureEventHubsTrigger { + if in == nil { + return nil + } + out := new(AzureEventHubsTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureEventsHubEventSource) DeepCopyInto(out *AzureEventsHubEventSource) { + *out = *in + if in.SharedAccessKeyName != nil { + in, out := &in.SharedAccessKeyName, &out.SharedAccessKeyName + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SharedAccessKey != nil { + in, out := &in.SharedAccessKey, &out.SharedAccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureEventsHubEventSource. +func (in *AzureEventsHubEventSource) DeepCopy() *AzureEventsHubEventSource { + if in == nil { + return nil + } + out := new(AzureEventsHubEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureQueueStorageEventSource) DeepCopyInto(out *AzureQueueStorageEventSource) { + *out = *in + if in.ConnectionString != nil { + in, out := &in.ConnectionString, &out.ConnectionString + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.WaitTimeInSeconds != nil { + in, out := &in.WaitTimeInSeconds, &out.WaitTimeInSeconds + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureQueueStorageEventSource. +func (in *AzureQueueStorageEventSource) DeepCopy() *AzureQueueStorageEventSource { + if in == nil { + return nil + } + out := new(AzureQueueStorageEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureServiceBusEventSource) DeepCopyInto(out *AzureServiceBusEventSource) { + *out = *in + if in.ConnectionString != nil { + in, out := &in.ConnectionString, &out.ConnectionString + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureServiceBusEventSource. +func (in *AzureServiceBusEventSource) DeepCopy() *AzureServiceBusEventSource { + if in == nil { + return nil + } + out := new(AzureServiceBusEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureServiceBusTrigger) DeepCopyInto(out *AzureServiceBusTrigger) { + *out = *in + if in.ConnectionString != nil { + in, out := &in.ConnectionString, &out.ConnectionString + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureServiceBusTrigger. +func (in *AzureServiceBusTrigger) DeepCopy() *AzureServiceBusTrigger { + if in == nil { + return nil + } + out := new(AzureServiceBusTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Backoff) DeepCopyInto(out *Backoff) { + *out = *in + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(Int64OrString) + **out = **in + } + if in.Factor != nil { + in, out := &in.Factor, &out.Factor + *out = new(Amount) + (*in).DeepCopyInto(*out) + } + if in.Jitter != nil { + in, out := &in.Jitter, &out.Jitter + *out = new(Amount) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backoff. +func (in *Backoff) DeepCopy() *Backoff { + if in == nil { + return nil + } + out := new(Backoff) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth. +func (in *BasicAuth) DeepCopy() *BasicAuth { + if in == nil { + return nil + } + out := new(BasicAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketAuth) DeepCopyInto(out *BitbucketAuth) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BitbucketBasicAuth) + (*in).DeepCopyInto(*out) + } + if in.OAuthToken != nil { + in, out := &in.OAuthToken, &out.OAuthToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketAuth. +func (in *BitbucketAuth) DeepCopy() *BitbucketAuth { + if in == nil { + return nil + } + out := new(BitbucketAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketBasicAuth) DeepCopyInto(out *BitbucketBasicAuth) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketBasicAuth. +func (in *BitbucketBasicAuth) DeepCopy() *BitbucketBasicAuth { + if in == nil { + return nil + } + out := new(BitbucketBasicAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketEventSource) DeepCopyInto(out *BitbucketEventSource) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BitbucketAuth) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]BitbucketRepository, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketEventSource. +func (in *BitbucketEventSource) DeepCopy() *BitbucketEventSource { + if in == nil { + return nil + } + out := new(BitbucketEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketRepository) DeepCopyInto(out *BitbucketRepository) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketRepository. +func (in *BitbucketRepository) DeepCopy() *BitbucketRepository { + if in == nil { + return nil + } + out := new(BitbucketRepository) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketServerEventSource) DeepCopyInto(out *BitbucketServerEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Projects != nil { + in, out := &in.Projects, &out.Projects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]BitbucketServerRepository, len(*in)) + copy(*out, *in) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AccessToken != nil { + in, out := &in.AccessToken, &out.AccessToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.WebhookSecret != nil { + in, out := &in.WebhookSecret, &out.WebhookSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerEventSource. +func (in *BitbucketServerEventSource) DeepCopy() *BitbucketServerEventSource { + if in == nil { + return nil + } + out := new(BitbucketServerEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BitbucketServerRepository) DeepCopyInto(out *BitbucketServerRepository) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerRepository. +func (in *BitbucketServerRepository) DeepCopy() *BitbucketServerRepository { + if in == nil { + return nil + } + out := new(BitbucketServerRepository) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BusConfig) DeepCopyInto(out *BusConfig) { + *out = *in + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = new(NATSConfig) + (*in).DeepCopyInto(*out) + } + if in.JetStream != nil { + in, out := &in.JetStream, &out.JetStream + *out = new(JetStreamConfig) + (*in).DeepCopyInto(*out) + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = new(KafkaBus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusConfig. +func (in *BusConfig) DeepCopy() *BusConfig { + if in == nil { + return nil + } + out := new(BusConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CalendarEventSource) DeepCopyInto(out *CalendarEventSource) { + *out = *in + if in.ExclusionDates != nil { + in, out := &in.ExclusionDates, &out.ExclusionDates + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(EventPersistence) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CalendarEventSource. +func (in *CalendarEventSource) DeepCopy() *CalendarEventSource { + if in == nil { + return nil + } + out := new(CalendarEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatchupConfiguration) DeepCopyInto(out *CatchupConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatchupConfiguration. +func (in *CatchupConfiguration) DeepCopy() *CatchupConfiguration { + if in == nil { + return nil + } + out := new(CatchupConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionsResetByTime) DeepCopyInto(out *ConditionsResetByTime) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionsResetByTime. +func (in *ConditionsResetByTime) DeepCopy() *ConditionsResetByTime { + if in == nil { + return nil + } + out := new(ConditionsResetByTime) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionsResetCriteria) DeepCopyInto(out *ConditionsResetCriteria) { + *out = *in + if in.ByTime != nil { + in, out := &in.ByTime, &out.ByTime + *out = new(ConditionsResetByTime) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionsResetCriteria. +func (in *ConditionsResetCriteria) DeepCopy() *ConditionsResetCriteria { + if in == nil { + return nil + } + out := new(ConditionsResetCriteria) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapPersistence) DeepCopyInto(out *ConfigMapPersistence) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapPersistence. +func (in *ConfigMapPersistence) DeepCopy() *ConfigMapPersistence { + if in == nil { + return nil + } + out := new(ConfigMapPersistence) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate) { + *out = *in + in.Resources.DeepCopyInto(&out.Resources) + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerTemplate. +func (in *ContainerTemplate) DeepCopy() *ContainerTemplate { + if in == nil { + return nil + } + out := new(ContainerTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomTrigger) DeepCopyInto(out *CustomTrigger) { + *out = *in + if in.CertSecret != nil { + in, out := &in.CertSecret, &out.CertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomTrigger. +func (in *CustomTrigger) DeepCopy() *CustomTrigger { + if in == nil { + return nil + } + out := new(CustomTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataFilter) DeepCopyInto(out *DataFilter) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataFilter. +func (in *DataFilter) DeepCopy() *DataFilter { + if in == nil { + return nil + } + out := new(DataFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EmailTrigger) DeepCopyInto(out *EmailTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SMTPPassword != nil { + in, out := &in.SMTPPassword, &out.SMTPPassword + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.To != nil { + in, out := &in.To, &out.To + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmailTrigger. +func (in *EmailTrigger) DeepCopy() *EmailTrigger { + if in == nil { + return nil + } + out := new(EmailTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EmitterEventSource) DeepCopyInto(out *EmitterEventSource) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmitterEventSource. +func (in *EmitterEventSource) DeepCopy() *EmitterEventSource { + if in == nil { + return nil + } + out := new(EmitterEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Event) DeepCopyInto(out *Event) { + *out = *in + if in.Context != nil { + in, out := &in.Context, &out.Context + *out = new(EventContext) + (*in).DeepCopyInto(*out) + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Event. +func (in *Event) DeepCopy() *Event { + if in == nil { + return nil + } + out := new(Event) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBus) DeepCopyInto(out *EventBus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBus. +func (in *EventBus) DeepCopy() *EventBus { + if in == nil { + return nil + } + out := new(EventBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventBus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBusList) DeepCopyInto(out *EventBusList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EventBus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBusList. +func (in *EventBusList) DeepCopy() *EventBusList { + if in == nil { + return nil + } + out := new(EventBusList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventBusList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBusSpec) DeepCopyInto(out *EventBusSpec) { + *out = *in + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = new(NATSBus) + (*in).DeepCopyInto(*out) + } + if in.JetStream != nil { + in, out := &in.JetStream, &out.JetStream + *out = new(JetStreamBus) + (*in).DeepCopyInto(*out) + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = new(KafkaBus) + (*in).DeepCopyInto(*out) + } + if in.JetStreamExotic != nil { + in, out := &in.JetStreamExotic, &out.JetStreamExotic + *out = new(JetStreamConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBusSpec. +func (in *EventBusSpec) DeepCopy() *EventBusSpec { + if in == nil { + return nil + } + out := new(EventBusSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBusStatus) DeepCopyInto(out *EventBusStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + in.Config.DeepCopyInto(&out.Config) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBusStatus. +func (in *EventBusStatus) DeepCopy() *EventBusStatus { + if in == nil { + return nil + } + out := new(EventBusStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventContext) DeepCopyInto(out *EventContext) { + *out = *in + in.Time.DeepCopyInto(&out.Time) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventContext. +func (in *EventContext) DeepCopy() *EventContext { + if in == nil { + return nil + } + out := new(EventContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventDependency) DeepCopyInto(out *EventDependency) { + *out = *in + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = new(EventDependencyFilter) + (*in).DeepCopyInto(*out) + } + if in.Transform != nil { + in, out := &in.Transform, &out.Transform + *out = new(EventDependencyTransformer) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventDependency. +func (in *EventDependency) DeepCopy() *EventDependency { + if in == nil { + return nil + } + out := new(EventDependency) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventDependencyFilter) DeepCopyInto(out *EventDependencyFilter) { + *out = *in + if in.Time != nil { + in, out := &in.Time, &out.Time + *out = new(TimeFilter) + **out = **in + } + if in.Context != nil { + in, out := &in.Context, &out.Context + *out = new(EventContext) + (*in).DeepCopyInto(*out) + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make([]DataFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Exprs != nil { + in, out := &in.Exprs, &out.Exprs + *out = make([]ExprFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventDependencyFilter. +func (in *EventDependencyFilter) DeepCopy() *EventDependencyFilter { + if in == nil { + return nil + } + out := new(EventDependencyFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventDependencyTransformer) DeepCopyInto(out *EventDependencyTransformer) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventDependencyTransformer. +func (in *EventDependencyTransformer) DeepCopy() *EventDependencyTransformer { + if in == nil { + return nil + } + out := new(EventDependencyTransformer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPersistence) DeepCopyInto(out *EventPersistence) { + *out = *in + if in.Catchup != nil { + in, out := &in.Catchup, &out.Catchup + *out = new(CatchupConfiguration) + **out = **in + } + if in.ConfigMap != nil { + in, out := &in.ConfigMap, &out.ConfigMap + *out = new(ConfigMapPersistence) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPersistence. +func (in *EventPersistence) DeepCopy() *EventPersistence { + if in == nil { + return nil + } + out := new(EventPersistence) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSource) DeepCopyInto(out *EventSource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSource. +func (in *EventSource) DeepCopy() *EventSource { + if in == nil { + return nil + } + out := new(EventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventSource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceFilter) DeepCopyInto(out *EventSourceFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceFilter. +func (in *EventSourceFilter) DeepCopy() *EventSourceFilter { + if in == nil { + return nil + } + out := new(EventSourceFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceList) DeepCopyInto(out *EventSourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EventSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceList. +func (in *EventSourceList) DeepCopy() *EventSourceList { + if in == nil { + return nil + } + out := new(EventSourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventSourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceSpec) DeepCopyInto(out *EventSourceSpec) { + *out = *in + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(Template) + (*in).DeepCopyInto(*out) + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(Service) + (*in).DeepCopyInto(*out) + } + if in.Minio != nil { + in, out := &in.Minio, &out.Minio + *out = make(map[string]S3Artifact, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Calendar != nil { + in, out := &in.Calendar, &out.Calendar + *out = make(map[string]CalendarEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.File != nil { + in, out := &in.File, &out.File + *out = make(map[string]FileEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = make(map[string]ResourceEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = make(map[string]WebhookEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AMQP != nil { + in, out := &in.AMQP, &out.AMQP + *out = make(map[string]AMQPEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = make(map[string]KafkaEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.MQTT != nil { + in, out := &in.MQTT, &out.MQTT + *out = make(map[string]MQTTEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = make(map[string]NATSEventsSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.SNS != nil { + in, out := &in.SNS, &out.SNS + *out = make(map[string]SNSEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.SQS != nil { + in, out := &in.SQS, &out.SQS + *out = make(map[string]SQSEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.PubSub != nil { + in, out := &in.PubSub, &out.PubSub + *out = make(map[string]PubSubEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Github != nil { + in, out := &in.Github, &out.Github + *out = make(map[string]GithubEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Gitlab != nil { + in, out := &in.Gitlab, &out.Gitlab + *out = make(map[string]GitlabEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.HDFS != nil { + in, out := &in.HDFS, &out.HDFS + *out = make(map[string]HDFSEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Slack != nil { + in, out := &in.Slack, &out.Slack + *out = make(map[string]SlackEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.StorageGrid != nil { + in, out := &in.StorageGrid, &out.StorageGrid + *out = make(map[string]StorageGridEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AzureEventsHub != nil { + in, out := &in.AzureEventsHub, &out.AzureEventsHub + *out = make(map[string]AzureEventsHubEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Stripe != nil { + in, out := &in.Stripe, &out.Stripe + *out = make(map[string]StripeEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Emitter != nil { + in, out := &in.Emitter, &out.Emitter + *out = make(map[string]EmitterEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Redis != nil { + in, out := &in.Redis, &out.Redis + *out = make(map[string]RedisEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.NSQ != nil { + in, out := &in.NSQ, &out.NSQ + *out = make(map[string]NSQEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Pulsar != nil { + in, out := &in.Pulsar, &out.Pulsar + *out = make(map[string]PulsarEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Generic != nil { + in, out := &in.Generic, &out.Generic + *out = make(map[string]GenericEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.BitbucketServer != nil { + in, out := &in.BitbucketServer, &out.BitbucketServer + *out = make(map[string]BitbucketServerEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Bitbucket != nil { + in, out := &in.Bitbucket, &out.Bitbucket + *out = make(map[string]BitbucketEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.RedisStream != nil { + in, out := &in.RedisStream, &out.RedisStream + *out = make(map[string]RedisStreamEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AzureServiceBus != nil { + in, out := &in.AzureServiceBus, &out.AzureServiceBus + *out = make(map[string]AzureServiceBusEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AzureQueueStorage != nil { + in, out := &in.AzureQueueStorage, &out.AzureQueueStorage + *out = make(map[string]AzureQueueStorageEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.SFTP != nil { + in, out := &in.SFTP, &out.SFTP + *out = make(map[string]SFTPEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Gerrit != nil { + in, out := &in.Gerrit, &out.Gerrit + *out = make(map[string]GerritEventSource, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceSpec. +func (in *EventSourceSpec) DeepCopy() *EventSourceSpec { + if in == nil { + return nil + } + out := new(EventSourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSourceStatus) DeepCopyInto(out *EventSourceStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceStatus. +func (in *EventSourceStatus) DeepCopy() *EventSourceStatus { + if in == nil { + return nil + } + out := new(EventSourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExprFilter) DeepCopyInto(out *ExprFilter) { + *out = *in + if in.Fields != nil { + in, out := &in.Fields, &out.Fields + *out = make([]PayloadField, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExprFilter. +func (in *ExprFilter) DeepCopy() *ExprFilter { + if in == nil { + return nil + } + out := new(ExprFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FileArtifact) DeepCopyInto(out *FileArtifact) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileArtifact. +func (in *FileArtifact) DeepCopy() *FileArtifact { + if in == nil { + return nil + } + out := new(FileArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FileEventSource) DeepCopyInto(out *FileEventSource) { + *out = *in + out.WatchPathConfig = in.WatchPathConfig + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileEventSource. +func (in *FileEventSource) DeepCopy() *FileEventSource { + if in == nil { + return nil + } + out := new(FileEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GenericEventSource) DeepCopyInto(out *GenericEventSource) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthSecret != nil { + in, out := &in.AuthSecret, &out.AuthSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericEventSource. +func (in *GenericEventSource) DeepCopy() *GenericEventSource { + if in == nil { + return nil + } + out := new(GenericEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GerritEventSource) DeepCopyInto(out *GerritEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Projects != nil { + in, out := &in.Projects, &out.Projects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GerritEventSource. +func (in *GerritEventSource) DeepCopy() *GerritEventSource { + if in == nil { + return nil + } + out := new(GerritEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitArtifact) DeepCopyInto(out *GitArtifact) { + *out = *in + if in.Creds != nil { + in, out := &in.Creds, &out.Creds + *out = new(GitCreds) + (*in).DeepCopyInto(*out) + } + if in.SSHKeySecret != nil { + in, out := &in.SSHKeySecret, &out.SSHKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Remote != nil { + in, out := &in.Remote, &out.Remote + *out = new(GitRemoteConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitArtifact. +func (in *GitArtifact) DeepCopy() *GitArtifact { + if in == nil { + return nil + } + out := new(GitArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitCreds) DeepCopyInto(out *GitCreds) { + *out = *in + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCreds. +func (in *GitCreds) DeepCopy() *GitCreds { + if in == nil { + return nil + } + out := new(GitCreds) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitRemoteConfig) DeepCopyInto(out *GitRemoteConfig) { + *out = *in + if in.URLS != nil { + in, out := &in.URLS, &out.URLS + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRemoteConfig. +func (in *GitRemoteConfig) DeepCopy() *GitRemoteConfig { + if in == nil { + return nil + } + out := new(GitRemoteConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GithubAppCreds) DeepCopyInto(out *GithubAppCreds) { + *out = *in + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubAppCreds. +func (in *GithubAppCreds) DeepCopy() *GithubAppCreds { + if in == nil { + return nil + } + out := new(GithubAppCreds) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GithubEventSource) DeepCopyInto(out *GithubEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.APIToken != nil { + in, out := &in.APIToken, &out.APIToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.WebhookSecret != nil { + in, out := &in.WebhookSecret, &out.WebhookSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Repositories != nil { + in, out := &in.Repositories, &out.Repositories + *out = make([]OwnedRepositories, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Organizations != nil { + in, out := &in.Organizations, &out.Organizations + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.GithubApp != nil { + in, out := &in.GithubApp, &out.GithubApp + *out = new(GithubAppCreds) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubEventSource. +func (in *GithubEventSource) DeepCopy() *GithubEventSource { + if in == nil { + return nil + } + out := new(GithubEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitlabEventSource) DeepCopyInto(out *GitlabEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AccessToken != nil { + in, out := &in.AccessToken, &out.AccessToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Projects != nil { + in, out := &in.Projects, &out.Projects + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SecretToken != nil { + in, out := &in.SecretToken, &out.SecretToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabEventSource. +func (in *GitlabEventSource) DeepCopy() *GitlabEventSource { + if in == nil { + return nil + } + out := new(GitlabEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HDFSEventSource) DeepCopyInto(out *HDFSEventSource) { + *out = *in + out.WatchPathConfig = in.WatchPathConfig + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.KrbCCacheSecret != nil { + in, out := &in.KrbCCacheSecret, &out.KrbCCacheSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.KrbKeytabSecret != nil { + in, out := &in.KrbKeytabSecret, &out.KrbKeytabSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.KrbConfigConfigMap != nil { + in, out := &in.KrbConfigConfigMap, &out.KrbConfigConfigMap + *out = new(v1.ConfigMapKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDFSEventSource. +func (in *HDFSEventSource) DeepCopy() *HDFSEventSource { + if in == nil { + return nil + } + out := new(HDFSEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPTrigger) DeepCopyInto(out *HTTPTrigger) { + *out = *in + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.BasicAuth != nil { + in, out := &in.BasicAuth, &out.BasicAuth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecureHeaders != nil { + in, out := &in.SecureHeaders, &out.SecureHeaders + *out = make([]*SecureHeader, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(SecureHeader) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPTrigger. +func (in *HTTPTrigger) DeepCopy() *HTTPTrigger { + if in == nil { + return nil + } + out := new(HTTPTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Int64OrString) DeepCopyInto(out *Int64OrString) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Int64OrString. +func (in *Int64OrString) DeepCopy() *Int64OrString { + if in == nil { + return nil + } + out := new(Int64OrString) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JetStreamBus) DeepCopyInto(out *JetStreamBus) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.ContainerTemplate != nil { + in, out := &in.ContainerTemplate, &out.ContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.ReloaderContainerTemplate != nil { + in, out := &in.ReloaderContainerTemplate, &out.ReloaderContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.MetricsContainerTemplate != nil { + in, out := &in.MetricsContainerTemplate, &out.MetricsContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(PersistenceStrategy) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Settings != nil { + in, out := &in.Settings, &out.Settings + *out = new(string) + **out = **in + } + if in.StartArgs != nil { + in, out := &in.StartArgs, &out.StartArgs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.StreamConfig != nil { + in, out := &in.StreamConfig, &out.StreamConfig + *out = new(string) + **out = **in + } + if in.MaxPayload != nil { + in, out := &in.MaxPayload, &out.MaxPayload + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JetStreamBus. +func (in *JetStreamBus) DeepCopy() *JetStreamBus { + if in == nil { + return nil + } + out := new(JetStreamBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JetStreamConfig) DeepCopyInto(out *JetStreamConfig) { + *out = *in + if in.AccessSecret != nil { + in, out := &in.AccessSecret, &out.AccessSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JetStreamConfig. +func (in *JetStreamConfig) DeepCopy() *JetStreamConfig { + if in == nil { + return nil + } + out := new(JetStreamConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *K8SResource) DeepCopyInto(out *K8SResource) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K8SResource. +func (in *K8SResource) DeepCopy() *K8SResource { + if in == nil { + return nil + } + out := new(K8SResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *K8SResourcePolicy) DeepCopyInto(out *K8SResourcePolicy) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Backoff != nil { + in, out := &in.Backoff, &out.Backoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new K8SResourcePolicy. +func (in *K8SResourcePolicy) DeepCopy() *K8SResourcePolicy { + if in == nil { + return nil + } + out := new(K8SResourcePolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaBus) DeepCopyInto(out *KafkaBus) { + *out = *in + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.SASL != nil { + in, out := &in.SASL, &out.SASL + *out = new(SASLConfig) + (*in).DeepCopyInto(*out) + } + if in.ConsumerGroup != nil { + in, out := &in.ConsumerGroup, &out.ConsumerGroup + *out = new(KafkaConsumerGroup) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaBus. +func (in *KafkaBus) DeepCopy() *KafkaBus { + if in == nil { + return nil + } + out := new(KafkaBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaConsumerGroup) DeepCopyInto(out *KafkaConsumerGroup) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaConsumerGroup. +func (in *KafkaConsumerGroup) DeepCopy() *KafkaConsumerGroup { + if in == nil { + return nil + } + out := new(KafkaConsumerGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaEventSource) DeepCopyInto(out *KafkaEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ConsumerGroup != nil { + in, out := &in.ConsumerGroup, &out.ConsumerGroup + *out = new(KafkaConsumerGroup) + **out = **in + } + if in.SASL != nil { + in, out := &in.SASL, &out.SASL + *out = new(SASLConfig) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaEventSource. +func (in *KafkaEventSource) DeepCopy() *KafkaEventSource { + if in == nil { + return nil + } + out := new(KafkaEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KafkaTrigger) DeepCopyInto(out *KafkaTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PartitioningKey != nil { + in, out := &in.PartitioningKey, &out.PartitioningKey + *out = new(string) + **out = **in + } + if in.SASL != nil { + in, out := &in.SASL, &out.SASL + *out = new(SASLConfig) + (*in).DeepCopyInto(*out) + } + if in.SchemaRegistry != nil { + in, out := &in.SchemaRegistry, &out.SchemaRegistry + *out = new(SchemaRegistryConfig) + (*in).DeepCopyInto(*out) + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecureHeaders != nil { + in, out := &in.SecureHeaders, &out.SecureHeaders + *out = make([]*SecureHeader, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(SecureHeader) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaTrigger. +func (in *KafkaTrigger) DeepCopy() *KafkaTrigger { + if in == nil { + return nil + } + out := new(KafkaTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogTrigger) DeepCopyInto(out *LogTrigger) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogTrigger. +func (in *LogTrigger) DeepCopy() *LogTrigger { + if in == nil { + return nil + } + out := new(LogTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MQTTEventSource) DeepCopyInto(out *MQTTEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MQTTEventSource. +func (in *MQTTEventSource) DeepCopy() *MQTTEventSource { + if in == nil { + return nil + } + out := new(MQTTEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Metadata) DeepCopyInto(out *Metadata) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata. +func (in *Metadata) DeepCopy() *Metadata { + if in == nil { + return nil + } + out := new(Metadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSAuth) DeepCopyInto(out *NATSAuth) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicAuth) + (*in).DeepCopyInto(*out) + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.NKey != nil { + in, out := &in.NKey, &out.NKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Credential != nil { + in, out := &in.Credential, &out.Credential + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSAuth. +func (in *NATSAuth) DeepCopy() *NATSAuth { + if in == nil { + return nil + } + out := new(NATSAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSBus) DeepCopyInto(out *NATSBus) { + *out = *in + if in.Native != nil { + in, out := &in.Native, &out.Native + *out = new(NativeStrategy) + (*in).DeepCopyInto(*out) + } + if in.Exotic != nil { + in, out := &in.Exotic, &out.Exotic + *out = new(NATSConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSBus. +func (in *NATSBus) DeepCopy() *NATSBus { + if in == nil { + return nil + } + out := new(NATSBus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSConfig) DeepCopyInto(out *NATSConfig) { + *out = *in + if in.ClusterID != nil { + in, out := &in.ClusterID, &out.ClusterID + *out = new(string) + **out = **in + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(AuthStrategy) + **out = **in + } + if in.AccessSecret != nil { + in, out := &in.AccessSecret, &out.AccessSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSConfig. +func (in *NATSConfig) DeepCopy() *NATSConfig { + if in == nil { + return nil + } + out := new(NATSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSEventsSource) DeepCopyInto(out *NATSEventsSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(NATSAuth) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.Queue != nil { + in, out := &in.Queue, &out.Queue + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSEventsSource. +func (in *NATSEventsSource) DeepCopy() *NATSEventsSource { + if in == nil { + return nil + } + out := new(NATSEventsSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NATSTrigger) DeepCopyInto(out *NATSTrigger) { + *out = *in + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(NATSAuth) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NATSTrigger. +func (in *NATSTrigger) DeepCopy() *NATSTrigger { + if in == nil { + return nil + } + out := new(NATSTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NSQEventSource) DeepCopyInto(out *NSQEventSource) { + *out = *in + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NSQEventSource. +func (in *NSQEventSource) DeepCopy() *NSQEventSource { + if in == nil { + return nil + } + out := new(NSQEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NativeStrategy) DeepCopyInto(out *NativeStrategy) { + *out = *in + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(AuthStrategy) + **out = **in + } + if in.Persistence != nil { + in, out := &in.Persistence, &out.Persistence + *out = new(PersistenceStrategy) + (*in).DeepCopyInto(*out) + } + if in.ContainerTemplate != nil { + in, out := &in.ContainerTemplate, &out.ContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.MetricsContainerTemplate != nil { + in, out := &in.MetricsContainerTemplate, &out.MetricsContainerTemplate + *out = new(ContainerTemplate) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.MaxAge != nil { + in, out := &in.MaxAge, &out.MaxAge + *out = new(string) + **out = **in + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.MaxMsgs != nil { + in, out := &in.MaxMsgs, &out.MaxMsgs + *out = new(uint64) + **out = **in + } + if in.MaxBytes != nil { + in, out := &in.MaxBytes, &out.MaxBytes + *out = new(string) + **out = **in + } + if in.MaxSubs != nil { + in, out := &in.MaxSubs, &out.MaxSubs + *out = new(uint64) + **out = **in + } + if in.MaxPayload != nil { + in, out := &in.MaxPayload, &out.MaxPayload + *out = new(string) + **out = **in + } + if in.RaftHeartbeatTimeout != nil { + in, out := &in.RaftHeartbeatTimeout, &out.RaftHeartbeatTimeout + *out = new(string) + **out = **in + } + if in.RaftElectionTimeout != nil { + in, out := &in.RaftElectionTimeout, &out.RaftElectionTimeout + *out = new(string) + **out = **in + } + if in.RaftLeaseTimeout != nil { + in, out := &in.RaftLeaseTimeout, &out.RaftLeaseTimeout + *out = new(string) + **out = **in + } + if in.RaftCommitTimeout != nil { + in, out := &in.RaftCommitTimeout, &out.RaftCommitTimeout + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NativeStrategy. +func (in *NativeStrategy) DeepCopy() *NativeStrategy { + if in == nil { + return nil + } + out := new(NativeStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenWhiskTrigger) DeepCopyInto(out *OpenWhiskTrigger) { + *out = *in + if in.AuthToken != nil { + in, out := &in.AuthToken, &out.AuthToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenWhiskTrigger. +func (in *OpenWhiskTrigger) DeepCopy() *OpenWhiskTrigger { + if in == nil { + return nil + } + out := new(OpenWhiskTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OwnedRepositories) DeepCopyInto(out *OwnedRepositories) { + *out = *in + if in.Names != nil { + in, out := &in.Names, &out.Names + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnedRepositories. +func (in *OwnedRepositories) DeepCopy() *OwnedRepositories { + if in == nil { + return nil + } + out := new(OwnedRepositories) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PayloadField) DeepCopyInto(out *PayloadField) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PayloadField. +func (in *PayloadField) DeepCopy() *PayloadField { + if in == nil { + return nil + } + out := new(PayloadField) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistenceStrategy) DeepCopyInto(out *PersistenceStrategy) { + *out = *in + if in.StorageClassName != nil { + in, out := &in.StorageClassName, &out.StorageClassName + *out = new(string) + **out = **in + } + if in.AccessMode != nil { + in, out := &in.AccessMode, &out.AccessMode + *out = new(v1.PersistentVolumeAccessMode) + **out = **in + } + if in.VolumeSize != nil { + in, out := &in.VolumeSize, &out.VolumeSize + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceStrategy. +func (in *PersistenceStrategy) DeepCopy() *PersistenceStrategy { + if in == nil { + return nil + } + out := new(PersistenceStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PubSubEventSource) DeepCopyInto(out *PubSubEventSource) { + *out = *in + if in.CredentialSecret != nil { + in, out := &in.CredentialSecret, &out.CredentialSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PubSubEventSource. +func (in *PubSubEventSource) DeepCopy() *PubSubEventSource { + if in == nil { + return nil + } + out := new(PubSubEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PulsarEventSource) DeepCopyInto(out *PulsarEventSource) { + *out = *in + if in.Topics != nil { + in, out := &in.Topics, &out.Topics + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLSTrustCertsSecret != nil { + in, out := &in.TLSTrustCertsSecret, &out.TLSTrustCertsSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthTokenSecret != nil { + in, out := &in.AuthTokenSecret, &out.AuthTokenSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.AuthAthenzParams != nil { + in, out := &in.AuthAthenzParams, &out.AuthAthenzParams + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthAthenzSecret != nil { + in, out := &in.AuthAthenzSecret, &out.AuthAthenzSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PulsarEventSource. +func (in *PulsarEventSource) DeepCopy() *PulsarEventSource { + if in == nil { + return nil + } + out := new(PulsarEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PulsarTrigger) DeepCopyInto(out *PulsarTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Payload != nil { + in, out := &in.Payload, &out.Payload + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLSTrustCertsSecret != nil { + in, out := &in.TLSTrustCertsSecret, &out.TLSTrustCertsSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.AuthTokenSecret != nil { + in, out := &in.AuthTokenSecret, &out.AuthTokenSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ConnectionBackoff != nil { + in, out := &in.ConnectionBackoff, &out.ConnectionBackoff + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.AuthAthenzParams != nil { + in, out := &in.AuthAthenzParams, &out.AuthAthenzParams + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthAthenzSecret != nil { + in, out := &in.AuthAthenzSecret, &out.AuthAthenzSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PulsarTrigger. +func (in *PulsarTrigger) DeepCopy() *PulsarTrigger { + if in == nil { + return nil + } + out := new(PulsarTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimit) DeepCopyInto(out *RateLimit) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit. +func (in *RateLimit) DeepCopy() *RateLimit { + if in == nil { + return nil + } + out := new(RateLimit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisEventSource) DeepCopyInto(out *RedisEventSource) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Channels != nil { + in, out := &in.Channels, &out.Channels + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisEventSource. +func (in *RedisEventSource) DeepCopy() *RedisEventSource { + if in == nil { + return nil + } + out := new(RedisEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisStreamEventSource) DeepCopyInto(out *RedisStreamEventSource) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Streams != nil { + in, out := &in.Streams, &out.Streams + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSConfig) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisStreamEventSource. +func (in *RedisStreamEventSource) DeepCopy() *RedisStreamEventSource { + if in == nil { + return nil + } + out := new(RedisStreamEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceEventSource) DeepCopyInto(out *ResourceEventSource) { + *out = *in + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(ResourceFilter) + (*in).DeepCopyInto(*out) + } + out.GroupVersionResource = in.GroupVersionResource + if in.EventTypes != nil { + in, out := &in.EventTypes, &out.EventTypes + *out = make([]ResourceEventType, len(*in)) + copy(*out, *in) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceEventSource. +func (in *ResourceEventSource) DeepCopy() *ResourceEventSource { + if in == nil { + return nil + } + out := new(ResourceEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]Selector, len(*in)) + copy(*out, *in) + } + if in.Fields != nil { + in, out := &in.Fields, &out.Fields + *out = make([]Selector, len(*in)) + copy(*out, *in) + } + in.CreatedBy.DeepCopyInto(&out.CreatedBy) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceFilter. +func (in *ResourceFilter) DeepCopy() *ResourceFilter { + if in == nil { + return nil + } + out := new(ResourceFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Artifact) DeepCopyInto(out *S3Artifact) { + *out = *in + if in.Bucket != nil { + in, out := &in.Bucket, &out.Bucket + *out = new(S3Bucket) + **out = **in + } + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(S3Filter) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CACertificate != nil { + in, out := &in.CACertificate, &out.CACertificate + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Artifact. +func (in *S3Artifact) DeepCopy() *S3Artifact { + if in == nil { + return nil + } + out := new(S3Artifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Bucket) DeepCopyInto(out *S3Bucket) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Bucket. +func (in *S3Bucket) DeepCopy() *S3Bucket { + if in == nil { + return nil + } + out := new(S3Bucket) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Filter) DeepCopyInto(out *S3Filter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Filter. +func (in *S3Filter) DeepCopy() *S3Filter { + if in == nil { + return nil + } + out := new(S3Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SASLConfig) DeepCopyInto(out *SASLConfig) { + *out = *in + if in.UserSecret != nil { + in, out := &in.UserSecret, &out.UserSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.PasswordSecret != nil { + in, out := &in.PasswordSecret, &out.PasswordSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SASLConfig. +func (in *SASLConfig) DeepCopy() *SASLConfig { + if in == nil { + return nil + } + out := new(SASLConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SFTPEventSource) DeepCopyInto(out *SFTPEventSource) { + *out = *in + out.WatchPathConfig = in.WatchPathConfig + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SSHKeySecret != nil { + in, out := &in.SSHKeySecret, &out.SSHKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFTPEventSource. +func (in *SFTPEventSource) DeepCopy() *SFTPEventSource { + if in == nil { + return nil + } + out := new(SFTPEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SNSEventSource) DeepCopyInto(out *SNSEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SNSEventSource. +func (in *SNSEventSource) DeepCopy() *SNSEventSource { + if in == nil { + return nil + } + out := new(SNSEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SQSEventSource) DeepCopyInto(out *SQSEventSource) { + *out = *in + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + if in.SessionToken != nil { + in, out := &in.SessionToken, &out.SessionToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SQSEventSource. +func (in *SQSEventSource) DeepCopy() *SQSEventSource { + if in == nil { + return nil + } + out := new(SQSEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchemaRegistryConfig) DeepCopyInto(out *SchemaRegistryConfig) { + *out = *in + in.Auth.DeepCopyInto(&out.Auth) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchemaRegistryConfig. +func (in *SchemaRegistryConfig) DeepCopy() *SchemaRegistryConfig { + if in == nil { + return nil + } + out := new(SchemaRegistryConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecureHeader) DeepCopyInto(out *SecureHeader) { + *out = *in + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(ValueFromSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecureHeader. +func (in *SecureHeader) DeepCopy() *SecureHeader { + if in == nil { + return nil + } + out := new(SecureHeader) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Selector) DeepCopyInto(out *Selector) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selector. +func (in *Selector) DeepCopy() *Selector { + if in == nil { + return nil + } + out := new(Selector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sensor) DeepCopyInto(out *Sensor) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sensor. +func (in *Sensor) DeepCopy() *Sensor { + if in == nil { + return nil + } + out := new(Sensor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Sensor) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SensorList) DeepCopyInto(out *SensorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Sensor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SensorList. +func (in *SensorList) DeepCopy() *SensorList { + if in == nil { + return nil + } + out := new(SensorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SensorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SensorSpec) DeepCopyInto(out *SensorSpec) { + *out = *in + if in.Dependencies != nil { + in, out := &in.Dependencies, &out.Dependencies + *out = make([]EventDependency, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Triggers != nil { + in, out := &in.Triggers, &out.Triggers + *out = make([]Trigger, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(Template) + (*in).DeepCopyInto(*out) + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + if in.LoggingFields != nil { + in, out := &in.LoggingFields, &out.LoggingFields + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SensorSpec. +func (in *SensorSpec) DeepCopy() *SensorSpec { + if in == nil { + return nil + } + out := new(SensorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SensorStatus) DeepCopyInto(out *SensorStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SensorStatus. +func (in *SensorStatus) DeepCopy() *SensorStatus { + if in == nil { + return nil + } + out := new(SensorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Service) DeepCopyInto(out *Service) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]v1.ServicePort, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service. +func (in *Service) DeepCopy() *Service { + if in == nil { + return nil + } + out := new(Service) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackEventSource) DeepCopyInto(out *SlackEventSource) { + *out = *in + if in.SigningSecret != nil { + in, out := &in.SigningSecret, &out.SigningSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackEventSource. +func (in *SlackEventSource) DeepCopy() *SlackEventSource { + if in == nil { + return nil + } + out := new(SlackEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackSender) DeepCopyInto(out *SlackSender) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackSender. +func (in *SlackSender) DeepCopy() *SlackSender { + if in == nil { + return nil + } + out := new(SlackSender) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackThread) DeepCopyInto(out *SlackThread) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackThread. +func (in *SlackThread) DeepCopy() *SlackThread { + if in == nil { + return nil + } + out := new(SlackThread) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SlackTrigger) DeepCopyInto(out *SlackTrigger) { + *out = *in + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SlackToken != nil { + in, out := &in.SlackToken, &out.SlackToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + out.Thread = in.Thread + out.Sender = in.Sender + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackTrigger. +func (in *SlackTrigger) DeepCopy() *SlackTrigger { + if in == nil { + return nil + } + out := new(SlackTrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StandardK8STrigger) DeepCopyInto(out *StandardK8STrigger) { + *out = *in + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(ArtifactLocation) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StandardK8STrigger. +func (in *StandardK8STrigger) DeepCopy() *StandardK8STrigger { + if in == nil { + return nil + } + out := new(StandardK8STrigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Status) DeepCopyInto(out *Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status. +func (in *Status) DeepCopy() *Status { + if in == nil { + return nil + } + out := new(Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusPolicy) DeepCopyInto(out *StatusPolicy) { + *out = *in + if in.Allow != nil { + in, out := &in.Allow, &out.Allow + *out = make([]int32, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusPolicy. +func (in *StatusPolicy) DeepCopy() *StatusPolicy { + if in == nil { + return nil + } + out := new(StatusPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageGridEventSource) DeepCopyInto(out *StorageGridEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.Events != nil { + in, out := &in.Events, &out.Events + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(StorageGridFilter) + **out = **in + } + if in.AuthToken != nil { + in, out := &in.AuthToken, &out.AuthToken + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageGridEventSource. +func (in *StorageGridEventSource) DeepCopy() *StorageGridEventSource { + if in == nil { + return nil + } + out := new(StorageGridEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageGridFilter) DeepCopyInto(out *StorageGridFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageGridFilter. +func (in *StorageGridFilter) DeepCopy() *StorageGridFilter { + if in == nil { + return nil + } + out := new(StorageGridFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StripeEventSource) DeepCopyInto(out *StripeEventSource) { + *out = *in + if in.Webhook != nil { + in, out := &in.Webhook, &out.Webhook + *out = new(WebhookContext) + (*in).DeepCopyInto(*out) + } + if in.APIKey != nil { + in, out := &in.APIKey, &out.APIKey + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.EventFilter != nil { + in, out := &in.EventFilter, &out.EventFilter + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StripeEventSource. +func (in *StripeEventSource) DeepCopy() *StripeEventSource { + if in == nil { + return nil + } + out := new(StripeEventSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSConfig) DeepCopyInto(out *TLSConfig) { + *out = *in + if in.CACertSecret != nil { + in, out := &in.CACertSecret, &out.CACertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ClientCertSecret != nil { + in, out := &in.ClientCertSecret, &out.ClientCertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ClientKeySecret != nil { + in, out := &in.ClientKeySecret, &out.ClientKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig. +func (in *TLSConfig) DeepCopy() *TLSConfig { + if in == nil { + return nil + } + out := new(TLSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Template) DeepCopyInto(out *Template) { + *out = *in + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = new(Metadata) + (*in).DeepCopyInto(*out) + } + if in.Container != nil { + in, out := &in.Container, &out.Container + *out = new(v1.Container) + (*in).DeepCopyInto(*out) + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]v1.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ImagePullSecrets != nil { + in, out := &in.ImagePullSecrets, &out.ImagePullSecrets + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template. +func (in *Template) DeepCopy() *Template { + if in == nil { + return nil + } + out := new(Template) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TimeFilter) DeepCopyInto(out *TimeFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeFilter. +func (in *TimeFilter) DeepCopy() *TimeFilter { + if in == nil { + return nil + } + out := new(TimeFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Trigger) DeepCopyInto(out *Trigger) { + *out = *in + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(TriggerTemplate) + (*in).DeepCopyInto(*out) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]TriggerParameter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Policy != nil { + in, out := &in.Policy, &out.Policy + *out = new(TriggerPolicy) + (*in).DeepCopyInto(*out) + } + if in.RetryStrategy != nil { + in, out := &in.RetryStrategy, &out.RetryStrategy + *out = new(Backoff) + (*in).DeepCopyInto(*out) + } + if in.RateLimit != nil { + in, out := &in.RateLimit, &out.RateLimit + *out = new(RateLimit) + **out = **in + } + if in.DlqTrigger != nil { + in, out := &in.DlqTrigger, &out.DlqTrigger + *out = new(Trigger) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trigger. +func (in *Trigger) DeepCopy() *Trigger { + if in == nil { + return nil + } + out := new(Trigger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerParameter) DeepCopyInto(out *TriggerParameter) { + *out = *in + if in.Src != nil { + in, out := &in.Src, &out.Src + *out = new(TriggerParameterSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerParameter. +func (in *TriggerParameter) DeepCopy() *TriggerParameter { + if in == nil { + return nil + } + out := new(TriggerParameter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerParameterSource) DeepCopyInto(out *TriggerParameterSource) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerParameterSource. +func (in *TriggerParameterSource) DeepCopy() *TriggerParameterSource { + if in == nil { + return nil + } + out := new(TriggerParameterSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerPolicy) DeepCopyInto(out *TriggerPolicy) { + *out = *in + if in.K8s != nil { + in, out := &in.K8s, &out.K8s + *out = new(K8SResourcePolicy) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(StatusPolicy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerPolicy. +func (in *TriggerPolicy) DeepCopy() *TriggerPolicy { + if in == nil { + return nil + } + out := new(TriggerPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TriggerTemplate) DeepCopyInto(out *TriggerTemplate) { + *out = *in + if in.K8s != nil { + in, out := &in.K8s, &out.K8s + *out = new(StandardK8STrigger) + (*in).DeepCopyInto(*out) + } + if in.ArgoWorkflow != nil { + in, out := &in.ArgoWorkflow, &out.ArgoWorkflow + *out = new(ArgoWorkflowTrigger) + (*in).DeepCopyInto(*out) + } + if in.HTTP != nil { + in, out := &in.HTTP, &out.HTTP + *out = new(HTTPTrigger) + (*in).DeepCopyInto(*out) + } + if in.AWSLambda != nil { + in, out := &in.AWSLambda, &out.AWSLambda + *out = new(AWSLambdaTrigger) + (*in).DeepCopyInto(*out) + } + if in.CustomTrigger != nil { + in, out := &in.CustomTrigger, &out.CustomTrigger + *out = new(CustomTrigger) + (*in).DeepCopyInto(*out) + } + if in.Kafka != nil { + in, out := &in.Kafka, &out.Kafka + *out = new(KafkaTrigger) + (*in).DeepCopyInto(*out) + } + if in.NATS != nil { + in, out := &in.NATS, &out.NATS + *out = new(NATSTrigger) + (*in).DeepCopyInto(*out) + } + if in.Slack != nil { + in, out := &in.Slack, &out.Slack + *out = new(SlackTrigger) + (*in).DeepCopyInto(*out) + } + if in.OpenWhisk != nil { + in, out := &in.OpenWhisk, &out.OpenWhisk + *out = new(OpenWhiskTrigger) + (*in).DeepCopyInto(*out) + } + if in.Log != nil { + in, out := &in.Log, &out.Log + *out = new(LogTrigger) + **out = **in + } + if in.AzureEventHubs != nil { + in, out := &in.AzureEventHubs, &out.AzureEventHubs + *out = new(AzureEventHubsTrigger) + (*in).DeepCopyInto(*out) + } + if in.Pulsar != nil { + in, out := &in.Pulsar, &out.Pulsar + *out = new(PulsarTrigger) + (*in).DeepCopyInto(*out) + } + if in.ConditionsReset != nil { + in, out := &in.ConditionsReset, &out.ConditionsReset + *out = make([]ConditionsResetCriteria, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AzureServiceBus != nil { + in, out := &in.AzureServiceBus, &out.AzureServiceBus + *out = new(AzureServiceBusTrigger) + (*in).DeepCopyInto(*out) + } + if in.Email != nil { + in, out := &in.Email, &out.Email + *out = new(EmailTrigger) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerTemplate. +func (in *TriggerTemplate) DeepCopy() *TriggerTemplate { + if in == nil { + return nil + } + out := new(TriggerTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *URLArtifact) DeepCopyInto(out *URLArtifact) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URLArtifact. +func (in *URLArtifact) DeepCopy() *URLArtifact { + if in == nil { + return nil + } + out := new(URLArtifact) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValueFromSource) DeepCopyInto(out *ValueFromSource) { + *out = *in + if in.SecretKeyRef != nil { + in, out := &in.SecretKeyRef, &out.SecretKeyRef + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ConfigMapKeyRef != nil { + in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef + *out = new(v1.ConfigMapKeySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFromSource. +func (in *ValueFromSource) DeepCopy() *ValueFromSource { + if in == nil { + return nil + } + out := new(ValueFromSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WatchPathConfig) DeepCopyInto(out *WatchPathConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WatchPathConfig. +func (in *WatchPathConfig) DeepCopy() *WatchPathConfig { + if in == nil { + return nil + } + out := new(WatchPathConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebhookContext) DeepCopyInto(out *WebhookContext) { + *out = *in + if in.ServerCertSecret != nil { + in, out := &in.ServerCertSecret, &out.ServerCertSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.ServerKeySecret != nil { + in, out := &in.ServerKeySecret, &out.ServerKeySecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AuthSecret != nil { + in, out := &in.AuthSecret, &out.AuthSecret + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.MaxPayloadSize != nil { + in, out := &in.MaxPayloadSize, &out.MaxPayloadSize + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookContext. +func (in *WebhookContext) DeepCopy() *WebhookContext { + if in == nil { + return nil + } + out := new(WebhookContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebhookEventSource) DeepCopyInto(out *WebhookEventSource) { + *out = *in + in.WebhookContext.DeepCopyInto(&out.WebhookContext) + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(EventSourceFilter) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookEventSource. +func (in *WebhookEventSource) DeepCopy() *WebhookEventSource { + if in == nil { + return nil + } + out := new(WebhookEventSource) + in.DeepCopyInto(out) + return out +} +``` + +## `pkg/apis/events/v1alpha1/zz_generated.defaults.go` (changed lines (42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170)) + +```go +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&EventSource{}, func(obj interface{}) { SetObjectDefaults_EventSource(obj.(*EventSource)) }) + scheme.AddTypeDefaultingFunc(&EventSourceList{}, func(obj interface{}) { SetObjectDefaults_EventSourceList(obj.(*EventSourceList)) }) + scheme.AddTypeDefaultingFunc(&Sensor{}, func(obj interface{}) { SetObjectDefaults_Sensor(obj.(*Sensor)) }) + scheme.AddTypeDefaultingFunc(&SensorList{}, func(obj interface{}) { SetObjectDefaults_SensorList(obj.(*SensorList)) }) + return nil +} + +func SetObjectDefaults_EventSource(in *EventSource) { + if in.Spec.Template != nil { + if in.Spec.Template.Container != nil { + for i := range in.Spec.Template.Container.Ports { + a := &in.Spec.Template.Container.Ports[i] + if a.Protocol == "" { + a.Protocol = "TCP" + } + } + if in.Spec.Template.Container.LivenessProbe != nil { + if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC != nil { + if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if in.Spec.Template.Container.ReadinessProbe != nil { + if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC != nil { + if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if in.Spec.Template.Container.StartupProbe != nil { + if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC != nil { + if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for i := range in.Spec.Template.Volumes { + a := &in.Spec.Template.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + } + if in.Spec.Service != nil { + for i := range in.Spec.Service.Ports { + a := &in.Spec.Service.Ports[i] + if a.Protocol == "" { + a.Protocol = "TCP" + } + } + } +} + +func SetObjectDefaults_EventSourceList(in *EventSourceList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_EventSource(a) + } +} + +func SetObjectDefaults_Sensor(in *Sensor) { + if in.Spec.Template != nil { + if in.Spec.Template.Container != nil { + for i := range in.Spec.Template.Container.Ports { + a := &in.Spec.Template.Container.Ports[i] + if a.Protocol == "" { + a.Protocol = "TCP" + } + } + if in.Spec.Template.Container.LivenessProbe != nil { + if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC != nil { + if in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + in.Spec.Template.Container.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if in.Spec.Template.Container.ReadinessProbe != nil { + if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC != nil { + if in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + in.Spec.Template.Container.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if in.Spec.Template.Container.StartupProbe != nil { + if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC != nil { + if in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + in.Spec.Template.Container.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for i := range in.Spec.Template.Volumes { + a := &in.Spec.Template.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + } +} + +func SetObjectDefaults_SensorList(in *SensorList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_Sensor(a) + } +} +``` + +## `pkg/reconciler/eventsource/controller.go` (changed lines (16, 41, 42, 70, 71, 99, 100)) + +```go +package eventsource + +import ( + "context" + + "go.uber.org/zap" + "k8s.io/apimachinery/pkg/api/equality" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + aev1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +const ( + // ControllerName is name of the controller + ControllerName = "eventsource-controller" + + finalizerName = ControllerName +) + +type reconciler struct { + client client.Client + scheme *runtime.Scheme + + eventSourceImage string + logger *zap.SugaredLogger +} + +// NewReconciler returns a new reconciler +func NewReconciler(client client.Client, scheme *runtime.Scheme, eventSourceImage string, logger *zap.SugaredLogger) reconcile.Reconciler { + return &reconciler{client: client, scheme: scheme, eventSourceImage: eventSourceImage, logger: logger} +} + +func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + eventSource := &aev1.EventSource{} + if err := r.client.Get(ctx, req.NamespacedName, eventSource); err != nil { + if apierrors.IsNotFound(err) { + r.logger.Warnw("WARNING: eventsource not found", "request", req) + return reconcile.Result{}, nil + } + r.logger.Errorw("unable to get eventsource ctl", "request", req, "error", err) + return ctrl.Result{}, err + } + log := r.logger.With("namespace", eventSource.Namespace).With("eventSource", eventSource.Name) + ctx = logging.WithLogger(ctx, log) + esCopy := eventSource.DeepCopy() + reconcileErr := r.reconcile(ctx, esCopy) + if reconcileErr != nil { + log.Errorw("reconcile error", zap.Error(reconcileErr)) + } + if r.needsUpdate(eventSource, esCopy) { + // Use a DeepCopy to update, because it will be mutated afterwards, with empty Status. + if err := r.client.Update(ctx, esCopy.DeepCopy()); err != nil { + return reconcile.Result{}, err + } + } + if err := r.client.Status().Update(ctx, esCopy); err != nil { + return reconcile.Result{}, err + } + return ctrl.Result{}, reconcileErr +} + +// reconcile does the real logic +func (r *reconciler) reconcile(ctx context.Context, eventSource *aev1.EventSource) error { + log := logging.FromContext(ctx) + if !eventSource.DeletionTimestamp.IsZero() { + log.Info("deleting eventsource") + if controllerutil.ContainsFinalizer(eventSource, finalizerName) { + // Finalizer logic should be added here. + controllerutil.RemoveFinalizer(eventSource, finalizerName) + } + return nil + } + controllerutil.AddFinalizer(eventSource, finalizerName) + + eventSource.Status.InitConditions() + if err := ValidateEventSource(eventSource); err != nil { + log.Errorw("validation error", zap.Error(err)) + return err + } + args := &AdaptorArgs{ + Image: r.eventSourceImage, + EventSource: eventSource, + Labels: map[string]string{ + "controller": "eventsource-controller", + v1alpha1.LabelEventSourceName: eventSource.Name, + v1alpha1.LabelOwnerName: eventSource.Name, + }, + } + return Reconcile(r.client, args, log) +} + +func (r *reconciler) needsUpdate(old, new *aev1.EventSource) bool { + if old == nil { + return true + } + if !equality.Semantic.DeepEqual(old.Finalizers, new.Finalizers) { + return true + } + return false +} +``` + +## `pkg/reconciler/eventsource/resource.go` (changed lines (11, 14, 29, 30, 37, 38, 164, 165, 169, 170, 343, 344, 359, 360, 361, 362, 363)) + +```go +package eventsource + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "sort" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + aev1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + controllerscommon "github.com/argoproj/argo-events/pkg/reconciler/common" + sharedutil "github.com/argoproj/argo-events/pkg/shared/util" + "github.com/imdario/mergo" + "go.uber.org/zap" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// AdaptorArgs are the args needed to create a sensor deployment +type AdaptorArgs struct { + Image string + EventSource *aev1.EventSource + Labels map[string]string +} + +// Reconcile does the real logic +func Reconcile(client client.Client, args *AdaptorArgs, logger *zap.SugaredLogger) error { + ctx := context.Background() + eventSource := args.EventSource + eventBus := &aev1.EventBus{} + eventBusName := v1alpha1.DefaultEventBusName + if len(eventSource.Spec.EventBusName) > 0 { + eventBusName = eventSource.Spec.EventBusName + } + err := client.Get(ctx, types.NamespacedName{Namespace: eventSource.Namespace, Name: eventBusName}, eventBus) + if err != nil { + if apierrors.IsNotFound(err) { + eventSource.Status.MarkDeployFailed("EventBusNotFound", "EventBus not found.") + logger.Errorw("EventBus not found", "eventBusName", eventBusName, "error", err) + return fmt.Errorf("eventbus %s not found", eventBusName) + } + eventSource.Status.MarkDeployFailed("GetEventBusFailed", "Failed to get EventBus.") + logger.Errorw("failed to get EventBus", "eventBusName", eventBusName, "error", err) + return err + } + if !eventBus.Status.IsReady() { + eventSource.Status.MarkDeployFailed("EventBusNotReady", "EventBus not ready.") + logger.Errorw("event bus is not in ready status", "eventBusName", eventBusName, "error", err) + return fmt.Errorf("eventbus not ready") + } + + expectedDeploy, err := buildDeployment(args, eventBus) + if err != nil { + eventSource.Status.MarkDeployFailed("BuildDeploymentSpecFailed", "Failed to build Deployment spec.") + logger.Errorw("failed to build deployment spec", "error", err) + return err + } + + deploy, err := getDeployment(ctx, client, args) + if err != nil && !apierrors.IsNotFound(err) { + eventSource.Status.MarkDeployFailed("GetDeploymentFailed", "Get existing deployment failed") + logger.Errorw("error getting existing deployment", "error", err) + return err + } + if deploy != nil { + if deploy.Annotations != nil && deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] != expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] { + deploy.Spec = expectedDeploy.Spec + deploy.SetLabels(expectedDeploy.Labels) + deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] = expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] + err = client.Update(ctx, deploy) + if err != nil { + eventSource.Status.MarkDeployFailed("UpdateDeploymentFailed", "Failed to update existing deployment") + logger.Errorw("error updating existing deployment", "error", err) + return err + } + logger.Infow("deployment is updated", "deploymentName", deploy.Name) + } + } else { + err = client.Create(ctx, expectedDeploy) + if err != nil { + eventSource.Status.MarkDeployFailed("CreateDeploymentFailed", "Failed to create a deployment") + logger.Errorw("error creating a deployment", "error", err) + return err + } + logger.Infow("deployment is created", "deploymentName", expectedDeploy.Name) + } + // Service if any + existingSvc, err := getService(ctx, client, args) + if err != nil && !apierrors.IsNotFound(err) { + eventSource.Status.MarkDeployFailed("GetServiceFailed", "Failed to get existing service") + logger.Errorw("error getting existing service", "error", err) + return err + } + expectedSvc, err := buildService(args) + if err != nil { + eventSource.Status.MarkDeployFailed("BuildServiceFailed", "Failed to build service spec") + logger.Errorw("error building service spec", "error", err) + return err + } + if expectedSvc == nil { + if existingSvc != nil { + err = client.Delete(ctx, existingSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("DeleteServiceFailed", "Failed to delete existing service") + logger.Errorw("error deleting existing service", "error", err) + return err + } + logger.Infow("deleted existing service", "serviceName", existingSvc.Name) + } + } else { + if existingSvc == nil { + err = client.Create(ctx, expectedSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("CreateServiceFailed", "Failed to create a service") + logger.Errorw("error creating a service", "error", err) + return err + } + logger.Infow("service is created", "serviceName", expectedSvc.Name) + } else if existingSvc.Annotations != nil && existingSvc.Annotations[v1alpha1.AnnotationResourceSpecHash] != expectedSvc.Annotations[v1alpha1.AnnotationResourceSpecHash] { + // To avoid service updating issues such as port name change, re-create it. + err = client.Delete(ctx, existingSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("DeleteServiceFailed", "Failed to delete existing service") + logger.Errorw("error deleting existing service", "error", err) + return err + } + err = client.Create(ctx, expectedSvc) + if err != nil { + eventSource.Status.MarkDeployFailed("RecreateServiceFailed", "Failed to re-create existing service") + logger.Errorw("error re-creating existing service", "error", err) + return err + } + logger.Infow("service is re-created", "serviceName", existingSvc.Name) + } + } + eventSource.Status.MarkDeployed() + return nil +} + +func getDeployment(ctx context.Context, cl client.Client, args *AdaptorArgs) (*appv1.Deployment, error) { + dl := &appv1.DeploymentList{} + err := cl.List(ctx, dl, &client.ListOptions{ + Namespace: args.EventSource.Namespace, + LabelSelector: labelSelector(args.Labels), + }) + if err != nil { + return nil, err + } + for _, deploy := range dl.Items { + if metav1.IsControlledBy(&deploy, args.EventSource) { + return &deploy, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") +} + +func buildDeployment(args *AdaptorArgs, eventBus *aev1.EventBus) (*appv1.Deployment, error) { + deploymentSpec, err := buildDeploymentSpec(args) + if err != nil { + return nil, err + } + eventSourceCopy := &aev1.EventSource{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.EventSource.Namespace, + Name: args.EventSource.Name, + }, + Spec: args.EventSource.Spec, + } + eventSourceBytes, err := json.Marshal(eventSourceCopy) + if err != nil { + return nil, fmt.Errorf("failed marshal eventsource spec") + } + busConfigBytes, err := json.Marshal(eventBus.Status.Config) + if err != nil { + return nil, fmt.Errorf("failed marshal event bus config: %v", err) + } + + env := []corev1.EnvVar{ + { + Name: v1alpha1.EnvVarEventSourceObject, + Value: base64.StdEncoding.EncodeToString(eventSourceBytes), + }, + { + Name: v1alpha1.EnvVarEventBusSubject, + Value: fmt.Sprintf("eventbus-%s", args.EventSource.Namespace), + }, + { + Name: v1alpha1.EnvVarPodName, + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, + { + Name: v1alpha1.EnvVarLeaderElection, + Value: args.EventSource.Annotations[v1alpha1.AnnotationLeaderElection], + }, + { + Name: v1alpha1.EnvVarEventBusConfig, + Value: base64.StdEncoding.EncodeToString(busConfigBytes), + }, + } + + volumes := []corev1.Volume{ + { + Name: "tmp", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }, + } + + volumeMounts := []corev1.VolumeMount{ + { + Name: "tmp", + MountPath: "/tmp", + }, + } + + var secretObjs []interface{} + var accessSecret *corev1.SecretKeySelector + var caCertSecret *corev1.SecretKeySelector + var clientCertSecret *corev1.SecretKeySelector + var clientKeySecret *corev1.SecretKeySelector + switch { + case eventBus.Status.Config.NATS != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = eventBus.Status.Config.NATS.AccessSecret + secretObjs = []interface{}{eventSourceCopy} + case eventBus.Status.Config.JetStream != nil: + tlsOptions := eventBus.Status.Config.JetStream.TLS + if tlsOptions != nil { + caCertSecret = tlsOptions.CACertSecret + clientCertSecret = tlsOptions.ClientCertSecret + clientKeySecret = tlsOptions.ClientKeySecret + } + accessSecret = eventBus.Status.Config.JetStream.AccessSecret + secretObjs = []interface{}{eventSourceCopy} + case eventBus.Status.Config.Kafka != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = nil + secretObjs = []interface{}{eventSourceCopy, eventBus} // kafka requires secrets for sasl and tls + default: + return nil, fmt.Errorf("unsupported event bus") + } + + if accessSecret != nil { + // Mount the secret as volume instead of using envFrom to gain the ability + // for the sensor deployment to auto reload when the secret changes + volumes = append(volumes, corev1.Volume{ + Name: "auth-volume", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: accessSecret.Name, + Items: []corev1.KeyToPath{ + { + Key: accessSecret.Key, + Path: "auth.yaml", + }, + }, + }, + }, + }) + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: "auth-volume", + MountPath: v1alpha1.EventBusAuthFileMountPath, + }) + } + + uniqueCertVolumeMap := make(map[string][]corev1.KeyToPath) + for _, secret := range []*corev1.SecretKeySelector{caCertSecret, clientCertSecret, clientKeySecret} { + if secret != nil { + uniqueCertVolumeMap[secret.Name] = append(uniqueCertVolumeMap[secret.Name], corev1.KeyToPath{ + Key: secret.Key, + Path: secret.Key, + }) + } + } + + // We deduplicate the certificate secret mounts to ensure every secret under the TLS config is only mounted once + // because the secrets MUST be mounted at /argo-events/secrets/ + // in order for util.GetTLSConfig to work without modification + for secretName, items := range uniqueCertVolumeMap { + // The names of volumes MUST be valid DNS_LABELs; as the secret names are user-supplied, + // we perform some input cleansing to ensure they conform + volumeName := sharedutil.ConvertToDNSLabel(secretName) + + optional := false + + volumes = append(volumes, corev1.Volume{ + Name: volumeName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: secretName, + Items: items, + Optional: &optional, + }, + }, + }) + + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: volumeName, + MountPath: fmt.Sprintf("/argo-events/secrets/%s", secretName), + }) + } + + // secrets + volSecrets, volSecretMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.SecretKeySelectorType, secretObjs...) + volumes = append(volumes, volSecrets...) + volumeMounts = append(volumeMounts, volSecretMounts...) + + // config maps + volConfigMaps, volCofigMapMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.ConfigMapKeySelectorType, eventSourceCopy) + volumeMounts = append(volumeMounts, volCofigMapMounts...) + volumes = append(volumes, volConfigMaps...) + + // Order volumes and volumemounts based on name to make the order deterministic + sort.Slice(volumes, func(i, j int) bool { + return volumes[i].Name < volumes[j].Name + }) + sort.Slice(volumeMounts, func(i, j int) bool { + return volumeMounts[i].Name < volumeMounts[j].Name + }) + + deploymentSpec.Template.Spec.Containers[0].Env = append(deploymentSpec.Template.Spec.Containers[0].Env, env...) + deploymentSpec.Template.Spec.Containers[0].VolumeMounts = append(deploymentSpec.Template.Spec.Containers[0].VolumeMounts, volumeMounts...) + deploymentSpec.Template.Spec.Volumes = append(deploymentSpec.Template.Spec.Volumes, volumes...) + + deployment := &appv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.EventSource.Namespace, + GenerateName: fmt.Sprintf("%s-eventsource-", args.EventSource.Name), + Labels: mergeLabels(args.EventSource.Labels, args.Labels), + }, + Spec: *deploymentSpec, + } + if err := controllerscommon.SetObjectMeta(args.EventSource, deployment, aev1.EventSourceGroupVersionKind); err != nil { + return nil, err + } + + return deployment, nil +} + +func buildDeploymentSpec(args *AdaptorArgs) (*appv1.DeploymentSpec, error) { + eventSourceContainer := corev1.Container{ + Image: args.Image, + ImagePullPolicy: sharedutil.GetImagePullPolicy(), + Args: []string{"eventsource-service"}, + Ports: []corev1.ContainerPort{ + {Name: "metrics", ContainerPort: v1alpha1.EventSourceMetricsPort}, + }, + } + if args.EventSource.Spec.Template != nil && args.EventSource.Spec.Template.Container != nil { + if err := mergo.Merge(&eventSourceContainer, args.EventSource.Spec.Template.Container, mergo.WithOverride); err != nil { + return nil, err + } + } + eventSourceContainer.Name = "main" + podTemplateLabels := make(map[string]string) + if args.EventSource.Spec.Template != nil && args.EventSource.Spec.Template.Metadata != nil && + len(args.EventSource.Spec.Template.Metadata.Labels) > 0 { + for k, v := range args.EventSource.Spec.Template.Metadata.Labels { + podTemplateLabels[k] = v + } + } + for k, v := range args.Labels { + podTemplateLabels[k] = v + } + + replicas := args.EventSource.Spec.GetReplicas() + spec := &appv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{ + MatchLabels: args.Labels, + }, + Replicas: &replicas, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: podTemplateLabels, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + eventSourceContainer, + }, + }, + }, + } + if args.EventSource.Spec.Template != nil { + if args.EventSource.Spec.Template.Metadata != nil { + spec.Template.SetAnnotations(args.EventSource.Spec.Template.Metadata.Annotations) + } + spec.Template.Spec.ServiceAccountName = args.EventSource.Spec.Template.ServiceAccountName + spec.Template.Spec.Volumes = args.EventSource.Spec.Template.Volumes + spec.Template.Spec.SecurityContext = args.EventSource.Spec.Template.SecurityContext + spec.Template.Spec.NodeSelector = args.EventSource.Spec.Template.NodeSelector + spec.Template.Spec.Tolerations = args.EventSource.Spec.Template.Tolerations + spec.Template.Spec.Affinity = args.EventSource.Spec.Template.Affinity + spec.Template.Spec.ImagePullSecrets = args.EventSource.Spec.Template.ImagePullSecrets + spec.Template.Spec.PriorityClassName = args.EventSource.Spec.Template.PriorityClassName + spec.Template.Spec.Priority = args.EventSource.Spec.Template.Priority + } + return spec, nil +} + +func getService(ctx context.Context, cl client.Client, args *AdaptorArgs) (*corev1.Service, error) { + sl := &corev1.ServiceList{} + err := cl.List(ctx, sl, &client.ListOptions{ + Namespace: args.EventSource.Namespace, + LabelSelector: labelSelector(args.Labels), + }) + if err != nil { + return nil, err + } + for _, svc := range sl.Items { + if metav1.IsControlledBy(&svc, args.EventSource) { + return &svc, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") +} + +func buildService(args *AdaptorArgs) (*corev1.Service, error) { + eventSource := args.EventSource + if eventSource.Spec.Service == nil { + return nil, nil + } + if len(eventSource.Spec.Service.Ports) == 0 { + return nil, nil + } + // Use a ports copy otherwise it will update the oririnal Ports spec in EventSource + ports := []corev1.ServicePort{} + ports = append(ports, eventSource.Spec.Service.Ports...) + + svc := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("%s-eventsource-svc", eventSource.Name), + Namespace: eventSource.Namespace, + }, + Spec: corev1.ServiceSpec{ + Ports: ports, + Type: corev1.ServiceTypeClusterIP, + ClusterIP: eventSource.Spec.Service.ClusterIP, + Selector: args.Labels, + }, + } + + labels := mergeLabels(args.EventSource.Labels, args.Labels) + annotations := make(map[string]string) + + if args.EventSource.Spec.Service.Metadata != nil { + if args.EventSource.Spec.Service.Metadata.Labels != nil { + labels = mergeLabels(args.EventSource.Spec.Service.Metadata.Labels, labels) + } + if args.EventSource.Spec.Service.Metadata.Annotations != nil { + annotations = mergeLabels(args.EventSource.Spec.Service.Metadata.Annotations, annotations) + } + } + + svc.ObjectMeta.SetLabels(labels) + svc.ObjectMeta.SetAnnotations(annotations) + + if err := controllerscommon.SetObjectMeta(eventSource, svc, v1alpha1.EventSourceGroupVersionKind); err != nil { + return nil, err + } + return svc, nil +} + +func mergeLabels(eventBusLabels, given map[string]string) map[string]string { + result := map[string]string{} + for k, v := range eventBusLabels { + result[k] = v + } + for k, v := range given { + result[k] = v + } + return result +} + +func labelSelector(labelMap map[string]string) labels.Selector { + return labels.SelectorFromSet(labelMap) +} +``` + +## `pkg/reconciler/sensor/resource.go` (changed lines (26, 320, 321, 322, 323, 324)) + +```go +/* +Copyright 2018 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sensor + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "sort" + + "github.com/imdario/mergo" + "go.uber.org/zap" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + controllerscommon "github.com/argoproj/argo-events/pkg/reconciler/common" + sharedutil "github.com/argoproj/argo-events/pkg/shared/util" +) + +// AdaptorArgs are the args needed to create a sensor deployment +type AdaptorArgs struct { + Image string + Sensor *v1alpha1.Sensor + Labels map[string]string +} + +// Reconcile does the real logic +func Reconcile(client client.Client, eventBus *v1alpha1.EventBus, args *AdaptorArgs, logger *zap.SugaredLogger) error { + ctx := context.Background() + sensor := args.Sensor + + if eventBus == nil { + sensor.Status.MarkDeployFailed("GetEventBusFailed", "Failed to get EventBus.") + logger.Error("failed to get EventBus") + return fmt.Errorf("failed to get EventBus") + } + + eventBusName := v1alpha1.DefaultEventBusName + if len(sensor.Spec.EventBusName) > 0 { + eventBusName = sensor.Spec.EventBusName + } + if !eventBus.Status.IsReady() { + sensor.Status.MarkDeployFailed("EventBusNotReady", "EventBus not ready.") + logger.Errorw("event bus is not in ready status", "eventBusName", eventBusName) + return fmt.Errorf("eventbus not ready") + } + + expectedDeploy, err := buildDeployment(args, eventBus) + if err != nil { + sensor.Status.MarkDeployFailed("BuildDeploymentSpecFailed", "Failed to build Deployment spec.") + logger.Errorw("failed to build deployment spec", "error", err) + return err + } + deploy, err := getDeployment(ctx, client, args) + if err != nil && !apierrors.IsNotFound(err) { + sensor.Status.MarkDeployFailed("GetDeploymentFailed", "Get existing deployment failed") + logger.Errorw("error getting existing deployment", "error", err) + return err + } + if deploy != nil { + if deploy.Annotations != nil && deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] != expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] { + deploy.Spec = expectedDeploy.Spec + deploy.SetLabels(expectedDeploy.Labels) + deploy.Annotations[v1alpha1.AnnotationResourceSpecHash] = expectedDeploy.Annotations[v1alpha1.AnnotationResourceSpecHash] + err = client.Update(ctx, deploy) + if err != nil { + sensor.Status.MarkDeployFailed("UpdateDeploymentFailed", "Failed to update existing deployment") + logger.Errorw("error updating existing deployment", "error", err) + return err + } + logger.Infow("deployment is updated", "deploymentName", deploy.Name) + } + } else { + err = client.Create(ctx, expectedDeploy) + if err != nil { + sensor.Status.MarkDeployFailed("CreateDeploymentFailed", "Failed to create a deployment") + logger.Errorw("error creating a deployment", "error", err) + return err + } + logger.Infow("deployment is created", "deploymentName", expectedDeploy.Name) + } + sensor.Status.MarkDeployed() + return nil +} + +func getDeployment(ctx context.Context, cl client.Client, args *AdaptorArgs) (*appv1.Deployment, error) { + dl := &appv1.DeploymentList{} + err := cl.List(ctx, dl, &client.ListOptions{ + Namespace: args.Sensor.Namespace, + LabelSelector: labelSelector(args.Labels), + }) + if err != nil { + return nil, err + } + for _, deploy := range dl.Items { + if metav1.IsControlledBy(&deploy, args.Sensor) { + return &deploy, nil + } + } + return nil, apierrors.NewNotFound(schema.GroupResource{}, "") +} + +func buildDeployment(args *AdaptorArgs, eventBus *v1alpha1.EventBus) (*appv1.Deployment, error) { + deploymentSpec, err := buildDeploymentSpec(args) + if err != nil { + return nil, err + } + sensorCopy := &v1alpha1.Sensor{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.Sensor.Namespace, + Name: args.Sensor.Name, + }, + Spec: args.Sensor.Spec, + } + sensorBytes, err := json.Marshal(sensorCopy) + if err != nil { + return nil, fmt.Errorf("failed marshal sensor spec") + } + busConfigBytes, err := json.Marshal(eventBus.Status.Config) + if err != nil { + return nil, fmt.Errorf("failed marshal event bus config: %v", err) + } + + env := []corev1.EnvVar{ + { + Name: v1alpha1.EnvVarSensorObject, + Value: base64.StdEncoding.EncodeToString(sensorBytes), + }, + { + Name: v1alpha1.EnvVarEventBusSubject, + Value: fmt.Sprintf("eventbus-%s", args.Sensor.Namespace), + }, + { + Name: v1alpha1.EnvVarPodName, + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, + { + Name: v1alpha1.EnvVarLeaderElection, + Value: args.Sensor.Annotations[v1alpha1.AnnotationLeaderElection], + }, + { + Name: v1alpha1.EnvVarEventBusConfig, + Value: base64.StdEncoding.EncodeToString(busConfigBytes), + }, + } + + volumes := []corev1.Volume{ + { + Name: "tmp", + VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, + }, + } + + volumeMounts := []corev1.VolumeMount{ + { + Name: "tmp", + MountPath: "/tmp", + }, + } + + var secretObjs []interface{} + var accessSecret *corev1.SecretKeySelector + var caCertSecret *corev1.SecretKeySelector + var clientCertSecret *corev1.SecretKeySelector + var clientKeySecret *corev1.SecretKeySelector + switch { + case eventBus.Status.Config.NATS != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = eventBus.Status.Config.NATS.AccessSecret + secretObjs = []interface{}{sensorCopy} + case eventBus.Status.Config.JetStream != nil: + tlsOptions := eventBus.Status.Config.JetStream.TLS + if tlsOptions != nil { + caCertSecret = tlsOptions.CACertSecret + clientCertSecret = tlsOptions.ClientCertSecret + clientKeySecret = tlsOptions.ClientKeySecret + } + accessSecret = eventBus.Status.Config.JetStream.AccessSecret + secretObjs = []interface{}{sensorCopy} + case eventBus.Status.Config.Kafka != nil: + caCertSecret = nil + clientCertSecret = nil + clientKeySecret = nil + accessSecret = nil + secretObjs = []interface{}{sensorCopy, eventBus} // kafka requires secrets for sasl and tls + default: + return nil, fmt.Errorf("unsupported event bus") + } + + if accessSecret != nil { + // Mount the secret as volume instead of using envFrom to gain the ability + // for the sensor deployment to auto reload when the secret changes + volumes = append(volumes, corev1.Volume{ + Name: "auth-volume", + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: accessSecret.Name, + Items: []corev1.KeyToPath{ + { + Key: accessSecret.Key, + Path: "auth.yaml", + }, + }, + }, + }, + }) + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: "auth-volume", + MountPath: v1alpha1.EventBusAuthFileMountPath, + }) + } + + uniqueCertVolumeMap := make(map[string][]corev1.KeyToPath) + for _, secret := range []*corev1.SecretKeySelector{caCertSecret, clientCertSecret, clientKeySecret} { + if secret != nil { + uniqueCertVolumeMap[secret.Name] = append(uniqueCertVolumeMap[secret.Name], corev1.KeyToPath{ + Key: secret.Key, + Path: secret.Key, + }) + } + } + + // We deduplicate the certificate secret mounts to ensure every secret under the TLS config is only mounted once + // because the secrets MUST be mounted at /argo-events/secrets/ + // in order for util.GetTLSConfig to work without modification + for secretName, items := range uniqueCertVolumeMap { + // The names of volumes MUST be valid DNS_LABELs; as the secret names are user-supplied, + // we perform some input cleansing to ensure they conform + volumeName := sharedutil.ConvertToDNSLabel(secretName) + + optional := false + + volumes = append(volumes, corev1.Volume{ + Name: volumeName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: secretName, + Items: items, + Optional: &optional, + }, + }, + }) + + volumeMounts = append(volumeMounts, corev1.VolumeMount{ + Name: volumeName, + MountPath: fmt.Sprintf("/argo-events/secrets/%s", secretName), + }) + } + + // secrets + volSecrets, volSecretMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.SecretKeySelectorType, secretObjs...) + volumes = append(volumes, volSecrets...) + volumeMounts = append(volumeMounts, volSecretMounts...) + + // config maps + volConfigMaps, volCofigMapMounts := sharedutil.VolumesFromSecretsOrConfigMaps(v1alpha1.ConfigMapKeySelectorType, sensorCopy) + volumeMounts = append(volumeMounts, volCofigMapMounts...) + volumes = append(volumes, volConfigMaps...) + + // Order volumes and volumemounts based on name to make the order deterministic + sort.Slice(volumes, func(i, j int) bool { + return volumes[i].Name < volumes[j].Name + }) + sort.Slice(volumeMounts, func(i, j int) bool { + return volumeMounts[i].Name < volumeMounts[j].Name + }) + + deploymentSpec.Template.Spec.Containers[0].Env = append(deploymentSpec.Template.Spec.Containers[0].Env, env...) + deploymentSpec.Template.Spec.Containers[0].VolumeMounts = append(deploymentSpec.Template.Spec.Containers[0].VolumeMounts, volumeMounts...) + deploymentSpec.Template.Spec.Volumes = append(deploymentSpec.Template.Spec.Volumes, volumes...) + + deployment := &appv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: args.Sensor.Namespace, + GenerateName: fmt.Sprintf("%s-sensor-", args.Sensor.Name), + Labels: mergeLabels(args.Sensor.Labels, args.Labels), + }, + Spec: *deploymentSpec, + } + if err := controllerscommon.SetObjectMeta(args.Sensor, deployment, v1alpha1.SensorGroupVersionKind); err != nil { + return nil, err + } + + return deployment, nil +} + +func buildDeploymentSpec(args *AdaptorArgs) (*appv1.DeploymentSpec, error) { + replicas := args.Sensor.Spec.GetReplicas() + sensorContainer := corev1.Container{ + Image: args.Image, + ImagePullPolicy: sharedutil.GetImagePullPolicy(), + Args: []string{"sensor-service"}, + Ports: []corev1.ContainerPort{ + {Name: "metrics", ContainerPort: v1alpha1.SensorMetricsPort}, + }, + } + if args.Sensor.Spec.Template != nil && args.Sensor.Spec.Template.Container != nil { + if err := mergo.Merge(&sensorContainer, args.Sensor.Spec.Template.Container, mergo.WithOverride); err != nil { + return nil, err + } + } + sensorContainer.Name = "main" + podTemplateLabels := make(map[string]string) + if args.Sensor.Spec.Template != nil && args.Sensor.Spec.Template.Metadata != nil && + len(args.Sensor.Spec.Template.Metadata.Labels) > 0 { + for k, v := range args.Sensor.Spec.Template.Metadata.Labels { + podTemplateLabels[k] = v + } + } + for k, v := range args.Labels { + podTemplateLabels[k] = v + } + spec := &appv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{ + MatchLabels: args.Labels, + }, + Replicas: &replicas, + RevisionHistoryLimit: args.Sensor.Spec.RevisionHistoryLimit, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: podTemplateLabels, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + sensorContainer, + }, + }, + }, + } + if args.Sensor.Spec.Template != nil { + if args.Sensor.Spec.Template.Metadata != nil { + spec.Template.SetAnnotations(args.Sensor.Spec.Template.Metadata.Annotations) + } + spec.Template.Spec.ServiceAccountName = args.Sensor.Spec.Template.ServiceAccountName + spec.Template.Spec.Volumes = args.Sensor.Spec.Template.Volumes + spec.Template.Spec.SecurityContext = args.Sensor.Spec.Template.SecurityContext + spec.Template.Spec.NodeSelector = args.Sensor.Spec.Template.NodeSelector + spec.Template.Spec.Tolerations = args.Sensor.Spec.Template.Tolerations + spec.Template.Spec.Affinity = args.Sensor.Spec.Template.Affinity + spec.Template.Spec.ImagePullSecrets = args.Sensor.Spec.Template.ImagePullSecrets + spec.Template.Spec.PriorityClassName = args.Sensor.Spec.Template.PriorityClassName + spec.Template.Spec.Priority = args.Sensor.Spec.Template.Priority + } + return spec, nil +} + +func mergeLabels(sensorLabels, given map[string]string) map[string]string { + result := map[string]string{} + for k, v := range sensorLabels { + result[k] = v + } + for k, v := range given { + result[k] = v + } + return result +} + +func labelSelector(labelMap map[string]string) labels.Selector { + return labels.SelectorFromSet(labelMap) +} +``` + +## `pkg/reconciler/sensor/resource_test.go` (changed lines (55, 56)) + +```go +/* +Copyright 2020 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sensor + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +const ( + testNamespace = "test-ns" +) + +var ( + testLabels = map[string]string{"controller": "test-controller"} + + sensorObj = &v1alpha1.Sensor{ + ObjectMeta: metav1.ObjectMeta{ + Name: "fake-sensor", + Namespace: testNamespace, + }, + Spec: v1alpha1.SensorSpec{ + Template: &v1alpha1.Template{ + ServiceAccountName: "fake-sa", + ImagePullSecrets: []corev1.LocalObjectReference{ + { + Name: "test", + }, + }, + Container: &corev1.Container{ + VolumeMounts: []corev1.VolumeMount{ + { + MountPath: "/test-data", + Name: "test-data", + }, + }, + }, + Volumes: []corev1.Volume{ + { + Name: "test-data", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + }, + PriorityClassName: "test-class", + }, + Triggers: []v1alpha1.Trigger{ + { + Template: &v1alpha1.TriggerTemplate{ + Name: "fake-trigger", + K8s: &v1alpha1.StandardK8STrigger{ + Operation: "create", + Source: &v1alpha1.ArtifactLocation{}, + }, + }, + }, + }, + Dependencies: []v1alpha1.EventDependency{ + { + Name: "fake-dep", + EventSourceName: "fake-source", + EventName: "fake-one", + }, + }, + }, + } + + fakeEventBus = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + NATS: &v1alpha1.NATSBus{ + Native: &v1alpha1.NativeStrategy{ + Auth: &v1alpha1.AuthStrategyToken, + }, + }, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + NATS: &v1alpha1.NATSConfig{ + URL: "nats://xxxx", + Auth: &v1alpha1.AuthStrategyToken, + AccessSecret: &corev1.SecretKeySelector{ + Key: "test-key", + LocalObjectReference: corev1.LocalObjectReference{ + Name: "test-name", + }, + }, + }, + }, + }, + } + + fakeEventBusJetstream = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + JetStream: &v1alpha1.JetStreamBus{ + Version: "x.x.x", + }, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + JetStream: &v1alpha1.JetStreamConfig{ + URL: "nats://xxxx", + }, + }, + }, + } + + fakeEventBusJetstreamWithTLS = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + JetStream: &v1alpha1.JetStreamBus{}, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + JetStream: &v1alpha1.JetStreamConfig{ + URL: "nats://xxxx", + TLS: &v1alpha1.TLSConfig{ + CACertSecret: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "secret-0", + }, + Key: "ca.crt", + }, + ClientKeySecret: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "secret-1", + }, + Key: "tls.key", + }, + ClientCertSecret: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "secret-1", + }, + Key: "tls.crt", + }, + }, + }, + }, + }, + } + + fakeEventBusKafka = &v1alpha1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: v1alpha1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: v1alpha1.DefaultEventBusName, + }, + Spec: v1alpha1.EventBusSpec{ + Kafka: &v1alpha1.KafkaBus{ + URL: "localhost:9092", + }, + }, + Status: v1alpha1.EventBusStatus{ + Config: v1alpha1.BusConfig{ + Kafka: &v1alpha1.KafkaBus{ + URL: "localhost:9092", + }, + }, + }, + } +) + +func Test_BuildDeployment(t *testing.T) { + t.Run("test build with eventbus", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + deployment, err := buildDeployment(args, fakeEventBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + volumes := deployment.Spec.Template.Spec.Volumes + assert.True(t, len(volumes) > 0) + hasAuthVolume := false + hasTmpVolume := false + for _, vol := range volumes { + if vol.Name == "auth-volume" { + hasAuthVolume = true + } + if vol.Name == "tmp" { + hasTmpVolume = true + } + } + assert.True(t, hasAuthVolume) + assert.True(t, hasTmpVolume) + assert.True(t, len(deployment.Spec.Template.Spec.ImagePullSecrets) > 0) + assert.Equal(t, deployment.Spec.Template.Spec.PriorityClassName, "test-class") + assert.Nil(t, deployment.Spec.RevisionHistoryLimit) + }) + t.Run("test revisionHistoryLimit", func(t *testing.T) { + sensorWithRevisionHistoryLimit := sensorObj.DeepCopy() + sensorWithRevisionHistoryLimit.Spec.RevisionHistoryLimit = func() *int32 { i := int32(3); return &i }() + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorWithRevisionHistoryLimit, + Labels: testLabels, + } + deployment, err := buildDeployment(args, fakeEventBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + assert.Equal(t, int32(3), *deployment.Spec.RevisionHistoryLimit) + }) + + t.Run("test kafka eventbus secrets attached", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + + // add secrets to kafka eventbus + testBus := fakeEventBusKafka.DeepCopy() + testBus.Spec.Kafka.TLS = &v1alpha1.TLSConfig{ + CACertSecret: &corev1.SecretKeySelector{Key: "cert", LocalObjectReference: corev1.LocalObjectReference{Name: "tls-secret"}}, + } + testBus.Spec.Kafka.SASL = &v1alpha1.SASLConfig{ + Mechanism: "SCRAM-SHA-512", + UserSecret: &corev1.SecretKeySelector{Key: "username", LocalObjectReference: corev1.LocalObjectReference{Name: "sasl-secret"}}, + PasswordSecret: &corev1.SecretKeySelector{Key: "password", LocalObjectReference: corev1.LocalObjectReference{Name: "sasl-secret"}}, + } + + deployment, err := buildDeployment(args, testBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + + hasSASLSecretVolume := false + hasSASLSecretVolumeMount := false + hasTLSSecretVolume := false + hasTLSSecretVolumeMount := false + for _, volume := range deployment.Spec.Template.Spec.Volumes { + if volume.Name == "secret-sasl-secret" { + hasSASLSecretVolume = true + } + if volume.Name == "secret-tls-secret" { + hasTLSSecretVolume = true + } + } + for _, volumeMount := range deployment.Spec.Template.Spec.Containers[0].VolumeMounts { + if volumeMount.Name == "secret-sasl-secret" { + hasSASLSecretVolumeMount = true + } + if volumeMount.Name == "secret-tls-secret" { + hasTLSSecretVolumeMount = true + } + } + + assert.True(t, hasSASLSecretVolume) + assert.True(t, hasSASLSecretVolumeMount) + assert.True(t, hasTLSSecretVolume) + assert.True(t, hasTLSSecretVolumeMount) + }) + + t.Run("test jetstream eventbus secrets attached", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + + deployment, err := buildDeployment(args, fakeEventBusJetstreamWithTLS.DeepCopy()) + assert.Nil(t, err) + assert.NotNil(t, deployment) + + hasCAVolume := false + hasCertVolume := false + hasCAVolumeMount := false + hasCertVolumeMount := false + for _, volume := range deployment.Spec.Template.Spec.Volumes { + if volume.Name == "secret-0" { + if hasCAVolume { + assert.Fail(t, "Secrets should be de-duplicated") + } + hasCAVolume = true + } + if volume.Name == "secret-1" { + if hasCertVolume { + assert.Fail(t, "Secrets should be de-duplicated") + } + hasCertVolume = true + } + } + for _, volumeMount := range deployment.Spec.Template.Spec.Containers[0].VolumeMounts { + if volumeMount.Name == "secret-0" { + hasCAVolumeMount = true + assert.Equal(t, volumeMount.MountPath, fmt.Sprintf("/argo-events/secrets/%s", volumeMount.Name)) + } + if volumeMount.Name == "secret-1" { + hasCertVolumeMount = true + assert.Equal(t, volumeMount.MountPath, fmt.Sprintf("/argo-events/secrets/%s", volumeMount.Name)) + } + } + + assert.True(t, hasCAVolume) + assert.True(t, hasCertVolume) + assert.True(t, hasCAVolumeMount) + assert.True(t, hasCertVolumeMount) + }) + + t.Run("test secret volume and volumemount order deterministic", func(t *testing.T) { + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + + wantVolumeNames := []string{"test-data", "auth-volume", "tmp"} + wantVolumeMountNames := []string{"test-data", "auth-volume", "tmp"} + + deployment, err := buildDeployment(args, fakeEventBus) + assert.Nil(t, err) + assert.NotNil(t, deployment) + gotVolumes := deployment.Spec.Template.Spec.Volumes + gotVolumeMounts := deployment.Spec.Template.Spec.Containers[0].VolumeMounts + + var gotVolumeNames []string + var gotVolumeMountNames []string + + for _, v := range gotVolumes { + gotVolumeNames = append(gotVolumeNames, v.Name) + } + for _, v := range gotVolumeMounts { + gotVolumeMountNames = append(gotVolumeMountNames, v.Name) + } + + assert.Equal(t, len(gotVolumes), len(wantVolumeNames)) + assert.Equal(t, len(gotVolumeMounts), len(wantVolumeMountNames)) + + for i := range gotVolumeNames { + assert.Equal(t, gotVolumeNames[i], wantVolumeNames[i]) + } + for i := range gotVolumeMountNames { + assert.Equal(t, gotVolumeMountNames[i], wantVolumeMountNames[i]) + } + }) +} + +func TestResourceReconcile(t *testing.T) { + t.Run("test resource reconcile without eventbus", func(t *testing.T) { + cl := fake.NewClientBuilder().Build() + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + err := Reconcile(cl, nil, args, logging.NewArgoEventsLogger()) + assert.Error(t, err) + assert.False(t, sensorObj.Status.IsReady()) + }) + + for _, eb := range []*v1alpha1.EventBus{fakeEventBus, fakeEventBusJetstream, fakeEventBusKafka} { + testBus := eb.DeepCopy() + + t.Run("test resource reconcile with eventbus", func(t *testing.T) { + ctx := context.TODO() + cl := fake.NewClientBuilder().Build() + testBus.Status.MarkDeployed("test", "test") + testBus.Status.MarkConfigured() + err := cl.Create(ctx, testBus) + assert.Nil(t, err) + args := &AdaptorArgs{ + Image: testImage, + Sensor: sensorObj, + Labels: testLabels, + } + err = Reconcile(cl, testBus, args, logging.NewArgoEventsLogger()) + assert.Nil(t, err) + assert.True(t, sensorObj.Status.IsReady()) + + deployList := &appv1.DeploymentList{} + err = cl.List(ctx, deployList, &client.ListOptions{ + Namespace: testNamespace, + }) + assert.NoError(t, err) + assert.Equal(t, 1, len(deployList.Items)) + + svcList := &corev1.ServiceList{} + err = cl.List(ctx, svcList, &client.ListOptions{ + Namespace: testNamespace, + }) + assert.NoError(t, err) + assert.Equal(t, 0, len(svcList.Items)) + }) + } +} +``` + +## `pkg/sensors/triggers/standard-k8s/standard-k8s.go` (changed lines (25, 26)) + +```go +/* +Copyright 2020 The Argoproj Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package standard_k8s + +import ( + "context" + "fmt" + "strconv" + "time" + + "github.com/imdario/mergo" + "go.uber.org/zap" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + k8stypes "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" + + "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + "github.com/argoproj/argo-events/pkg/sensors/policy" + "github.com/argoproj/argo-events/pkg/sensors/triggers" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +var clusterResources = map[string]bool{ + "namespaces": true, + "nodes": true, + "persistentvolumes": true, + "clusterroles": true, + "clusterrolebindings": true, +} + +// StandardK8STrigger implements Trigger interface for standard Kubernetes resources +type StandardK8sTrigger struct { + // K8sClient is kubernetes client + K8sClient kubernetes.Interface + // Dynamic client is Kubernetes dymalic client + DynamicClient dynamic.Interface + // Sensor object + Sensor *v1alpha1.Sensor + // Trigger definition + Trigger *v1alpha1.Trigger + // logger to log stuff + Logger *zap.SugaredLogger + + namespableDynamicClient dynamic.NamespaceableResourceInterface +} + +// NewStandardK8sTrigger returns a new StandardK8STrigger +func NewStandardK8sTrigger(k8sClient kubernetes.Interface, dynamicClient dynamic.Interface, sensor *v1alpha1.Sensor, trigger *v1alpha1.Trigger, logger *zap.SugaredLogger) *StandardK8sTrigger { + return &StandardK8sTrigger{ + K8sClient: k8sClient, + DynamicClient: dynamicClient, + Sensor: sensor, + Trigger: trigger, + Logger: logger.With(logging.LabelTriggerType, v1alpha1.TriggerTypeK8s), + } +} + +// GetTriggerType returns the type of the trigger +func (k8sTrigger *StandardK8sTrigger) GetTriggerType() v1alpha1.TriggerType { + return v1alpha1.TriggerTypeK8s +} + +// FetchResource fetches the trigger resource from external source +func (k8sTrigger *StandardK8sTrigger) FetchResource(ctx context.Context) (interface{}, error) { + trigger := k8sTrigger.Trigger + var rObj runtime.Object + + uObj, err := triggers.FetchKubernetesResource(trigger.Template.K8s.Source) + if err != nil { + return nil, err + } + + gvr := triggers.GetGroupVersionResource(uObj) + k8sTrigger.namespableDynamicClient = k8sTrigger.DynamicClient.Resource(gvr) + + if trigger.Template.K8s.LiveObject && trigger.Template.K8s.Operation == v1alpha1.Update { + objName := uObj.GetName() + if objName == "" { + return nil, fmt.Errorf("resource name must be specified for fetching live object") + } + + objNamespace := uObj.GetNamespace() + _, isClusterResource := clusterResources[gvr.Resource] + if objNamespace == "" && !isClusterResource { + return nil, fmt.Errorf("resource namespace must be specified for fetching live object") + } + rObj, err = k8sTrigger.namespableDynamicClient.Namespace(objNamespace).Get(ctx, objName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + } else { + rObj = uObj + } + return rObj, nil +} + +// ApplyResourceParameters applies parameters to the trigger resource +func (k8sTrigger *StandardK8sTrigger) ApplyResourceParameters(events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error) { + obj, ok := resource.(*unstructured.Unstructured) + if !ok { + return nil, fmt.Errorf("failed to interpret the trigger resource") + } + if err := triggers.ApplyResourceParameters(events, k8sTrigger.Trigger.Template.K8s.Parameters, obj); err != nil { + return nil, err + } + return obj, nil +} + +// Execute executes the trigger +func (k8sTrigger *StandardK8sTrigger) Execute(ctx context.Context, events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error) { + trigger := k8sTrigger.Trigger + + obj, ok := resource.(*unstructured.Unstructured) + if !ok { + return nil, fmt.Errorf("failed to interpret the trigger resource") + } + + gvr := triggers.GetGroupVersionResource(obj) + namespace := "" + if _, isClusterResource := clusterResources[gvr.Resource]; !isClusterResource { + namespace = obj.GetNamespace() + // Defaults to sensor's namespace + if namespace == "" { + namespace = k8sTrigger.Sensor.Namespace + } + } + obj.SetNamespace(namespace) + + op := v1alpha1.Create + if trigger.Template.K8s.Operation != "" { + op = trigger.Template.K8s.Operation + } + + // We might have a client from FetchResource() already, or we might not have one yet. + if k8sTrigger.namespableDynamicClient == nil { + k8sTrigger.namespableDynamicClient = k8sTrigger.DynamicClient.Resource(gvr) + } + + switch op { + case v1alpha1.Create: + k8sTrigger.Logger.Info("creating the object...") + // Add labels + labels := obj.GetLabels() + if labels == nil { + labels = make(map[string]string) + } + labels["events.argoproj.io/sensor"] = k8sTrigger.Sensor.Name + labels["events.argoproj.io/trigger"] = trigger.Template.Name + labels["events.argoproj.io/action-timestamp"] = strconv.Itoa(int(time.Now().UnixNano() / int64(time.Millisecond))) + obj.SetLabels(labels) + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Create(ctx, obj, metav1.CreateOptions{}) + + case v1alpha1.Update: + k8sTrigger.Logger.Info("updating the object...") + + oldObj, err := k8sTrigger.namespableDynamicClient.Namespace(namespace).Get(ctx, obj.GetName(), metav1.GetOptions{}) + if err != nil && apierrors.IsNotFound(err) { + k8sTrigger.Logger.Info("object not found, creating the object...") + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Create(ctx, obj, metav1.CreateOptions{}) + } else if err != nil { + return nil, fmt.Errorf("failed to retrieve existing object. err: %w", err) + } + + if err := mergo.Merge(oldObj, obj, mergo.WithOverride); err != nil { + return nil, fmt.Errorf("failed to update the object. err: %w", err) + } + + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Update(ctx, oldObj, metav1.UpdateOptions{}) + + case v1alpha1.Patch: + k8sTrigger.Logger.Info("patching the object...") + + _, err := k8sTrigger.namespableDynamicClient.Namespace(namespace).Get(ctx, obj.GetName(), metav1.GetOptions{}) + if err != nil && apierrors.IsNotFound(err) { + k8sTrigger.Logger.Info("object not found, creating the object...") + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Create(ctx, obj, metav1.CreateOptions{}) + } else if err != nil { + return nil, fmt.Errorf("failed to retrieve existing object. err: %w", err) + } + + if k8sTrigger.Trigger.Template.K8s.PatchStrategy == "" { + k8sTrigger.Trigger.Template.K8s.PatchStrategy = k8stypes.MergePatchType + } + + body, err := obj.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("failed to marshal object into JSON schema. err: %w", err) + } + + return k8sTrigger.namespableDynamicClient.Namespace(namespace).Patch(ctx, obj.GetName(), k8sTrigger.Trigger.Template.K8s.PatchStrategy, body, metav1.PatchOptions{}) + + case v1alpha1.Delete: + k8sTrigger.Logger.Info("deleting the object...") + _, err := k8sTrigger.namespableDynamicClient.Namespace(namespace).Get(ctx, obj.GetName(), metav1.GetOptions{}) + + if err != nil && apierrors.IsNotFound(err) { + k8sTrigger.Logger.Info("object not found, nothing to delete...") + return nil, nil + } else if err != nil { + return nil, fmt.Errorf("failed to retrieve existing object. err: %w", err) + } + + err = k8sTrigger.namespableDynamicClient.Namespace(namespace).Delete(ctx, obj.GetName(), metav1.DeleteOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to delete object. err: %w", err) + } + return nil, nil + + default: + return nil, fmt.Errorf("unknown operation type %s", string(op)) + } +} + +// ApplyPolicy applies the policy on the trigger +func (k8sTrigger *StandardK8sTrigger) ApplyPolicy(ctx context.Context, resource interface{}) error { + trigger := k8sTrigger.Trigger + + if trigger.Policy == nil || trigger.Policy.K8s == nil || trigger.Policy.K8s.Labels == nil { + return nil + } + + obj, ok := resource.(*unstructured.Unstructured) + if !ok { + return fmt.Errorf("failed to interpret the trigger resource") + } + + p := policy.NewResourceLabels(trigger, k8sTrigger.namespableDynamicClient, obj) + if p == nil { + return nil + } + + err := p.ApplyPolicy(ctx) + if err != nil { + if wait.Interrupted(err) { + if trigger.Policy.K8s.ErrorOnBackoffTimeout { + return fmt.Errorf("failed to determine status of the triggered resource. setting trigger state as failed") + } + return nil + } else { + return err + } + } + return nil +} +``` + +## `pkg/webhook/validator/validator_test.go` (changed lines (97, 98)) + +```go +package validator + +import ( + "context" + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + fakeClient "k8s.io/client-go/kubernetes/fake" + + aev1 "github.com/argoproj/argo-events/pkg/apis/events/v1alpha1" + fakeeventsclient "github.com/argoproj/argo-events/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo-events/pkg/shared/logging" +) + +const ( + testNamespace = "test-ns" +) + +var ( + fakeK8sClient = fakeClient.NewSimpleClientset() + fakeEventsClient = fakeeventsclient.NewSimpleClientset().ArgoprojV1alpha1() +) + +func contextWithLogger(t *testing.T) context.Context { + t.Helper() + return logging.WithLogger(context.Background(), logging.NewArgoEventsLogger()) +} + +func fromSchemaGVK(gvk schema.GroupVersionKind) metav1.GroupVersionKind { + return metav1.GroupVersionKind{ + Group: gvk.Group, + Version: gvk.Version, + Kind: gvk.Kind, + } +} + +func fakeEventBus() *aev1.EventBus { + return &aev1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: aev1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: aev1.DefaultEventBusName, + }, + Spec: aev1.EventBusSpec{ + NATS: &aev1.NATSBus{ + Native: &aev1.NativeStrategy{ + Auth: &aev1.AuthStrategyToken, + }, + }, + }, + } +} + +func fakeExoticEventBus() *aev1.EventBus { + cID := "test-cluster-id" + return &aev1.EventBus{ + TypeMeta: metav1.TypeMeta{ + APIVersion: aev1.SchemeGroupVersion.String(), + Kind: "EventBus", + }, + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: "test-name", + }, + Spec: aev1.EventBusSpec{ + NATS: &aev1.NATSBus{ + Exotic: &aev1.NATSConfig{ + ClusterID: &cID, + URL: "nats://adsaf:1234", + }, + }, + }, + } +} + +func fakeSensor() *aev1.Sensor { + return &aev1.Sensor{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-sensor", + Namespace: testNamespace, + }, + Spec: aev1.SensorSpec{ + Template: &aev1.Template{ + ServiceAccountName: "fake-sa", + ImagePullSecrets: []corev1.LocalObjectReference{ + { + Name: "test", + }, + }, + Container: &corev1.Container{ + VolumeMounts: []corev1.VolumeMount{ + { + MountPath: "/test-data", + Name: "test-data", + }, + }, + }, + Volumes: []corev1.Volume{ + { + Name: "test-data", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + }, + }, + Triggers: []aev1.Trigger{ + { + Template: &aev1.TriggerTemplate{ + Name: "fake-trigger", + K8s: &aev1.StandardK8STrigger{ + Operation: "create", + Source: &aev1.ArtifactLocation{}, + }, + }, + }, + }, + Dependencies: []aev1.EventDependency{ + { + Name: "fake-dep", + EventSourceName: "fake-source", + EventName: "fake-one", + }, + }, + }, + } +} + +func fakeCalendarEventSourceMap(name string) map[string]aev1.CalendarEventSource { + return map[string]aev1.CalendarEventSource{name: {Schedule: "*/5 * * * *"}} +} + +func fakeCalendarEventSource() *aev1.EventSource { + return &aev1.EventSource{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: testNamespace, + Name: "test-es", + }, + Spec: aev1.EventSourceSpec{ + Calendar: fakeCalendarEventSourceMap("test"), + }, + } +} + +func TestGetValidator(t *testing.T) { + t.Run("test get EventBus validator", func(t *testing.T) { + byts, err := json.Marshal(fakeEventBus()) + assert.NoError(t, err) + v, err := GetValidator(contextWithLogger(t), fakeK8sClient, fakeEventsClient, fromSchemaGVK(aev1.EventBusGroupVersionKind), nil, byts) + assert.NoError(t, err) + assert.NotNil(t, v) + }) + t.Run("test get EventSource validator", func(t *testing.T) { + byts, err := json.Marshal(fakeCalendarEventSource()) + assert.NoError(t, err) + v, err := GetValidator(contextWithLogger(t), fakeK8sClient, fakeEventsClient, fromSchemaGVK(aev1.EventSourceGroupVersionKind), nil, byts) + assert.NoError(t, err) + assert.NotNil(t, v) + }) + t.Run("test get Sensor validator", func(t *testing.T) { + byts, err := json.Marshal(fakeSensor()) + assert.NoError(t, err) + v, err := GetValidator(contextWithLogger(t), fakeK8sClient, fakeEventsClient, fromSchemaGVK(aev1.SensorGroupVersionKind), nil, byts) + assert.NoError(t, err) + assert.NotNil(t, v) + }) +} +``` diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/task.json b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8b3ee32441a34cce566067104de61e276856eb97 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/task.json @@ -0,0 +1,79 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-fb75b5c545e3cb24f7ae", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-fb75b5c545e3cb24f7ae", + "project_id": "morefixes__argoproj__argo-events", + "language": "go", + "backend": "codeql" + }, + "changed_go_files": [ + "pkg/apis/events/openapi/openapi_generated.go", + "pkg/apis/events/v1alpha1/container_template.go", + "pkg/apis/events/v1alpha1/generated.pb.go", + "pkg/apis/events/v1alpha1/template.go", + "pkg/apis/events/v1alpha1/template_test.go", + "pkg/apis/events/v1alpha1/zz_generated.deepcopy.go", + "pkg/apis/events/v1alpha1/zz_generated.defaults.go", + "pkg/reconciler/eventsource/controller.go", + "pkg/reconciler/eventsource/resource.go", + "pkg/reconciler/sensor/resource.go", + "pkg/reconciler/sensor/resource_test.go", + "pkg/sensors/triggers/standard-k8s/standard-k8s.go", + "pkg/webhook/validator/validator_test.go" + ], + "patch_units": { + "before": [ + "pkg/apis/events/openapi/openapi_generated.go", + "pkg/apis/events/v1alpha1/container_template.go", + "pkg/apis/events/v1alpha1/generated.pb.go", + "pkg/apis/events/v1alpha1/template.go", + "pkg/apis/events/v1alpha1/zz_generated.deepcopy.go", + "pkg/apis/events/v1alpha1/zz_generated.defaults.go", + "pkg/reconciler/eventsource/controller.go", + "pkg/reconciler/eventsource/resource.go", + "pkg/reconciler/sensor/resource.go", + "pkg/reconciler/sensor/resource_test.go", + "pkg/sensors/triggers/standard-k8s/standard-k8s.go", + "pkg/webhook/validator/validator_test.go" + ], + "after": [ + "pkg/apis/events/openapi/openapi_generated.go", + "pkg/apis/events/v1alpha1/container_template.go", + "pkg/apis/events/v1alpha1/generated.pb.go", + "pkg/apis/events/v1alpha1/template.go", + "pkg/apis/events/v1alpha1/template_test.go", + "pkg/apis/events/v1alpha1/zz_generated.deepcopy.go", + "pkg/apis/events/v1alpha1/zz_generated.defaults.go", + "pkg/reconciler/eventsource/controller.go", + "pkg/reconciler/eventsource/resource.go", + "pkg/reconciler/sensor/resource.go", + "pkg/reconciler/sensor/resource_test.go", + "pkg/sensors/triggers/standard-k8s/standard-k8s.go", + "pkg/webhook/validator/validator_test.go" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/44c0b7a872627e883734bff4b6ea4b9b171306b5a137d555c12405db9f296876/database", + "cache_key": "44c0b7a872627e883734bff4b6ea4b9b171306b5a137d555c12405db9f296876", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/b1895ee3050cf487dd34c5be85fcd254fc3d3c61c46530331337421f90be2f24/database", + "cache_key": "b1895ee3050cf487dd34c5be85fcd254fc3d3c61c46530331337421f90be2f24", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/9232ce158bf25e546d088f0884c6a0fbf14d9c7f0d0ce64b9a51bc3ec043f81a/database", + "cache_key": "9232ce158bf25e546d088f0884c6a0fbf14d9c7f0d0ce64b9a51bc3ec043f81a", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-fb75b5c545e3cb24f7ae/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-fb75b5c545e3cb24f7ae/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/task_prompt.md b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca4eaa95c7b1c147a1670e92642cfd78451b18 --- /dev/null +++ b/tasks/codeql_go_benchmark_top30_v1/morefixes-fb75b5c545e3cb24f7ae/task_prompt.md @@ -0,0 +1,82 @@ +# Go CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Go context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `go_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/go_api.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 50-minute hard wall-clock ceiling and must be finalized by minute 43. Minutes +43–50 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-43 + finalization deadline, and the minute-50 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..41ff46348ebe03ed4a2e95646c62a53c37838e7a --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/patch.diff @@ -0,0 +1,63 @@ +diff --git a/src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java b/src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java +index 5880869..600593a 100644 +--- a/src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java ++++ b/src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java +@@ -785,11 +785,14 @@ public class CodeDxPublisher extends Recorder implements SimpleBuildStep { + return FormValidation.ok(); + } + ++ @POST + public FormValidation doCheckSourceAndBinaryFiles(@QueryParameter final String value, @QueryParameter final boolean gitFetchConfiguration, @QueryParameter final String toolOutputFiles, @AncestorInPath AbstractProject project) { + if (project == null) { + return FormValidation.ok(); + } + ++ project.checkPermission(AbstractProject.CONFIGURE); ++ + if (value.length() == 0) { + if (gitFetchConfiguration) + return FormValidation.ok(); +@@ -802,20 +805,25 @@ public class CodeDxPublisher extends Recorder implements SimpleBuildStep { + return Util.checkCSVGlobMatches(value, project.getSomeWorkspace()); + } + ++ @POST + public FormValidation doCheckExcludedSourceAndBinaryFiles(@QueryParameter final String value, @AncestorInPath AbstractProject project) { + if (project == null) { + return FormValidation.ok(); + } else { ++ project.checkPermission(AbstractProject.CONFIGURE); + return Util.checkCSVGlobMatches(value, project.getSomeWorkspace()); + } + } + ++ @POST + public FormValidation doCheckToolOutputFiles(@QueryParameter final String value, @QueryParameter final String sourceAndBinaryFiles, @QueryParameter final boolean gitFetchConfiguration, @AncestorInPath AbstractProject project) { + + if (project == null) { + return FormValidation.ok(); + } + ++ project.checkPermission(AbstractProject.CONFIGURE); ++ + if (value.length() == 0 && sourceAndBinaryFiles.length() == 0 && !gitFetchConfiguration) { + return FormValidation.error("You must specify \"Tool Output Files\" and/or \"Source and Binary Files\", or enable \"Include Git Source\""); + } +diff --git a/src/main/java/org/jenkinsci/plugins/codedx/Util.java b/src/main/java/org/jenkinsci/plugins/codedx/Util.java +index ef156ea..603858e 100755 +--- a/src/main/java/org/jenkinsci/plugins/codedx/Util.java ++++ b/src/main/java/org/jenkinsci/plugins/codedx/Util.java +@@ -67,10 +67,12 @@ public class Util { + + if(value.length() != 0 && workspace != null){ + ++ String basePath = workspace.getRemote(); + for(String path : Util.commaSeparatedToArray(value)){ + + try { +- if(path.length() == 0 || ! new FilePath(workspace, path).exists()){ ++ FilePath subPath = new FilePath(workspace, path); ++ if(path.length() == 0 || !subPath.exists() || !subPath.absolutize().getRemote().startsWith(basePath)){ + + return FormValidation.warning(path + " does not exist in the workspace."); + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..d4048ffc4eec3ce773945286aa093f59dec64613 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/post_context.md @@ -0,0 +1,1049 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java` (changed lines (788, 794, 795, 808, 813, 818, 825, 826)) + +```java +/* + * © 2023 Synopsys, Inc. All rights reserved worldwide. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ +package org.jenkinsci.plugins.codedx; + +import com.codedx.api.client.*; +import com.codedx.api.client.Job; +import com.codedx.api.client.Project; +import com.codedx.security.JenkinsSSLConnectionSocketFactoryFactory; +import com.codedx.util.CodeDxVersion; +import hudson.AbortException; +import hudson.FilePath; +import hudson.Launcher; +import hudson.Extension; +import hudson.model.*; +import hudson.util.FormValidation; +import hudson.util.ListBoxModel; +import hudson.tasks.BuildStepMonitor; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Publisher; +import hudson.tasks.Recorder; +import jenkins.model.Jenkins; +import jenkins.tasks.SimpleBuildStep; +import net.sf.json.JSONObject; + +import org.apache.commons.io.IOUtils; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.impl.client.HttpClientBuilder; +import org.jenkinsci.plugins.codedx.model.CodeDxReportStatistics; +import org.jenkinsci.plugins.codedx.model.CodeDxGroupStatistics; +import org.jenkinsci.plugins.codedx.monitor.AnalysisMonitor; +import org.jenkinsci.plugins.codedx.monitor.DirectAnalysisMonitor; +import org.jenkinsci.plugins.codedx.monitor.GitJobAnalysisMonitor; +import org.kohsuke.stapler.*; +import org.kohsuke.stapler.verb.POST; + +import javax.net.ssl.SSLHandshakeException; +import javax.servlet.ServletException; + +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.util.*; +import java.util.logging.Logger; + +/** + * Jenkins publisher that publishes project source, binaries, and + * analysis tool output files to a CodeDx server. + * + * @author anthonyd + */ +public class CodeDxPublisher extends Recorder implements SimpleBuildStep { + + private final String url; + private final String key; + private final String projectId; + + // Comma separated list of source/binary file Ant GLOB patterns + private String sourceAndBinaryFiles; + // List of paths to tool output files + private String toolOutputFiles; + // Comma separated list of source/binary file Ant GLOB patterns to exclude + private String excludedSourceAndBinaryFiles; + + private String analysisName; + + // Contains the fields applicable when the user chooses to have Jenkins wait for + // analysis runs to complete. + private AnalysisResultConfiguration analysisResultConfiguration; + + private transient CodeDxClient client; + + private String selfSignedCertificateFingerprint; + + private String targetBranchName, baseBranchName; + + private BuildErrorBehavior errorHandlingBehavior; + + private GitFetchConfiguration gitFetchConfiguration; + + private final static Logger logger = Logger.getLogger(CodeDxPublisher.class.getName()); + + /** + * @param url URL of the Code Dx server + * @param key API key of the Code Dx server + * @param projectId Code Dx project ID + * @param analysisName The name to use for the analysis + */ + @DataBoundConstructor + public CodeDxPublisher( + final String url, + final String key, + final String projectId, + final String analysisName + ) { + this.projectId = projectId; + this.url = url; + this.key = key; + this.analysisName = analysisName.trim(); + + this.sourceAndBinaryFiles = ""; + this.excludedSourceAndBinaryFiles = ""; + this.toolOutputFiles = ""; + this.analysisResultConfiguration = null; + this.selfSignedCertificateFingerprint = null; + this.targetBranchName = null; + this.baseBranchName = null; + this.errorHandlingBehavior = BuildErrorBehavior.MarkFailed; + + this.gitFetchConfiguration = null; + + setupClient(); + } + + private void setupClient() { + if (this.client == null) { + this.client = buildClient(url, key, selfSignedCertificateFingerprint); + } + } + + public AnalysisResultConfiguration getAnalysisResultConfiguration() { + return analysisResultConfiguration; + } + + @DataBoundSetter + public void setAnalysisResultConfiguration(AnalysisResultConfiguration analysisResultConfiguration) { + this.analysisResultConfiguration = analysisResultConfiguration; + } + + public String getProjectId() { + return projectId; + } + + public String getUrl() { + return url; + } + + public String getKey() { + return key; + } + + public String getSourceAndBinaryFiles() { + return sourceAndBinaryFiles; + } + + @DataBoundSetter + public void setSourceAndBinaryFiles(String sourceAndBinaryFiles) { + this.sourceAndBinaryFiles = sourceAndBinaryFiles; + } + + public String getToolOutputFiles() { + return toolOutputFiles; + } + + @DataBoundSetter + public void setToolOutputFiles(String toolOutputFiles) { + this.toolOutputFiles = toolOutputFiles; + } + + public String getExcludedSourceAndBinaryFiles() { + return excludedSourceAndBinaryFiles; + } + + @DataBoundSetter + public void setExcludedSourceAndBinaryFiles(String excludedSourceAndBinaryFiles) { + this.excludedSourceAndBinaryFiles = excludedSourceAndBinaryFiles; + } + + public String getSelfSignedCertificateFingerprint() { + return selfSignedCertificateFingerprint; + } + + @DataBoundSetter + public void setSelfSignedCertificateFingerprint(String selfSignedCertificateFingerprint) { + this.selfSignedCertificateFingerprint = selfSignedCertificateFingerprint; + + this.client = null; + setupClient(); + } + + public String getAnalysisName(){ return analysisName; } + + private String getLatestAnalysisUrl() { + if (projectId.length() != 0 && !projectId.equals("-1")) { + setupClient(); + return client.buildLatestFindingsUrl(Integer.parseInt(projectId)); + } else { + return null; + } + } + + public String getTargetBranchName() { + return targetBranchName; + } + + @DataBoundSetter + public void setTargetBranchName(String targetBranchName) { + if (targetBranchName != null) targetBranchName = targetBranchName.trim(); + + if (targetBranchName != null && targetBranchName.length() > 0) + this.targetBranchName = targetBranchName; + else + this.targetBranchName = null; + } + + public String getBaseBranchName() { + return baseBranchName; + } + + @DataBoundSetter + public void setBaseBranchName(String baseBranchName) { + if (baseBranchName != null) baseBranchName = baseBranchName.trim(); + + if (baseBranchName != null && baseBranchName.length() > 0) + this.baseBranchName = baseBranchName; + else + this.baseBranchName = null; + } + + public BuildErrorBehavior getErrorHandlingBehavior() { + return errorHandlingBehavior; + } + + @DataBoundSetter + public void setErrorHandlingBehavior(BuildErrorBehavior behavior) { + errorHandlingBehavior = behavior; + } + + public GitFetchConfiguration getGitFetchConfiguration() { + return gitFetchConfiguration; + } + + @DataBoundSetter + public void setGitFetchConfiguration(GitFetchConfiguration config) { + gitFetchConfiguration = config; + } + + // Sets the build status based on `errorHandlingBehavior`. Only meant to be used for Code Dx-specific + // errors, eg analysis failure and connection issues. Configuration errors will be thrown as usual + // since those issues aren't related to Code Dx itself. + // + // returns true if we ignore the error, false if we want to exit prematurely + private Boolean handleCodeDxError(Run build, PrintStream buildOutput, String cause) throws AbortException { + buildOutput.println(cause); + + BuildErrorBehavior behavior = errorHandlingBehavior; + if (behavior == null) behavior = BuildErrorBehavior.Default; + + if (behavior != BuildErrorBehavior.None) { + build.setResult(behavior.getEquivalentResult()); + return false; + } else { + buildOutput.println("This will be ignored since errorHandlingBehavior is set to " + behavior.getLabel()); + return true; + } + } + + @Override + public void perform( + final Run build, + final FilePath workspace, + final Launcher launcher, + final TaskListener listener) throws InterruptedException, IOException { + + Date startingDate = new Date(); + + setupClient(); + final Map toSend = new HashMap(); + final PrintStream buildOutput = listener.getLogger(); + + buildOutput.println("Publishing build to Code Dx:"); + + if (errorHandlingBehavior == null) { + errorHandlingBehavior = BuildErrorBehavior.Default; + } + buildOutput.println("Error handling set to: " + errorHandlingBehavior.getLabel()); + + if (projectId.length() == 0 || projectId.equals("-1")) { + buildOutput.println("No project has been selected"); + return; + } + + ProjectContext project; + try { + project = new ProjectContext(Integer.parseInt(projectId)); + } catch (NumberFormatException e) { + throw new AbortException("Invalid project ID: " + projectId); + } + + buildOutput.println(String.format("Publishing to Code Dx server at %s to Code Dx project %s: ", url, projectId)); + + final CodeDxClient repeatingClient = new CodeDxRepeatingClient(this.client, buildOutput); + + CodeDxVersion cdxVersion = null; + try { + cdxVersion = repeatingClient.getCodeDxVersion(); + buildOutput.println("Got Code Dx version: " + cdxVersion); + } catch (Exception e) { + e.printStackTrace(buildOutput); + if (handleCodeDxError(build, buildOutput, "An error occurred fetching the Code Dx version")) { + buildOutput.println("The Code Dx plugin cannot continue without verifying the Code Dx version, exiting"); + } + // we can't continue without a version since we don't want to accidentally put data into the wrong target + // by eg using a placeholder version which skips over the Code Dx branch + return; + } + + ValueResolver valueResolver = new ValueResolver(build, workspace, listener, buildOutput); + TargetBranchChecker branchChecker = new TargetBranchChecker(project, repeatingClient, valueResolver, buildOutput); + try { + branchChecker.validate(cdxVersion, targetBranchName, baseBranchName); + } catch (AbortException e) { + // configuration error + throw e; + } catch (IOException e) { + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "An error occurred while validating branch selection"); + // connection error; this will only happen if a target branch was specified. we can't continue without + // applying that target branch, or we might cause data to be written to an unexpected target branch + return; + } + + project = project.withBranch(branchChecker.getTargetBranchName()); + + buildOutput.println("Creating source/binary zip..."); + + FilePath sourceAndBinaryZip = Archiver.archive(workspace, + Util.commaSeparatedToArray(sourceAndBinaryFiles), + Util.commaSeparatedToArray(excludedSourceAndBinaryFiles), + "source"); + + if (sourceAndBinaryZip != null) { + buildOutput.println("Adding source/binary zip..."); + toSend.put("Jenkins-SourceAndBinary.zip", new DeferredFilePathInputStream(sourceAndBinaryZip)); + } else { + buildOutput.println("No matching source/binary files."); + } + + String[] files = Util.commaSeparatedToArray(toolOutputFiles); + + for (String file : files) { + if (file.length() != 0) { + FilePath path = workspace.child(file); + + if (path.exists()) { + buildOutput.println("Add tool output file " + path.getRemote() + " to request."); + toSend.put(path.getName(), new DeferredFilePathInputStream(path)); + } else { + buildOutput.println("Path specified but could not be found: " + path); + } + } + } + + GitFetchConfiguration effectiveGitConfig = gitFetchConfiguration; + if (effectiveGitConfig != null) { + buildOutput.println("Verifying git config for Code Dx project..."); + try { + GitConfigResponse response = repeatingClient.getProjectGitConfig(project); + if (response.getUrl().isEmpty()) { + buildOutput.println("'Include Git Source' was enabled but the project does not have a Git config assigned. 'Include Git Source' will be disabled for this run."); + effectiveGitConfig = null; + } + } catch (Exception e) { + if (!handleCodeDxError(build, buildOutput, "There was a problem fetching the project's Git config")) { + return; + } + buildOutput.println("'Include Git Source' will be disabled for this run."); + effectiveGitConfig = null; + } + } + + if (toSend.size() > 0 || effectiveGitConfig != null) { + try { + buildOutput.println("Submitting files to Code Dx for analysis"); + + AnalysisMonitor analysisMonitor; + + StartAnalysisResponse response; + try { + boolean includeGitSource = effectiveGitConfig != null; + String targetGitBranch = null; + if (includeGitSource) { + targetGitBranch = effectiveGitConfig.getSpecificBranch(); + if (targetGitBranch != null) { + targetGitBranch = valueResolver.resolve("Git branch", targetGitBranch); + buildOutput.println("Using Git branch for Code Dx: " + targetGitBranch); + } else { + buildOutput.println("No Git branch specified, using Code Dx project's default Git branch"); + } + } + + response = repeatingClient.startAnalysis( + project.getProjectId(), + includeGitSource, + targetGitBranch, + branchChecker.getBaseBranchName(), + branchChecker.getTargetBranchName(), + toSend + ); + + // (shouldn't be necessary, but this condition was checked in previous impl., so it will be preserved) + if (response == null) { + handleCodeDxError(build, buildOutput, "Received null data for the analysis job"); + // everything else has to do with checking for the analysis indicated by the response, nothing + // else to do if this fails + return; + } + + analysisMonitor = effectiveGitConfig != null + ? new GitJobAnalysisMonitor(response, buildOutput) + : new DirectAnalysisMonitor(response, buildOutput); + + } catch (CodeDxClientException e) { + String errorSpecificMessage; + + switch(e.getHttpCode()) { + case 400: + errorSpecificMessage = + " (Bad Request: have you included files from unsupported Tools? " + + "Code Dx Standard Edition does not support uploading tool results)"; + break; + case 403: + errorSpecificMessage = " (Forbidden: have you configured your key and permissions correctly?)"; + break; + case 404: + errorSpecificMessage = " (Project Not Found: is it possible it was deleted?)"; + break; + case 500: + errorSpecificMessage = " (Internal Server Error: Please check your Code Dx server logs for more details)"; + break; + default: + errorSpecificMessage = ""; + } + + String message = + String.format("Failed to start analysis%s.", errorSpecificMessage) + '\n' + + String.format("Response Status: %d: %s", e.getHttpCode(), e.getResponseMessage()) + '\n' + + String.format("Response Content: %s", e.getResponseContent()) + '\n' + + Util.getStackTrace(e); + + buildOutput.println(message); + handleCodeDxError(build, buildOutput, "Failed to start analysis"); + return; // nothing else to do if we can't start the analysis, everything else relies on it + } finally { + // close streams after we're done sending them + for(Map.Entry entry : toSend.entrySet()){ + IOUtils.closeQuietly(entry.getValue()); + } + } + + buildOutput.println("Code Dx accepted files for analysis"); + + int analysisId = analysisMonitor.waitForStart(repeatingClient); + + // Set the analysis name on the server + if(analysisName == null || analysisName.length() == 0) { + buildOutput.println("No 'Analysis Name' was chosen."); + } else if (analysisId == -1) { + buildOutput.println("Code Dx did not provide an analysis ID - the 'Analysis Name' will not be applied."); + } else { + String expandedAnalysisName = valueResolver.resolve("analysis name", analysisName); + buildOutput.println("Analysis Name: " + expandedAnalysisName); + buildOutput.println("Analysis Id: " + analysisId); + + if(cdxVersion.compareTo(CodeDxVersion.MIN_FOR_ANALYSIS_NAMES) < 0){ + buildOutput.println("The connected Code Dx server is only version " + cdxVersion + + ", which doesn't support naming analyses (minimum supported version is " + + CodeDxVersion.MIN_FOR_ANALYSIS_NAMES + "). The analysis name will not be set."); + } else { + try { + repeatingClient.setAnalysisName(project, analysisId, expandedAnalysisName); + buildOutput.println("Successfully updated analysis name."); + } catch (CodeDxClientException e) { + e.printStackTrace(buildOutput); + // this doesn't affect anything else in the plugin, only exit early if we're meant to fail + if (!handleCodeDxError(build, buildOutput, "Got error from Code Dx API Client while trying to set the analysis name")) { + return; + } + } + } + } + + if (analysisResultConfiguration == null) { + logger.info("Project not configured to wait on analysis results"); + return; + } + + String status; + try { + status = analysisMonitor.waitForFinish(repeatingClient); + } catch (CodeDxClientException e) { + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "There was an error querying for the analysis status"); + return; // nothing else to do if the analysis failed + } + + if (Job.COMPLETED.equals(status)) { + try { + buildOutput.println("Analysis succeeded"); + + buildOutput.println("Fetching severity counts"); + + Filter notGoneFilter = new Filter(); + notGoneFilter.setNotStatus(new String[]{Filter.STATUS_GONE}); + List severityCounts = repeatingClient.getFindingsGroupedCounts(project, notGoneFilter, "severity"); + + buildOutput.println("Fetching status counts"); + + Filter notAssignedFilter = new Filter(); + notAssignedFilter.setNotStatus(new String[]{ Filter.STATUS_ASSIGNED, Filter.STATUS_GONE }); + + List statusCounts = repeatingClient.getFindingsGroupedCounts(project, notAssignedFilter, "status"); + + Filter assignedFilter = new Filter(); + assignedFilter.setStatus(new String[]{Filter.STATUS_ASSIGNED}); + + buildOutput.println("Fetching assigned count"); + + //Since CodeDx splits assigned status into different statuses (one per user), + //we need to get the total assigned count and add our own CountGroup. + int assignedCount = repeatingClient.getFindingsCount(project, assignedFilter); + + if (assignedCount > 0) { + + CountGroup assignedGroup = new CountGroup(); + assignedGroup.setName("Assigned"); + assignedGroup.setCount(assignedCount); + statusCounts.add(assignedGroup); + } + + buildOutput.println("Building table and charts"); + + Map statMap = new HashMap(); + + statMap.put("severity", createStatistics(severityCounts)); + statMap.put("status", createStatistics(statusCounts)); + + CodeDxResult result = new CodeDxResult(statMap, build); + + buildOutput.println("Adding CodeDx build action"); + build.addAction(new CodeDxBuildAction(build, analysisResultConfiguration, getLatestAnalysisUrl(), result)); + + AnalysisResultChecker checker = new AnalysisResultChecker(repeatingClient, + cdxVersion, + analysisResultConfiguration.getFailureSeverity(), + analysisResultConfiguration.getUnstableSeverity(), + startingDate, // the time this process started is the "new" threshold for filtering + analysisResultConfiguration.isFailureOnlyNew(), + analysisResultConfiguration.isUnstableOnlyNew(), + analysisResultConfiguration.getPolicyBreakBuildBehavior(), + project, + buildOutput); + Result buildResult = checker.checkResult(); + build.setResult(buildResult); + } catch (CodeDxClientException e) { + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "There was an error fetching/processing analysis results"); + } + } else { + buildOutput.println("Analysis status: " + status); + handleCodeDxError(build, buildOutput, "Analysis status was non-success"); + } + } + catch (AbortException e) { + // re-throw any "expected" exceptions; if we didn't want these to be thrown due to error + // handling behavior, they wouldn't have been thrown in the first place + throw e; + } catch (Exception e) { + // any remaining exceptions from this `try` block should be related to comms with Code Dx + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "An unexpected error occurred"); + } finally { + if(sourceAndBinaryZip != null){ + sourceAndBinaryZip.delete(); + } + } + } else { + throw new AbortException("Nothing to send, this doesn't seem right! Please check your 'Code Dx > Source and Binary Files' configuration."); + } + } + + public static CodeDxClient buildClient(String url, String key, String fingerprint) { + CodeDxClient client = new CodeDxClient(url, key); + try { + if (fingerprint != null) { + fingerprint = fingerprint.replaceAll("[^a-fA-F0-9]", ""); + } + URL parsedUrl = new URL(url); + SSLConnectionSocketFactory socketFactory = JenkinsSSLConnectionSocketFactoryFactory.getFactory(fingerprint, parsedUrl.getHost()); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setSSLSocketFactory(socketFactory); + client = new CodeDxClient(url, key, builder); + } catch (MalformedURLException e) { + logger.warning("A valid CodeDxClient could not be built. Malformed URL: " + url); + } catch (GeneralSecurityException e) { + logger.warning("A valid CodeDxClient could not be built. GeneralSecurityException: url: " + url + ", fingerprint: " + fingerprint); + } catch (Exception e) { + logger.warning("An exception was thrown while building the client " + e); + e.printStackTrace(); + } + return client; + } + + private String[] getUsers(Map assignedStatuses) { + + List users = new ArrayList(); + + + for (TriageStatus status : assignedStatuses.values()) { + + if (status.getType().equals(TriageStatus.TYPE_USER)) { + users.add(status.getDisplay()); + } + } + + return users.toArray(new String[0]); + } + + private CodeDxReportStatistics createStatistics(List countGroups) { + + List groupStatsList = new ArrayList(); + + + for (CountGroup group : countGroups) { + + CodeDxGroupStatistics stats = new CodeDxGroupStatistics(group.getName(), group.getCount()); + groupStatsList.add(stats); + } + + return new CodeDxReportStatistics(groupStatsList); + } + + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.NONE; // NONE since this is not dependent on the last step + } + + // Overridden for better type safety. + // If your plugin doesn't really define any property on Descriptor, + // you don't have to do this. + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl) super.getDescriptor(); + } + + /** + * Descriptor for {@link CodeDxPublisher}. Used as a singleton. + * The class is marked as public so that it can be accessed from views. + */ + @Extension // This indicates to Jenkins that this is an implementation of an extension point. + public static final class DescriptorImpl extends BuildStepDescriptor { + + /* + Note: Endpoints which make HTTP requests have `Job` as a path parameter so we can do permission + checks whether it's a project (freestyle) or job (pipeline syntax gen.) being tested + + Endpoints which access workspace contents have `AbstractProject` instead since we need + it to get a workspace path. These endpoints will get `null` for the project in the + pipeline syntax gen. and no-op, which is expected since there's no way to get a workspace + while running in the syntax gen. + */ + + private void checkPermissionForRemoteRequests(Item item) + { + if (item != null) item.checkPermission(Item.CONFIGURE); + else Jenkins.get().checkPermission(Jenkins.ADMINISTER); + } + + /** + * To persist global configuration information, + * simply store it in a field and call save(). + * + *

+ * If you don't want fields to be persisted, use transient. + */ + + /** + * In order to load the persisted global configuration, you have to + * call load() in the constructor. + */ + public DescriptorImpl() { + load(); + } + + public boolean isApplicable(Class aClass) { + // Indicates that this builder can be used with all kinds of project types + return true; + } + + /** + * This human readable name is used in the configuration screen. + */ + public String getDisplayName() { + return "Publish to Code Dx"; + } + + public FormValidation doCheckProjectId(@QueryParameter final String value) + throws IOException, ServletException { + if (value.length() == 0) + return FormValidation.error("Please set a project. If none are shown above, then be sure that system settings are configured correctly."); + if (Integer.parseInt(value) == -1) + return FormValidation.error("Failed to get available projects, please ensure systems settings are configured correctly."); + + return FormValidation.ok(); + } + + public FormValidation doCheckKey(@QueryParameter final String value) + throws IOException, ServletException { + + if (value.length() == 0) + return FormValidation.error("Please set a Key."); + + return FormValidation.ok(); + } + + @POST + public FormValidation doCheckUrl(@QueryParameter final String value, @QueryParameter final String selfSignedCertificateFingerprint, @AncestorInPath Item item) + throws IOException, ServletException { + checkPermissionForRemoteRequests(item); + + CodeDxClient client = buildClient(value, "", selfSignedCertificateFingerprint); + + if (value.length() == 0) + return FormValidation.error("Please set a URL."); + + try { + new URL(value); + + } catch (MalformedURLException malformedURLException) { + return FormValidation.error("Malformed URL"); + } + + if (value.toLowerCase().startsWith("http:")) { + + return FormValidation.warning("HTTP is considered insecure, it is recommended that you use HTTPS."); + } else if (value.toLowerCase().startsWith("https:")) { + try { + client.getProjects(); + } catch (Exception e) { + if (e instanceof SSLHandshakeException) { + return FormValidation.warning("The SSL Certificate presented by the server is invalid. If this is expected, please input an SHA1 Fingerprint in the \"Advanced\" option"); + } + } + return FormValidation.ok(); + } else { + + return FormValidation.error("Invalid protocol, please use HTTPS or HTTP."); + } + } + + @POST + public FormValidation doCheckSelfSignedCertificateFingerprint(@QueryParameter final String value, @QueryParameter final String url, @AncestorInPath Item item) { + checkPermissionForRemoteRequests(item); + + if (url != null && ! url.isEmpty() && value != null && ! value.isEmpty()) { + CodeDxClient client = buildClient(url, "", value); + + try { + client.getProjects(); + } catch (Exception e) { + if (e instanceof SSLHandshakeException) { + logger.warning("When retrieving projects: " + e); + e.printStackTrace(); + if (isFingerprintMismatch((SSLHandshakeException)e)) { + return FormValidation.warning("The fingerprint doesn't match the fingerprint of the certificate presented by the server"); + } else { + return FormValidation.warning("A secure connection to the server could not be established"); + } + } + } + } + return FormValidation.ok(); + } + + @POST + public FormValidation doCheckSourceAndBinaryFiles(@QueryParameter final String value, @QueryParameter final boolean gitFetchConfiguration, @QueryParameter final String toolOutputFiles, @AncestorInPath AbstractProject project) { + if (project == null) { + return FormValidation.ok(); + } + + project.checkPermission(AbstractProject.CONFIGURE); + + if (value.length() == 0) { + if (gitFetchConfiguration) + return FormValidation.ok(); + else if (toolOutputFiles.length() == 0) + return FormValidation.error("You must specify \"Tool Output Files\" and/or \"Source and Binary Files\", or enable \"Include Git Source\""); + else + return FormValidation.warning("It is recommended that at least source files are provided to Code Dx."); + } + + return Util.checkCSVGlobMatches(value, project.getSomeWorkspace()); + } + + @POST + public FormValidation doCheckExcludedSourceAndBinaryFiles(@QueryParameter final String value, @AncestorInPath AbstractProject project) { + if (project == null) { + return FormValidation.ok(); + } else { + project.checkPermission(AbstractProject.CONFIGURE); + return Util.checkCSVGlobMatches(value, project.getSomeWorkspace()); + } + } + + @POST + public FormValidation doCheckToolOutputFiles(@QueryParameter final String value, @QueryParameter final String sourceAndBinaryFiles, @QueryParameter final boolean gitFetchConfiguration, @AncestorInPath AbstractProject project) { + + if (project == null) { + return FormValidation.ok(); + } + + project.checkPermission(AbstractProject.CONFIGURE); + + if (value.length() == 0 && sourceAndBinaryFiles.length() == 0 && !gitFetchConfiguration) { + return FormValidation.error("You must specify \"Tool Output Files\" and/or \"Source and Binary Files\", or enable \"Include Git Source\""); + } + + return Util.checkCSVFileMatches(value, project.getSomeWorkspace()); + } + + @POST + public ListBoxModel doFillProjectIdItems(@QueryParameter final String url, @QueryParameter final String selfSignedCertificateFingerprint, @QueryParameter final String key, @AncestorInPath Item item) { + checkPermissionForRemoteRequests(item); + + ListBoxModel listBox = new ListBoxModel(); + + CodeDxClient client = buildClient(url, key, selfSignedCertificateFingerprint); + + try { + final List projects = client.getProjects(); + + Map duplicates = new HashMap(); + + for (Project proj : projects) { + + if (!duplicates.containsKey(proj.getName())) { + duplicates.put(proj.getName(), false); + } else { + + duplicates.put(proj.getName(), true); + } + } + for (Project proj : projects) { + + if (!duplicates.get(proj.getName())) { + + listBox.add(proj.getName(), Integer.toString(proj.getId())); + } else { + + listBox.add(proj.getName() + " (id:" + proj.getId() + ")", Integer.toString(proj.getId())); + } + + } + } catch (Exception e) { + logger.warning("Exception when populating projects dropdown " + e); + listBox.add("", "-1"); + } + + return listBox; + } + + public ListBoxModel doFillErrorHandlingBehaviorItems() { + ListBoxModel listBox = new ListBoxModel(); + listBox.add(BuildErrorBehavior.None.getLabel(), BuildErrorBehavior.None.name()); + listBox.add(BuildErrorBehavior.MarkUnstable.getLabel(), BuildErrorBehavior.MarkUnstable.name()); + listBox.add(BuildErrorBehavior.MarkFailed.getLabel(), BuildErrorBehavior.MarkFailed.name()); + return listBox; + } + + public ListBoxModel doFillPolicyBreakBuildBehaviorItems() { + ListBoxModel listBox = new ListBoxModel(); + listBox.add(BuildPolicyBehavior.NoAction.getLabel(), BuildPolicyBehavior.NoAction.name()); + listBox.add(BuildPolicyBehavior.MarkUnstable.getLabel(), BuildPolicyBehavior.MarkUnstable.name()); + listBox.add(BuildPolicyBehavior.MarkFailed.getLabel(), BuildPolicyBehavior.MarkFailed.name()); + return listBox; + } + + public ListBoxModel doFillFailureSeverityItems() { + + return getSeverityItems(); + } + + public ListBoxModel doFillUnstableSeverityItems() { + + return getSeverityItems(); + } + + private ListBoxModel getSeverityItems() { + + final ListBoxModel listBox = new ListBoxModel(); + + listBox.add("None", "None"); + listBox.add("Info or Higher", "Info"); + listBox.add("Low or Higher", "Low"); + listBox.add("Medium or Higher", "Medium"); + listBox.add("High or Higher", "High"); + listBox.add("Critical", "Critical"); + + return listBox; + } + + @Override + public boolean configure(final StaplerRequest req, final JSONObject formData) throws FormException { + // To persist global configuration information, + // set that to properties and call save(). + // ^Can also use req.bindJSON(this, formData); + // (easier when there are many fields; need set* methods for this, like setUseFrench) + + save(); + System.out.println("Code Dx descriptor configure method"); + return super.configure(req, formData); + } + + @Override + public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { + return super.newInstance(req, formData); + } + } + + private static boolean isFingerprintMismatch(SSLHandshakeException exception) { + return exception.getMessage().contains("None of the TrustManagers trust this certificate chain"); + } +} +``` + +## `src/main/java/org/jenkinsci/plugins/codedx/Util.java` (changed lines (70, 74, 75)) + +```java +/* + * © 2023 Synopsys, Inc. All rights reserved worldwide. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ +package org.jenkinsci.plugins.codedx; + +import hudson.FilePath; +import hudson.util.FormValidation; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Contains string and GLOB pattern matching utility methods. + * @author anthonyd + * + */ +public class Util { + + private static final Logger log = Logger.getLogger(Util.class.getName()); + + public static String[] commaSeparatedToArray(String str){ + + return str.split("\\s*,\\s*"); + } + + public static FormValidation checkCSVGlobMatches(final String value, final FilePath workspace){ + + + if(value.length() != 0 && workspace != null){ + + for(String path : Util.commaSeparatedToArray(value)){ + + try { + if(path.length() == 0 || workspace.list(path).length == 0){ + return FormValidation.warning(path + " doesn't match anything in the workspace."); + } + } catch (Exception e) { + if(e.getMessage() != null && e.getMessage().startsWith("Expecting Ant GLOB pattern")){ + return FormValidation.error(path + " is not a valid Ant GLOB pattern. Note that patterns must not begin with a '/'"); + } else { + log.log(Level.SEVERE, "Unexpected error in form validation", e); + return FormValidation.error("An unexpected error occurred while validating this field. Check the logs for more detail."); + } + } + } + } + + return FormValidation.ok(); + } + + public static FormValidation checkCSVFileMatches(final String value, final FilePath workspace){ + + + if(value.length() != 0 && workspace != null){ + + String basePath = workspace.getRemote(); + for(String path : Util.commaSeparatedToArray(value)){ + + try { + FilePath subPath = new FilePath(workspace, path); + if(path.length() == 0 || !subPath.exists() || !subPath.absolutize().getRemote().startsWith(basePath)){ + + return FormValidation.warning(path + " does not exist in the workspace."); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return FormValidation.ok(); + } + + public static String getStackTrace(final Throwable e) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + e.printStackTrace(pw); + + String result = sw.toString(); + + pw.close(); + return result; + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..6c26646474741b3b53e9d9b201dcbaabed54a06e --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/pre_context.md @@ -0,0 +1,1039 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java` (changed lines (788, 793, 805, 809, 813, 819)) + +```java +/* + * © 2023 Synopsys, Inc. All rights reserved worldwide. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ +package org.jenkinsci.plugins.codedx; + +import com.codedx.api.client.*; +import com.codedx.api.client.Job; +import com.codedx.api.client.Project; +import com.codedx.security.JenkinsSSLConnectionSocketFactoryFactory; +import com.codedx.util.CodeDxVersion; +import hudson.AbortException; +import hudson.FilePath; +import hudson.Launcher; +import hudson.Extension; +import hudson.model.*; +import hudson.util.FormValidation; +import hudson.util.ListBoxModel; +import hudson.tasks.BuildStepMonitor; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Publisher; +import hudson.tasks.Recorder; +import jenkins.model.Jenkins; +import jenkins.tasks.SimpleBuildStep; +import net.sf.json.JSONObject; + +import org.apache.commons.io.IOUtils; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.impl.client.HttpClientBuilder; +import org.jenkinsci.plugins.codedx.model.CodeDxReportStatistics; +import org.jenkinsci.plugins.codedx.model.CodeDxGroupStatistics; +import org.jenkinsci.plugins.codedx.monitor.AnalysisMonitor; +import org.jenkinsci.plugins.codedx.monitor.DirectAnalysisMonitor; +import org.jenkinsci.plugins.codedx.monitor.GitJobAnalysisMonitor; +import org.kohsuke.stapler.*; +import org.kohsuke.stapler.verb.POST; + +import javax.net.ssl.SSLHandshakeException; +import javax.servlet.ServletException; + +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.util.*; +import java.util.logging.Logger; + +/** + * Jenkins publisher that publishes project source, binaries, and + * analysis tool output files to a CodeDx server. + * + * @author anthonyd + */ +public class CodeDxPublisher extends Recorder implements SimpleBuildStep { + + private final String url; + private final String key; + private final String projectId; + + // Comma separated list of source/binary file Ant GLOB patterns + private String sourceAndBinaryFiles; + // List of paths to tool output files + private String toolOutputFiles; + // Comma separated list of source/binary file Ant GLOB patterns to exclude + private String excludedSourceAndBinaryFiles; + + private String analysisName; + + // Contains the fields applicable when the user chooses to have Jenkins wait for + // analysis runs to complete. + private AnalysisResultConfiguration analysisResultConfiguration; + + private transient CodeDxClient client; + + private String selfSignedCertificateFingerprint; + + private String targetBranchName, baseBranchName; + + private BuildErrorBehavior errorHandlingBehavior; + + private GitFetchConfiguration gitFetchConfiguration; + + private final static Logger logger = Logger.getLogger(CodeDxPublisher.class.getName()); + + /** + * @param url URL of the Code Dx server + * @param key API key of the Code Dx server + * @param projectId Code Dx project ID + * @param analysisName The name to use for the analysis + */ + @DataBoundConstructor + public CodeDxPublisher( + final String url, + final String key, + final String projectId, + final String analysisName + ) { + this.projectId = projectId; + this.url = url; + this.key = key; + this.analysisName = analysisName.trim(); + + this.sourceAndBinaryFiles = ""; + this.excludedSourceAndBinaryFiles = ""; + this.toolOutputFiles = ""; + this.analysisResultConfiguration = null; + this.selfSignedCertificateFingerprint = null; + this.targetBranchName = null; + this.baseBranchName = null; + this.errorHandlingBehavior = BuildErrorBehavior.MarkFailed; + + this.gitFetchConfiguration = null; + + setupClient(); + } + + private void setupClient() { + if (this.client == null) { + this.client = buildClient(url, key, selfSignedCertificateFingerprint); + } + } + + public AnalysisResultConfiguration getAnalysisResultConfiguration() { + return analysisResultConfiguration; + } + + @DataBoundSetter + public void setAnalysisResultConfiguration(AnalysisResultConfiguration analysisResultConfiguration) { + this.analysisResultConfiguration = analysisResultConfiguration; + } + + public String getProjectId() { + return projectId; + } + + public String getUrl() { + return url; + } + + public String getKey() { + return key; + } + + public String getSourceAndBinaryFiles() { + return sourceAndBinaryFiles; + } + + @DataBoundSetter + public void setSourceAndBinaryFiles(String sourceAndBinaryFiles) { + this.sourceAndBinaryFiles = sourceAndBinaryFiles; + } + + public String getToolOutputFiles() { + return toolOutputFiles; + } + + @DataBoundSetter + public void setToolOutputFiles(String toolOutputFiles) { + this.toolOutputFiles = toolOutputFiles; + } + + public String getExcludedSourceAndBinaryFiles() { + return excludedSourceAndBinaryFiles; + } + + @DataBoundSetter + public void setExcludedSourceAndBinaryFiles(String excludedSourceAndBinaryFiles) { + this.excludedSourceAndBinaryFiles = excludedSourceAndBinaryFiles; + } + + public String getSelfSignedCertificateFingerprint() { + return selfSignedCertificateFingerprint; + } + + @DataBoundSetter + public void setSelfSignedCertificateFingerprint(String selfSignedCertificateFingerprint) { + this.selfSignedCertificateFingerprint = selfSignedCertificateFingerprint; + + this.client = null; + setupClient(); + } + + public String getAnalysisName(){ return analysisName; } + + private String getLatestAnalysisUrl() { + if (projectId.length() != 0 && !projectId.equals("-1")) { + setupClient(); + return client.buildLatestFindingsUrl(Integer.parseInt(projectId)); + } else { + return null; + } + } + + public String getTargetBranchName() { + return targetBranchName; + } + + @DataBoundSetter + public void setTargetBranchName(String targetBranchName) { + if (targetBranchName != null) targetBranchName = targetBranchName.trim(); + + if (targetBranchName != null && targetBranchName.length() > 0) + this.targetBranchName = targetBranchName; + else + this.targetBranchName = null; + } + + public String getBaseBranchName() { + return baseBranchName; + } + + @DataBoundSetter + public void setBaseBranchName(String baseBranchName) { + if (baseBranchName != null) baseBranchName = baseBranchName.trim(); + + if (baseBranchName != null && baseBranchName.length() > 0) + this.baseBranchName = baseBranchName; + else + this.baseBranchName = null; + } + + public BuildErrorBehavior getErrorHandlingBehavior() { + return errorHandlingBehavior; + } + + @DataBoundSetter + public void setErrorHandlingBehavior(BuildErrorBehavior behavior) { + errorHandlingBehavior = behavior; + } + + public GitFetchConfiguration getGitFetchConfiguration() { + return gitFetchConfiguration; + } + + @DataBoundSetter + public void setGitFetchConfiguration(GitFetchConfiguration config) { + gitFetchConfiguration = config; + } + + // Sets the build status based on `errorHandlingBehavior`. Only meant to be used for Code Dx-specific + // errors, eg analysis failure and connection issues. Configuration errors will be thrown as usual + // since those issues aren't related to Code Dx itself. + // + // returns true if we ignore the error, false if we want to exit prematurely + private Boolean handleCodeDxError(Run build, PrintStream buildOutput, String cause) throws AbortException { + buildOutput.println(cause); + + BuildErrorBehavior behavior = errorHandlingBehavior; + if (behavior == null) behavior = BuildErrorBehavior.Default; + + if (behavior != BuildErrorBehavior.None) { + build.setResult(behavior.getEquivalentResult()); + return false; + } else { + buildOutput.println("This will be ignored since errorHandlingBehavior is set to " + behavior.getLabel()); + return true; + } + } + + @Override + public void perform( + final Run build, + final FilePath workspace, + final Launcher launcher, + final TaskListener listener) throws InterruptedException, IOException { + + Date startingDate = new Date(); + + setupClient(); + final Map toSend = new HashMap(); + final PrintStream buildOutput = listener.getLogger(); + + buildOutput.println("Publishing build to Code Dx:"); + + if (errorHandlingBehavior == null) { + errorHandlingBehavior = BuildErrorBehavior.Default; + } + buildOutput.println("Error handling set to: " + errorHandlingBehavior.getLabel()); + + if (projectId.length() == 0 || projectId.equals("-1")) { + buildOutput.println("No project has been selected"); + return; + } + + ProjectContext project; + try { + project = new ProjectContext(Integer.parseInt(projectId)); + } catch (NumberFormatException e) { + throw new AbortException("Invalid project ID: " + projectId); + } + + buildOutput.println(String.format("Publishing to Code Dx server at %s to Code Dx project %s: ", url, projectId)); + + final CodeDxClient repeatingClient = new CodeDxRepeatingClient(this.client, buildOutput); + + CodeDxVersion cdxVersion = null; + try { + cdxVersion = repeatingClient.getCodeDxVersion(); + buildOutput.println("Got Code Dx version: " + cdxVersion); + } catch (Exception e) { + e.printStackTrace(buildOutput); + if (handleCodeDxError(build, buildOutput, "An error occurred fetching the Code Dx version")) { + buildOutput.println("The Code Dx plugin cannot continue without verifying the Code Dx version, exiting"); + } + // we can't continue without a version since we don't want to accidentally put data into the wrong target + // by eg using a placeholder version which skips over the Code Dx branch + return; + } + + ValueResolver valueResolver = new ValueResolver(build, workspace, listener, buildOutput); + TargetBranchChecker branchChecker = new TargetBranchChecker(project, repeatingClient, valueResolver, buildOutput); + try { + branchChecker.validate(cdxVersion, targetBranchName, baseBranchName); + } catch (AbortException e) { + // configuration error + throw e; + } catch (IOException e) { + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "An error occurred while validating branch selection"); + // connection error; this will only happen if a target branch was specified. we can't continue without + // applying that target branch, or we might cause data to be written to an unexpected target branch + return; + } + + project = project.withBranch(branchChecker.getTargetBranchName()); + + buildOutput.println("Creating source/binary zip..."); + + FilePath sourceAndBinaryZip = Archiver.archive(workspace, + Util.commaSeparatedToArray(sourceAndBinaryFiles), + Util.commaSeparatedToArray(excludedSourceAndBinaryFiles), + "source"); + + if (sourceAndBinaryZip != null) { + buildOutput.println("Adding source/binary zip..."); + toSend.put("Jenkins-SourceAndBinary.zip", new DeferredFilePathInputStream(sourceAndBinaryZip)); + } else { + buildOutput.println("No matching source/binary files."); + } + + String[] files = Util.commaSeparatedToArray(toolOutputFiles); + + for (String file : files) { + if (file.length() != 0) { + FilePath path = workspace.child(file); + + if (path.exists()) { + buildOutput.println("Add tool output file " + path.getRemote() + " to request."); + toSend.put(path.getName(), new DeferredFilePathInputStream(path)); + } else { + buildOutput.println("Path specified but could not be found: " + path); + } + } + } + + GitFetchConfiguration effectiveGitConfig = gitFetchConfiguration; + if (effectiveGitConfig != null) { + buildOutput.println("Verifying git config for Code Dx project..."); + try { + GitConfigResponse response = repeatingClient.getProjectGitConfig(project); + if (response.getUrl().isEmpty()) { + buildOutput.println("'Include Git Source' was enabled but the project does not have a Git config assigned. 'Include Git Source' will be disabled for this run."); + effectiveGitConfig = null; + } + } catch (Exception e) { + if (!handleCodeDxError(build, buildOutput, "There was a problem fetching the project's Git config")) { + return; + } + buildOutput.println("'Include Git Source' will be disabled for this run."); + effectiveGitConfig = null; + } + } + + if (toSend.size() > 0 || effectiveGitConfig != null) { + try { + buildOutput.println("Submitting files to Code Dx for analysis"); + + AnalysisMonitor analysisMonitor; + + StartAnalysisResponse response; + try { + boolean includeGitSource = effectiveGitConfig != null; + String targetGitBranch = null; + if (includeGitSource) { + targetGitBranch = effectiveGitConfig.getSpecificBranch(); + if (targetGitBranch != null) { + targetGitBranch = valueResolver.resolve("Git branch", targetGitBranch); + buildOutput.println("Using Git branch for Code Dx: " + targetGitBranch); + } else { + buildOutput.println("No Git branch specified, using Code Dx project's default Git branch"); + } + } + + response = repeatingClient.startAnalysis( + project.getProjectId(), + includeGitSource, + targetGitBranch, + branchChecker.getBaseBranchName(), + branchChecker.getTargetBranchName(), + toSend + ); + + // (shouldn't be necessary, but this condition was checked in previous impl., so it will be preserved) + if (response == null) { + handleCodeDxError(build, buildOutput, "Received null data for the analysis job"); + // everything else has to do with checking for the analysis indicated by the response, nothing + // else to do if this fails + return; + } + + analysisMonitor = effectiveGitConfig != null + ? new GitJobAnalysisMonitor(response, buildOutput) + : new DirectAnalysisMonitor(response, buildOutput); + + } catch (CodeDxClientException e) { + String errorSpecificMessage; + + switch(e.getHttpCode()) { + case 400: + errorSpecificMessage = + " (Bad Request: have you included files from unsupported Tools? " + + "Code Dx Standard Edition does not support uploading tool results)"; + break; + case 403: + errorSpecificMessage = " (Forbidden: have you configured your key and permissions correctly?)"; + break; + case 404: + errorSpecificMessage = " (Project Not Found: is it possible it was deleted?)"; + break; + case 500: + errorSpecificMessage = " (Internal Server Error: Please check your Code Dx server logs for more details)"; + break; + default: + errorSpecificMessage = ""; + } + + String message = + String.format("Failed to start analysis%s.", errorSpecificMessage) + '\n' + + String.format("Response Status: %d: %s", e.getHttpCode(), e.getResponseMessage()) + '\n' + + String.format("Response Content: %s", e.getResponseContent()) + '\n' + + Util.getStackTrace(e); + + buildOutput.println(message); + handleCodeDxError(build, buildOutput, "Failed to start analysis"); + return; // nothing else to do if we can't start the analysis, everything else relies on it + } finally { + // close streams after we're done sending them + for(Map.Entry entry : toSend.entrySet()){ + IOUtils.closeQuietly(entry.getValue()); + } + } + + buildOutput.println("Code Dx accepted files for analysis"); + + int analysisId = analysisMonitor.waitForStart(repeatingClient); + + // Set the analysis name on the server + if(analysisName == null || analysisName.length() == 0) { + buildOutput.println("No 'Analysis Name' was chosen."); + } else if (analysisId == -1) { + buildOutput.println("Code Dx did not provide an analysis ID - the 'Analysis Name' will not be applied."); + } else { + String expandedAnalysisName = valueResolver.resolve("analysis name", analysisName); + buildOutput.println("Analysis Name: " + expandedAnalysisName); + buildOutput.println("Analysis Id: " + analysisId); + + if(cdxVersion.compareTo(CodeDxVersion.MIN_FOR_ANALYSIS_NAMES) < 0){ + buildOutput.println("The connected Code Dx server is only version " + cdxVersion + + ", which doesn't support naming analyses (minimum supported version is " + + CodeDxVersion.MIN_FOR_ANALYSIS_NAMES + "). The analysis name will not be set."); + } else { + try { + repeatingClient.setAnalysisName(project, analysisId, expandedAnalysisName); + buildOutput.println("Successfully updated analysis name."); + } catch (CodeDxClientException e) { + e.printStackTrace(buildOutput); + // this doesn't affect anything else in the plugin, only exit early if we're meant to fail + if (!handleCodeDxError(build, buildOutput, "Got error from Code Dx API Client while trying to set the analysis name")) { + return; + } + } + } + } + + if (analysisResultConfiguration == null) { + logger.info("Project not configured to wait on analysis results"); + return; + } + + String status; + try { + status = analysisMonitor.waitForFinish(repeatingClient); + } catch (CodeDxClientException e) { + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "There was an error querying for the analysis status"); + return; // nothing else to do if the analysis failed + } + + if (Job.COMPLETED.equals(status)) { + try { + buildOutput.println("Analysis succeeded"); + + buildOutput.println("Fetching severity counts"); + + Filter notGoneFilter = new Filter(); + notGoneFilter.setNotStatus(new String[]{Filter.STATUS_GONE}); + List severityCounts = repeatingClient.getFindingsGroupedCounts(project, notGoneFilter, "severity"); + + buildOutput.println("Fetching status counts"); + + Filter notAssignedFilter = new Filter(); + notAssignedFilter.setNotStatus(new String[]{ Filter.STATUS_ASSIGNED, Filter.STATUS_GONE }); + + List statusCounts = repeatingClient.getFindingsGroupedCounts(project, notAssignedFilter, "status"); + + Filter assignedFilter = new Filter(); + assignedFilter.setStatus(new String[]{Filter.STATUS_ASSIGNED}); + + buildOutput.println("Fetching assigned count"); + + //Since CodeDx splits assigned status into different statuses (one per user), + //we need to get the total assigned count and add our own CountGroup. + int assignedCount = repeatingClient.getFindingsCount(project, assignedFilter); + + if (assignedCount > 0) { + + CountGroup assignedGroup = new CountGroup(); + assignedGroup.setName("Assigned"); + assignedGroup.setCount(assignedCount); + statusCounts.add(assignedGroup); + } + + buildOutput.println("Building table and charts"); + + Map statMap = new HashMap(); + + statMap.put("severity", createStatistics(severityCounts)); + statMap.put("status", createStatistics(statusCounts)); + + CodeDxResult result = new CodeDxResult(statMap, build); + + buildOutput.println("Adding CodeDx build action"); + build.addAction(new CodeDxBuildAction(build, analysisResultConfiguration, getLatestAnalysisUrl(), result)); + + AnalysisResultChecker checker = new AnalysisResultChecker(repeatingClient, + cdxVersion, + analysisResultConfiguration.getFailureSeverity(), + analysisResultConfiguration.getUnstableSeverity(), + startingDate, // the time this process started is the "new" threshold for filtering + analysisResultConfiguration.isFailureOnlyNew(), + analysisResultConfiguration.isUnstableOnlyNew(), + analysisResultConfiguration.getPolicyBreakBuildBehavior(), + project, + buildOutput); + Result buildResult = checker.checkResult(); + build.setResult(buildResult); + } catch (CodeDxClientException e) { + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "There was an error fetching/processing analysis results"); + } + } else { + buildOutput.println("Analysis status: " + status); + handleCodeDxError(build, buildOutput, "Analysis status was non-success"); + } + } + catch (AbortException e) { + // re-throw any "expected" exceptions; if we didn't want these to be thrown due to error + // handling behavior, they wouldn't have been thrown in the first place + throw e; + } catch (Exception e) { + // any remaining exceptions from this `try` block should be related to comms with Code Dx + e.printStackTrace(buildOutput); + handleCodeDxError(build, buildOutput, "An unexpected error occurred"); + } finally { + if(sourceAndBinaryZip != null){ + sourceAndBinaryZip.delete(); + } + } + } else { + throw new AbortException("Nothing to send, this doesn't seem right! Please check your 'Code Dx > Source and Binary Files' configuration."); + } + } + + public static CodeDxClient buildClient(String url, String key, String fingerprint) { + CodeDxClient client = new CodeDxClient(url, key); + try { + if (fingerprint != null) { + fingerprint = fingerprint.replaceAll("[^a-fA-F0-9]", ""); + } + URL parsedUrl = new URL(url); + SSLConnectionSocketFactory socketFactory = JenkinsSSLConnectionSocketFactoryFactory.getFactory(fingerprint, parsedUrl.getHost()); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setSSLSocketFactory(socketFactory); + client = new CodeDxClient(url, key, builder); + } catch (MalformedURLException e) { + logger.warning("A valid CodeDxClient could not be built. Malformed URL: " + url); + } catch (GeneralSecurityException e) { + logger.warning("A valid CodeDxClient could not be built. GeneralSecurityException: url: " + url + ", fingerprint: " + fingerprint); + } catch (Exception e) { + logger.warning("An exception was thrown while building the client " + e); + e.printStackTrace(); + } + return client; + } + + private String[] getUsers(Map assignedStatuses) { + + List users = new ArrayList(); + + + for (TriageStatus status : assignedStatuses.values()) { + + if (status.getType().equals(TriageStatus.TYPE_USER)) { + users.add(status.getDisplay()); + } + } + + return users.toArray(new String[0]); + } + + private CodeDxReportStatistics createStatistics(List countGroups) { + + List groupStatsList = new ArrayList(); + + + for (CountGroup group : countGroups) { + + CodeDxGroupStatistics stats = new CodeDxGroupStatistics(group.getName(), group.getCount()); + groupStatsList.add(stats); + } + + return new CodeDxReportStatistics(groupStatsList); + } + + public BuildStepMonitor getRequiredMonitorService() { + return BuildStepMonitor.NONE; // NONE since this is not dependent on the last step + } + + // Overridden for better type safety. + // If your plugin doesn't really define any property on Descriptor, + // you don't have to do this. + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl) super.getDescriptor(); + } + + /** + * Descriptor for {@link CodeDxPublisher}. Used as a singleton. + * The class is marked as public so that it can be accessed from views. + */ + @Extension // This indicates to Jenkins that this is an implementation of an extension point. + public static final class DescriptorImpl extends BuildStepDescriptor { + + /* + Note: Endpoints which make HTTP requests have `Job` as a path parameter so we can do permission + checks whether it's a project (freestyle) or job (pipeline syntax gen.) being tested + + Endpoints which access workspace contents have `AbstractProject` instead since we need + it to get a workspace path. These endpoints will get `null` for the project in the + pipeline syntax gen. and no-op, which is expected since there's no way to get a workspace + while running in the syntax gen. + */ + + private void checkPermissionForRemoteRequests(Item item) + { + if (item != null) item.checkPermission(Item.CONFIGURE); + else Jenkins.get().checkPermission(Jenkins.ADMINISTER); + } + + /** + * To persist global configuration information, + * simply store it in a field and call save(). + * + *

+ * If you don't want fields to be persisted, use transient. + */ + + /** + * In order to load the persisted global configuration, you have to + * call load() in the constructor. + */ + public DescriptorImpl() { + load(); + } + + public boolean isApplicable(Class aClass) { + // Indicates that this builder can be used with all kinds of project types + return true; + } + + /** + * This human readable name is used in the configuration screen. + */ + public String getDisplayName() { + return "Publish to Code Dx"; + } + + public FormValidation doCheckProjectId(@QueryParameter final String value) + throws IOException, ServletException { + if (value.length() == 0) + return FormValidation.error("Please set a project. If none are shown above, then be sure that system settings are configured correctly."); + if (Integer.parseInt(value) == -1) + return FormValidation.error("Failed to get available projects, please ensure systems settings are configured correctly."); + + return FormValidation.ok(); + } + + public FormValidation doCheckKey(@QueryParameter final String value) + throws IOException, ServletException { + + if (value.length() == 0) + return FormValidation.error("Please set a Key."); + + return FormValidation.ok(); + } + + @POST + public FormValidation doCheckUrl(@QueryParameter final String value, @QueryParameter final String selfSignedCertificateFingerprint, @AncestorInPath Item item) + throws IOException, ServletException { + checkPermissionForRemoteRequests(item); + + CodeDxClient client = buildClient(value, "", selfSignedCertificateFingerprint); + + if (value.length() == 0) + return FormValidation.error("Please set a URL."); + + try { + new URL(value); + + } catch (MalformedURLException malformedURLException) { + return FormValidation.error("Malformed URL"); + } + + if (value.toLowerCase().startsWith("http:")) { + + return FormValidation.warning("HTTP is considered insecure, it is recommended that you use HTTPS."); + } else if (value.toLowerCase().startsWith("https:")) { + try { + client.getProjects(); + } catch (Exception e) { + if (e instanceof SSLHandshakeException) { + return FormValidation.warning("The SSL Certificate presented by the server is invalid. If this is expected, please input an SHA1 Fingerprint in the \"Advanced\" option"); + } + } + return FormValidation.ok(); + } else { + + return FormValidation.error("Invalid protocol, please use HTTPS or HTTP."); + } + } + + @POST + public FormValidation doCheckSelfSignedCertificateFingerprint(@QueryParameter final String value, @QueryParameter final String url, @AncestorInPath Item item) { + checkPermissionForRemoteRequests(item); + + if (url != null && ! url.isEmpty() && value != null && ! value.isEmpty()) { + CodeDxClient client = buildClient(url, "", value); + + try { + client.getProjects(); + } catch (Exception e) { + if (e instanceof SSLHandshakeException) { + logger.warning("When retrieving projects: " + e); + e.printStackTrace(); + if (isFingerprintMismatch((SSLHandshakeException)e)) { + return FormValidation.warning("The fingerprint doesn't match the fingerprint of the certificate presented by the server"); + } else { + return FormValidation.warning("A secure connection to the server could not be established"); + } + } + } + } + return FormValidation.ok(); + } + + public FormValidation doCheckSourceAndBinaryFiles(@QueryParameter final String value, @QueryParameter final boolean gitFetchConfiguration, @QueryParameter final String toolOutputFiles, @AncestorInPath AbstractProject project) { + if (project == null) { + return FormValidation.ok(); + } + + if (value.length() == 0) { + if (gitFetchConfiguration) + return FormValidation.ok(); + else if (toolOutputFiles.length() == 0) + return FormValidation.error("You must specify \"Tool Output Files\" and/or \"Source and Binary Files\", or enable \"Include Git Source\""); + else + return FormValidation.warning("It is recommended that at least source files are provided to Code Dx."); + } + + return Util.checkCSVGlobMatches(value, project.getSomeWorkspace()); + } + + public FormValidation doCheckExcludedSourceAndBinaryFiles(@QueryParameter final String value, @AncestorInPath AbstractProject project) { + if (project == null) { + return FormValidation.ok(); + } else { + return Util.checkCSVGlobMatches(value, project.getSomeWorkspace()); + } + } + + public FormValidation doCheckToolOutputFiles(@QueryParameter final String value, @QueryParameter final String sourceAndBinaryFiles, @QueryParameter final boolean gitFetchConfiguration, @AncestorInPath AbstractProject project) { + + if (project == null) { + return FormValidation.ok(); + } + + if (value.length() == 0 && sourceAndBinaryFiles.length() == 0 && !gitFetchConfiguration) { + return FormValidation.error("You must specify \"Tool Output Files\" and/or \"Source and Binary Files\", or enable \"Include Git Source\""); + } + + return Util.checkCSVFileMatches(value, project.getSomeWorkspace()); + } + + @POST + public ListBoxModel doFillProjectIdItems(@QueryParameter final String url, @QueryParameter final String selfSignedCertificateFingerprint, @QueryParameter final String key, @AncestorInPath Item item) { + checkPermissionForRemoteRequests(item); + + ListBoxModel listBox = new ListBoxModel(); + + CodeDxClient client = buildClient(url, key, selfSignedCertificateFingerprint); + + try { + final List projects = client.getProjects(); + + Map duplicates = new HashMap(); + + for (Project proj : projects) { + + if (!duplicates.containsKey(proj.getName())) { + duplicates.put(proj.getName(), false); + } else { + + duplicates.put(proj.getName(), true); + } + } + for (Project proj : projects) { + + if (!duplicates.get(proj.getName())) { + + listBox.add(proj.getName(), Integer.toString(proj.getId())); + } else { + + listBox.add(proj.getName() + " (id:" + proj.getId() + ")", Integer.toString(proj.getId())); + } + + } + } catch (Exception e) { + logger.warning("Exception when populating projects dropdown " + e); + listBox.add("", "-1"); + } + + return listBox; + } + + public ListBoxModel doFillErrorHandlingBehaviorItems() { + ListBoxModel listBox = new ListBoxModel(); + listBox.add(BuildErrorBehavior.None.getLabel(), BuildErrorBehavior.None.name()); + listBox.add(BuildErrorBehavior.MarkUnstable.getLabel(), BuildErrorBehavior.MarkUnstable.name()); + listBox.add(BuildErrorBehavior.MarkFailed.getLabel(), BuildErrorBehavior.MarkFailed.name()); + return listBox; + } + + public ListBoxModel doFillPolicyBreakBuildBehaviorItems() { + ListBoxModel listBox = new ListBoxModel(); + listBox.add(BuildPolicyBehavior.NoAction.getLabel(), BuildPolicyBehavior.NoAction.name()); + listBox.add(BuildPolicyBehavior.MarkUnstable.getLabel(), BuildPolicyBehavior.MarkUnstable.name()); + listBox.add(BuildPolicyBehavior.MarkFailed.getLabel(), BuildPolicyBehavior.MarkFailed.name()); + return listBox; + } + + public ListBoxModel doFillFailureSeverityItems() { + + return getSeverityItems(); + } + + public ListBoxModel doFillUnstableSeverityItems() { + + return getSeverityItems(); + } + + private ListBoxModel getSeverityItems() { + + final ListBoxModel listBox = new ListBoxModel(); + + listBox.add("None", "None"); + listBox.add("Info or Higher", "Info"); + listBox.add("Low or Higher", "Low"); + listBox.add("Medium or Higher", "Medium"); + listBox.add("High or Higher", "High"); + listBox.add("Critical", "Critical"); + + return listBox; + } + + @Override + public boolean configure(final StaplerRequest req, final JSONObject formData) throws FormException { + // To persist global configuration information, + // set that to properties and call save(). + // ^Can also use req.bindJSON(this, formData); + // (easier when there are many fields; need set* methods for this, like setUseFrench) + + save(); + System.out.println("Code Dx descriptor configure method"); + return super.configure(req, formData); + } + + @Override + public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { + return super.newInstance(req, formData); + } + } + + private static boolean isFingerprintMismatch(SSLHandshakeException exception) { + return exception.getMessage().contains("None of the TrustManagers trust this certificate chain"); + } +} +``` + +## `src/main/java/org/jenkinsci/plugins/codedx/Util.java` (changed lines (70, 73, 74)) + +```java +/* + * © 2023 Synopsys, Inc. All rights reserved worldwide. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ +package org.jenkinsci.plugins.codedx; + +import hudson.FilePath; +import hudson.util.FormValidation; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Contains string and GLOB pattern matching utility methods. + * @author anthonyd + * + */ +public class Util { + + private static final Logger log = Logger.getLogger(Util.class.getName()); + + public static String[] commaSeparatedToArray(String str){ + + return str.split("\\s*,\\s*"); + } + + public static FormValidation checkCSVGlobMatches(final String value, final FilePath workspace){ + + + if(value.length() != 0 && workspace != null){ + + for(String path : Util.commaSeparatedToArray(value)){ + + try { + if(path.length() == 0 || workspace.list(path).length == 0){ + return FormValidation.warning(path + " doesn't match anything in the workspace."); + } + } catch (Exception e) { + if(e.getMessage() != null && e.getMessage().startsWith("Expecting Ant GLOB pattern")){ + return FormValidation.error(path + " is not a valid Ant GLOB pattern. Note that patterns must not begin with a '/'"); + } else { + log.log(Level.SEVERE, "Unexpected error in form validation", e); + return FormValidation.error("An unexpected error occurred while validating this field. Check the logs for more detail."); + } + } + } + } + + return FormValidation.ok(); + } + + public static FormValidation checkCSVFileMatches(final String value, final FilePath workspace){ + + + if(value.length() != 0 && workspace != null){ + + for(String path : Util.commaSeparatedToArray(value)){ + + try { + if(path.length() == 0 || ! new FilePath(workspace, path).exists()){ + + return FormValidation.warning(path + " does not exist in the workspace."); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return FormValidation.ok(); + } + + public static String getStackTrace(final Throwable e) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + e.printStackTrace(pw); + + String result = sw.toString(); + + pw.close(); + return result; + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/task.json new file mode 100644 index 0000000000000000000000000000000000000000..6764433bb9b21809cdd2c0526364125c7126d627 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-02f75a63a6f0b8d6c6c7", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-02f75a63a6f0b8d6c6c7", + "project_id": "morefixes__jenkinsci__codedx-plugin", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java", + "src/main/java/org/jenkinsci/plugins/codedx/Util.java" + ], + "patch_units": { + "before": [ + "src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java", + "src/main/java/org/jenkinsci/plugins/codedx/Util.java" + ], + "after": [ + "src/main/java/org/jenkinsci/plugins/codedx/CodeDxPublisher.java", + "src/main/java/org/jenkinsci/plugins/codedx/Util.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/fa0f653d10e83fda0d93d7ea0c86edacba3c6244c1df592a36bd55995eccf00c/database", + "cache_key": "fa0f653d10e83fda0d93d7ea0c86edacba3c6244c1df592a36bd55995eccf00c", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/068f69bbed31e2097d164ad68b72f1c032ff75a5d11d563a5b884d1772b97fe3/database", + "cache_key": "068f69bbed31e2097d164ad68b72f1c032ff75a5d11d563a5b884d1772b97fe3", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/7854338a0efe77646ce5d5f3a5a8c347377c5ae80da56fe7a62d7c89da72dc7c/database", + "cache_key": "7854338a0efe77646ce5d5f3a5a8c347377c5ae80da56fe7a62d7c89da72dc7c", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-02f75a63a6f0b8d6c6c7/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-02f75a63a6f0b8d6c6c7/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-02f75a63a6f0b8d6c6c7/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..a616d75a27f3aadcadc8d6c8a1e64a84d3029532 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/patch.diff @@ -0,0 +1,44 @@ +diff --git a/src/main/java/au/com/rayh/XcodeProjectParser.java b/src/main/java/au/com/rayh/XcodeProjectParser.java +index 09db4c8..e05177e 100644 +--- a/src/main/java/au/com/rayh/XcodeProjectParser.java ++++ b/src/main/java/au/com/rayh/XcodeProjectParser.java +@@ -96,6 +96,19 @@ public class XcodeProjectParser { + ProjectScheme projectScheme = new ProjectScheme(); + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); ++ ++ String FEATURE = null; ++ FEATURE = "http://apache.org/xml/features/disallow-doctype-decl"; ++ factory.setFeature(FEATURE, true); ++ FEATURE = "http://xml.org/sax/features/external-general-entities"; ++ factory.setFeature(FEATURE, false); ++ FEATURE = "http://xml.org/sax/features/external-parameter-entities"; ++ factory.setFeature(FEATURE, false); ++ FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; ++ factory.setFeature(FEATURE, false); ++ factory.setXIncludeAware(false); ++ factory.setExpandEntityReferences(false); ++ + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(schemeFile.read()); + +@@ -179,6 +192,19 @@ public class XcodeProjectParser { + try { + FilePath workspaceFilePath = workspaceFileLocation.child("contents.xcworkspacedata"); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); ++ ++ String FEATURE = null; ++ FEATURE = "http://apache.org/xml/features/disallow-doctype-decl"; ++ factory.setFeature(FEATURE, true); ++ FEATURE = "http://xml.org/sax/features/external-general-entities"; ++ factory.setFeature(FEATURE, false); ++ FEATURE = "http://xml.org/sax/features/external-parameter-entities"; ++ factory.setFeature(FEATURE, false); ++ FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; ++ factory.setFeature(FEATURE, false); ++ factory.setXIncludeAware(false); ++ factory.setExpandEntityReferences(false); ++ + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(workspaceFilePath.read()); + diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..f6007486ebd67c0067b92fd9fe1f161763a23555 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/post_context.md @@ -0,0 +1,361 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/au/com/rayh/XcodeProjectParser.java` (changed lines (99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207)) + +```java +package au.com.rayh; + +import java.io.File; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.HashMap; +import java.text.ParseException; +import java.io.ByteArrayInputStream; +import hudson.FilePath; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +//import javax.xml.parsers.ParserException; +import javax.xml.parsers.ParserConfigurationException; +import java.lang.InterruptedException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import com.dd.plist.NSDictionary; +import com.dd.plist.NSArray; +import com.dd.plist.NSNumber; +import com.dd.plist.NSObject; +import com.dd.plist.NSString; +import com.dd.plist.PropertyListFormatException; +import com.dd.plist.PropertyListParser; + +/** + * Analyze the Xcode project file and obtain the information necessary for building the application. (Only combinations of UUID and BundleID used for CodeSign now) + * @author Kazuhide Takahashi + */ +public class XcodeProjectParser { + + /** + * Retrieve all Xcode scheme file from project directory. + * @param projectLocation Xcode project file location (directory path) + * @return the list of schema files found in the project directory and the result (ProjectScheme) of analysis of the contents as a HashMap. If analysis fails, it is empty + */ + public static HashMap listXcodeSchemes(FilePath projectLocation) { + String currentUser = System.getProperty("user.name") ; + HashMap schemeList = new HashMap(); + List schemeFilesDirList = new ArrayList(); + try { + if ( projectLocation.child("xcuserdata/" + currentUser + ".xcuserdatad/xcschemes").exists() ) { + schemeFilesDirList.add(projectLocation.child("xcuserdata/" + currentUser + ".xcuserdatad/xcschemes")); + } + if ( projectLocation.child("xcshareddata/xcschemes").exists() ) { + schemeFilesDirList.add(projectLocation.child("xcshareddata/xcschemes")); + } + } + catch ( IOException ex ) { + ex.printStackTrace(); + schemeList = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + schemeList = null; + } + for ( FilePath schemeFilesDir : schemeFilesDirList ) { + try { + List files = schemeFilesDir.list(new XcodeSchemeFileFilter()); + if ( files == null ) { + return null; + } + for ( FilePath file : files ) { + ProjectScheme scheme = parseXcodeScheme(file); + String schemeName = file.getBaseName().replaceAll(".xcscheme$", ""); + schemeList.put(schemeName, scheme); + } + } + catch ( IOException ex ) { + ex.printStackTrace(); + schemeList = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + schemeList = null; + } + } + return schemeList; + } + + /** + * @param schemeFile Xcode schieme file location + * @return analysis result of Xcode projectscheme file. If analysis fails, it is null + */ + public static ProjectScheme parseXcodeScheme(FilePath schemeFile) { + ProjectScheme projectScheme = new ProjectScheme(); + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + + String FEATURE = null; + FEATURE = "http://apache.org/xml/features/disallow-doctype-decl"; + factory.setFeature(FEATURE, true); + FEATURE = "http://xml.org/sax/features/external-general-entities"; + factory.setFeature(FEATURE, false); + FEATURE = "http://xml.org/sax/features/external-parameter-entities"; + factory.setFeature(FEATURE, false); + FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; + factory.setFeature(FEATURE, false); + factory.setXIncludeAware(false); + factory.setExpandEntityReferences(false); + + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(schemeFile.read()); + + Element root = document.getDocumentElement(); + if ( root.getNodeName().equals("Scheme") ) { + NodeList schemeNodes = root.getChildNodes(); + for ( int i = 0; i < schemeNodes.getLength(); i++ ) { + Node node = schemeNodes.item(i); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + Element element = (Element)node; + if ( element.getNodeName().equals("BuildAction") ) { + //projectScheme.parallelizeBuildables = element.getAttribute("parallelizeBuildables"); + //projectScheme.buildImplicitDependencies = element.getAttribute("buildImplicitDependencies"); + NodeList buildActionNodes = element.getChildNodes(); + for ( int j = 0; j < buildActionNodes.getLength(); j++ ) { + node = buildActionNodes.item(j); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + element = (Element)node; + if ( element.getNodeName().equals("BuildActionEntries") ) { + NodeList buildActionEntriesNodes = element.getChildNodes(); + for ( int k = 0; k < buildActionEntriesNodes.getLength(); k++ ) { + node = buildActionEntriesNodes.item(k); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + element = (Element)node; + if ( element.getNodeName().equals("BuildActionEntry") ) { + //projectScheme.buildForTesting = element.getAttribute("buildForTesting"); + //projectScheme.buildForRunning = element.getAttribute("buildForRunning"); + //projectScheme.buildForProfiling = element.getAttribute("buildForProfiling"); + //projectScheme.buildForArchiving = element.getAttribute("buildForArchiving"); + //projectScheme.buildForAnalyzing = element.getAttribute("buildForAnalyzing"); + NodeList buildActionEntryNodes = element.getChildNodes(); + for ( int l = 0; l < buildActionEntryNodes.getLength(); l++ ) { + node = buildActionEntryNodes.item(l); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + element = (Element)node; + if ( element.getNodeName().equals("BuildableReference") ) { + //projectScheme.buildableIdentifier = element.getAttribute("BuildableIdentifier"); + //projectScheme.blueprintIdentifier = element.getAttribute("BlueprintIdentifier"); + //projectScheme.buildableName = element.getAttribute("BuildableName"); + projectScheme.blueprintName = element.getAttribute("BlueprintName"); + projectScheme.referencedContainer = element.getAttribute("ReferencedContainer"); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + catch (SAXException ex) { + ex.printStackTrace(); + projectScheme = null; + } + catch (IOException ex) { + ex.printStackTrace(); + projectScheme = null; + } + catch (ParserConfigurationException ex) { + ex.printStackTrace(); + projectScheme = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + projectScheme = null; + } + return projectScheme; + } + + /** + * @param workspaceFileLocation Xcode workspace file location (directory) + * @return list of project files obtained as a result of analyzing workspaceFile. If analysis fails, it is empty + */ + public static List parseXcodeWorkspace(FilePath workspaceFileLocation) { + List projectList = new ArrayList<>(); + try { + FilePath workspaceFilePath = workspaceFileLocation.child("contents.xcworkspacedata"); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + + String FEATURE = null; + FEATURE = "http://apache.org/xml/features/disallow-doctype-decl"; + factory.setFeature(FEATURE, true); + FEATURE = "http://xml.org/sax/features/external-general-entities"; + factory.setFeature(FEATURE, false); + FEATURE = "http://xml.org/sax/features/external-parameter-entities"; + factory.setFeature(FEATURE, false); + FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; + factory.setFeature(FEATURE, false); + factory.setXIncludeAware(false); + factory.setExpandEntityReferences(false); + + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(workspaceFilePath.read()); + + Element root = document.getDocumentElement(); + if ( root.getNodeName().equals("Workspace") ) { + NodeList rootChildren = root.getChildNodes(); + + for ( int i = 0; i < rootChildren.getLength(); i++ ) { + Node node = rootChildren.item(i); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + Element element = (Element)node; + if ( element.getNodeName().equals("FileRef") ) { + String projectLocation = element.getAttribute("location"); + if ( projectLocation.startsWith("group:") ) { + projectLocation = projectLocation.replaceAll("^group:", ""); + projectList.add(projectLocation); + } + } + } + } + } + } + catch (SAXException ex) { + ex.printStackTrace(); + projectList = null; + } + catch (IOException ex) { + ex.printStackTrace(); + projectList = null; + } + catch (ParserConfigurationException ex) { + ex.printStackTrace(); + projectList = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + projectList = null; + } + return projectList; + } + + /** + * @param infoPlistFile Xcode Info.plist file location + * @return analysis result of Info.plist file. If analysis fails, it is null + */ + public static InfoPlist parseInfoPlist(FilePath infoPlistFile) { + InfoPlist infoPlist = null; + try { + NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(infoPlistFile.read()); + String cfBundleIdentifier = rootDict.objectForKey("CFBundleIdentifier").toString(); + String cfBundleVersion = rootDict.objectForKey("CFBundleVersion").toString(); + String cfBundleShortVersionString = rootDict.objectForKey("CFBundleShortVersionString").toString(); + infoPlist = new InfoPlist(infoPlistFile, cfBundleIdentifier, cfBundleVersion, cfBundleShortVersionString); + } + catch ( Exception ex ) { + ex.printStackTrace(); + } + return infoPlist; + } + + /** + * @param projectLocation Xcode project file location (directory) + * @return analysis result of Xcode project file. If analysis fails, it is null + */ + public static XcodeProject parseXcodeProject(FilePath projectLocation) { + XcodeProject project = new XcodeProject(); + FilePath xcodeProjectFile = projectLocation.child("project.pbxproj"); + try { + NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(xcodeProjectFile.read()); + String rootObjectsUUID = rootDict.objectForKey("rootObject").toString(); + NSDictionary objectsDict = ((NSDictionary)rootDict.objectForKey("objects")); + NSDictionary pbxProjectSectionDict = ((NSDictionary)objectsDict.objectForKey(rootObjectsUUID)); + NSObject[] projectTargetUUIDs = ((NSArray)pbxProjectSectionDict.objectForKey("targets")).getArray(); + // In case Project has buildConfigurationList. + // Parse each targets. + for ( NSObject projectTargetUUID:projectTargetUUIDs ) { + ProjectTarget target = new ProjectTarget(); + NSDictionary projectTargetDict = ((NSDictionary)objectsDict.objectForKey(projectTargetUUID.toString())); + target.uuid = projectTargetUUID.toString(); + String targetName = projectTargetDict.objectForKey("name").toString(); + // Target has buildConfigurationList. + String buildConfigurationListUUID = projectTargetDict.objectForKey("buildConfigurationList").toString(); + target.productType = projectTargetDict.objectForKey("productType").toString(); + if ( target.productType.equals("com.apple.product-type.application") || + target.productType.equals("com.apple.product-type.bundle.unit-test") || + target.productType.equals("com.apple.product-type.bundle.ui-testing") || + target.productType.equals("com.apple.product-type.watchkit-extension") || + target.productType.equals("com.apple.product-type.application.watchapp") || + target.productType.equals("com.apple.product-type.watchkit2-extension") || + target.productType.equals("com.apple.product-type.application.watchapp2") ) { + NSDictionary attributesDict = ((NSDictionary)pbxProjectSectionDict.objectForKey("attributes")); + NSDictionary targetAttributesDict = ((NSDictionary)attributesDict.objectForKey("TargetAttributes")); + NSDictionary attributeDict = ((NSDictionary)targetAttributesDict.objectForKey(target.uuid)); + if ( attributeDict.objectForKey("ProvisioningStyle") != null ) { + target.provisioningStyle = attributeDict.objectForKey("ProvisioningStyle").toString(); + } + else { + // Default code signing style is "Automatic" + target.provisioningStyle = "Automatic"; + } + if ( attributeDict.objectForKey("TestTargetID") != null ) { + target.testTargetID = attributeDict.objectForKey("TestTargetID").toString(); + } + NSDictionary buildConfigurationList = ((NSDictionary)objectsDict.objectForKey(buildConfigurationListUUID)); + if ( buildConfigurationList != null ) { + if ( buildConfigurationList.objectForKey("defaultConfigurationName") != null ) { + target.defaultConfigurationName = buildConfigurationList.objectForKey("defaultConfigurationName").toString(); + } + NSObject[] buildConfigurationUUIDs = ((NSArray)buildConfigurationList.objectForKey("buildConfigurations")).getArray(); + // Parse each build configurations. + for ( NSObject buildConfigurationUUID : buildConfigurationUUIDs ) { + BuildConfiguration buildConfiguration = new BuildConfiguration(objectsDict, buildConfigurationUUID.toString(), target.provisioningStyle.equals("Automatic")); + target.buildConfiguration.put(buildConfiguration.name, buildConfiguration); + } + } + project.projectTarget.put(targetName, target); + } + else if ( target.productType.equals("com.apple.product-type.framework" ) ) { + } + } + } + catch ( IOException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( PropertyListFormatException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( ParseException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( ParserConfigurationException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( SAXException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + project = null; + } + return project; + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..7fbcf6f8983e059381e26d7e11598fb706827919 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/pre_context.md @@ -0,0 +1,335 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/au/com/rayh/XcodeProjectParser.java` (changed lines (99, 182)) + +```java +package au.com.rayh; + +import java.io.File; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.HashMap; +import java.text.ParseException; +import java.io.ByteArrayInputStream; +import hudson.FilePath; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +//import javax.xml.parsers.ParserException; +import javax.xml.parsers.ParserConfigurationException; +import java.lang.InterruptedException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import com.dd.plist.NSDictionary; +import com.dd.plist.NSArray; +import com.dd.plist.NSNumber; +import com.dd.plist.NSObject; +import com.dd.plist.NSString; +import com.dd.plist.PropertyListFormatException; +import com.dd.plist.PropertyListParser; + +/** + * Analyze the Xcode project file and obtain the information necessary for building the application. (Only combinations of UUID and BundleID used for CodeSign now) + * @author Kazuhide Takahashi + */ +public class XcodeProjectParser { + + /** + * Retrieve all Xcode scheme file from project directory. + * @param projectLocation Xcode project file location (directory path) + * @return the list of schema files found in the project directory and the result (ProjectScheme) of analysis of the contents as a HashMap. If analysis fails, it is empty + */ + public static HashMap listXcodeSchemes(FilePath projectLocation) { + String currentUser = System.getProperty("user.name") ; + HashMap schemeList = new HashMap(); + List schemeFilesDirList = new ArrayList(); + try { + if ( projectLocation.child("xcuserdata/" + currentUser + ".xcuserdatad/xcschemes").exists() ) { + schemeFilesDirList.add(projectLocation.child("xcuserdata/" + currentUser + ".xcuserdatad/xcschemes")); + } + if ( projectLocation.child("xcshareddata/xcschemes").exists() ) { + schemeFilesDirList.add(projectLocation.child("xcshareddata/xcschemes")); + } + } + catch ( IOException ex ) { + ex.printStackTrace(); + schemeList = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + schemeList = null; + } + for ( FilePath schemeFilesDir : schemeFilesDirList ) { + try { + List files = schemeFilesDir.list(new XcodeSchemeFileFilter()); + if ( files == null ) { + return null; + } + for ( FilePath file : files ) { + ProjectScheme scheme = parseXcodeScheme(file); + String schemeName = file.getBaseName().replaceAll(".xcscheme$", ""); + schemeList.put(schemeName, scheme); + } + } + catch ( IOException ex ) { + ex.printStackTrace(); + schemeList = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + schemeList = null; + } + } + return schemeList; + } + + /** + * @param schemeFile Xcode schieme file location + * @return analysis result of Xcode projectscheme file. If analysis fails, it is null + */ + public static ProjectScheme parseXcodeScheme(FilePath schemeFile) { + ProjectScheme projectScheme = new ProjectScheme(); + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(schemeFile.read()); + + Element root = document.getDocumentElement(); + if ( root.getNodeName().equals("Scheme") ) { + NodeList schemeNodes = root.getChildNodes(); + for ( int i = 0; i < schemeNodes.getLength(); i++ ) { + Node node = schemeNodes.item(i); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + Element element = (Element)node; + if ( element.getNodeName().equals("BuildAction") ) { + //projectScheme.parallelizeBuildables = element.getAttribute("parallelizeBuildables"); + //projectScheme.buildImplicitDependencies = element.getAttribute("buildImplicitDependencies"); + NodeList buildActionNodes = element.getChildNodes(); + for ( int j = 0; j < buildActionNodes.getLength(); j++ ) { + node = buildActionNodes.item(j); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + element = (Element)node; + if ( element.getNodeName().equals("BuildActionEntries") ) { + NodeList buildActionEntriesNodes = element.getChildNodes(); + for ( int k = 0; k < buildActionEntriesNodes.getLength(); k++ ) { + node = buildActionEntriesNodes.item(k); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + element = (Element)node; + if ( element.getNodeName().equals("BuildActionEntry") ) { + //projectScheme.buildForTesting = element.getAttribute("buildForTesting"); + //projectScheme.buildForRunning = element.getAttribute("buildForRunning"); + //projectScheme.buildForProfiling = element.getAttribute("buildForProfiling"); + //projectScheme.buildForArchiving = element.getAttribute("buildForArchiving"); + //projectScheme.buildForAnalyzing = element.getAttribute("buildForAnalyzing"); + NodeList buildActionEntryNodes = element.getChildNodes(); + for ( int l = 0; l < buildActionEntryNodes.getLength(); l++ ) { + node = buildActionEntryNodes.item(l); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + element = (Element)node; + if ( element.getNodeName().equals("BuildableReference") ) { + //projectScheme.buildableIdentifier = element.getAttribute("BuildableIdentifier"); + //projectScheme.blueprintIdentifier = element.getAttribute("BlueprintIdentifier"); + //projectScheme.buildableName = element.getAttribute("BuildableName"); + projectScheme.blueprintName = element.getAttribute("BlueprintName"); + projectScheme.referencedContainer = element.getAttribute("ReferencedContainer"); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + catch (SAXException ex) { + ex.printStackTrace(); + projectScheme = null; + } + catch (IOException ex) { + ex.printStackTrace(); + projectScheme = null; + } + catch (ParserConfigurationException ex) { + ex.printStackTrace(); + projectScheme = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + projectScheme = null; + } + return projectScheme; + } + + /** + * @param workspaceFileLocation Xcode workspace file location (directory) + * @return list of project files obtained as a result of analyzing workspaceFile. If analysis fails, it is empty + */ + public static List parseXcodeWorkspace(FilePath workspaceFileLocation) { + List projectList = new ArrayList<>(); + try { + FilePath workspaceFilePath = workspaceFileLocation.child("contents.xcworkspacedata"); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(workspaceFilePath.read()); + + Element root = document.getDocumentElement(); + if ( root.getNodeName().equals("Workspace") ) { + NodeList rootChildren = root.getChildNodes(); + + for ( int i = 0; i < rootChildren.getLength(); i++ ) { + Node node = rootChildren.item(i); + if ( node.getNodeType() == Node.ELEMENT_NODE ) { + Element element = (Element)node; + if ( element.getNodeName().equals("FileRef") ) { + String projectLocation = element.getAttribute("location"); + if ( projectLocation.startsWith("group:") ) { + projectLocation = projectLocation.replaceAll("^group:", ""); + projectList.add(projectLocation); + } + } + } + } + } + } + catch (SAXException ex) { + ex.printStackTrace(); + projectList = null; + } + catch (IOException ex) { + ex.printStackTrace(); + projectList = null; + } + catch (ParserConfigurationException ex) { + ex.printStackTrace(); + projectList = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + projectList = null; + } + return projectList; + } + + /** + * @param infoPlistFile Xcode Info.plist file location + * @return analysis result of Info.plist file. If analysis fails, it is null + */ + public static InfoPlist parseInfoPlist(FilePath infoPlistFile) { + InfoPlist infoPlist = null; + try { + NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(infoPlistFile.read()); + String cfBundleIdentifier = rootDict.objectForKey("CFBundleIdentifier").toString(); + String cfBundleVersion = rootDict.objectForKey("CFBundleVersion").toString(); + String cfBundleShortVersionString = rootDict.objectForKey("CFBundleShortVersionString").toString(); + infoPlist = new InfoPlist(infoPlistFile, cfBundleIdentifier, cfBundleVersion, cfBundleShortVersionString); + } + catch ( Exception ex ) { + ex.printStackTrace(); + } + return infoPlist; + } + + /** + * @param projectLocation Xcode project file location (directory) + * @return analysis result of Xcode project file. If analysis fails, it is null + */ + public static XcodeProject parseXcodeProject(FilePath projectLocation) { + XcodeProject project = new XcodeProject(); + FilePath xcodeProjectFile = projectLocation.child("project.pbxproj"); + try { + NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(xcodeProjectFile.read()); + String rootObjectsUUID = rootDict.objectForKey("rootObject").toString(); + NSDictionary objectsDict = ((NSDictionary)rootDict.objectForKey("objects")); + NSDictionary pbxProjectSectionDict = ((NSDictionary)objectsDict.objectForKey(rootObjectsUUID)); + NSObject[] projectTargetUUIDs = ((NSArray)pbxProjectSectionDict.objectForKey("targets")).getArray(); + // In case Project has buildConfigurationList. + // Parse each targets. + for ( NSObject projectTargetUUID:projectTargetUUIDs ) { + ProjectTarget target = new ProjectTarget(); + NSDictionary projectTargetDict = ((NSDictionary)objectsDict.objectForKey(projectTargetUUID.toString())); + target.uuid = projectTargetUUID.toString(); + String targetName = projectTargetDict.objectForKey("name").toString(); + // Target has buildConfigurationList. + String buildConfigurationListUUID = projectTargetDict.objectForKey("buildConfigurationList").toString(); + target.productType = projectTargetDict.objectForKey("productType").toString(); + if ( target.productType.equals("com.apple.product-type.application") || + target.productType.equals("com.apple.product-type.bundle.unit-test") || + target.productType.equals("com.apple.product-type.bundle.ui-testing") || + target.productType.equals("com.apple.product-type.watchkit-extension") || + target.productType.equals("com.apple.product-type.application.watchapp") || + target.productType.equals("com.apple.product-type.watchkit2-extension") || + target.productType.equals("com.apple.product-type.application.watchapp2") ) { + NSDictionary attributesDict = ((NSDictionary)pbxProjectSectionDict.objectForKey("attributes")); + NSDictionary targetAttributesDict = ((NSDictionary)attributesDict.objectForKey("TargetAttributes")); + NSDictionary attributeDict = ((NSDictionary)targetAttributesDict.objectForKey(target.uuid)); + if ( attributeDict.objectForKey("ProvisioningStyle") != null ) { + target.provisioningStyle = attributeDict.objectForKey("ProvisioningStyle").toString(); + } + else { + // Default code signing style is "Automatic" + target.provisioningStyle = "Automatic"; + } + if ( attributeDict.objectForKey("TestTargetID") != null ) { + target.testTargetID = attributeDict.objectForKey("TestTargetID").toString(); + } + NSDictionary buildConfigurationList = ((NSDictionary)objectsDict.objectForKey(buildConfigurationListUUID)); + if ( buildConfigurationList != null ) { + if ( buildConfigurationList.objectForKey("defaultConfigurationName") != null ) { + target.defaultConfigurationName = buildConfigurationList.objectForKey("defaultConfigurationName").toString(); + } + NSObject[] buildConfigurationUUIDs = ((NSArray)buildConfigurationList.objectForKey("buildConfigurations")).getArray(); + // Parse each build configurations. + for ( NSObject buildConfigurationUUID : buildConfigurationUUIDs ) { + BuildConfiguration buildConfiguration = new BuildConfiguration(objectsDict, buildConfigurationUUID.toString(), target.provisioningStyle.equals("Automatic")); + target.buildConfiguration.put(buildConfiguration.name, buildConfiguration); + } + } + project.projectTarget.put(targetName, target); + } + else if ( target.productType.equals("com.apple.product-type.framework" ) ) { + } + } + } + catch ( IOException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( PropertyListFormatException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( ParseException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( ParserConfigurationException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( SAXException ex ) { + ex.printStackTrace(); + project = null; + } + catch ( InterruptedException ex ) { + ex.printStackTrace(); + project = null; + } + return project; + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/task.json new file mode 100644 index 0000000000000000000000000000000000000000..e49e0473023d456f632c7e8e6cd862394feb69f4 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-04bdb708bf23aabdc444", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-04bdb708bf23aabdc444", + "project_id": "morefixes__jenkinsci__xcode-plugin", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/au/com/rayh/XcodeProjectParser.java" + ], + "patch_units": { + "before": [ + "src/main/java/au/com/rayh/XcodeProjectParser.java" + ], + "after": [ + "src/main/java/au/com/rayh/XcodeProjectParser.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/10ac33e50139db01c29e8bb88e4b2bce7acb93e126a6f6bfbdc9042fd5d8bd6a/database", + "cache_key": "10ac33e50139db01c29e8bb88e4b2bce7acb93e126a6f6bfbdc9042fd5d8bd6a", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/8d17755766a009d75837c688f123229076dee0063eee0e7184e4d0da7870dc6b/database", + "cache_key": "8d17755766a009d75837c688f123229076dee0063eee0e7184e4d0da7870dc6b", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/3adc34d39991156d2f3215e1fbb6e01452db1116e50c44839af2881809f2a815/database", + "cache_key": "3adc34d39991156d2f3215e1fbb6e01452db1116e50c44839af2881809f2a815", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-04bdb708bf23aabdc444/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-04bdb708bf23aabdc444/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-04bdb708bf23aabdc444/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..6aa4b5804a2730bf42622942c40f83b698df8ef1 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/patch.diff @@ -0,0 +1,103 @@ +diff --git a/src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java b/src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java +index 4f76c60..cd43691 100644 +--- a/src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java ++++ b/src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java +@@ -46,6 +46,7 @@ import org.kohsuke.stapler.AncestorInPath; + import org.kohsuke.stapler.DataBoundSetter; + import org.kohsuke.stapler.QueryParameter; + import org.kohsuke.stapler.StaplerRequest; ++import org.kohsuke.stapler.verb.POST; + + /** + *

+@@ -149,6 +150,7 @@ public final class DescriptorImpl extends BuildStepDescriptor impleme + * @param item used to lookup credentials in job config. ignored in global + * @return ListBoxModel + */ ++ @POST + public ListBoxModel doFillProjectIdItems(@QueryParameter final String dependencyTrackUrl, @QueryParameter final String dependencyTrackApiKey, @AncestorInPath @Nullable Item item) { + final ListBoxModel projects = new ListBoxModel(); + try { +@@ -169,6 +171,7 @@ public final class DescriptorImpl extends BuildStepDescriptor impleme + return projects; + } + ++ @POST + public ListBoxModel doFillDependencyTrackApiKeyItems(@QueryParameter String credentialsId, @AncestorInPath Item item) { + StandardListBoxModel result = new StandardListBoxModel(); + if (item == null) { +@@ -190,9 +193,16 @@ public final class DescriptorImpl extends BuildStepDescriptor impleme + * Performs input validation when submitting the global config + * + * @param value The value of the URL as specified in the global config ++ * @param item used to check permissions in job config. ignored in global + * @return a FormValidation object + */ +- public FormValidation doCheckDependencyTrackUrl(@QueryParameter String value) { ++ @POST ++ public FormValidation doCheckDependencyTrackUrl(@QueryParameter String value, @AncestorInPath @Nullable Item item) { ++ if (item == null) { ++ Jenkins.get().checkPermission(Jenkins.ADMINISTER); ++ } else { ++ item.checkPermission(Item.CONFIGURE); ++ } + return PluginUtil.doCheckUrl(value); + } + +@@ -200,9 +210,16 @@ public final class DescriptorImpl extends BuildStepDescriptor impleme + * Performs input validation when submitting the global config + * + * @param value The value of the URL as specified in the global config ++ * @param item used to check permissions in job config. ignored in global + * @return a FormValidation object + */ +- public FormValidation doCheckDependencyTrackFrontendUrl(@QueryParameter String value) { ++ @POST ++ public FormValidation doCheckDependencyTrackFrontendUrl(@QueryParameter String value, @AncestorInPath @Nullable Item item) { ++ if (item == null) { ++ Jenkins.get().checkPermission(Jenkins.ADMINISTER); ++ } else { ++ item.checkPermission(Item.CONFIGURE); ++ } + return PluginUtil.doCheckUrl(value); + } + +@@ -217,12 +234,18 @@ public final class DescriptorImpl extends BuildStepDescriptor impleme + * config + * @return FormValidation + */ ++ @POST + public FormValidation doTestConnection(@QueryParameter final String dependencyTrackUrl, @QueryParameter final String dependencyTrackApiKey, @AncestorInPath @Nullable Item item) { ++ if (item == null) { ++ Jenkins.get().checkPermission(Jenkins.ADMINISTER); ++ } else { ++ item.checkPermission(Item.CONFIGURE); ++ } + // url may come from instance-config. if empty, then take it from global config (this) + final String url = Optional.ofNullable(PluginUtil.parseBaseUrl(dependencyTrackUrl)).orElse(getDependencyTrackUrl()); + // api-key may come from instance-config. if empty, then take it from global config (this) + final String apiKey = lookupApiKey(Optional.ofNullable(StringUtils.trimToNull(dependencyTrackApiKey)).orElse(getDependencyTrackApiKey()), item); +- if (doCheckDependencyTrackUrl(url).kind == FormValidation.Kind.OK && StringUtils.isNotBlank(apiKey)) { ++ if (doCheckDependencyTrackUrl(url, item).kind == FormValidation.Kind.OK && StringUtils.isNotBlank(apiKey)) { + try { + final ApiClient apiClient = getClient(url, apiKey); + final String result = apiClient.testConnection(); +diff --git a/src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java b/src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java +index a696122..525072d 100644 +--- a/src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java ++++ b/src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java +@@ -162,10 +162,10 @@ public class DescriptorImplTest { + + @Test + public void doCheckDependencyTrackUrlTest() { +- assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar/")).isEqualTo(FormValidation.ok()); +- assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar")).isEqualTo(FormValidation.ok()); +- assertThat(uut.doCheckDependencyTrackUrl("")).isEqualTo(FormValidation.ok()); +- assertThat(uut.doCheckDependencyTrackUrl("foo")) ++ assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar/", null)).isEqualTo(FormValidation.ok()); ++ assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar", null)).isEqualTo(FormValidation.ok()); ++ assertThat(uut.doCheckDependencyTrackUrl("", null)).isEqualTo(FormValidation.ok()); ++ assertThat(uut.doCheckDependencyTrackUrl("foo", null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessage("The specified value is not a valid URL"); + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..4f056c643b8832996ed5c7e151cc81d9cd48294f --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/post_context.md @@ -0,0 +1,549 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java` (changed lines (49, 153, 174, 196, 199, 200, 201, 202, 203, 204, 205, 213, 216, 217, 218, 219, 220, 221, 222, 237, 239, 240, 241, 242, 243, 248)) + +```java +/* + * Copyright 2020 OWASP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jenkinsci.plugins.DependencyTrack; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.common.StandardListBoxModel; +import edu.umd.cs.findbugs.annotations.CheckForNull; +import edu.umd.cs.findbugs.annotations.Nullable; +import hudson.Extension; +import hudson.model.AbstractProject; +import hudson.model.Descriptor; +import hudson.model.Item; +import hudson.security.ACL; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Publisher; +import hudson.util.FormValidation; +import hudson.util.ListBoxModel; +import hudson.util.Secret; +import java.io.Serializable; +import java.util.Collections; +import java.util.Comparator; +import java.util.Optional; +import java.util.stream.Collectors; +import jenkins.model.Jenkins; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; +import org.jenkinsci.Symbol; +import org.jenkinsci.plugins.plaincredentials.StringCredentials; +import org.kohsuke.stapler.AncestorInPath; +import org.kohsuke.stapler.DataBoundSetter; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.verb.POST; + +/** + *

+ * Descriptor for {@link DependencyTrackPublisher}. Used as a singleton. The + * class is marked as public so that it can be accessed from views. + *

+ * See + * src/main/resources/org/jenkinsci/plugins/DependencyCheck/DependencyTrackBuilder/*.jelly + * for the actual HTML fragment for the configuration screen. + */ +@Extension +@Symbol("dependencyTrackPublisher") // This indicates to Jenkins that this is an implementation of an extension point. +public final class DescriptorImpl extends BuildStepDescriptor implements Serializable { + + private static final long serialVersionUID = -2018722914973282748L; + + private transient final ApiClientFactory clientFactory; + + /** + * Specifies the base URL to Dependency-Track v3 or higher. + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private String dependencyTrackUrl; + + /** + * Specifies the alternative base URL to the frontend of Dependency-Track v3 or higher. + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private String dependencyTrackFrontendUrl; + + /** + * Specifies an API Key used for authentication (if authentication is + * required). + */ + @Getter(onMethod_ = {@CheckForNull}) + @Setter(onMethod_ = {@DataBoundSetter}) + private String dependencyTrackApiKey; + + /** + * Specifies whether the API key provided has the PROJECT_CREATION_UPLOAD + * permission. + */ + @Getter + @Setter(onMethod_ = {@DataBoundSetter}) + private boolean dependencyTrackAutoCreateProjects; + + /** + * Specifies the maximum number of minutes to wait for synchronous jobs to + * complete. + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackPollingTimeout; + + /** + * Defines the number of seconds to wait between two checks for + * Dependency-Track to process a job (Synchronous Publishing Mode). + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackPollingInterval; + + /** + * the connection-timeout in seconds for every call to DT + */ + @Getter + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackConnectionTimeout; + + /** + * the read-timeout in seconds for every call to DT + */ + @Getter + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackReadTimeout; + + /** + * Default constructor. Obtains the Descriptor used in + * DependencyCheckBuilder as this contains the global Dependency-Check + * Jenkins plugin configuration. + */ + public DescriptorImpl() { + this(ApiClient::new); + } + + DescriptorImpl(@NonNull ApiClientFactory clientFactory) { + super(DependencyTrackPublisher.class); + this.clientFactory = clientFactory; + load(); + } + + @Override + public boolean isApplicable(Class aClass) { + // Indicates that this builder can be used with all kinds of project types + return true; + } + + /** + * Retrieve the projects to populate the dropdown. + * + * @param dependencyTrackUrl the base URL to Dependency-Track + * @param dependencyTrackApiKey the API key to use for authentication + * @param item used to lookup credentials in job config. ignored in global + * @return ListBoxModel + */ + @POST + public ListBoxModel doFillProjectIdItems(@QueryParameter final String dependencyTrackUrl, @QueryParameter final String dependencyTrackApiKey, @AncestorInPath @Nullable Item item) { + final ListBoxModel projects = new ListBoxModel(); + try { + // url may come from instance-config. if empty, then take it from global config (this) + final String url = Optional.ofNullable(PluginUtil.parseBaseUrl(dependencyTrackUrl)).orElse(getDependencyTrackUrl()); + // api-key may come from instance-config. if empty, then take it from global config (this) + final String apiKey = lookupApiKey(Optional.ofNullable(StringUtils.trimToNull(dependencyTrackApiKey)).orElse(getDependencyTrackApiKey()), item); + final ApiClient apiClient = getClient(url, apiKey); + projects.addAll(apiClient.getProjects().stream() + .map(p -> new ListBoxModel.Option(p.getName().concat(" ").concat(Optional.ofNullable(p.getVersion()).orElse(StringUtils.EMPTY)).trim(), p.getUuid())) + .sorted(Comparator.comparing(o -> o.name)) + .collect(Collectors.toList()) + ); + projects.add(0, new ListBoxModel.Option("-- Select Project --", null)); + } catch (ApiClientException e) { + projects.add(Messages.Builder_Error_Projects(e.getLocalizedMessage()), null); + } + return projects; + } + + @POST + public ListBoxModel doFillDependencyTrackApiKeyItems(@QueryParameter String credentialsId, @AncestorInPath Item item) { + StandardListBoxModel result = new StandardListBoxModel(); + if (item == null) { + if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) { + return result.includeCurrentValue(credentialsId); + } + } else { + if (!item.hasPermission(Item.EXTENDED_READ) && !item.hasPermission(CredentialsProvider.USE_ITEM)) { + return result.includeCurrentValue(credentialsId); + } + } + return result + .includeEmptyValue() + .includeAs(ACL.SYSTEM, item, StringCredentials.class, Collections.emptyList()) + .includeCurrentValue(credentialsId); + } + + /** + * Performs input validation when submitting the global config + * + * @param value The value of the URL as specified in the global config + * @param item used to check permissions in job config. ignored in global + * @return a FormValidation object + */ + @POST + public FormValidation doCheckDependencyTrackUrl(@QueryParameter String value, @AncestorInPath @Nullable Item item) { + if (item == null) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); + } else { + item.checkPermission(Item.CONFIGURE); + } + return PluginUtil.doCheckUrl(value); + } + + /** + * Performs input validation when submitting the global config + * + * @param value The value of the URL as specified in the global config + * @param item used to check permissions in job config. ignored in global + * @return a FormValidation object + */ + @POST + public FormValidation doCheckDependencyTrackFrontendUrl(@QueryParameter String value, @AncestorInPath @Nullable Item item) { + if (item == null) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); + } else { + item.checkPermission(Item.CONFIGURE); + } + return PluginUtil.doCheckUrl(value); + } + + /** + * Performs an on-the-fly check of the Dependency-Track URL and api key + * parameters by making a simple call to the server and validating the + * response code. + * + * @param dependencyTrackUrl the base URL to Dependency-Track + * @param dependencyTrackApiKey the credential-id of the API key to use for authentication + * @param item used to lookup credentials in job config. ignored in global + * config + * @return FormValidation + */ + @POST + public FormValidation doTestConnection(@QueryParameter final String dependencyTrackUrl, @QueryParameter final String dependencyTrackApiKey, @AncestorInPath @Nullable Item item) { + if (item == null) { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); + } else { + item.checkPermission(Item.CONFIGURE); + } + // url may come from instance-config. if empty, then take it from global config (this) + final String url = Optional.ofNullable(PluginUtil.parseBaseUrl(dependencyTrackUrl)).orElse(getDependencyTrackUrl()); + // api-key may come from instance-config. if empty, then take it from global config (this) + final String apiKey = lookupApiKey(Optional.ofNullable(StringUtils.trimToNull(dependencyTrackApiKey)).orElse(getDependencyTrackApiKey()), item); + if (doCheckDependencyTrackUrl(url, item).kind == FormValidation.Kind.OK && StringUtils.isNotBlank(apiKey)) { + try { + final ApiClient apiClient = getClient(url, apiKey); + final String result = apiClient.testConnection(); + return result.startsWith("Dependency-Track v") ? FormValidation.ok("Connection successful - " + result) : FormValidation.error("Connection failed - " + result); + } catch (ApiClientException e) { + return FormValidation.error(e, "Connection failed"); + } + } + return FormValidation.warning("URL must be valid and Api-Key must not be empty"); + } + + /** + * Takes the /apply/save step in the global config and saves the JSON data. + * + * @param req the request + * @param formData the form data + * @return a boolean + * @throws FormException an exception validating form input + */ + @Override + public boolean configure(StaplerRequest req, JSONObject formData) throws Descriptor.FormException { + req.bindJSON(this, formData); + save(); + return super.configure(req, formData); + } + + /** + * This name is used on the build configuration screen. + * + * @return + */ + @Override + public String getDisplayName() { + return Messages.Publisher_DependencyTrack_Name(); + } + + /** + * @return global configuration for dependencyTrackUrl + */ + @CheckForNull + public String getDependencyTrackUrl() { + return PluginUtil.parseBaseUrl(dependencyTrackUrl); + } + + /** + * @return global configuration for dependencyTrackFrontendUrl + */ + @CheckForNull + public String getDependencyTrackFrontendUrl() { + return PluginUtil.parseBaseUrl(dependencyTrackFrontendUrl); + } + + /** + * @return global configuration for dependencyTrackPollingTimeout. + */ + public int getDependencyTrackPollingTimeout() { + if (dependencyTrackPollingTimeout <= 0) { + return 5; + } + return dependencyTrackPollingTimeout; + } + + /** + * @return global configuration for dependencyTrackPollingInterval. + */ + public int getDependencyTrackPollingInterval() { + if (dependencyTrackPollingInterval <= 0) { + return 10; + } + return dependencyTrackPollingInterval; + } + + private ApiClient getClient(final String baseUrl, final String apiKey) { + return clientFactory.create(baseUrl, apiKey, new ConsoleLogger(), Math.max(dependencyTrackConnectionTimeout, 0), Math.max(dependencyTrackReadTimeout, 0)); + } + + private String lookupApiKey(final String credentialId, final Item item) { + return CredentialsProvider.lookupCredentials(StringCredentials.class, item, ACL.SYSTEM, Collections.emptyList()).stream() + .filter(c -> c.getId().equals(credentialId)) + .map(StringCredentials::getSecret) + .map(Secret::getPlainText) + .findFirst().orElse(StringUtils.EMPTY); + } +} +``` + +## `src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java` (changed lines (165, 166, 167, 168)) + +```java +/* + * Copyright 2020 OWASP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jenkinsci.plugins.DependencyTrack; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.CredentialsScope; +import com.cloudbees.plugins.credentials.domains.Domain; +import hudson.model.Descriptor; +import hudson.util.FormValidation; +import hudson.util.ListBoxModel; +import hudson.util.Secret; +import io.jenkins.plugins.casc.misc.JenkinsConfiguredRule; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import net.sf.json.JSONObject; +import org.jenkinsci.plugins.DependencyTrack.model.Project; +import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.kohsuke.stapler.StaplerRequest; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +/** + * + * @author Ronny "Sephiroth" Perinke + */ +public class DescriptorImplTest { + + @Rule + public JenkinsConfiguredRule r = new JenkinsConfiguredRule(); + + @Rule + public MockitoRule rule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + + @Mock + private ApiClient client; + private DescriptorImpl uut; + + @Before + public void setup() { + uut = new DescriptorImpl((url, apiKey, logger, connTimeout, readTimeout) -> client); + } + + @Test + public void doFillProjectIdItemsTest() throws ApiClientException { + List projects = new ArrayList<>(); + projects.add(Project.builder().name("Project 2").uuid("uuid-2").version("1.2.3").build()); + projects.add(Project.builder().name("Project 1").uuid("uuid-1").build()); + doReturn(projects).doThrow(new ApiClientException("test failure")) + .when(client).getProjects(); + + assertThat(uut.doFillProjectIdItems(null, null, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option("-- Select Project --", null, false), + new ListBoxModel.Option("Project 1", "uuid-1", false), + new ListBoxModel.Option("Project 2 1.2.3", "uuid-2", false) + ); + + assertThat(uut.doFillProjectIdItems(null, null, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option(Messages.Builder_Error_Projects("test failure"), null, false) + ); + } + + @Test + public void doFillDependencyTrackApiKeyItems() throws IOException { + final String apikey = "api-key"; + final String credentialsid = "credentials-id"; + CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsid, "test", Secret.fromString(apikey))); + assertThat(uut.doFillDependencyTrackApiKeyItems(null, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option("- none -", "", false), + new ListBoxModel.Option("test", credentialsid, false) + ); + assertThat(uut.doFillDependencyTrackApiKeyItems(credentialsid, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option("- none -", "", false), + new ListBoxModel.Option("test", credentialsid, false) + ); + } + + @Test + public void doTestConnectionTest() throws ApiClientException, IOException { + final String apikey = "api-key"; + final String credentialsid = "credentials-id"; + // custom factory here so we can check that doTestConnection strips trailing slashes from the url + ApiClientFactory factory = (url, apiKey, logger, connTimeout, readTimeout) -> { + assertThat(url).isEqualTo("http:///url.tld"); + assertThat(apiKey).isEqualTo(apikey); + assertThat(logger).isInstanceOf(ConsoleLogger.class); + return client; + }; + when(client.testConnection()).thenReturn("Dependency-Track v3.8.0").thenReturn("test").thenThrow(ApiClientException.class); + CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsid, "test", Secret.fromString(apikey))); + uut = new DescriptorImpl(factory); + + assertThat(uut.doTestConnection("http:///url.tld", credentialsid, null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.OK) + .hasMessage("Connection successful - Dependency-Track v3.8.0") + .hasNoCause(); + + assertThat(uut.doTestConnection("http:///url.tld/", credentialsid, null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessageStartingWith("Connection failed - test") + .hasNoCause(); + + assertThat(uut.doTestConnection("http:///url.tld/", credentialsid, null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessageStartingWith("Connection failed") + .hasMessageContaining(ApiClientException.class.getCanonicalName()) + .hasNoCause(); + + assertThat(uut.doTestConnection("url", "", null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.WARNING) + .hasMessage("URL must be valid and Api-Key must not be empty") + .hasNoCause(); + } + + @Test + public void doTestConnectionTestWithEmptyArgs() throws ApiClientException, IOException { + final String apikey = "api-key"; + final String credentialsid = "credentials-id"; + // custom factory here so we can check that doTestConnection strips trailing slashes from the url + ApiClientFactory factory = (url, apiKey, logger, connTimeout, readTimeout) -> { + assertThat(url).isEqualTo("http:///url.tld"); + assertThat(apiKey).isEqualTo(apikey); + assertThat(logger).isInstanceOf(ConsoleLogger.class); + return client; + }; + when(client.testConnection()).thenReturn("Dependency-Track v3.8.0").thenReturn("test").thenThrow(ApiClientException.class); + CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsid, "test", Secret.fromString(apikey))); + uut = new DescriptorImpl(factory); + uut.setDependencyTrackApiKey(credentialsid); + uut.setDependencyTrackUrl("http:///url.tld/"); + + assertThat(uut.doTestConnection("", "", null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.OK) + .hasMessage("Connection successful - Dependency-Track v3.8.0") + .hasNoCause(); + } + + @Test + public void doCheckDependencyTrackUrlTest() { + assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar/", null)).isEqualTo(FormValidation.ok()); + assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar", null)).isEqualTo(FormValidation.ok()); + assertThat(uut.doCheckDependencyTrackUrl("", null)).isEqualTo(FormValidation.ok()); + assertThat(uut.doCheckDependencyTrackUrl("foo", null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessage("The specified value is not a valid URL"); + } + + @Test + public void getDependencyTrackUrlTest() { + uut.setDependencyTrackUrl("http://foo.bar/"); + assertThat(uut.getDependencyTrackUrl()).isEqualTo("http://foo.bar"); + + uut.setDependencyTrackUrl("http://foo.bar"); + assertThat(uut.getDependencyTrackUrl()).isEqualTo("http://foo.bar"); + } + + @Test + public void getDependencyTrackPollingTimeoutTest() { + assertThat(uut.getDependencyTrackPollingTimeout()).isEqualTo(5); + + uut.setDependencyTrackPollingTimeout(0); + assertThat(uut.getDependencyTrackPollingTimeout()).isEqualTo(5); + + uut.setDependencyTrackPollingTimeout(Integer.MAX_VALUE); + assertThat(uut.getDependencyTrackPollingTimeout()).isEqualTo(Integer.MAX_VALUE); + } + + @Test + public void configureTest() throws Descriptor.FormException { + StaplerRequest req = mock(StaplerRequest.class); + JSONObject formData = new JSONObject() + .element("dependencyTrackUrl", "https://foo.bar/") + .element("dependencyTrackApiKey", "api-key") + .element("dependencyTrackAutoCreateProjects", true) + .element("dependencyTrackPollingTimeout", 7); + + assertThat(uut.configure(req, formData)).isTrue(); + + verify(req).bindJSON(eq(uut), eq(formData)); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..37e775b837e5acae3c9d61feefd90e8de0b51238 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/pre_context.md @@ -0,0 +1,526 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java` (changed lines (49, 152, 172, 193, 195, 196, 203, 205, 206, 220, 221, 225, 226)) + +```java +/* + * Copyright 2020 OWASP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jenkinsci.plugins.DependencyTrack; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.common.StandardListBoxModel; +import edu.umd.cs.findbugs.annotations.CheckForNull; +import edu.umd.cs.findbugs.annotations.Nullable; +import hudson.Extension; +import hudson.model.AbstractProject; +import hudson.model.Descriptor; +import hudson.model.Item; +import hudson.security.ACL; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Publisher; +import hudson.util.FormValidation; +import hudson.util.ListBoxModel; +import hudson.util.Secret; +import java.io.Serializable; +import java.util.Collections; +import java.util.Comparator; +import java.util.Optional; +import java.util.stream.Collectors; +import jenkins.model.Jenkins; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; +import org.jenkinsci.Symbol; +import org.jenkinsci.plugins.plaincredentials.StringCredentials; +import org.kohsuke.stapler.AncestorInPath; +import org.kohsuke.stapler.DataBoundSetter; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.StaplerRequest; + +/** + *

+ * Descriptor for {@link DependencyTrackPublisher}. Used as a singleton. The + * class is marked as public so that it can be accessed from views. + *

+ * See + * src/main/resources/org/jenkinsci/plugins/DependencyCheck/DependencyTrackBuilder/*.jelly + * for the actual HTML fragment for the configuration screen. + */ +@Extension +@Symbol("dependencyTrackPublisher") // This indicates to Jenkins that this is an implementation of an extension point. +public final class DescriptorImpl extends BuildStepDescriptor implements Serializable { + + private static final long serialVersionUID = -2018722914973282748L; + + private transient final ApiClientFactory clientFactory; + + /** + * Specifies the base URL to Dependency-Track v3 or higher. + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private String dependencyTrackUrl; + + /** + * Specifies the alternative base URL to the frontend of Dependency-Track v3 or higher. + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private String dependencyTrackFrontendUrl; + + /** + * Specifies an API Key used for authentication (if authentication is + * required). + */ + @Getter(onMethod_ = {@CheckForNull}) + @Setter(onMethod_ = {@DataBoundSetter}) + private String dependencyTrackApiKey; + + /** + * Specifies whether the API key provided has the PROJECT_CREATION_UPLOAD + * permission. + */ + @Getter + @Setter(onMethod_ = {@DataBoundSetter}) + private boolean dependencyTrackAutoCreateProjects; + + /** + * Specifies the maximum number of minutes to wait for synchronous jobs to + * complete. + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackPollingTimeout; + + /** + * Defines the number of seconds to wait between two checks for + * Dependency-Track to process a job (Synchronous Publishing Mode). + */ + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackPollingInterval; + + /** + * the connection-timeout in seconds for every call to DT + */ + @Getter + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackConnectionTimeout; + + /** + * the read-timeout in seconds for every call to DT + */ + @Getter + @Setter(onMethod_ = {@DataBoundSetter}) + private int dependencyTrackReadTimeout; + + /** + * Default constructor. Obtains the Descriptor used in + * DependencyCheckBuilder as this contains the global Dependency-Check + * Jenkins plugin configuration. + */ + public DescriptorImpl() { + this(ApiClient::new); + } + + DescriptorImpl(@NonNull ApiClientFactory clientFactory) { + super(DependencyTrackPublisher.class); + this.clientFactory = clientFactory; + load(); + } + + @Override + public boolean isApplicable(Class aClass) { + // Indicates that this builder can be used with all kinds of project types + return true; + } + + /** + * Retrieve the projects to populate the dropdown. + * + * @param dependencyTrackUrl the base URL to Dependency-Track + * @param dependencyTrackApiKey the API key to use for authentication + * @param item used to lookup credentials in job config. ignored in global + * @return ListBoxModel + */ + public ListBoxModel doFillProjectIdItems(@QueryParameter final String dependencyTrackUrl, @QueryParameter final String dependencyTrackApiKey, @AncestorInPath @Nullable Item item) { + final ListBoxModel projects = new ListBoxModel(); + try { + // url may come from instance-config. if empty, then take it from global config (this) + final String url = Optional.ofNullable(PluginUtil.parseBaseUrl(dependencyTrackUrl)).orElse(getDependencyTrackUrl()); + // api-key may come from instance-config. if empty, then take it from global config (this) + final String apiKey = lookupApiKey(Optional.ofNullable(StringUtils.trimToNull(dependencyTrackApiKey)).orElse(getDependencyTrackApiKey()), item); + final ApiClient apiClient = getClient(url, apiKey); + projects.addAll(apiClient.getProjects().stream() + .map(p -> new ListBoxModel.Option(p.getName().concat(" ").concat(Optional.ofNullable(p.getVersion()).orElse(StringUtils.EMPTY)).trim(), p.getUuid())) + .sorted(Comparator.comparing(o -> o.name)) + .collect(Collectors.toList()) + ); + projects.add(0, new ListBoxModel.Option("-- Select Project --", null)); + } catch (ApiClientException e) { + projects.add(Messages.Builder_Error_Projects(e.getLocalizedMessage()), null); + } + return projects; + } + + public ListBoxModel doFillDependencyTrackApiKeyItems(@QueryParameter String credentialsId, @AncestorInPath Item item) { + StandardListBoxModel result = new StandardListBoxModel(); + if (item == null) { + if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) { + return result.includeCurrentValue(credentialsId); + } + } else { + if (!item.hasPermission(Item.EXTENDED_READ) && !item.hasPermission(CredentialsProvider.USE_ITEM)) { + return result.includeCurrentValue(credentialsId); + } + } + return result + .includeEmptyValue() + .includeAs(ACL.SYSTEM, item, StringCredentials.class, Collections.emptyList()) + .includeCurrentValue(credentialsId); + } + + /** + * Performs input validation when submitting the global config + * + * @param value The value of the URL as specified in the global config + * @return a FormValidation object + */ + public FormValidation doCheckDependencyTrackUrl(@QueryParameter String value) { + return PluginUtil.doCheckUrl(value); + } + + /** + * Performs input validation when submitting the global config + * + * @param value The value of the URL as specified in the global config + * @return a FormValidation object + */ + public FormValidation doCheckDependencyTrackFrontendUrl(@QueryParameter String value) { + return PluginUtil.doCheckUrl(value); + } + + /** + * Performs an on-the-fly check of the Dependency-Track URL and api key + * parameters by making a simple call to the server and validating the + * response code. + * + * @param dependencyTrackUrl the base URL to Dependency-Track + * @param dependencyTrackApiKey the credential-id of the API key to use for authentication + * @param item used to lookup credentials in job config. ignored in global + * config + * @return FormValidation + */ + public FormValidation doTestConnection(@QueryParameter final String dependencyTrackUrl, @QueryParameter final String dependencyTrackApiKey, @AncestorInPath @Nullable Item item) { + // url may come from instance-config. if empty, then take it from global config (this) + final String url = Optional.ofNullable(PluginUtil.parseBaseUrl(dependencyTrackUrl)).orElse(getDependencyTrackUrl()); + // api-key may come from instance-config. if empty, then take it from global config (this) + final String apiKey = lookupApiKey(Optional.ofNullable(StringUtils.trimToNull(dependencyTrackApiKey)).orElse(getDependencyTrackApiKey()), item); + if (doCheckDependencyTrackUrl(url).kind == FormValidation.Kind.OK && StringUtils.isNotBlank(apiKey)) { + try { + final ApiClient apiClient = getClient(url, apiKey); + final String result = apiClient.testConnection(); + return result.startsWith("Dependency-Track v") ? FormValidation.ok("Connection successful - " + result) : FormValidation.error("Connection failed - " + result); + } catch (ApiClientException e) { + return FormValidation.error(e, "Connection failed"); + } + } + return FormValidation.warning("URL must be valid and Api-Key must not be empty"); + } + + /** + * Takes the /apply/save step in the global config and saves the JSON data. + * + * @param req the request + * @param formData the form data + * @return a boolean + * @throws FormException an exception validating form input + */ + @Override + public boolean configure(StaplerRequest req, JSONObject formData) throws Descriptor.FormException { + req.bindJSON(this, formData); + save(); + return super.configure(req, formData); + } + + /** + * This name is used on the build configuration screen. + * + * @return + */ + @Override + public String getDisplayName() { + return Messages.Publisher_DependencyTrack_Name(); + } + + /** + * @return global configuration for dependencyTrackUrl + */ + @CheckForNull + public String getDependencyTrackUrl() { + return PluginUtil.parseBaseUrl(dependencyTrackUrl); + } + + /** + * @return global configuration for dependencyTrackFrontendUrl + */ + @CheckForNull + public String getDependencyTrackFrontendUrl() { + return PluginUtil.parseBaseUrl(dependencyTrackFrontendUrl); + } + + /** + * @return global configuration for dependencyTrackPollingTimeout. + */ + public int getDependencyTrackPollingTimeout() { + if (dependencyTrackPollingTimeout <= 0) { + return 5; + } + return dependencyTrackPollingTimeout; + } + + /** + * @return global configuration for dependencyTrackPollingInterval. + */ + public int getDependencyTrackPollingInterval() { + if (dependencyTrackPollingInterval <= 0) { + return 10; + } + return dependencyTrackPollingInterval; + } + + private ApiClient getClient(final String baseUrl, final String apiKey) { + return clientFactory.create(baseUrl, apiKey, new ConsoleLogger(), Math.max(dependencyTrackConnectionTimeout, 0), Math.max(dependencyTrackReadTimeout, 0)); + } + + private String lookupApiKey(final String credentialId, final Item item) { + return CredentialsProvider.lookupCredentials(StringCredentials.class, item, ACL.SYSTEM, Collections.emptyList()).stream() + .filter(c -> c.getId().equals(credentialId)) + .map(StringCredentials::getSecret) + .map(Secret::getPlainText) + .findFirst().orElse(StringUtils.EMPTY); + } +} +``` + +## `src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java` (changed lines (165, 166, 167, 168, 169)) + +```java +/* + * Copyright 2020 OWASP. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jenkinsci.plugins.DependencyTrack; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.CredentialsScope; +import com.cloudbees.plugins.credentials.domains.Domain; +import hudson.model.Descriptor; +import hudson.util.FormValidation; +import hudson.util.ListBoxModel; +import hudson.util.Secret; +import io.jenkins.plugins.casc.misc.JenkinsConfiguredRule; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import net.sf.json.JSONObject; +import org.jenkinsci.plugins.DependencyTrack.model.Project; +import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.kohsuke.stapler.StaplerRequest; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +/** + * + * @author Ronny "Sephiroth" Perinke + */ +public class DescriptorImplTest { + + @Rule + public JenkinsConfiguredRule r = new JenkinsConfiguredRule(); + + @Rule + public MockitoRule rule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + + @Mock + private ApiClient client; + private DescriptorImpl uut; + + @Before + public void setup() { + uut = new DescriptorImpl((url, apiKey, logger, connTimeout, readTimeout) -> client); + } + + @Test + public void doFillProjectIdItemsTest() throws ApiClientException { + List projects = new ArrayList<>(); + projects.add(Project.builder().name("Project 2").uuid("uuid-2").version("1.2.3").build()); + projects.add(Project.builder().name("Project 1").uuid("uuid-1").build()); + doReturn(projects).doThrow(new ApiClientException("test failure")) + .when(client).getProjects(); + + assertThat(uut.doFillProjectIdItems(null, null, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option("-- Select Project --", null, false), + new ListBoxModel.Option("Project 1", "uuid-1", false), + new ListBoxModel.Option("Project 2 1.2.3", "uuid-2", false) + ); + + assertThat(uut.doFillProjectIdItems(null, null, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option(Messages.Builder_Error_Projects("test failure"), null, false) + ); + } + + @Test + public void doFillDependencyTrackApiKeyItems() throws IOException { + final String apikey = "api-key"; + final String credentialsid = "credentials-id"; + CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsid, "test", Secret.fromString(apikey))); + assertThat(uut.doFillDependencyTrackApiKeyItems(null, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option("- none -", "", false), + new ListBoxModel.Option("test", credentialsid, false) + ); + assertThat(uut.doFillDependencyTrackApiKeyItems(credentialsid, null)).usingElementComparatorOnFields("name", "value", "selected").containsExactly( + new ListBoxModel.Option("- none -", "", false), + new ListBoxModel.Option("test", credentialsid, false) + ); + } + + @Test + public void doTestConnectionTest() throws ApiClientException, IOException { + final String apikey = "api-key"; + final String credentialsid = "credentials-id"; + // custom factory here so we can check that doTestConnection strips trailing slashes from the url + ApiClientFactory factory = (url, apiKey, logger, connTimeout, readTimeout) -> { + assertThat(url).isEqualTo("http:///url.tld"); + assertThat(apiKey).isEqualTo(apikey); + assertThat(logger).isInstanceOf(ConsoleLogger.class); + return client; + }; + when(client.testConnection()).thenReturn("Dependency-Track v3.8.0").thenReturn("test").thenThrow(ApiClientException.class); + CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsid, "test", Secret.fromString(apikey))); + uut = new DescriptorImpl(factory); + + assertThat(uut.doTestConnection("http:///url.tld", credentialsid, null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.OK) + .hasMessage("Connection successful - Dependency-Track v3.8.0") + .hasNoCause(); + + assertThat(uut.doTestConnection("http:///url.tld/", credentialsid, null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessageStartingWith("Connection failed - test") + .hasNoCause(); + + assertThat(uut.doTestConnection("http:///url.tld/", credentialsid, null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessageStartingWith("Connection failed") + .hasMessageContaining(ApiClientException.class.getCanonicalName()) + .hasNoCause(); + + assertThat(uut.doTestConnection("url", "", null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.WARNING) + .hasMessage("URL must be valid and Api-Key must not be empty") + .hasNoCause(); + } + + @Test + public void doTestConnectionTestWithEmptyArgs() throws ApiClientException, IOException { + final String apikey = "api-key"; + final String credentialsid = "credentials-id"; + // custom factory here so we can check that doTestConnection strips trailing slashes from the url + ApiClientFactory factory = (url, apiKey, logger, connTimeout, readTimeout) -> { + assertThat(url).isEqualTo("http:///url.tld"); + assertThat(apiKey).isEqualTo(apikey); + assertThat(logger).isInstanceOf(ConsoleLogger.class); + return client; + }; + when(client.testConnection()).thenReturn("Dependency-Track v3.8.0").thenReturn("test").thenThrow(ApiClientException.class); + CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsid, "test", Secret.fromString(apikey))); + uut = new DescriptorImpl(factory); + uut.setDependencyTrackApiKey(credentialsid); + uut.setDependencyTrackUrl("http:///url.tld/"); + + assertThat(uut.doTestConnection("", "", null)) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.OK) + .hasMessage("Connection successful - Dependency-Track v3.8.0") + .hasNoCause(); + } + + @Test + public void doCheckDependencyTrackUrlTest() { + assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar/")).isEqualTo(FormValidation.ok()); + assertThat(uut.doCheckDependencyTrackUrl("http://foo.bar")).isEqualTo(FormValidation.ok()); + assertThat(uut.doCheckDependencyTrackUrl("")).isEqualTo(FormValidation.ok()); + assertThat(uut.doCheckDependencyTrackUrl("foo")) + .hasFieldOrPropertyWithValue("kind", FormValidation.Kind.ERROR) + .hasMessage("The specified value is not a valid URL"); + } + + @Test + public void getDependencyTrackUrlTest() { + uut.setDependencyTrackUrl("http://foo.bar/"); + assertThat(uut.getDependencyTrackUrl()).isEqualTo("http://foo.bar"); + + uut.setDependencyTrackUrl("http://foo.bar"); + assertThat(uut.getDependencyTrackUrl()).isEqualTo("http://foo.bar"); + } + + @Test + public void getDependencyTrackPollingTimeoutTest() { + assertThat(uut.getDependencyTrackPollingTimeout()).isEqualTo(5); + + uut.setDependencyTrackPollingTimeout(0); + assertThat(uut.getDependencyTrackPollingTimeout()).isEqualTo(5); + + uut.setDependencyTrackPollingTimeout(Integer.MAX_VALUE); + assertThat(uut.getDependencyTrackPollingTimeout()).isEqualTo(Integer.MAX_VALUE); + } + + @Test + public void configureTest() throws Descriptor.FormException { + StaplerRequest req = mock(StaplerRequest.class); + JSONObject formData = new JSONObject() + .element("dependencyTrackUrl", "https://foo.bar/") + .element("dependencyTrackApiKey", "api-key") + .element("dependencyTrackAutoCreateProjects", true) + .element("dependencyTrackPollingTimeout", 7); + + assertThat(uut.configure(req, formData)).isTrue(); + + verify(req).bindJSON(eq(uut), eq(formData)); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/task.json new file mode 100644 index 0000000000000000000000000000000000000000..29826b76482dad38ca0a986661b71edf531568b0 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-05d6240fd5a9017a44ec", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-05d6240fd5a9017a44ec", + "project_id": "morefixes__jenkinsci__dependency-track-plugin", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java", + "src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java" + ], + "patch_units": { + "before": [ + "src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java", + "src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java" + ], + "after": [ + "src/main/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImpl.java", + "src/test/java/org/jenkinsci/plugins/DependencyTrack/DescriptorImplTest.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/887b51eb6ab229dc31496af9aa4657f503ff35a8627158e9381ebbdf80620bc5/database", + "cache_key": "887b51eb6ab229dc31496af9aa4657f503ff35a8627158e9381ebbdf80620bc5", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/b4369a5f486d894569973b82f473ccd2a6e0ab955383f95a9f062f8602f0fdcd/database", + "cache_key": "b4369a5f486d894569973b82f473ccd2a6e0ab955383f95a9f062f8602f0fdcd", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/5667afc3dae2ecfa5fb5993689de7477dde985adc049c7fd4fcae5c81a1e12a7/database", + "cache_key": "5667afc3dae2ecfa5fb5993689de7477dde985adc049c7fd4fcae5c81a1e12a7", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-05d6240fd5a9017a44ec/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-05d6240fd5a9017a44ec/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-05d6240fd5a9017a44ec/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..e73699b31742d18c90ad9d14b46d4d8f460dfcfe --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/patch.diff @@ -0,0 +1,37 @@ +diff --git a/src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java b/src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java +index 2cd4697..4b35d2e 100644 +--- a/src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java ++++ b/src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java +@@ -64,7 +64,7 @@ public class EnvironmentManagerBuilder extends Builder { + private String repoHost; + private int repoPort; + private String repoUsername; +- private String repoPassword; ++ private Secret repoPassword; + private boolean abortOnFailure; + + @DataBoundConstructor +@@ -101,7 +101,7 @@ public class EnvironmentManagerBuilder extends Builder { + this.repoHost = repoHost; + this.repoPort = repoPort; + this.repoUsername = repoUsername; +- this.repoPassword = repoPassword; ++ this.repoPassword = Secret.fromString(repoPassword); + this.abortOnFailure = abortOnFailure; + } + +@@ -168,7 +168,13 @@ public class EnvironmentManagerBuilder extends Builder { + } + + public String getRepoPassword() { +- return repoPassword == null ? "admin" : repoPassword; ++ if (repoPassword != null) { ++ String plainText = repoPassword.getPlainText(); ++ if (!plainText.isEmpty()) { ++ return plainText; ++ } ++ } ++ return "admin"; + } + + public boolean isAbortOnFailure() { diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..6cc21d4f6d10918ca707e5dbe745341a9a67a2da --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/post_context.md @@ -0,0 +1,523 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java` (changed lines (67, 104, 171, 172, 173, 174, 175, 176, 177)) + +```java +/* + * Copyright 2016 Parasoft Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.parasoft.environmentmanager.jenkins; + +import java.io.IOException; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.StaplerRequest; + +import com.parasoft.em.client.api.EnvironmentCopy; +import com.parasoft.em.client.api.Environments; +import com.parasoft.em.client.api.EventMonitor; +import com.parasoft.em.client.api.Provisions; +import com.parasoft.em.client.api.Servers; +import com.parasoft.em.client.api.Systems; +import com.parasoft.em.client.impl.EnvironmentCopyImpl; +import com.parasoft.em.client.impl.EnvironmentsImpl; +import com.parasoft.em.client.impl.ProvisionsImpl; +import com.parasoft.em.client.impl.ServersImpl; +import com.parasoft.em.client.impl.SystemsImpl; +import com.parasoft.environmentmanager.jenkins.EnvironmentManagerPlugin.EnvironmentManagerPluginDescriptor; + +import hudson.EnvVars; +import hudson.Extension; +import hudson.Launcher; +import hudson.model.AbstractBuild; +import hudson.model.AbstractProject; +import hudson.model.BuildListener; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import hudson.util.Secret; +import hudson.util.ListBoxModel; + +public class EnvironmentManagerBuilder extends Builder { + private int systemId; + private int environmentId; + private int instanceId; + private boolean copyToServer; + private String newEnvironmentName; + private String serverType; + private int serverId; + private String serverHost; + private String serverName; + private boolean copyDataRepo; + private String repoType; + private String repoHost; + private int repoPort; + private String repoUsername; + private Secret repoPassword; + private boolean abortOnFailure; + + @DataBoundConstructor + public EnvironmentManagerBuilder( + int systemId, + int environmentId, + int instanceId, + boolean copyToServer, + String newEnvironmentName, + String serverType, + int serverId, + String serverHost, + String serverName, + boolean copyDataRepo, + String repoType, + String repoHost, + int repoPort, + String repoUsername, + String repoPassword, + boolean abortOnFailure) + { + super(); + this.systemId = systemId; + this.environmentId = environmentId; + this.instanceId = instanceId; + this.copyToServer = copyToServer; + this.newEnvironmentName = newEnvironmentName; + this.serverType = serverType; + this.serverId = serverId; + this.serverHost = serverHost; + this.serverName = serverName; + this.copyDataRepo = copyDataRepo; + this.repoType = repoType; + this.repoHost = repoHost; + this.repoPort = repoPort; + this.repoUsername = repoUsername; + this.repoPassword = Secret.fromString(repoPassword); + this.abortOnFailure = abortOnFailure; + } + + public int getSystemId() { + return systemId; + } + + public int getEnvironmentId() { + return environmentId; + } + + public int getInstanceId() { + return instanceId; + } + + public boolean isCopyToServer() { + return copyToServer; + } + + public String getNewEnvironmentName() { + return newEnvironmentName; + } + + public boolean isServerType(String type) { + if ((serverType == null) || serverType.isEmpty()) { + return "registered".equals(type); + } + return serverType.equals(type); + } + + public int getServerId() { + return serverId; + } + + public String getServerHost() { + return serverHost; + } + + public String getServerName() { + return serverName; + } + + public boolean isCopyDataRepo() { + return copyDataRepo; + } + + public boolean isRepoType(String type) { + if ((repoType == null) || repoType.isEmpty()) { + return "current".equals(type); + } + return repoType.equals(type); + } + + public String getRepoHost() { + return repoHost; + } + + public int getRepoPort() { + return repoPort == 0 ? 2424 : repoPort; + } + + public String getRepoUsername() { + return repoUsername == null ? "admin" : repoUsername; + } + + public String getRepoPassword() { + if (repoPassword != null) { + String plainText = repoPassword.getPlainText(); + if (!plainText.isEmpty()) { + return plainText; + } + } + return "admin"; + } + + public boolean isAbortOnFailure() { + return abortOnFailure; + } + + @Override + public boolean perform(final AbstractBuild build, Launcher launcher, + final BuildListener listener) throws InterruptedException, IOException + { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + EnvVars envVars = build.getEnvironment(listener); + int targetEnvironmentId = environmentId; + int targetInstanceId = instanceId; + Environments environments = new EnvironmentsImpl(emUrl, username, password.getPlainText()); + JSONObject instance = environments.getEnvironmentInstance(environmentId, instanceId); + if (copyToServer) { + JSONObject targetServer = null; + int targetServerId = 0; + String targetServerName = envVars.expand(serverName); + String targetServerHost = envVars.expand(serverHost); + boolean waitingNotFoundMessageShown = false; + boolean waitingOfflineMessageShown = false; + String status = null; + while (targetServerId == 0) { + if (isServerType("registered")) { + targetServerId = serverId; + } + Servers servers = new ServersImpl(emUrl, username, password.getPlainText()); + JSONObject response = servers.getServers(); + if (response.has("servers")) { + JSONArray envArray = response.getJSONArray("servers"); + for (Object o : envArray) { + JSONObject server = (JSONObject) o; + if (isServerType("registered")) { + int id = server.getInt("id"); + if (id == serverId) { + targetServer = server; + status = server.optString("status"); + } + } else if (isServerType("name")) { + String name = server.getString("name"); + if (name.indexOf(targetServerName) >= 0) { + targetServerId = server.getInt("id"); + targetServer = server; + status = server.optString("status"); + } + if (name.equalsIgnoreCase(targetServerName)) { + break; + } + } else if (isServerType("host")) { + String host = server.getString("host"); + if (host.indexOf(targetServerHost) >= 0) { + targetServerId = server.getInt("id"); + targetServer = server; + status = server.optString("status"); + } + if (host.equalsIgnoreCase(targetServerHost)) { + break; + } + } + } + } + if ((targetServerId == 0) && !waitingNotFoundMessageShown) { + String errorMessage = "WARNING: Could not find any Virtualize servers matching "; + if (isServerType("name")) { + errorMessage += "name: " + targetServerName; + } else if (isServerType("host")) { + errorMessage += "host: " + targetServerHost; + } + listener.getLogger().println(errorMessage); + listener.getLogger().println("Waiting for a matching Virtualize server to register with the Continuous Testing Platform..."); + waitingNotFoundMessageShown = true; + } + if ("OFFLINE".equals(status) || "REFRESHING".equals(status)) { + targetServerId = 0; + if (!waitingOfflineMessageShown) { + listener.getLogger().println("Waiting for Virtualize server to come online..."); + waitingOfflineMessageShown = true; + } + } + Thread.sleep(10000); // try again in 10 seconds + } + EnvironmentCopy environmentCopy = new EnvironmentCopyImpl(emUrl, username, password.getPlainText()); + JSONObject dataRepoSettings = null; + if (isRepoType("target")) { + dataRepoSettings = new JSONObject(); + dataRepoSettings.put("host", targetServer.getString("host")); + } else if (isRepoType("custom")) { + dataRepoSettings = new JSONObject(); + dataRepoSettings.put("host", getRepoHost()); + } + if (dataRepoSettings != null) { + dataRepoSettings.put("port", getRepoPort()); + dataRepoSettings.put("username", getRepoUsername()); + dataRepoSettings.put("password", getRepoPassword()); + } + JSONObject copyEvent = environmentCopy.createEnvironmentCopy(environmentId, targetServerId, envVars.expand(newEnvironmentName), copyDataRepo, dataRepoSettings); + boolean copyResult = environmentCopy.monitorEvent(copyEvent, new EventMonitor() { + public void logMessage(String message) { + listener.getLogger().println(message); + } + }); + JSONObject copyStatus = environmentCopy.removeCopyStatus(copyEvent.getInt("id")); + if (!copyResult) { + return false; + } + targetEnvironmentId = copyStatus.getInt("environmentId"); + targetInstanceId = 0; + String instanceName = instance.getString("name"); + JSONObject copiedInstances = environments.getEnvironmentInstances(targetEnvironmentId); + if (copiedInstances.has("instances")) { + JSONArray instArray = copiedInstances.getJSONArray("instances"); + for (int i = 0; i < instArray.size(); i++) { + JSONObject inst = instArray.getJSONObject(i); + if (instanceName.equals(inst.getString("name"))) { + targetInstanceId = inst.getInt("id"); + break; + } + } + } + if (targetInstanceId == 0) { + listener.getLogger().println("Unable to find environment instance named \"" + instanceName + "\" in the copied environment."); + return false; + } + } + listener.getLogger().println("Executing provisioning action on " + emUrl); + Provisions provisions = new ProvisionsImpl(emUrl, username, password.getPlainText()); + JSONObject event = provisions.createProvisionEvent(targetEnvironmentId, targetInstanceId, abortOnFailure); + boolean result = provisions.monitorEvent(event, new EventMonitor() { + public void logMessage(String message) { + listener.getLogger().println(message); + } + }); + String baseUrl = emUrl; + if (!baseUrl.endsWith("/")) { + baseUrl += "/"; + } + + JSONObject eventResult = provisions.getProvisions(event.getInt("eventId")); + JSONArray steps = eventResult.getJSONArray("steps"); + int failed = 0; + for (int i = 0; i < steps.size(); i++) { + JSONObject step = steps.getJSONObject(i); + if ("error".equals(step.getString("result"))) { + failed++; + } + } + + String environmentUrl = baseUrl + "environments/" + targetEnvironmentId; + build.addAction(new ProvisioningEventAction(build, instance.getString("name"), environmentUrl, steps.size(), failed)); + return result; + } + + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl)super.getDescriptor(); + } + + @Extension + public static final class DescriptorImpl extends BuildStepDescriptor { + + public DescriptorImpl() { + load(); + } + + @Override + public boolean isApplicable(Class jobType) { + return true; + } + + @Override + public String getDisplayName() { + return "Deploy an environment"; + } + + @Override + public boolean configure(StaplerRequest req, JSONObject json) throws FormException { + req.bindJSON(this, json); + save(); + return super.configure(req, json); + } + + public ListBoxModel doFillSystemIdItems() { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (emUrl != null) { + Systems systems = new SystemsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = systems.getSystems(); + if (envs.has("systems")) { + JSONArray sysArray = envs.getJSONArray("systems"); + for (Object o : sysArray) { + JSONObject system = (JSONObject) o; + String name = system.getString("name"); + if (system.has("version")) { + name += " (" + system.getString("version") + ")"; + } + m.add(name, system.getString("id")); + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return m; + } + + public ListBoxModel doFillEnvironmentIdItems(@QueryParameter int systemId) { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (emUrl != null) { + if (systemId == 0) { + Systems systems = new SystemsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = systems.getSystems(); + if (envs.has("systems")) { + JSONArray sysArray = envs.getJSONArray("systems"); + if (sysArray.size() > 0) { + JSONObject system = sysArray.getJSONObject(0); + systemId = system.getInt("id"); + } + } + } + Environments environments = new EnvironmentsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = environments.getEnvironments(); + if (envs.has("environments")) { + JSONArray envArray = envs.getJSONArray("environments"); + for (Object o : envArray) { + JSONObject env = (JSONObject) o; + if (env.getInt("systemId") == systemId) { + String name = env.getString("name"); + if (env.has("version")) { + name += " (" + env.getString("version") + ")"; + } + m.add(name, env.getString("id")); + } + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return m; + } + + public ListBoxModel doFillInstanceIdItems(@QueryParameter int systemId, @QueryParameter int environmentId) { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (systemId == 0) { + Systems systems = new SystemsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = systems.getSystems(); + if (envs.has("systems")) { + JSONArray sysArray = envs.getJSONArray("systems"); + if (sysArray.size() > 0) { + JSONObject system = sysArray.getJSONObject(0); + systemId = system.getInt("id"); + } + } + } + Environments environments = new EnvironmentsImpl(emUrl, username, password.getPlainText()); + if (environmentId == 0) { + JSONObject envs = environments.getEnvironments(); + if (envs.has("environments")) { + JSONArray envArray = envs.getJSONArray("environments"); + for (Object o : envArray) { + JSONObject env = (JSONObject) o; + if (env.getInt("systemId") == systemId) { + environmentId = env.getInt("id"); + break; + } + } + } + } else { + JSONObject env = environments.getEnvironment(environmentId); + if (env.getInt("systemId") != systemId) { + return m; + } + } + JSONObject instances = environments.getEnvironmentInstances(environmentId); + if (instances.has("instances")) { + JSONArray instArray = instances.getJSONArray("instances"); + for (Object o : instArray) { + JSONObject inst = (JSONObject) o; + m.add(inst.getString("name"), inst.getString("id")); + } + } + } catch (IOException e) { + } + return m; + } + + public ListBoxModel doFillServerIdItems() { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (emUrl != null) { + Servers servers = new ServersImpl(emUrl, username, password.getPlainText()); + JSONObject response = servers.getServers(); + if (response.has("servers")) { + JSONArray envArray = response.getJSONArray("servers"); + for (Object o : envArray) { + JSONObject server = (JSONObject) o; + String name = server.getString("name"); + String host = server.getString("host"); + if (!name.equals(host)) { + name += " (" + host + ':' + server.getInt("port") + ')'; + } + m.add(name, server.getString("id")); + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return m; + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..04e30c2759f2ddf02b81c830d4c9c7093f314ec9 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/pre_context.md @@ -0,0 +1,517 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java` (changed lines (67, 68, 104, 105, 171, 172)) + +```java +/* + * Copyright 2016 Parasoft Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.parasoft.environmentmanager.jenkins; + +import java.io.IOException; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.StaplerRequest; + +import com.parasoft.em.client.api.EnvironmentCopy; +import com.parasoft.em.client.api.Environments; +import com.parasoft.em.client.api.EventMonitor; +import com.parasoft.em.client.api.Provisions; +import com.parasoft.em.client.api.Servers; +import com.parasoft.em.client.api.Systems; +import com.parasoft.em.client.impl.EnvironmentCopyImpl; +import com.parasoft.em.client.impl.EnvironmentsImpl; +import com.parasoft.em.client.impl.ProvisionsImpl; +import com.parasoft.em.client.impl.ServersImpl; +import com.parasoft.em.client.impl.SystemsImpl; +import com.parasoft.environmentmanager.jenkins.EnvironmentManagerPlugin.EnvironmentManagerPluginDescriptor; + +import hudson.EnvVars; +import hudson.Extension; +import hudson.Launcher; +import hudson.model.AbstractBuild; +import hudson.model.AbstractProject; +import hudson.model.BuildListener; +import hudson.tasks.BuildStepDescriptor; +import hudson.tasks.Builder; +import hudson.util.Secret; +import hudson.util.ListBoxModel; + +public class EnvironmentManagerBuilder extends Builder { + private int systemId; + private int environmentId; + private int instanceId; + private boolean copyToServer; + private String newEnvironmentName; + private String serverType; + private int serverId; + private String serverHost; + private String serverName; + private boolean copyDataRepo; + private String repoType; + private String repoHost; + private int repoPort; + private String repoUsername; + private String repoPassword; + private boolean abortOnFailure; + + @DataBoundConstructor + public EnvironmentManagerBuilder( + int systemId, + int environmentId, + int instanceId, + boolean copyToServer, + String newEnvironmentName, + String serverType, + int serverId, + String serverHost, + String serverName, + boolean copyDataRepo, + String repoType, + String repoHost, + int repoPort, + String repoUsername, + String repoPassword, + boolean abortOnFailure) + { + super(); + this.systemId = systemId; + this.environmentId = environmentId; + this.instanceId = instanceId; + this.copyToServer = copyToServer; + this.newEnvironmentName = newEnvironmentName; + this.serverType = serverType; + this.serverId = serverId; + this.serverHost = serverHost; + this.serverName = serverName; + this.copyDataRepo = copyDataRepo; + this.repoType = repoType; + this.repoHost = repoHost; + this.repoPort = repoPort; + this.repoUsername = repoUsername; + this.repoPassword = repoPassword; + this.abortOnFailure = abortOnFailure; + } + + public int getSystemId() { + return systemId; + } + + public int getEnvironmentId() { + return environmentId; + } + + public int getInstanceId() { + return instanceId; + } + + public boolean isCopyToServer() { + return copyToServer; + } + + public String getNewEnvironmentName() { + return newEnvironmentName; + } + + public boolean isServerType(String type) { + if ((serverType == null) || serverType.isEmpty()) { + return "registered".equals(type); + } + return serverType.equals(type); + } + + public int getServerId() { + return serverId; + } + + public String getServerHost() { + return serverHost; + } + + public String getServerName() { + return serverName; + } + + public boolean isCopyDataRepo() { + return copyDataRepo; + } + + public boolean isRepoType(String type) { + if ((repoType == null) || repoType.isEmpty()) { + return "current".equals(type); + } + return repoType.equals(type); + } + + public String getRepoHost() { + return repoHost; + } + + public int getRepoPort() { + return repoPort == 0 ? 2424 : repoPort; + } + + public String getRepoUsername() { + return repoUsername == null ? "admin" : repoUsername; + } + + public String getRepoPassword() { + return repoPassword == null ? "admin" : repoPassword; + } + + public boolean isAbortOnFailure() { + return abortOnFailure; + } + + @Override + public boolean perform(final AbstractBuild build, Launcher launcher, + final BuildListener listener) throws InterruptedException, IOException + { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + EnvVars envVars = build.getEnvironment(listener); + int targetEnvironmentId = environmentId; + int targetInstanceId = instanceId; + Environments environments = new EnvironmentsImpl(emUrl, username, password.getPlainText()); + JSONObject instance = environments.getEnvironmentInstance(environmentId, instanceId); + if (copyToServer) { + JSONObject targetServer = null; + int targetServerId = 0; + String targetServerName = envVars.expand(serverName); + String targetServerHost = envVars.expand(serverHost); + boolean waitingNotFoundMessageShown = false; + boolean waitingOfflineMessageShown = false; + String status = null; + while (targetServerId == 0) { + if (isServerType("registered")) { + targetServerId = serverId; + } + Servers servers = new ServersImpl(emUrl, username, password.getPlainText()); + JSONObject response = servers.getServers(); + if (response.has("servers")) { + JSONArray envArray = response.getJSONArray("servers"); + for (Object o : envArray) { + JSONObject server = (JSONObject) o; + if (isServerType("registered")) { + int id = server.getInt("id"); + if (id == serverId) { + targetServer = server; + status = server.optString("status"); + } + } else if (isServerType("name")) { + String name = server.getString("name"); + if (name.indexOf(targetServerName) >= 0) { + targetServerId = server.getInt("id"); + targetServer = server; + status = server.optString("status"); + } + if (name.equalsIgnoreCase(targetServerName)) { + break; + } + } else if (isServerType("host")) { + String host = server.getString("host"); + if (host.indexOf(targetServerHost) >= 0) { + targetServerId = server.getInt("id"); + targetServer = server; + status = server.optString("status"); + } + if (host.equalsIgnoreCase(targetServerHost)) { + break; + } + } + } + } + if ((targetServerId == 0) && !waitingNotFoundMessageShown) { + String errorMessage = "WARNING: Could not find any Virtualize servers matching "; + if (isServerType("name")) { + errorMessage += "name: " + targetServerName; + } else if (isServerType("host")) { + errorMessage += "host: " + targetServerHost; + } + listener.getLogger().println(errorMessage); + listener.getLogger().println("Waiting for a matching Virtualize server to register with the Continuous Testing Platform..."); + waitingNotFoundMessageShown = true; + } + if ("OFFLINE".equals(status) || "REFRESHING".equals(status)) { + targetServerId = 0; + if (!waitingOfflineMessageShown) { + listener.getLogger().println("Waiting for Virtualize server to come online..."); + waitingOfflineMessageShown = true; + } + } + Thread.sleep(10000); // try again in 10 seconds + } + EnvironmentCopy environmentCopy = new EnvironmentCopyImpl(emUrl, username, password.getPlainText()); + JSONObject dataRepoSettings = null; + if (isRepoType("target")) { + dataRepoSettings = new JSONObject(); + dataRepoSettings.put("host", targetServer.getString("host")); + } else if (isRepoType("custom")) { + dataRepoSettings = new JSONObject(); + dataRepoSettings.put("host", getRepoHost()); + } + if (dataRepoSettings != null) { + dataRepoSettings.put("port", getRepoPort()); + dataRepoSettings.put("username", getRepoUsername()); + dataRepoSettings.put("password", getRepoPassword()); + } + JSONObject copyEvent = environmentCopy.createEnvironmentCopy(environmentId, targetServerId, envVars.expand(newEnvironmentName), copyDataRepo, dataRepoSettings); + boolean copyResult = environmentCopy.monitorEvent(copyEvent, new EventMonitor() { + public void logMessage(String message) { + listener.getLogger().println(message); + } + }); + JSONObject copyStatus = environmentCopy.removeCopyStatus(copyEvent.getInt("id")); + if (!copyResult) { + return false; + } + targetEnvironmentId = copyStatus.getInt("environmentId"); + targetInstanceId = 0; + String instanceName = instance.getString("name"); + JSONObject copiedInstances = environments.getEnvironmentInstances(targetEnvironmentId); + if (copiedInstances.has("instances")) { + JSONArray instArray = copiedInstances.getJSONArray("instances"); + for (int i = 0; i < instArray.size(); i++) { + JSONObject inst = instArray.getJSONObject(i); + if (instanceName.equals(inst.getString("name"))) { + targetInstanceId = inst.getInt("id"); + break; + } + } + } + if (targetInstanceId == 0) { + listener.getLogger().println("Unable to find environment instance named \"" + instanceName + "\" in the copied environment."); + return false; + } + } + listener.getLogger().println("Executing provisioning action on " + emUrl); + Provisions provisions = new ProvisionsImpl(emUrl, username, password.getPlainText()); + JSONObject event = provisions.createProvisionEvent(targetEnvironmentId, targetInstanceId, abortOnFailure); + boolean result = provisions.monitorEvent(event, new EventMonitor() { + public void logMessage(String message) { + listener.getLogger().println(message); + } + }); + String baseUrl = emUrl; + if (!baseUrl.endsWith("/")) { + baseUrl += "/"; + } + + JSONObject eventResult = provisions.getProvisions(event.getInt("eventId")); + JSONArray steps = eventResult.getJSONArray("steps"); + int failed = 0; + for (int i = 0; i < steps.size(); i++) { + JSONObject step = steps.getJSONObject(i); + if ("error".equals(step.getString("result"))) { + failed++; + } + } + + String environmentUrl = baseUrl + "environments/" + targetEnvironmentId; + build.addAction(new ProvisioningEventAction(build, instance.getString("name"), environmentUrl, steps.size(), failed)); + return result; + } + + @Override + public DescriptorImpl getDescriptor() { + return (DescriptorImpl)super.getDescriptor(); + } + + @Extension + public static final class DescriptorImpl extends BuildStepDescriptor { + + public DescriptorImpl() { + load(); + } + + @Override + public boolean isApplicable(Class jobType) { + return true; + } + + @Override + public String getDisplayName() { + return "Deploy an environment"; + } + + @Override + public boolean configure(StaplerRequest req, JSONObject json) throws FormException { + req.bindJSON(this, json); + save(); + return super.configure(req, json); + } + + public ListBoxModel doFillSystemIdItems() { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (emUrl != null) { + Systems systems = new SystemsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = systems.getSystems(); + if (envs.has("systems")) { + JSONArray sysArray = envs.getJSONArray("systems"); + for (Object o : sysArray) { + JSONObject system = (JSONObject) o; + String name = system.getString("name"); + if (system.has("version")) { + name += " (" + system.getString("version") + ")"; + } + m.add(name, system.getString("id")); + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return m; + } + + public ListBoxModel doFillEnvironmentIdItems(@QueryParameter int systemId) { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (emUrl != null) { + if (systemId == 0) { + Systems systems = new SystemsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = systems.getSystems(); + if (envs.has("systems")) { + JSONArray sysArray = envs.getJSONArray("systems"); + if (sysArray.size() > 0) { + JSONObject system = sysArray.getJSONObject(0); + systemId = system.getInt("id"); + } + } + } + Environments environments = new EnvironmentsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = environments.getEnvironments(); + if (envs.has("environments")) { + JSONArray envArray = envs.getJSONArray("environments"); + for (Object o : envArray) { + JSONObject env = (JSONObject) o; + if (env.getInt("systemId") == systemId) { + String name = env.getString("name"); + if (env.has("version")) { + name += " (" + env.getString("version") + ")"; + } + m.add(name, env.getString("id")); + } + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return m; + } + + public ListBoxModel doFillInstanceIdItems(@QueryParameter int systemId, @QueryParameter int environmentId) { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (systemId == 0) { + Systems systems = new SystemsImpl(emUrl, username, password.getPlainText()); + JSONObject envs = systems.getSystems(); + if (envs.has("systems")) { + JSONArray sysArray = envs.getJSONArray("systems"); + if (sysArray.size() > 0) { + JSONObject system = sysArray.getJSONObject(0); + systemId = system.getInt("id"); + } + } + } + Environments environments = new EnvironmentsImpl(emUrl, username, password.getPlainText()); + if (environmentId == 0) { + JSONObject envs = environments.getEnvironments(); + if (envs.has("environments")) { + JSONArray envArray = envs.getJSONArray("environments"); + for (Object o : envArray) { + JSONObject env = (JSONObject) o; + if (env.getInt("systemId") == systemId) { + environmentId = env.getInt("id"); + break; + } + } + } + } else { + JSONObject env = environments.getEnvironment(environmentId); + if (env.getInt("systemId") != systemId) { + return m; + } + } + JSONObject instances = environments.getEnvironmentInstances(environmentId); + if (instances.has("instances")) { + JSONArray instArray = instances.getJSONArray("instances"); + for (Object o : instArray) { + JSONObject inst = (JSONObject) o; + m.add(inst.getString("name"), inst.getString("id")); + } + } + } catch (IOException e) { + } + return m; + } + + public ListBoxModel doFillServerIdItems() { + ListBoxModel m = new ListBoxModel(); + try { + EnvironmentManagerPluginDescriptor pluginDescriptor = + EnvironmentManagerPlugin.getEnvironmentManagerPluginDescriptor(); + String emUrl = pluginDescriptor.getEmUrl(); + String username = pluginDescriptor.getUsername(); + Secret password = pluginDescriptor.getPassword(); + if (emUrl != null) { + Servers servers = new ServersImpl(emUrl, username, password.getPlainText()); + JSONObject response = servers.getServers(); + if (response.has("servers")) { + JSONArray envArray = response.getJSONArray("servers"); + for (Object o : envArray) { + JSONObject server = (JSONObject) o; + String name = server.getString("name"); + String host = server.getString("host"); + if (!name.equals(host)) { + name += " (" + host + ':' + server.getInt("port") + ')'; + } + m.add(name, server.getString("id")); + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return m; + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/task.json new file mode 100644 index 0000000000000000000000000000000000000000..d6a3d2345ab968498f1597bad88ad95657030533 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-0608482232bb0119b561", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-0608482232bb0119b561", + "project_id": "morefixes__jenkinsci__environment-manager-tools-plugin", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java" + ], + "patch_units": { + "before": [ + "src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java" + ], + "after": [ + "src/main/java/com/parasoft/environmentmanager/jenkins/EnvironmentManagerBuilder.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/348add40fc2e9b8843029eb23bd7a5abea5e246c30af3ad46e7a1d06701aaedc/database", + "cache_key": "348add40fc2e9b8843029eb23bd7a5abea5e246c30af3ad46e7a1d06701aaedc", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/a27c3c48414095081ae69c5351234c11980089efad971e778fc8a15d42a9e363/database", + "cache_key": "a27c3c48414095081ae69c5351234c11980089efad971e778fc8a15d42a9e363", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/b56cf28194f7080920fa1c145c47fb8aa6678356c778e985b3637426036749f7/database", + "cache_key": "b56cf28194f7080920fa1c145c47fb8aa6678356c778e985b3637426036749f7", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-0608482232bb0119b561/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-0608482232bb0119b561/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0608482232bb0119b561/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..419e56865610a3e47c42f942d0f6df480c1b5275 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/patch.diff @@ -0,0 +1,24 @@ +diff --git a/src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java b/src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java +index ab82e89..7b7cdda 100644 +--- a/src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java ++++ b/src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java +@@ -14,7 +14,7 @@ import net.sf.json.JSONObject; + import org.jenkinsci.Symbol; + import org.kohsuke.stapler.StaplerRequest; + import org.kohsuke.stapler.StaplerResponse; +-import org.kohsuke.stapler.interceptor.RequirePOST; ++import org.kohsuke.stapler.verb.POST; + + import javax.annotation.CheckForNull; + import javax.servlet.ServletException; +@@ -61,8 +61,9 @@ public class AwsManagementLink extends ManagementLink implements Describable { + + private static Logger LOGGER = Logger.getLogger(AwsManagementLink.class.getName()); + + @CheckForNull + @Override + public String getUrlName() { + return "aws"; + } + + @CheckForNull + @Override + public String getDisplayName() { + return "AWS"; + } + + @Override + public String getIconFileName() { + return "/plugin/aws-global-configuration/images/aws.png"; + } + + @Override + public String getDescription() { + return "Amazon Web Services Configuration"; + } + + @Override + public Category getCategory() { return Category.CONFIGURATION; } + + @Override + public Descriptor getDescriptor() { + return Jenkins.get().getDescriptorOrDie(AwsManagementLink.class); + } + + @POST + public synchronized void doConfigure(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, Descriptor.FormException { + Jenkins.get().checkPermission(Jenkins.ADMINISTER); + // for compatibility reasons, the actual value is stored in Jenkins + BulkChange bc = new BulkChange(Jenkins.get()); + try{ + boolean result = configure(req, req.getSubmittedForm()); + LOGGER.log(Level.FINE, "security saved: "+result); + Jenkins.get().save(); + FormApply.success(req.getContextPath()+"/manage").generateResponse(req, rsp, null); + } finally { + bc.commit(); + } + } + + public boolean configure(StaplerRequest req, JSONObject json) throws Descriptor.FormException { + boolean result = true; + for(Descriptor d : Functions.getSortedDescriptorsForGlobalConfigByDescriptor(descriptor -> + FILTER.apply(descriptor.getCategory()))){ + result &= configureDescriptor(req,json,d); + } + + return result; + } + + private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor d) throws Descriptor.FormException { + // collapse the structure to remain backward compatible with the JSON structure before 1. + String name = d.getJsonSafeClassName(); + JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. + json.putAll(js); + return d.configure(req, js); + } + + public static final Predicate FILTER = new Predicate() { + public boolean apply(GlobalConfigurationCategory input) { + return input instanceof AwsGlobalConfigurationCategory; + } + }; + + @Extension + @Symbol("aws") + public static final class DescriptorImpl extends Descriptor { + @Override + public String getDisplayName() { + return "AWS"; + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..5a84b6a997419cda657c9a694b2ddfbdf0f297d6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/pre_context.md @@ -0,0 +1,116 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java` (changed lines (17, 18, 64, 65, 66)) + +```java +package io.jenkins.plugins.aws.global_configuration; + +import com.google.common.base.Predicate; +import hudson.BulkChange; +import hudson.Extension; +import hudson.Functions; +import hudson.model.Describable; +import hudson.model.Descriptor; +import hudson.model.ManagementLink; +import hudson.util.FormApply; +import jenkins.model.GlobalConfigurationCategory; +import jenkins.model.Jenkins; +import net.sf.json.JSONObject; +import org.jenkinsci.Symbol; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.interceptor.RequirePOST; + +import javax.annotation.CheckForNull; +import javax.servlet.ServletException; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * @author Oleg Nenashev + * @since TODO + */ +@Extension @Symbol("aws") +public class AwsManagementLink extends ManagementLink implements Describable { + + private static Logger LOGGER = Logger.getLogger(AwsManagementLink.class.getName()); + + @CheckForNull + @Override + public String getUrlName() { + return "aws"; + } + + @CheckForNull + @Override + public String getDisplayName() { + return "AWS"; + } + + @Override + public String getIconFileName() { + return "/plugin/aws-global-configuration/images/aws.png"; + } + + @Override + public String getDescription() { + return "Amazon Web Services Configuration"; + } + + @Override + public Category getCategory() { return Category.CONFIGURATION; } + + @Override + public Descriptor getDescriptor() { + return Jenkins.get().getDescriptorOrDie(AwsManagementLink.class); + } + + @RequirePOST + public synchronized void doConfigure(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, Descriptor.FormException { + // for compatibility reasons, the actual value is stored in Jenkins + BulkChange bc = new BulkChange(Jenkins.get()); + try{ + boolean result = configure(req, req.getSubmittedForm()); + LOGGER.log(Level.FINE, "security saved: "+result); + Jenkins.get().save(); + FormApply.success(req.getContextPath()+"/manage").generateResponse(req, rsp, null); + } finally { + bc.commit(); + } + } + + public boolean configure(StaplerRequest req, JSONObject json) throws Descriptor.FormException { + boolean result = true; + for(Descriptor d : Functions.getSortedDescriptorsForGlobalConfigByDescriptor(descriptor -> + FILTER.apply(descriptor.getCategory()))){ + result &= configureDescriptor(req,json,d); + } + + return result; + } + + private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor d) throws Descriptor.FormException { + // collapse the structure to remain backward compatible with the JSON structure before 1. + String name = d.getJsonSafeClassName(); + JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. + json.putAll(js); + return d.configure(req, js); + } + + public static final Predicate FILTER = new Predicate() { + public boolean apply(GlobalConfigurationCategory input) { + return input instanceof AwsGlobalConfigurationCategory; + } + }; + + @Extension + @Symbol("aws") + public static final class DescriptorImpl extends Descriptor { + @Override + public String getDisplayName() { + return "AWS"; + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/task.json new file mode 100644 index 0000000000000000000000000000000000000000..7fe3f88fa1cc3c4cf5041984ab71828b97e2397e --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-0709c903a0f96b124bd5", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-0709c903a0f96b124bd5", + "project_id": "morefixes__jenkinsci__aws-global-configuration-plugin", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java" + ], + "patch_units": { + "before": [ + "src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java" + ], + "after": [ + "src/main/java/io/jenkins/plugins/aws/global_configuration/AwsManagementLink.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/ee6858f550c3d94650eccb7a94b6628712b52ff697dda95fd126d8e6397b7fa9/database", + "cache_key": "ee6858f550c3d94650eccb7a94b6628712b52ff697dda95fd126d8e6397b7fa9", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/930abb255976d81cccf564dbcbf1575b272bfa2c3ff06af46a7c96989fe1f6c4/database", + "cache_key": "930abb255976d81cccf564dbcbf1575b272bfa2c3ff06af46a7c96989fe1f6c4", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/acf96be652bf85e66e459fae9a2722be3ce7e314be14a8ef03eb7a1f42ec2ed8/database", + "cache_key": "acf96be652bf85e66e459fae9a2722be3ce7e314be14a8ef03eb7a1f42ec2ed8", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-0709c903a0f96b124bd5/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-0709c903a0f96b124bd5/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-0709c903a0f96b124bd5/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..037bb4babc1d6a6348cabb310ea44264a1aab5e8 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/patch.diff @@ -0,0 +1,35 @@ +diff --git a/src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java b/src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java +index af32394..807d5c0 100644 +--- a/src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java ++++ b/src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java +@@ -104,6 +104,8 @@ class EJBSimpleTransactionControl implements SimpleTransactionControl { + throw new SystemException(); + } catch (IOException e) { + throw new SystemException(); ++ } finally { ++ invocationTracker.remove(invocation); + } + } + +diff --git a/src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java b/src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java +index d41c124..cb110f5 100644 +--- a/src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java ++++ b/src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java +@@ -125,6 +125,8 @@ class EJBTransactionOperations implements RemotingOperations { + throw new XAException(XAException.XAER_RMERR); + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); ++ } finally { ++ invocationTracker.remove(invocation); + } + } + +@@ -204,6 +206,8 @@ class EJBTransactionOperations implements RemotingOperations { + throw new XAException(XAException.XAER_RMERR); + } catch (IOException | ClassNotFoundException e) { + throw new XAException(XAException.XAER_RMERR); ++ } finally { ++ invocationTracker.remove(invocation); + } + } + diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..76e5c0acc66a1bba344019f5ff8a97eefcf27785 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/post_context.md @@ -0,0 +1,377 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java` (changed lines (107, 108)) + +```java +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017 Red Hat, Inc., and individual contributors + * as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jboss.ejb.protocol.remote; + +import java.io.IOException; + +import javax.transaction.HeuristicMixedException; +import javax.transaction.HeuristicRollbackException; +import javax.transaction.RollbackException; +import javax.transaction.SystemException; + +import org.jboss.ejb.client.UserTransactionID; +import org.jboss.marshalling.Marshalling; +import org.jboss.marshalling.Unmarshaller; +import org.jboss.remoting3.MessageInputStream; +import org.jboss.remoting3.MessageOutputStream; +import org.jboss.remoting3.util.BlockingInvocation; +import org.jboss.remoting3.util.InvocationTracker; +import org.wildfly.transaction.client._private.Log; +import org.wildfly.transaction.client.provider.remoting.SimpleIdResolver; +import org.wildfly.transaction.client.spi.SimpleTransactionControl; + +/** + * @author David M. Lloyd + */ +class EJBSimpleTransactionControl implements SimpleTransactionControl { + private final EJBClientChannel channel; + private final UserTransactionID transactionID; + private final SimpleIdResolver simpleIdResolver; + + EJBSimpleTransactionControl(final EJBClientChannel channel) { + this.channel = channel; + final UserTransactionID transactionID = channel.allocateUserTransactionID(); + this.transactionID = transactionID; + simpleIdResolver = connection -> { + if (channel.getChannel().getConnection() != connection) { + throw Log.log.invalidTransactionConnection(); + } + return transactionID.getId(); + }; + } + + public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { + executeSimpleInvocation(Protocol.TXN_COMMIT_REQUEST, true); + } + + public void rollback() throws SecurityException, SystemException { + executeSimpleInvocation(Protocol.TXN_ROLLBACK_REQUEST, false); + } + + private void executeSimpleInvocation(int type, boolean withParam) throws SystemException { + final EJBClientChannel channel = this.channel; + final InvocationTracker invocationTracker = channel.getInvocationTracker(); + final EJBTransactionOperations.PlainTransactionInvocation invocation = invocationTracker.addInvocation(EJBTransactionOperations.PlainTransactionInvocation::new); + try (MessageOutputStream os = invocationTracker.allocateMessage(invocation)) { + os.writeByte(type); + os.writeShort(invocation.getIndex()); + final byte[] encoded = transactionID.getEncodedForm(); + PackedInteger.writePackedInteger(os, encoded.length); + os.write(encoded); + if (withParam) { + os.writeBoolean(true); + } + } catch (IOException e) { + throw new SystemException(); + } + try (BlockingInvocation.Response response = invocation.getResponse()) { + switch (response.getParameter()) { + case Protocol.TXN_RESPONSE: { + final MessageInputStream inputStream = response.getInputStream(); + boolean flag = inputStream.readBoolean(); + if (flag) { + // unrecognized parameter + throw new SystemException(); + } + return; + } + case Protocol.APPLICATION_EXCEPTION: { + throw readAppException(channel, response); + } + default: { + throw new SystemException(); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + invocation.cancel(); + throw new SystemException(); + } catch (IOException e) { + throw new SystemException(); + } finally { + invocationTracker.remove(invocation); + } + } + + static SystemException readAppException(final EJBClientChannel channel, final BlockingInvocation.Response response) throws SystemException { + Exception e; + try (final Unmarshaller unmarshaller = channel.createUnmarshaller()) { + try (MessageInputStream inputStream = response.getInputStream()) { + unmarshaller.start(Marshalling.createByteInput(inputStream)); + e = unmarshaller.readObject(Exception.class); + unmarshaller.finish(); + // The version is probably < 3 else we would not be here + // drain off attachments so the server doesn't complain + while (inputStream.read() != -1) { + inputStream.skip(Long.MAX_VALUE); + } + } + } catch (IOException | ClassNotFoundException e1) { + throw new SystemException(); + } + if (e == null) { + throw new SystemException(); + } + try { + throw e; + } catch (RuntimeException | SystemException e1) { + throw e1; + } catch (Exception e1) { + final SystemException e2 = new SystemException(); + e2.initCause(e1); + return e2; + } + } + + public T getProviderInterface(final Class providerInterfaceType) { + if (providerInterfaceType.isAssignableFrom(SimpleIdResolver.class)) { + return providerInterfaceType.cast(simpleIdResolver); + } + return null; + } +} +``` + +## `src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java` (changed lines (128, 129, 209, 210)) + +```java +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017 Red Hat, Inc., and individual contributors + * as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jboss.ejb.protocol.remote; + +import java.io.IOException; + +import javax.transaction.SystemException; +import javax.transaction.xa.XAException; +import javax.transaction.xa.Xid; + +import org.jboss.ejb._private.Logs; +import org.jboss.ejb.client.EJBClientContext; +import org.jboss.ejb.client.TransactionID; +import org.jboss.ejb.client.XidTransactionID; +import org.jboss.marshalling.Marshalling; +import org.jboss.marshalling.Unmarshaller; +import org.jboss.remoting3.Connection; +import org.jboss.remoting3.ConnectionPeerIdentity; +import org.jboss.remoting3.MessageInputStream; +import org.jboss.remoting3.MessageOutputStream; +import org.jboss.remoting3.util.BlockingInvocation; +import org.jboss.remoting3.util.InvocationTracker; +import org.jboss.remoting3.util.StreamUtils; +import org.wildfly.transaction.client.provider.remoting.RemotingOperations; +import org.wildfly.transaction.client.spi.SimpleTransactionControl; + +/** + * @author David M. Lloyd + */ +class EJBTransactionOperations implements RemotingOperations { + private final EJBClientChannel channel; + + EJBTransactionOperations(final Connection connection) throws IOException { + final EJBClientContext ejbClientContext = EJBClientContext.getCurrent(); + final RemoteEJBReceiver receiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); + if (receiver != null) { + this.channel = receiver.getClientChannel(connection); + } else { + throw Logs.REMOTING.noRemoteTransportOnEJBContext(); + } + } + + public void rollback(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_ROLLBACK_REQUEST, false, false, false); + } + + public void setRollbackOnly(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + // no operation + } + + public void beforeCompletion(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_BEFORE_COMPLETION_REQUEST, false, false, false); + } + + public int prepare(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + return executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_PREPARE_REQUEST, true, false, false); + } + + public void forget(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_FORGET_REQUEST, false, false, false); + } + + public void commit(final Xid xid, final boolean onePhase, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_COMMIT_REQUEST, false, true, onePhase); + } + + private int executeSimpleInvocation(final TransactionID transactionID, int type, boolean withAnswer, boolean withParam, boolean param) throws XAException { + final InvocationTracker invocationTracker = channel.getInvocationTracker(); + final PlainTransactionInvocation invocation = invocationTracker.addInvocation(PlainTransactionInvocation::new); + try (MessageOutputStream os = invocationTracker.allocateMessage(invocation)) { + os.writeByte(type); + os.writeShort(invocation.getIndex()); + final byte[] encoded = transactionID.getEncodedForm(); + PackedInteger.writePackedInteger(os, encoded.length); + os.write(encoded); + if (withParam) { + os.writeBoolean(param); + } + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); + } + try (BlockingInvocation.Response response = invocation.getResponse()) { + switch (response.getParameter()) { + case Protocol.TXN_RESPONSE: { + final MessageInputStream inputStream = response.getInputStream(); + boolean flag = inputStream.readBoolean(); + if (flag != withAnswer) { + // unrecognized parameter + throw new XAException(XAException.XAER_RMFAIL); + } + return flag ? PackedInteger.readPackedInteger(inputStream) : 0; + } + case Protocol.APPLICATION_EXCEPTION: { + throw readAppException(channel, response); + } + default: { + throw new XAException(XAException.XAER_RMFAIL); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + invocation.cancel(); + throw new XAException(XAException.XAER_RMERR); + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); + } finally { + invocationTracker.remove(invocation); + } + } + + static XAException readAppException(final EJBClientChannel channel, final BlockingInvocation.Response response) throws XAException { + Exception e; + try (final Unmarshaller unmarshaller = channel.createUnmarshaller()) { + try (MessageInputStream inputStream = response.getInputStream()) { + unmarshaller.start(Marshalling.createByteInput(inputStream)); + e = unmarshaller.readObject(Exception.class); + unmarshaller.finish(); + // The version is probably < 3 else we would not be here + // drain off attachments so the server doesn't complain + while (inputStream.read() != -1) { + inputStream.skip(Long.MAX_VALUE); + } + } + } catch (IOException | ClassNotFoundException e1) { + throw new XAException(XAException.XAER_RMERR); + } + if (e == null) { + throw new XAException(XAException.XAER_RMFAIL); + } + try { + throw e; + } catch (RuntimeException | XAException e1) { + throw e1; + } catch (Exception e1) { + final XAException xae = new XAException(XAException.XAER_RMERR); + xae.initCause(e1); + return xae; + } + } + + static class PlainTransactionInvocation extends BlockingInvocation { + PlainTransactionInvocation(final int index) { + super(index); + } + } + + public Xid[] recover(final int flag, final String parentName, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + final InvocationTracker invocationTracker = channel.getInvocationTracker(); + final PlainTransactionInvocation invocation = invocationTracker.addInvocation(PlainTransactionInvocation::new); + try (MessageOutputStream os = invocationTracker.allocateMessage(invocation)) { + os.writeByte(Protocol.TXN_RECOVERY_REQUEST); + os.writeShort(invocation.getIndex()); + os.writeUTF(parentName); + os.writeInt(flag); + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); + } + try (BlockingInvocation.Response response = invocation.getResponse()) { + switch (response.getParameter()) { + case Protocol.TXN_RECOVERY_RESPONSE: { + final MessageInputStream inputStream = response.getInputStream(); + int count = StreamUtils.readPackedUnsignedInt31(inputStream); + final Xid[] xids = new Xid[count]; + // unmarshall it :( + final Unmarshaller unmarshaller = channel.createUnmarshaller(); + unmarshaller.start(Marshalling.createByteInput(inputStream)); + for (int i = 0; i < count; i ++) { + xids[i ++] = unmarshaller.readObject(XidTransactionID.class).getXid(); + } + unmarshaller.finish(); + return xids; + } + case Protocol.APPLICATION_EXCEPTION: { + throw readAppException(channel, response); + } + default: { + throw new XAException(XAException.XAER_RMFAIL); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + invocation.cancel(); + throw new XAException(XAException.XAER_RMERR); + } catch (IOException | ClassNotFoundException e) { + throw new XAException(XAException.XAER_RMERR); + } finally { + invocationTracker.remove(invocation); + } + } + + public SimpleTransactionControl begin(final ConnectionPeerIdentity peerIdentity) throws SystemException { + assert peerIdentity.getId() == 0; + return new EJBSimpleTransactionControl(channel); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..44d0d0881c0c0bbd58d68eac0d7f7e4dc19db074 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/pre_context.md @@ -0,0 +1,371 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java` (changed lines (107,)) + +```java +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017 Red Hat, Inc., and individual contributors + * as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jboss.ejb.protocol.remote; + +import java.io.IOException; + +import javax.transaction.HeuristicMixedException; +import javax.transaction.HeuristicRollbackException; +import javax.transaction.RollbackException; +import javax.transaction.SystemException; + +import org.jboss.ejb.client.UserTransactionID; +import org.jboss.marshalling.Marshalling; +import org.jboss.marshalling.Unmarshaller; +import org.jboss.remoting3.MessageInputStream; +import org.jboss.remoting3.MessageOutputStream; +import org.jboss.remoting3.util.BlockingInvocation; +import org.jboss.remoting3.util.InvocationTracker; +import org.wildfly.transaction.client._private.Log; +import org.wildfly.transaction.client.provider.remoting.SimpleIdResolver; +import org.wildfly.transaction.client.spi.SimpleTransactionControl; + +/** + * @author David M. Lloyd + */ +class EJBSimpleTransactionControl implements SimpleTransactionControl { + private final EJBClientChannel channel; + private final UserTransactionID transactionID; + private final SimpleIdResolver simpleIdResolver; + + EJBSimpleTransactionControl(final EJBClientChannel channel) { + this.channel = channel; + final UserTransactionID transactionID = channel.allocateUserTransactionID(); + this.transactionID = transactionID; + simpleIdResolver = connection -> { + if (channel.getChannel().getConnection() != connection) { + throw Log.log.invalidTransactionConnection(); + } + return transactionID.getId(); + }; + } + + public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { + executeSimpleInvocation(Protocol.TXN_COMMIT_REQUEST, true); + } + + public void rollback() throws SecurityException, SystemException { + executeSimpleInvocation(Protocol.TXN_ROLLBACK_REQUEST, false); + } + + private void executeSimpleInvocation(int type, boolean withParam) throws SystemException { + final EJBClientChannel channel = this.channel; + final InvocationTracker invocationTracker = channel.getInvocationTracker(); + final EJBTransactionOperations.PlainTransactionInvocation invocation = invocationTracker.addInvocation(EJBTransactionOperations.PlainTransactionInvocation::new); + try (MessageOutputStream os = invocationTracker.allocateMessage(invocation)) { + os.writeByte(type); + os.writeShort(invocation.getIndex()); + final byte[] encoded = transactionID.getEncodedForm(); + PackedInteger.writePackedInteger(os, encoded.length); + os.write(encoded); + if (withParam) { + os.writeBoolean(true); + } + } catch (IOException e) { + throw new SystemException(); + } + try (BlockingInvocation.Response response = invocation.getResponse()) { + switch (response.getParameter()) { + case Protocol.TXN_RESPONSE: { + final MessageInputStream inputStream = response.getInputStream(); + boolean flag = inputStream.readBoolean(); + if (flag) { + // unrecognized parameter + throw new SystemException(); + } + return; + } + case Protocol.APPLICATION_EXCEPTION: { + throw readAppException(channel, response); + } + default: { + throw new SystemException(); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + invocation.cancel(); + throw new SystemException(); + } catch (IOException e) { + throw new SystemException(); + } + } + + static SystemException readAppException(final EJBClientChannel channel, final BlockingInvocation.Response response) throws SystemException { + Exception e; + try (final Unmarshaller unmarshaller = channel.createUnmarshaller()) { + try (MessageInputStream inputStream = response.getInputStream()) { + unmarshaller.start(Marshalling.createByteInput(inputStream)); + e = unmarshaller.readObject(Exception.class); + unmarshaller.finish(); + // The version is probably < 3 else we would not be here + // drain off attachments so the server doesn't complain + while (inputStream.read() != -1) { + inputStream.skip(Long.MAX_VALUE); + } + } + } catch (IOException | ClassNotFoundException e1) { + throw new SystemException(); + } + if (e == null) { + throw new SystemException(); + } + try { + throw e; + } catch (RuntimeException | SystemException e1) { + throw e1; + } catch (Exception e1) { + final SystemException e2 = new SystemException(); + e2.initCause(e1); + return e2; + } + } + + public T getProviderInterface(final Class providerInterfaceType) { + if (providerInterfaceType.isAssignableFrom(SimpleIdResolver.class)) { + return providerInterfaceType.cast(simpleIdResolver); + } + return null; + } +} +``` + +## `src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java` (changed lines (128, 207)) + +```java +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017 Red Hat, Inc., and individual contributors + * as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jboss.ejb.protocol.remote; + +import java.io.IOException; + +import javax.transaction.SystemException; +import javax.transaction.xa.XAException; +import javax.transaction.xa.Xid; + +import org.jboss.ejb._private.Logs; +import org.jboss.ejb.client.EJBClientContext; +import org.jboss.ejb.client.TransactionID; +import org.jboss.ejb.client.XidTransactionID; +import org.jboss.marshalling.Marshalling; +import org.jboss.marshalling.Unmarshaller; +import org.jboss.remoting3.Connection; +import org.jboss.remoting3.ConnectionPeerIdentity; +import org.jboss.remoting3.MessageInputStream; +import org.jboss.remoting3.MessageOutputStream; +import org.jboss.remoting3.util.BlockingInvocation; +import org.jboss.remoting3.util.InvocationTracker; +import org.jboss.remoting3.util.StreamUtils; +import org.wildfly.transaction.client.provider.remoting.RemotingOperations; +import org.wildfly.transaction.client.spi.SimpleTransactionControl; + +/** + * @author David M. Lloyd + */ +class EJBTransactionOperations implements RemotingOperations { + private final EJBClientChannel channel; + + EJBTransactionOperations(final Connection connection) throws IOException { + final EJBClientContext ejbClientContext = EJBClientContext.getCurrent(); + final RemoteEJBReceiver receiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); + if (receiver != null) { + this.channel = receiver.getClientChannel(connection); + } else { + throw Logs.REMOTING.noRemoteTransportOnEJBContext(); + } + } + + public void rollback(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_ROLLBACK_REQUEST, false, false, false); + } + + public void setRollbackOnly(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + // no operation + } + + public void beforeCompletion(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_BEFORE_COMPLETION_REQUEST, false, false, false); + } + + public int prepare(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + return executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_PREPARE_REQUEST, true, false, false); + } + + public void forget(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_FORGET_REQUEST, false, false, false); + } + + public void commit(final Xid xid, final boolean onePhase, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_COMMIT_REQUEST, false, true, onePhase); + } + + private int executeSimpleInvocation(final TransactionID transactionID, int type, boolean withAnswer, boolean withParam, boolean param) throws XAException { + final InvocationTracker invocationTracker = channel.getInvocationTracker(); + final PlainTransactionInvocation invocation = invocationTracker.addInvocation(PlainTransactionInvocation::new); + try (MessageOutputStream os = invocationTracker.allocateMessage(invocation)) { + os.writeByte(type); + os.writeShort(invocation.getIndex()); + final byte[] encoded = transactionID.getEncodedForm(); + PackedInteger.writePackedInteger(os, encoded.length); + os.write(encoded); + if (withParam) { + os.writeBoolean(param); + } + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); + } + try (BlockingInvocation.Response response = invocation.getResponse()) { + switch (response.getParameter()) { + case Protocol.TXN_RESPONSE: { + final MessageInputStream inputStream = response.getInputStream(); + boolean flag = inputStream.readBoolean(); + if (flag != withAnswer) { + // unrecognized parameter + throw new XAException(XAException.XAER_RMFAIL); + } + return flag ? PackedInteger.readPackedInteger(inputStream) : 0; + } + case Protocol.APPLICATION_EXCEPTION: { + throw readAppException(channel, response); + } + default: { + throw new XAException(XAException.XAER_RMFAIL); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + invocation.cancel(); + throw new XAException(XAException.XAER_RMERR); + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); + } + } + + static XAException readAppException(final EJBClientChannel channel, final BlockingInvocation.Response response) throws XAException { + Exception e; + try (final Unmarshaller unmarshaller = channel.createUnmarshaller()) { + try (MessageInputStream inputStream = response.getInputStream()) { + unmarshaller.start(Marshalling.createByteInput(inputStream)); + e = unmarshaller.readObject(Exception.class); + unmarshaller.finish(); + // The version is probably < 3 else we would not be here + // drain off attachments so the server doesn't complain + while (inputStream.read() != -1) { + inputStream.skip(Long.MAX_VALUE); + } + } + } catch (IOException | ClassNotFoundException e1) { + throw new XAException(XAException.XAER_RMERR); + } + if (e == null) { + throw new XAException(XAException.XAER_RMFAIL); + } + try { + throw e; + } catch (RuntimeException | XAException e1) { + throw e1; + } catch (Exception e1) { + final XAException xae = new XAException(XAException.XAER_RMERR); + xae.initCause(e1); + return xae; + } + } + + static class PlainTransactionInvocation extends BlockingInvocation { + PlainTransactionInvocation(final int index) { + super(index); + } + } + + public Xid[] recover(final int flag, final String parentName, final ConnectionPeerIdentity peerIdentity) throws XAException { + assert peerIdentity.getId() == 0; + final InvocationTracker invocationTracker = channel.getInvocationTracker(); + final PlainTransactionInvocation invocation = invocationTracker.addInvocation(PlainTransactionInvocation::new); + try (MessageOutputStream os = invocationTracker.allocateMessage(invocation)) { + os.writeByte(Protocol.TXN_RECOVERY_REQUEST); + os.writeShort(invocation.getIndex()); + os.writeUTF(parentName); + os.writeInt(flag); + } catch (IOException e) { + throw new XAException(XAException.XAER_RMERR); + } + try (BlockingInvocation.Response response = invocation.getResponse()) { + switch (response.getParameter()) { + case Protocol.TXN_RECOVERY_RESPONSE: { + final MessageInputStream inputStream = response.getInputStream(); + int count = StreamUtils.readPackedUnsignedInt31(inputStream); + final Xid[] xids = new Xid[count]; + // unmarshall it :( + final Unmarshaller unmarshaller = channel.createUnmarshaller(); + unmarshaller.start(Marshalling.createByteInput(inputStream)); + for (int i = 0; i < count; i ++) { + xids[i ++] = unmarshaller.readObject(XidTransactionID.class).getXid(); + } + unmarshaller.finish(); + return xids; + } + case Protocol.APPLICATION_EXCEPTION: { + throw readAppException(channel, response); + } + default: { + throw new XAException(XAException.XAER_RMFAIL); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + invocation.cancel(); + throw new XAException(XAException.XAER_RMERR); + } catch (IOException | ClassNotFoundException e) { + throw new XAException(XAException.XAER_RMERR); + } + } + + public SimpleTransactionControl begin(final ConnectionPeerIdentity peerIdentity) throws SystemException { + assert peerIdentity.getId() == 0; + return new EJBSimpleTransactionControl(channel); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/task.json new file mode 100644 index 0000000000000000000000000000000000000000..fe08b589d4ba16deed72fa830a01c5fa1df18775 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/task.json @@ -0,0 +1,47 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-09002f4d38e9ecf8238a", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-09002f4d38e9ecf8238a", + "project_id": "morefixes__wildfly__jboss-ejb-client", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java", + "src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java" + ], + "patch_units": { + "before": [ + "src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java", + "src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java" + ], + "after": [ + "src/main/java/org/jboss/ejb/protocol/remote/EJBSimpleTransactionControl.java", + "src/main/java/org/jboss/ejb/protocol/remote/EJBTransactionOperations.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/37bd11eb259d8f36019c5d4bb3b4aec7e0c859870bfa1b0cbf986db2f24ef6f5/database", + "cache_key": "37bd11eb259d8f36019c5d4bb3b4aec7e0c859870bfa1b0cbf986db2f24ef6f5", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/9f3dec78c24deb5de9f33e559a2676fd824bf844744ff4ee7c65cedafb37ac2c/database", + "cache_key": "9f3dec78c24deb5de9f33e559a2676fd824bf844744ff4ee7c65cedafb37ac2c", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/ebb8190c0c6caa67b6b1e5cd795590f01f18680ef0aaf3a369eeb56ccb9f825c/database", + "cache_key": "ebb8190c0c6caa67b6b1e5cd795590f01f18680ef0aaf3a369eeb56ccb9f825c", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-09002f4d38e9ecf8238a/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-09002f4d38e9ecf8238a/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-09002f4d38e9ecf8238a/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..9119fa330482f444e1c32e6145aac97b5c5282eb --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/patch.diff @@ -0,0 +1,148 @@ +diff --git a/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java b/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java +index 7cd2b74..f627be3 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java +@@ -185,10 +185,11 @@ class AESGCMFallbackCipherState implements CipherState { + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; +- else +- space = ciphertext.length - ciphertextOffset; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) +@@ -214,16 +215,15 @@ class AESGCMFallbackCipherState implements CipherState { + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); +- if (plaintextOffset > plaintext.length) +- space = 0; +- else +- space = plaintext.length - plaintextOffset; ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) +diff --git a/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java b/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java +index deada67..df40945 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java +@@ -218,10 +218,11 @@ class AESGCMOnCtrCipherState implements CipherState { + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; +- else +- space = ciphertext.length - ciphertextOffset; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = ciphertext.length - ciphertextOffset; + if (keySpec == null) { + // The key is not set yet - return the plaintext as-is. + if (length > space) +@@ -262,16 +263,15 @@ class AESGCMOnCtrCipherState implements CipherState { + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); +- if (plaintextOffset > plaintext.length) +- space = 0; +- else +- space = plaintext.length - plaintextOffset; ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = plaintext.length - plaintextOffset; + if (keySpec == null) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) +diff --git a/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java b/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java +index 25b1a4c..40ce2bc 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java +@@ -214,10 +214,11 @@ class ChaChaPolyCipherState implements CipherState { + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; +- else +- space = ciphertext.length - ciphertextOffset; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) +@@ -241,16 +242,15 @@ class ChaChaPolyCipherState implements CipherState { + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); +- if (plaintextOffset > plaintext.length) +- space = 0; +- else +- space = plaintext.length - plaintextOffset; ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) +diff --git a/src/main/java/com/southernstorm/noise/protocol/CipherState.java b/src/main/java/com/southernstorm/noise/protocol/CipherState.java +index 3168139..74f808b 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/CipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/CipherState.java +@@ -100,6 +100,8 @@ public interface CipherState extends Destroyable { + * + * @throws IllegalStateException The nonce has wrapped around. + * ++ * @throws IllegalArgumentException One of the parameters is out of range. ++ * + * The plaintext and ciphertext buffers can be the same for in-place + * encryption. In that case, plaintextOffset must be identical to + * ciphertextOffset. +@@ -130,6 +132,8 @@ public interface CipherState extends Destroyable { + * + * @throws IllegalStateException The nonce has wrapped around. + * ++ * @throws IllegalArgumentException One of the parameters is out of range. ++ * + * The plaintext and ciphertext buffers can be the same for in-place + * decryption. In that case, ciphertextOffset must be identical to + * plaintextOffset. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..2c35d4cdf0b1db7976981087af5a1a235817d962 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/post_context.md @@ -0,0 +1,1073 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java` (changed lines (188, 189, 190, 191, 192, 218, 219, 224, 225, 226)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.GHASH; +import com.southernstorm.noise.crypto.RijndaelAES; + +/** + * Fallback implementation of "AESGCM" on platforms where + * the JCA/JCE does not have a suitable GCM or CTR provider. + */ +class AESGCMFallbackCipherState implements CipherState { + + private RijndaelAES aes; + private long n; + private byte[] iv; + private byte[] enciv; + private byte[] hashKey; + private GHASH ghash; + private boolean haskey; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + */ + public AESGCMFallbackCipherState() + { + aes = new RijndaelAES(); + n = 0; + iv = new byte [16]; + enciv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + haskey = false; + } + + @Override + public void destroy() { + aes.destroy(); + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + Noise.destroy(enciv); + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set up the AES key. + aes.setupEnc(key, offset, 256); + haskey = true; + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(hashKey, 0, hashKey, 0); + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(iv, 0, hashKey, 0); + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + /** + * Encrypts a block in CTR mode. + * + * @param plaintext The plaintext to encrypt. + * @param plaintextOffset Offset of the first plaintext byte. + * @param ciphertext The resulting ciphertext. + * @param ciphertextOffset Offset of the first ciphertext byte. + * @param length The number of bytes to encrypt. + * + * This function can also be used to decrypt. + */ + private void encryptCTR(byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) + { + while (length > 0) { + // Increment the IV and encrypt it to get the next keystream block. + if (++(iv[15]) == 0) + if (++(iv[14]) == 0) + if (++(iv[13]) == 0) + ++(iv[12]); + aes.encrypt(iv, 0, enciv, 0); + + // XOR the keystream block with the plaintext to create the ciphertext. + int temp = length; + if (temp > 16) + temp = 16; + for (int index = 0; index < temp; ++index) + ciphertext[ciphertextOffset + index] = (byte)(plaintext[plaintextOffset + index] ^ enciv[index]); + + // Advance to the next block. + plaintextOffset += temp; + ciphertextOffset += temp; + length -= temp; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encryptCTR(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(enciv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ enciv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encryptCTR(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + cipher = new AESGCMFallbackCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java` (changed lines (221, 222, 223, 224, 225, 266, 267, 272, 273, 274)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import com.southernstorm.noise.crypto.GHASH; + +/** + * Emulates the "AESGCM" cipher for Noise using the "AES/CTR/NoPadding" + * transformation from JCA/JCE. + * + * This class is used on platforms that don't have "AES/GCM/NoPadding", + * but which do have the older "AES/CTR/NoPadding". + */ +class AESGCMOnCtrCipherState implements CipherState { + + private Cipher cipher; + private SecretKeySpec keySpec; + private long n; + private byte[] iv; + private byte[] hashKey; + private GHASH ghash; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + * + * @throws NoSuchAlgorithmException The system does not have a + * provider for this algorithm. + */ + public AESGCMOnCtrCipherState() throws NoSuchAlgorithmException + { + try { + cipher = Cipher.getInstance("AES/CTR/NoPadding"); + } catch (NoSuchPaddingException e) { + // AES/CTR is available, but not the unpadded version? Huh? + throw new NoSuchAlgorithmException("AES/CTR/NoPadding not available", e); + } + keySpec = null; + n = 0; + iv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + + // Try to set a 256-bit key on the cipher. Some JCE's are + // configured to disallow 256-bit AES if an extra policy + // file has not been installed. + try { + SecretKeySpec spec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, spec, params); + } catch (InvalidKeyException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } catch (InvalidAlgorithmParameterException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } + } + + @Override + public void destroy() { + // There doesn't seem to be a standard API to clean out a Cipher. + // So we instead set the key and IV to all-zeroes to hopefully + // destroy the sensitive data in the cipher instance. + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + keySpec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, params); + } catch (InvalidKeyException e) { + // Shouldn't happen. + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + } + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return keySpec != null ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set the encryption key. + keySpec = new SecretKeySpec(key, offset, 32, "AES"); + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(iv, (byte)0); + Arrays.fill(hashKey, (byte)0); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + try { + int result = cipher.update(hashKey, 0, 16, hashKey, 0); + cipher.doFinal(hashKey, result); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return keySpec != null; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) throws InvalidKeyException, InvalidAlgorithmParameterException + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block for AES/CTR/NoPadding. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Initialize the CTR mode cipher with the key and IV. + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + try { + cipher.update(hashKey, 0, 16, hashKey, 0); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = ciphertext.length - ciphertextOffset; + if (keySpec == null) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + try { + setup(ad); + int result = cipher.update(plaintext, plaintextOffset, length, ciphertext, ciphertextOffset); + cipher.doFinal(ciphertext, ciphertextOffset + result); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = plaintext.length - plaintextOffset; + if (keySpec == null) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + try { + setup(ad); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(iv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ iv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + try { + int result = cipher.update(ciphertext, ciphertextOffset, dataLen, plaintext, plaintextOffset); + cipher.doFinal(plaintext, plaintextOffset + result); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + try { + cipher = new AESGCMOnCtrCipherState(); + } catch (NoSuchAlgorithmException e) { + // Shouldn't happen. + return null; + } + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java` (changed lines (217, 218, 219, 220, 221, 245, 246, 251, 252, 253)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.ChaChaCore; +import com.southernstorm.noise.crypto.Poly1305; + +/** + * Implements the ChaChaPoly cipher for Noise. + */ +class ChaChaPolyCipherState implements CipherState { + + private Poly1305 poly; + private int[] input; + private int[] output; + private byte[] polyKey; + long n; + private boolean haskey; + + /** + * Constructs a new cipher state for the "ChaChaPoly" algorithm. + */ + public ChaChaPolyCipherState() + { + poly = new Poly1305(); + input = new int [16]; + output = new int [16]; + polyKey = new byte [32]; + n = 0; + haskey = false; + } + + @Override + public void destroy() { + poly.destroy(); + Arrays.fill(input, 0); + Arrays.fill(output, 0); + Noise.destroy(polyKey); + } + + @Override + public String getCipherName() { + return "ChaChaPoly"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + ChaChaCore.initKey256(input, key, offset); + n = 0; + haskey = true; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * XOR's the output of ChaCha20 with a byte buffer. + * + * @param input The input byte buffer. + * @param inputOffset The offset of the first input byte. + * @param output The output byte buffer (can be the same as the input). + * @param outputOffset The offset of the first output byte. + * @param length The number of bytes to XOR between 1 and 64. + * @param block The ChaCha20 output block. + */ + private static void xorBlock(byte[] input, int inputOffset, byte[] output, int outputOffset, int length, int[] block) + { + int posn = 0; + int value; + while (length >= 4) { + value = block[posn++]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + output[outputOffset + 3] = (byte)(input[inputOffset + 3] ^ (value >> 24)); + inputOffset += 4; + outputOffset += 4; + length -= 4; + } + if (length == 3) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + } else if (length == 2) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + } else if (length == 1) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + } + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + ChaChaCore.initIV(input, n++); + ChaChaCore.hash(output, input); + Arrays.fill(polyKey, (byte)0); + xorBlock(polyKey, 0, polyKey, 0, 32, output); + poly.reset(polyKey, 0); + if (ad != null) { + poly.update(ad, 0, ad.length); + poly.pad(); + } + if (++(input[12]) == 0) + ++(input[13]); + } + + /** + * Puts a 64-bit integer into a buffer in little-endian order. + * + * @param output The output buffer. + * @param offset The offset into the output buffer. + * @param value The 64-bit integer value. + */ + private static void putLittleEndian64(byte[] output, int offset, long value) + { + output[offset] = (byte)value; + output[offset + 1] = (byte)(value >> 8); + output[offset + 2] = (byte)(value >> 16); + output[offset + 3] = (byte)(value >> 24); + output[offset + 4] = (byte)(value >> 32); + output[offset + 5] = (byte)(value >> 40); + output[offset + 6] = (byte)(value >> 48); + output[offset + 7] = (byte)(value >> 56); + } + + /** + * Finishes up the authentication tag for a packet. + * + * @param ad The associated data. + * @param length The length of the plaintext data. + */ + private void finish(byte[] ad, int length) + { + poly.pad(); + putLittleEndian64(polyKey, 0, ad != null ? ad.length : 0); + putLittleEndian64(polyKey, 8, length); + poly.update(polyKey, 0, 16); + poly.finish(polyKey, 0); + } + + /** + * Encrypts or decrypts a buffer of bytes for the active packet. + * + * @param plaintext The plaintext data to be encrypted. + * @param plaintextOffset The offset to the first plaintext byte. + * @param ciphertext The ciphertext data that results from encryption. + * @param ciphertextOffset The offset to the first ciphertext byte. + * @param length The number of bytes to encrypt. + */ + private void encrypt(byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) { + while (length > 0) { + int tempLen = 64; + if (tempLen > length) + tempLen = length; + ChaChaCore.hash(output, input); + xorBlock(plaintext, plaintextOffset, ciphertext, ciphertextOffset, tempLen, output); + if (++(input[12]) == 0) + ++(input[13]); + plaintextOffset += tempLen; + ciphertextOffset += tempLen; + length -= tempLen; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encrypt(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + poly.update(ciphertext, ciphertextOffset, length); + finish(ad, length); + System.arraycopy(polyKey, 0, ciphertext, ciphertextOffset + length, 16); + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + poly.update(ciphertext, ciphertextOffset, dataLen); + finish(ad, dataLen); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (polyKey[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encrypt(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher = new ChaChaPolyCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/CipherState.java` (changed lines (103, 104, 135, 136)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +/** + * Interface to an authenticated cipher for use in the Noise protocol. + * + * CipherState objects are used to encrypt or decrypt data during a + * session. Once the handshake has completed, HandshakeState.split() + * will create two CipherState objects for encrypting packets sent to + * the other party, and decrypting packets received from the other party. + */ +public interface CipherState extends Destroyable { + + /** + * Gets the Noise protocol name for this cipher. + * + * @return The cipher name. + */ + String getCipherName(); + + /** + * Gets the length of the key values for this cipher. + * + * @return The length of the key in bytes; usually 32. + */ + int getKeyLength(); + + /** + * Gets the length of the MAC values for this cipher. + * + * @return The length of MAC values in bytes, or zero if the + * key has not yet been initialized. + */ + int getMACLength(); + + /** + * Initializes the key on this cipher object. + * + * @param key Points to a buffer that contains the key. + * @param offset The offset of the key in the key buffer. + * + * The key buffer must contain at least getKeyLength() bytes + * starting at offset. + * + * @see #hasKey() + */ + void initializeKey(byte[] key, int offset); + + /** + * Determine if this cipher object has been configured with a key. + * + * @return true if this cipher object has a key; false if the + * key has not yet been set with initializeKey(). + * + * @see #initializeKey(byte[], int) + */ + boolean hasKey(); + + /** + * Encrypts a plaintext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param plaintext The buffer containing the plaintext to encrypt. + * @param plaintextOffset The offset within the plaintext buffer of the + * first byte or plaintext data. + * @param ciphertext The buffer to place the ciphertext in. This can + * be the same as the plaintext buffer. + * @param ciphertextOffset The first offset within the ciphertext buffer + * to place the ciphertext and the MAC tag. + * @param length The length of the plaintext. + * @return The length of the ciphertext plus the MAC tag, or -1 if the + * ciphertext buffer is not large enough to hold the result. + * + * @throws ShortBufferException The ciphertext buffer does not have + * enough space to hold the ciphertext plus MAC. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * @throws IllegalArgumentException One of the parameters is out of range. + * + * The plaintext and ciphertext buffers can be the same for in-place + * encryption. In that case, plaintextOffset must be identical to + * ciphertextOffset. + * + * There must be enough space in the ciphertext buffer to accomodate + * length + getMACLength() bytes of data starting at ciphertextOffset. + */ + int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException; + + /** + * Decrypts a ciphertext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param ciphertext The buffer containing the ciphertext to decrypt. + * @param ciphertextOffset The offset within the ciphertext buffer of + * the first byte of ciphertext data. + * @param plaintext The buffer to place the plaintext in. This can be + * the same as the ciphertext buffer. + * @param plaintextOffset The first offset within the plaintext buffer + * to place the plaintext. + * @param length The length of the incoming ciphertext plus the MAC tag. + * @return The length of the plaintext with the MAC tag stripped off. + * + * @throws ShortBufferException The plaintext buffer does not have + * enough space to store the decrypted data. + * + * @throws BadPaddingException The MAC value failed to verify. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * @throws IllegalArgumentException One of the parameters is out of range. + * + * The plaintext and ciphertext buffers can be the same for in-place + * decryption. In that case, ciphertextOffset must be identical to + * plaintextOffset. + */ + int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException; + + /** + * Creates a new instance of this cipher and initializes it with a key. + * + * @param key The buffer containing the key. + * @param offset The offset into the key buffer of the first key byte. + * @return A new CipherState of the same class as this one. + */ + CipherState fork(byte[] key, int offset); + + /** + * Sets the nonce value. + * + * @param nonce The new nonce value, which must be greater than or equal + * to the current value. + * + * This function is intended for testing purposes only. If the nonce + * value goes backwards then security may be compromised. + */ + void setNonce(long nonce); +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..80c4cfef1c3381c1b38be4c165e857e8b6d9934c --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/pre_context.md @@ -0,0 +1,1069 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java` (changed lines (188, 189, 190, 191, 192, 217, 218, 219, 223, 224, 225, 226, 227)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.GHASH; +import com.southernstorm.noise.crypto.RijndaelAES; + +/** + * Fallback implementation of "AESGCM" on platforms where + * the JCA/JCE does not have a suitable GCM or CTR provider. + */ +class AESGCMFallbackCipherState implements CipherState { + + private RijndaelAES aes; + private long n; + private byte[] iv; + private byte[] enciv; + private byte[] hashKey; + private GHASH ghash; + private boolean haskey; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + */ + public AESGCMFallbackCipherState() + { + aes = new RijndaelAES(); + n = 0; + iv = new byte [16]; + enciv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + haskey = false; + } + + @Override + public void destroy() { + aes.destroy(); + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + Noise.destroy(enciv); + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set up the AES key. + aes.setupEnc(key, offset, 256); + haskey = true; + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(hashKey, 0, hashKey, 0); + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(iv, 0, hashKey, 0); + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + /** + * Encrypts a block in CTR mode. + * + * @param plaintext The plaintext to encrypt. + * @param plaintextOffset Offset of the first plaintext byte. + * @param ciphertext The resulting ciphertext. + * @param ciphertextOffset Offset of the first ciphertext byte. + * @param length The number of bytes to encrypt. + * + * This function can also be used to decrypt. + */ + private void encryptCTR(byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) + { + while (length > 0) { + // Increment the IV and encrypt it to get the next keystream block. + if (++(iv[15]) == 0) + if (++(iv[14]) == 0) + if (++(iv[13]) == 0) + ++(iv[12]); + aes.encrypt(iv, 0, enciv, 0); + + // XOR the keystream block with the plaintext to create the ciphertext. + int temp = length; + if (temp > 16) + temp = 16; + for (int index = 0; index < temp; ++index) + ciphertext[ciphertextOffset + index] = (byte)(plaintext[plaintextOffset + index] ^ enciv[index]); + + // Advance to the next block. + plaintextOffset += temp; + ciphertextOffset += temp; + length -= temp; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encryptCTR(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (plaintextOffset > plaintext.length) + space = 0; + else + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(enciv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ enciv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encryptCTR(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + cipher = new AESGCMFallbackCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java` (changed lines (221, 222, 223, 224, 225, 265, 266, 267, 271, 272, 273, 274, 275)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import com.southernstorm.noise.crypto.GHASH; + +/** + * Emulates the "AESGCM" cipher for Noise using the "AES/CTR/NoPadding" + * transformation from JCA/JCE. + * + * This class is used on platforms that don't have "AES/GCM/NoPadding", + * but which do have the older "AES/CTR/NoPadding". + */ +class AESGCMOnCtrCipherState implements CipherState { + + private Cipher cipher; + private SecretKeySpec keySpec; + private long n; + private byte[] iv; + private byte[] hashKey; + private GHASH ghash; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + * + * @throws NoSuchAlgorithmException The system does not have a + * provider for this algorithm. + */ + public AESGCMOnCtrCipherState() throws NoSuchAlgorithmException + { + try { + cipher = Cipher.getInstance("AES/CTR/NoPadding"); + } catch (NoSuchPaddingException e) { + // AES/CTR is available, but not the unpadded version? Huh? + throw new NoSuchAlgorithmException("AES/CTR/NoPadding not available", e); + } + keySpec = null; + n = 0; + iv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + + // Try to set a 256-bit key on the cipher. Some JCE's are + // configured to disallow 256-bit AES if an extra policy + // file has not been installed. + try { + SecretKeySpec spec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, spec, params); + } catch (InvalidKeyException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } catch (InvalidAlgorithmParameterException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } + } + + @Override + public void destroy() { + // There doesn't seem to be a standard API to clean out a Cipher. + // So we instead set the key and IV to all-zeroes to hopefully + // destroy the sensitive data in the cipher instance. + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + keySpec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, params); + } catch (InvalidKeyException e) { + // Shouldn't happen. + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + } + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return keySpec != null ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set the encryption key. + keySpec = new SecretKeySpec(key, offset, 32, "AES"); + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(iv, (byte)0); + Arrays.fill(hashKey, (byte)0); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + try { + int result = cipher.update(hashKey, 0, 16, hashKey, 0); + cipher.doFinal(hashKey, result); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return keySpec != null; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) throws InvalidKeyException, InvalidAlgorithmParameterException + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block for AES/CTR/NoPadding. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Initialize the CTR mode cipher with the key and IV. + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + try { + cipher.update(hashKey, 0, 16, hashKey, 0); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (keySpec == null) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + try { + setup(ad); + int result = cipher.update(plaintext, plaintextOffset, length, ciphertext, ciphertextOffset); + cipher.doFinal(ciphertext, ciphertextOffset + result); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (plaintextOffset > plaintext.length) + space = 0; + else + space = plaintext.length - plaintextOffset; + if (keySpec == null) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + try { + setup(ad); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(iv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ iv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + try { + int result = cipher.update(ciphertext, ciphertextOffset, dataLen, plaintext, plaintextOffset); + cipher.doFinal(plaintext, plaintextOffset + result); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + try { + cipher = new AESGCMOnCtrCipherState(); + } catch (NoSuchAlgorithmException e) { + // Shouldn't happen. + return null; + } + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java` (changed lines (217, 218, 219, 220, 221, 244, 245, 246, 250, 251, 252, 253, 254)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.ChaChaCore; +import com.southernstorm.noise.crypto.Poly1305; + +/** + * Implements the ChaChaPoly cipher for Noise. + */ +class ChaChaPolyCipherState implements CipherState { + + private Poly1305 poly; + private int[] input; + private int[] output; + private byte[] polyKey; + long n; + private boolean haskey; + + /** + * Constructs a new cipher state for the "ChaChaPoly" algorithm. + */ + public ChaChaPolyCipherState() + { + poly = new Poly1305(); + input = new int [16]; + output = new int [16]; + polyKey = new byte [32]; + n = 0; + haskey = false; + } + + @Override + public void destroy() { + poly.destroy(); + Arrays.fill(input, 0); + Arrays.fill(output, 0); + Noise.destroy(polyKey); + } + + @Override + public String getCipherName() { + return "ChaChaPoly"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + ChaChaCore.initKey256(input, key, offset); + n = 0; + haskey = true; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * XOR's the output of ChaCha20 with a byte buffer. + * + * @param input The input byte buffer. + * @param inputOffset The offset of the first input byte. + * @param output The output byte buffer (can be the same as the input). + * @param outputOffset The offset of the first output byte. + * @param length The number of bytes to XOR between 1 and 64. + * @param block The ChaCha20 output block. + */ + private static void xorBlock(byte[] input, int inputOffset, byte[] output, int outputOffset, int length, int[] block) + { + int posn = 0; + int value; + while (length >= 4) { + value = block[posn++]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + output[outputOffset + 3] = (byte)(input[inputOffset + 3] ^ (value >> 24)); + inputOffset += 4; + outputOffset += 4; + length -= 4; + } + if (length == 3) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + } else if (length == 2) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + } else if (length == 1) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + } + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + ChaChaCore.initIV(input, n++); + ChaChaCore.hash(output, input); + Arrays.fill(polyKey, (byte)0); + xorBlock(polyKey, 0, polyKey, 0, 32, output); + poly.reset(polyKey, 0); + if (ad != null) { + poly.update(ad, 0, ad.length); + poly.pad(); + } + if (++(input[12]) == 0) + ++(input[13]); + } + + /** + * Puts a 64-bit integer into a buffer in little-endian order. + * + * @param output The output buffer. + * @param offset The offset into the output buffer. + * @param value The 64-bit integer value. + */ + private static void putLittleEndian64(byte[] output, int offset, long value) + { + output[offset] = (byte)value; + output[offset + 1] = (byte)(value >> 8); + output[offset + 2] = (byte)(value >> 16); + output[offset + 3] = (byte)(value >> 24); + output[offset + 4] = (byte)(value >> 32); + output[offset + 5] = (byte)(value >> 40); + output[offset + 6] = (byte)(value >> 48); + output[offset + 7] = (byte)(value >> 56); + } + + /** + * Finishes up the authentication tag for a packet. + * + * @param ad The associated data. + * @param length The length of the plaintext data. + */ + private void finish(byte[] ad, int length) + { + poly.pad(); + putLittleEndian64(polyKey, 0, ad != null ? ad.length : 0); + putLittleEndian64(polyKey, 8, length); + poly.update(polyKey, 0, 16); + poly.finish(polyKey, 0); + } + + /** + * Encrypts or decrypts a buffer of bytes for the active packet. + * + * @param plaintext The plaintext data to be encrypted. + * @param plaintextOffset The offset to the first plaintext byte. + * @param ciphertext The ciphertext data that results from encryption. + * @param ciphertextOffset The offset to the first ciphertext byte. + * @param length The number of bytes to encrypt. + */ + private void encrypt(byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) { + while (length > 0) { + int tempLen = 64; + if (tempLen > length) + tempLen = length; + ChaChaCore.hash(output, input); + xorBlock(plaintext, plaintextOffset, ciphertext, ciphertextOffset, tempLen, output); + if (++(input[12]) == 0) + ++(input[13]); + plaintextOffset += tempLen; + ciphertextOffset += tempLen; + length -= tempLen; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encrypt(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + poly.update(ciphertext, ciphertextOffset, length); + finish(ad, length); + System.arraycopy(polyKey, 0, ciphertext, ciphertextOffset + length, 16); + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (plaintextOffset > plaintext.length) + space = 0; + else + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + poly.update(ciphertext, ciphertextOffset, dataLen); + finish(ad, dataLen); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (polyKey[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encrypt(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher = new ChaChaPolyCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/CipherState.java` (changed lines (103, 133)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +/** + * Interface to an authenticated cipher for use in the Noise protocol. + * + * CipherState objects are used to encrypt or decrypt data during a + * session. Once the handshake has completed, HandshakeState.split() + * will create two CipherState objects for encrypting packets sent to + * the other party, and decrypting packets received from the other party. + */ +public interface CipherState extends Destroyable { + + /** + * Gets the Noise protocol name for this cipher. + * + * @return The cipher name. + */ + String getCipherName(); + + /** + * Gets the length of the key values for this cipher. + * + * @return The length of the key in bytes; usually 32. + */ + int getKeyLength(); + + /** + * Gets the length of the MAC values for this cipher. + * + * @return The length of MAC values in bytes, or zero if the + * key has not yet been initialized. + */ + int getMACLength(); + + /** + * Initializes the key on this cipher object. + * + * @param key Points to a buffer that contains the key. + * @param offset The offset of the key in the key buffer. + * + * The key buffer must contain at least getKeyLength() bytes + * starting at offset. + * + * @see #hasKey() + */ + void initializeKey(byte[] key, int offset); + + /** + * Determine if this cipher object has been configured with a key. + * + * @return true if this cipher object has a key; false if the + * key has not yet been set with initializeKey(). + * + * @see #initializeKey(byte[], int) + */ + boolean hasKey(); + + /** + * Encrypts a plaintext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param plaintext The buffer containing the plaintext to encrypt. + * @param plaintextOffset The offset within the plaintext buffer of the + * first byte or plaintext data. + * @param ciphertext The buffer to place the ciphertext in. This can + * be the same as the plaintext buffer. + * @param ciphertextOffset The first offset within the ciphertext buffer + * to place the ciphertext and the MAC tag. + * @param length The length of the plaintext. + * @return The length of the ciphertext plus the MAC tag, or -1 if the + * ciphertext buffer is not large enough to hold the result. + * + * @throws ShortBufferException The ciphertext buffer does not have + * enough space to hold the ciphertext plus MAC. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * The plaintext and ciphertext buffers can be the same for in-place + * encryption. In that case, plaintextOffset must be identical to + * ciphertextOffset. + * + * There must be enough space in the ciphertext buffer to accomodate + * length + getMACLength() bytes of data starting at ciphertextOffset. + */ + int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException; + + /** + * Decrypts a ciphertext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param ciphertext The buffer containing the ciphertext to decrypt. + * @param ciphertextOffset The offset within the ciphertext buffer of + * the first byte of ciphertext data. + * @param plaintext The buffer to place the plaintext in. This can be + * the same as the ciphertext buffer. + * @param plaintextOffset The first offset within the plaintext buffer + * to place the plaintext. + * @param length The length of the incoming ciphertext plus the MAC tag. + * @return The length of the plaintext with the MAC tag stripped off. + * + * @throws ShortBufferException The plaintext buffer does not have + * enough space to store the decrypted data. + * + * @throws BadPaddingException The MAC value failed to verify. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * The plaintext and ciphertext buffers can be the same for in-place + * decryption. In that case, ciphertextOffset must be identical to + * plaintextOffset. + */ + int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException; + + /** + * Creates a new instance of this cipher and initializes it with a key. + * + * @param key The buffer containing the key. + * @param offset The offset into the key buffer of the first key byte. + * @return A new CipherState of the same class as this one. + */ + CipherState fork(byte[] key, int offset); + + /** + * Sets the nonce value. + * + * @param nonce The new nonce value, which must be greater than or equal + * to the current value. + * + * This function is intended for testing purposes only. If the nonce + * value goes backwards then security may be compromised. + */ + void setNonce(long nonce); +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/task.json new file mode 100644 index 0000000000000000000000000000000000000000..016c2ecb1442b4cac93dcd0eb762434fc7c8047b --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/task.json @@ -0,0 +1,53 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-13b1b3610eb300ab9704", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-13b1b3610eb300ab9704", + "project_id": "morefixes__rweather__noise-java", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/CipherState.java" + ], + "patch_units": { + "before": [ + "src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/CipherState.java" + ], + "after": [ + "src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/CipherState.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/ee2f778534422dec17fbdad0e762e6abfde77ed184d8a089d11db18f570b08e8/database", + "cache_key": "ee2f778534422dec17fbdad0e762e6abfde77ed184d8a089d11db18f570b08e8", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/3dc1daf8fb7439a252126b4f9324699559bd3bc6425dd8b366245e4b18fdcf72/database", + "cache_key": "3dc1daf8fb7439a252126b4f9324699559bd3bc6425dd8b366245e4b18fdcf72", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/4c263a54c66ea2f20b42a1955c6d1854523ded76aaddd393ca8a8f94f211b130/database", + "cache_key": "4c263a54c66ea2f20b42a1955c6d1854523ded76aaddd393ca8a8f94f211b130", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-13b1b3610eb300ab9704/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-13b1b3610eb300ab9704/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-13b1b3610eb300ab9704/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..9287a2a8ea0eb4972ed45810d4185ef9f1ab9837 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/patch.diff @@ -0,0 +1,197 @@ +diff --git a/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java b/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java +index c0b5ea2..7e4b043 100644 +--- a/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java ++++ b/src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java +@@ -18,26 +18,26 @@ + */ + package org.apache.sling.jcr.base.util; + +-import java.util.Hashtable; +- +-import javax.jcr.Repository; +-import javax.naming.InitialContext; +- +-import org.apache.jackrabbit.rmi.client.ClientAdapterFactory; + import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory; + import org.apache.jackrabbit.rmi.client.LocalAdapterFactory; +-import org.apache.jackrabbit.rmi.remote.RemoteRepository; +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; + +-/** Access a Repository via JNDI or RMI. */ ++import javax.jcr.Repository; ++import java.util.Hashtable; ++ ++/** ++ * Access a Repository via JNDI or RMI. ++ * ++ * @deprecated No longer supported ++ */ ++@Deprecated + public class RepositoryAccessor { +- private final Logger log = LoggerFactory.getLogger(getClass()); + + /** Prefix for RMI Repository URLs */ ++ @Deprecated + public static final String RMI_PREFIX = "rmi://"; + + /** Prefix for JNDI Repository URLs */ ++ @Deprecated + public static final String JNDI_PREFIX = "jndi://"; + + /** +@@ -55,79 +55,13 @@ public class RepositoryAccessor { + * the Repository + * @param jndiContext if null, JNDI is not tried + * @return a Repository, or null if not found ++ * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} ++ * @deprecated No longer supported + */ ++ @Deprecated + public Repository getRepository(String repositoryName, + Hashtable jndiContext) { +- +- Repository result = null; +- String tried = ""; +- +- if (jndiContext == null || jndiContext.size() == 0) { +- log.info("jndiContext is null or empty, not trying JNDI"); +- } else { +- log.debug("Trying to acquire Repository '" + repositoryName +- + "' via JNDI, context=" + jndiContext); +- tried += "JNDI "; +- final ClassLoader old = Thread.currentThread().getContextClassLoader(); +- try { +- Thread.currentThread().setContextClassLoader( +- this.getClass().getClassLoader()); +- InitialContext initialContext = new InitialContext(jndiContext); +- Object repoObject = initialContext.lookup(repositoryName); +- if (repoObject instanceof Repository) { +- result = (Repository) repoObject; +- log.info("Acquired Repository '" + repositoryName +- + "' via JNDI"); +- +- } else if (repoObject instanceof RemoteRepository) { +- RemoteRepository remoteRepo = (RemoteRepository) repoObject; +- LocalAdapterFactory laf = getLocalAdapterFactory(); +- result = laf.getRepository(remoteRepo); +- log.info("Acquired RemoteRepository '" + repositoryName +- + "' via JNDI"); +- +- } else { +- log.info("Repository '" + repositoryName +- + "' acquired via JDNI " +- + "does not implement the required interfaces, class=" +- + repoObject.getClass().getName()); +- } +- +- } catch (Throwable t) { +- log.info("Unable to acquire Repository '" + repositoryName +- + "' via JNDI, context=" + jndiContext, t); +- } finally { +- Thread.currentThread().setContextClassLoader(old); +- } +- } +- +- if (result == null) { +- if (repositoryName == null +- || !repositoryName.startsWith(RMI_PREFIX)) { +- log.info("Repository name does not start with '" + RMI_PREFIX +- + "', not trying RMI"); +- } else { +- try { +- tried += "RMI "; +- log.debug("Trying to acquire Repository '" + repositoryName +- + "' via RMI"); +- ClientRepositoryFactory crf = getClientRepositoryFactory(); +- result = crf.getRepository(repositoryName); +- log.info("Acquired Repository '" + repositoryName +- + "' via RMI"); +- } catch (Throwable t) { +- log.info("Unable to acquire Repository '" + repositoryName +- + "' via RMI", t); +- } +- } +- } +- +- if (result == null) { +- log.info("Unable to acquire Repository '" + repositoryName +- + "', tried " + tried); +- } +- +- return result; ++ throw new UnsupportedOperationException("Repository access via JNDI-context is no longer supported."); + } + + /** +@@ -142,39 +76,12 @@ public class RepositoryAccessor { + * + * + * @return the repository for the given url +- * @throws NullPointerException If url is null. ++ * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} ++ * @deprecated No longer supported + */ ++ @Deprecated + public Repository getRepositoryFromURL(String url) { +- +- if (url == null) { +- throw new NullPointerException("url"); +- } +- +- if (url.startsWith(JNDI_PREFIX)) { +- // Parse JNDI URL to extract repository name and context +- String name = null; +- final Hashtable jndiContext = new Hashtable(); +- final String urlNoPrefix = url.substring(JNDI_PREFIX.length()); +- final int colonPos = urlNoPrefix.indexOf(':'); +- if (colonPos < 0) { +- name = urlNoPrefix; +- } else { +- name = urlNoPrefix.substring(0, colonPos); +- for (String entryStr : urlNoPrefix.substring(colonPos + 1).split( +- ",")) { +- final String[] entry = entryStr.split("="); +- if (entry.length == 2) { +- jndiContext.put(entry[0], entry[1]); +- } +- } +- } +- +- return getRepository(name, jndiContext); +- +- } +- +- // Use URL as is +- return getRepository(url, null); ++ throw new UnsupportedOperationException("Repository access via URL is no longer supported."); + } + + /** +@@ -188,9 +95,12 @@ public class RepositoryAccessor { + * + * @return the LocalAdapterFactory used to convert Jackrabbit + * JCR RMI remote objects to local JCR API objects. ++ * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} ++ * @deprecated No longer supported + */ ++ @Deprecated + protected LocalAdapterFactory getLocalAdapterFactory() { +- return new ClientAdapterFactory(); ++ throw new UnsupportedOperationException("Repository access via RMI is no longer supported."); + } + + /** +@@ -206,8 +116,11 @@ public class RepositoryAccessor { + * + * @return the ClientRepositoryFactory to access the remote + * JCR repository over RMI. ++ * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} ++ * @deprecated No longer supported + */ ++ @Deprecated + protected ClientRepositoryFactory getClientRepositoryFactory() { +- return new ClientRepositoryFactory(getLocalAdapterFactory()); ++ throw new UnsupportedOperationException("Repository access via RMI is no longer supported."); + } + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..f908e015f0c441518a274426caee132437e8adc2 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/post_context.md @@ -0,0 +1,132 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java` (changed lines (21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 36, 40, 58, 59, 61, 64, 79, 80, 82, 84, 98, 99, 101, 103, 119, 120, 122, 124)) + +```java +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.sling.jcr.base.util; + +import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory; +import org.apache.jackrabbit.rmi.client.LocalAdapterFactory; + +import javax.jcr.Repository; +import java.util.Hashtable; + +/** + * Access a Repository via JNDI or RMI. + * + * @deprecated No longer supported + */ +@Deprecated +public class RepositoryAccessor { + + /** Prefix for RMI Repository URLs */ + @Deprecated + public static final String RMI_PREFIX = "rmi://"; + + /** Prefix for JNDI Repository URLs */ + @Deprecated + public static final String JNDI_PREFIX = "jndi://"; + + /** + * Name of the property that the jcr client and server bundles to override + * their default configuration settings and connect to the specified + * repository instead (SLING-254 and SLING-260) + */ + public static final String REPOSITORY_URL_OVERRIDE_PROPERTY = "sling.repository.url"; + + /** + * First try to access the Repository via JNDI (unless jndiContext is null), + * and if not successful try RMI. + * + * @param repositoryName JNDI name or RMI URL (must start with "rmi://") of + * the Repository + * @param jndiContext if null, JNDI is not tried + * @return a Repository, or null if not found + * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} + * @deprecated No longer supported + */ + @Deprecated + public Repository getRepository(String repositoryName, + Hashtable jndiContext) { + throw new UnsupportedOperationException("Repository access via JNDI-context is no longer supported."); + } + + /** + * Acquire a Repository from the given URL + * + * @param url for RMI, an RMI URL. For JNDI, "jndi://", followed by the JNDI + * repository name, followed by a colon and a comma-separated + * list of JNDI context values, for example: + * + *

+     *      jndi://jackrabbit:java.naming.factory.initial=org.SomeClass,java.naming.provider.url=http://foo.com
+     * 
+ * + * @return the repository for the given url + * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} + * @deprecated No longer supported + */ + @Deprecated + public Repository getRepositoryFromURL(String url) { + throw new UnsupportedOperationException("Repository access via URL is no longer supported."); + } + + /** + * Returns the LocalAdapterFactory used to convert Jackrabbit + * JCR RMI remote objects to local JCR API objects. + *

+ * This method returns an instance of the + * JackrabbitClientAdapterFactory which allows accessing + * Jackrabbit (or Jackrabbit-based) repositories over RMI. Extensions of + * this class may overwrite this method to use a different implementation. + * + * @return the LocalAdapterFactory used to convert Jackrabbit + * JCR RMI remote objects to local JCR API objects. + * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} + * @deprecated No longer supported + */ + @Deprecated + protected LocalAdapterFactory getLocalAdapterFactory() { + throw new UnsupportedOperationException("Repository access via RMI is no longer supported."); + } + + /** + * Returns the ClientRepositoryFactory to access the remote + * JCR repository over RMI. + *

+ * This method creates an instance of the + * ClientRepositoryFactory class initialized with the + * LocalAdapterFactory returned from the + * {@link #getLocalAdapterFactory()} method. Extensions may overwrite this + * method to return an extension of the Jackrabbit JCR RMI + * ClientRepositoryFactory class. + * + * @return the ClientRepositoryFactory to access the remote + * JCR repository over RMI. + * @throws UnsupportedOperationException Always throws {@code UnsupportedOperationException} + * @deprecated No longer supported + */ + @Deprecated + protected ClientRepositoryFactory getClientRepositoryFactory() { + throw new UnsupportedOperationException("Repository access via RMI is no longer supported."); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..b121693dbf1c561704329de9813d63b2498ae832 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/pre_context.md @@ -0,0 +1,219 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java` (changed lines (21, 22, 23, 24, 25, 26, 29, 30, 31, 33, 34, 35, 38, 41, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 191, 192, 193, 194, 209, 210, 211, 212)) + +```java +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.sling.jcr.base.util; + +import java.util.Hashtable; + +import javax.jcr.Repository; +import javax.naming.InitialContext; + +import org.apache.jackrabbit.rmi.client.ClientAdapterFactory; +import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory; +import org.apache.jackrabbit.rmi.client.LocalAdapterFactory; +import org.apache.jackrabbit.rmi.remote.RemoteRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** Access a Repository via JNDI or RMI. */ +public class RepositoryAccessor { + private final Logger log = LoggerFactory.getLogger(getClass()); + + /** Prefix for RMI Repository URLs */ + public static final String RMI_PREFIX = "rmi://"; + + /** Prefix for JNDI Repository URLs */ + public static final String JNDI_PREFIX = "jndi://"; + + /** + * Name of the property that the jcr client and server bundles to override + * their default configuration settings and connect to the specified + * repository instead (SLING-254 and SLING-260) + */ + public static final String REPOSITORY_URL_OVERRIDE_PROPERTY = "sling.repository.url"; + + /** + * First try to access the Repository via JNDI (unless jndiContext is null), + * and if not successful try RMI. + * + * @param repositoryName JNDI name or RMI URL (must start with "rmi://") of + * the Repository + * @param jndiContext if null, JNDI is not tried + * @return a Repository, or null if not found + */ + public Repository getRepository(String repositoryName, + Hashtable jndiContext) { + + Repository result = null; + String tried = ""; + + if (jndiContext == null || jndiContext.size() == 0) { + log.info("jndiContext is null or empty, not trying JNDI"); + } else { + log.debug("Trying to acquire Repository '" + repositoryName + + "' via JNDI, context=" + jndiContext); + tried += "JNDI "; + final ClassLoader old = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader( + this.getClass().getClassLoader()); + InitialContext initialContext = new InitialContext(jndiContext); + Object repoObject = initialContext.lookup(repositoryName); + if (repoObject instanceof Repository) { + result = (Repository) repoObject; + log.info("Acquired Repository '" + repositoryName + + "' via JNDI"); + + } else if (repoObject instanceof RemoteRepository) { + RemoteRepository remoteRepo = (RemoteRepository) repoObject; + LocalAdapterFactory laf = getLocalAdapterFactory(); + result = laf.getRepository(remoteRepo); + log.info("Acquired RemoteRepository '" + repositoryName + + "' via JNDI"); + + } else { + log.info("Repository '" + repositoryName + + "' acquired via JDNI " + + "does not implement the required interfaces, class=" + + repoObject.getClass().getName()); + } + + } catch (Throwable t) { + log.info("Unable to acquire Repository '" + repositoryName + + "' via JNDI, context=" + jndiContext, t); + } finally { + Thread.currentThread().setContextClassLoader(old); + } + } + + if (result == null) { + if (repositoryName == null + || !repositoryName.startsWith(RMI_PREFIX)) { + log.info("Repository name does not start with '" + RMI_PREFIX + + "', not trying RMI"); + } else { + try { + tried += "RMI "; + log.debug("Trying to acquire Repository '" + repositoryName + + "' via RMI"); + ClientRepositoryFactory crf = getClientRepositoryFactory(); + result = crf.getRepository(repositoryName); + log.info("Acquired Repository '" + repositoryName + + "' via RMI"); + } catch (Throwable t) { + log.info("Unable to acquire Repository '" + repositoryName + + "' via RMI", t); + } + } + } + + if (result == null) { + log.info("Unable to acquire Repository '" + repositoryName + + "', tried " + tried); + } + + return result; + } + + /** + * Acquire a Repository from the given URL + * + * @param url for RMI, an RMI URL. For JNDI, "jndi://", followed by the JNDI + * repository name, followed by a colon and a comma-separated + * list of JNDI context values, for example: + * + *

+     *      jndi://jackrabbit:java.naming.factory.initial=org.SomeClass,java.naming.provider.url=http://foo.com
+     * 
+ * + * @return the repository for the given url + * @throws NullPointerException If url is null. + */ + public Repository getRepositoryFromURL(String url) { + + if (url == null) { + throw new NullPointerException("url"); + } + + if (url.startsWith(JNDI_PREFIX)) { + // Parse JNDI URL to extract repository name and context + String name = null; + final Hashtable jndiContext = new Hashtable(); + final String urlNoPrefix = url.substring(JNDI_PREFIX.length()); + final int colonPos = urlNoPrefix.indexOf(':'); + if (colonPos < 0) { + name = urlNoPrefix; + } else { + name = urlNoPrefix.substring(0, colonPos); + for (String entryStr : urlNoPrefix.substring(colonPos + 1).split( + ",")) { + final String[] entry = entryStr.split("="); + if (entry.length == 2) { + jndiContext.put(entry[0], entry[1]); + } + } + } + + return getRepository(name, jndiContext); + + } + + // Use URL as is + return getRepository(url, null); + } + + /** + * Returns the LocalAdapterFactory used to convert Jackrabbit + * JCR RMI remote objects to local JCR API objects. + *

+ * This method returns an instance of the + * JackrabbitClientAdapterFactory which allows accessing + * Jackrabbit (or Jackrabbit-based) repositories over RMI. Extensions of + * this class may overwrite this method to use a different implementation. + * + * @return the LocalAdapterFactory used to convert Jackrabbit + * JCR RMI remote objects to local JCR API objects. + */ + protected LocalAdapterFactory getLocalAdapterFactory() { + return new ClientAdapterFactory(); + } + + /** + * Returns the ClientRepositoryFactory to access the remote + * JCR repository over RMI. + *

+ * This method creates an instance of the + * ClientRepositoryFactory class initialized with the + * LocalAdapterFactory returned from the + * {@link #getLocalAdapterFactory()} method. Extensions may overwrite this + * method to return an extension of the Jackrabbit JCR RMI + * ClientRepositoryFactory class. + * + * @return the ClientRepositoryFactory to access the remote + * JCR repository over RMI. + */ + protected ClientRepositoryFactory getClientRepositoryFactory() { + return new ClientRepositoryFactory(getLocalAdapterFactory()); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8c2ca5de0ea325a2450499ededca8712e0cd76cd --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-149c5507d76b198944c3", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-149c5507d76b198944c3", + "project_id": "morefixes__apache__sling-org-apache-sling-jcr-base", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java" + ], + "patch_units": { + "before": [ + "src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java" + ], + "after": [ + "src/main/java/org/apache/sling/jcr/base/util/RepositoryAccessor.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/973dc30b523d6172032bda9bceda2cb0fd7738cda5197f0e2f70c6d5b67967f0/database", + "cache_key": "973dc30b523d6172032bda9bceda2cb0fd7738cda5197f0e2f70c6d5b67967f0", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/8b5f6c4ac19648f41e0292dd0cc5908ffcc534ca572a551d7105dfe9e64cb5a6/database", + "cache_key": "8b5f6c4ac19648f41e0292dd0cc5908ffcc534ca572a551d7105dfe9e64cb5a6", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/99a40311a52f56827020fc5aea9ea810feb48fd4a0ba521cf8a072701132eb45/database", + "cache_key": "99a40311a52f56827020fc5aea9ea810feb48fd4a0ba521cf8a072701132eb45", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-149c5507d76b198944c3/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-149c5507d76b198944c3/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-149c5507d76b198944c3/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..de38b762ef19438e45634aae4b7e7cc3370b0e2b --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/patch.diff @@ -0,0 +1,46 @@ +diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java +index dcf5bb83..67faebcc 100644 +--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java ++++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java +@@ -1,7 +1,7 @@ + package com.xxl.job.admin.controller; + +-import com.xxl.job.admin.core.exception.XxlJobException; + import com.xxl.job.admin.core.complete.XxlJobCompleter; ++import com.xxl.job.admin.core.exception.XxlJobException; + import com.xxl.job.admin.core.model.XxlJobGroup; + import com.xxl.job.admin.core.model.XxlJobInfo; + import com.xxl.job.admin.core.model.XxlJobLog; +@@ -129,22 +129,26 @@ public class JobLogController { + + model.addAttribute("triggerCode", jobLog.getTriggerCode()); + model.addAttribute("handleCode", jobLog.getHandleCode()); +- model.addAttribute("executorAddress", jobLog.getExecutorAddress()); +- model.addAttribute("triggerTime", jobLog.getTriggerTime().getTime()); + model.addAttribute("logId", jobLog.getId()); + return "joblog/joblog.detail"; + } + + @RequestMapping("/logDetailCat") + @ResponseBody +- public ReturnT logDetailCat(String executorAddress, long triggerTime, long logId, int fromLineNum){ ++ public ReturnT logDetailCat(long logId, int fromLineNum){ + try { +- ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(executorAddress); +- ReturnT logResult = executorBiz.log(new LogParam(triggerTime, logId, fromLineNum)); ++ // valid ++ XxlJobLog jobLog = xxlJobLogDao.load(logId); // todo, need to improve performance ++ if (jobLog == null) { ++ return new ReturnT(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_logid_unvalid")); ++ } ++ ++ // log cat ++ ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(jobLog.getExecutorAddress()); ++ ReturnT logResult = executorBiz.log(new LogParam(jobLog.getTriggerTime().getTime(), logId, fromLineNum)); + + // is end + if (logResult.getContent()!=null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) { +- XxlJobLog jobLog = xxlJobLogDao.load(logId); + if (jobLog.getHandleCode() > 0) { + logResult.getContent().setEnd(true); + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..34d2938a7eb80003369cfc78d56d413cd7204af2 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/post_context.md @@ -0,0 +1,243 @@ +# Patch-overlapping Java context after the fix + +## `xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java` (changed lines (3, 4, 132, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 152)) + +```java +package com.xxl.job.admin.controller; + +import com.xxl.job.admin.core.complete.XxlJobCompleter; +import com.xxl.job.admin.core.exception.XxlJobException; +import com.xxl.job.admin.core.model.XxlJobGroup; +import com.xxl.job.admin.core.model.XxlJobInfo; +import com.xxl.job.admin.core.model.XxlJobLog; +import com.xxl.job.admin.core.scheduler.XxlJobScheduler; +import com.xxl.job.admin.core.util.I18nUtil; +import com.xxl.job.admin.dao.XxlJobGroupDao; +import com.xxl.job.admin.dao.XxlJobInfoDao; +import com.xxl.job.admin.dao.XxlJobLogDao; +import com.xxl.job.core.biz.ExecutorBiz; +import com.xxl.job.core.biz.model.KillParam; +import com.xxl.job.core.biz.model.LogParam; +import com.xxl.job.core.biz.model.LogResult; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.util.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * index controller + * @author xuxueli 2015-12-19 16:13:16 + */ +@Controller +@RequestMapping("/joblog") +public class JobLogController { + private static Logger logger = LoggerFactory.getLogger(JobLogController.class); + + @Resource + private XxlJobGroupDao xxlJobGroupDao; + @Resource + public XxlJobInfoDao xxlJobInfoDao; + @Resource + public XxlJobLogDao xxlJobLogDao; + + @RequestMapping + public String index(HttpServletRequest request, Model model, @RequestParam(required = false, defaultValue = "0") Integer jobId) { + + // 执行器列表 + List jobGroupList_all = xxlJobGroupDao.findAll(); + + // filter group + List jobGroupList = JobInfoController.filterJobGroupByRole(request, jobGroupList_all); + if (jobGroupList==null || jobGroupList.size()==0) { + throw new XxlJobException(I18nUtil.getString("jobgroup_empty")); + } + + model.addAttribute("JobGroupList", jobGroupList); + + // 任务 + if (jobId > 0) { + XxlJobInfo jobInfo = xxlJobInfoDao.loadById(jobId); + if (jobInfo == null) { + throw new RuntimeException(I18nUtil.getString("jobinfo_field_id") + I18nUtil.getString("system_unvalid")); + } + + model.addAttribute("jobInfo", jobInfo); + + // valid permission + JobInfoController.validPermission(request, jobInfo.getJobGroup()); + } + + return "joblog/joblog.index"; + } + + @RequestMapping("/getJobsByGroup") + @ResponseBody + public ReturnT> getJobsByGroup(int jobGroup){ + List list = xxlJobInfoDao.getJobsByGroup(jobGroup); + return new ReturnT>(list); + } + + @RequestMapping("/pageList") + @ResponseBody + public Map pageList(HttpServletRequest request, + @RequestParam(required = false, defaultValue = "0") int start, + @RequestParam(required = false, defaultValue = "10") int length, + int jobGroup, int jobId, int logStatus, String filterTime) { + + // valid permission + JobInfoController.validPermission(request, jobGroup); // 仅管理员支持查询全部;普通用户仅支持查询有权限的 jobGroup + + // parse param + Date triggerTimeStart = null; + Date triggerTimeEnd = null; + if (filterTime!=null && filterTime.trim().length()>0) { + String[] temp = filterTime.split(" - "); + if (temp.length == 2) { + triggerTimeStart = DateUtil.parseDateTime(temp[0]); + triggerTimeEnd = DateUtil.parseDateTime(temp[1]); + } + } + + // page query + List list = xxlJobLogDao.pageList(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); + int list_count = xxlJobLogDao.pageListCount(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); + + // package result + Map maps = new HashMap(); + maps.put("recordsTotal", list_count); // 总记录数 + maps.put("recordsFiltered", list_count); // 过滤后的总记录数 + maps.put("data", list); // 分页列表 + return maps; + } + + @RequestMapping("/logDetailPage") + public String logDetailPage(int id, Model model){ + + // base check + ReturnT logStatue = ReturnT.SUCCESS; + XxlJobLog jobLog = xxlJobLogDao.load(id); + if (jobLog == null) { + throw new RuntimeException(I18nUtil.getString("joblog_logid_unvalid")); + } + + model.addAttribute("triggerCode", jobLog.getTriggerCode()); + model.addAttribute("handleCode", jobLog.getHandleCode()); + model.addAttribute("logId", jobLog.getId()); + return "joblog/joblog.detail"; + } + + @RequestMapping("/logDetailCat") + @ResponseBody + public ReturnT logDetailCat(long logId, int fromLineNum){ + try { + // valid + XxlJobLog jobLog = xxlJobLogDao.load(logId); // todo, need to improve performance + if (jobLog == null) { + return new ReturnT(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_logid_unvalid")); + } + + // log cat + ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(jobLog.getExecutorAddress()); + ReturnT logResult = executorBiz.log(new LogParam(jobLog.getTriggerTime().getTime(), logId, fromLineNum)); + + // is end + if (logResult.getContent()!=null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) { + if (jobLog.getHandleCode() > 0) { + logResult.getContent().setEnd(true); + } + } + + return logResult; + } catch (Exception e) { + logger.error(e.getMessage(), e); + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); + } + } + + @RequestMapping("/logKill") + @ResponseBody + public ReturnT logKill(int id){ + // base check + XxlJobLog log = xxlJobLogDao.load(id); + XxlJobInfo jobInfo = xxlJobInfoDao.loadById(log.getJobId()); + if (jobInfo==null) { + return new ReturnT(500, I18nUtil.getString("jobinfo_glue_jobid_unvalid")); + } + if (ReturnT.SUCCESS_CODE != log.getTriggerCode()) { + return new ReturnT(500, I18nUtil.getString("joblog_kill_log_limit")); + } + + // request of kill + ReturnT runResult = null; + try { + ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(log.getExecutorAddress()); + runResult = executorBiz.kill(new KillParam(jobInfo.getId())); + } catch (Exception e) { + logger.error(e.getMessage(), e); + runResult = new ReturnT(500, e.getMessage()); + } + + if (ReturnT.SUCCESS_CODE == runResult.getCode()) { + log.setHandleCode(ReturnT.FAIL_CODE); + log.setHandleMsg( I18nUtil.getString("joblog_kill_log_byman")+":" + (runResult.getMsg()!=null?runResult.getMsg():"")); + log.setHandleTime(new Date()); + XxlJobCompleter.updateHandleInfoAndFinish(log); + return new ReturnT(runResult.getMsg()); + } else { + return new ReturnT(500, runResult.getMsg()); + } + } + + @RequestMapping("/clearLog") + @ResponseBody + public ReturnT clearLog(int jobGroup, int jobId, int type){ + + Date clearBeforeTime = null; + int clearBeforeNum = 0; + if (type == 1) { + clearBeforeTime = DateUtil.addMonths(new Date(), -1); // 清理一个月之前日志数据 + } else if (type == 2) { + clearBeforeTime = DateUtil.addMonths(new Date(), -3); // 清理三个月之前日志数据 + } else if (type == 3) { + clearBeforeTime = DateUtil.addMonths(new Date(), -6); // 清理六个月之前日志数据 + } else if (type == 4) { + clearBeforeTime = DateUtil.addYears(new Date(), -1); // 清理一年之前日志数据 + } else if (type == 5) { + clearBeforeNum = 1000; // 清理一千条以前日志数据 + } else if (type == 6) { + clearBeforeNum = 10000; // 清理一万条以前日志数据 + } else if (type == 7) { + clearBeforeNum = 30000; // 清理三万条以前日志数据 + } else if (type == 8) { + clearBeforeNum = 100000; // 清理十万条以前日志数据 + } else if (type == 9) { + clearBeforeNum = 0; // 清理所有日志数据 + } else { + return new ReturnT(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_clean_type_unvalid")); + } + + List logIds = null; + do { + logIds = xxlJobLogDao.findClearLogIds(jobGroup, jobId, clearBeforeTime, clearBeforeNum, 1000); + if (logIds!=null && logIds.size()>0) { + xxlJobLogDao.clearLog(logIds); + } + } while (logIds!=null && logIds.size()>0); + + return ReturnT.SUCCESS; + } + +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..07db6da0ce19b2af3cf2bc480b6f7be79302226d --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/pre_context.md @@ -0,0 +1,239 @@ +# Patch-overlapping Java context before the fix + +## `xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java` (changed lines (3, 5, 132, 133, 140, 141, 142, 143, 144, 147)) + +```java +package com.xxl.job.admin.controller; + +import com.xxl.job.admin.core.exception.XxlJobException; +import com.xxl.job.admin.core.complete.XxlJobCompleter; +import com.xxl.job.admin.core.model.XxlJobGroup; +import com.xxl.job.admin.core.model.XxlJobInfo; +import com.xxl.job.admin.core.model.XxlJobLog; +import com.xxl.job.admin.core.scheduler.XxlJobScheduler; +import com.xxl.job.admin.core.util.I18nUtil; +import com.xxl.job.admin.dao.XxlJobGroupDao; +import com.xxl.job.admin.dao.XxlJobInfoDao; +import com.xxl.job.admin.dao.XxlJobLogDao; +import com.xxl.job.core.biz.ExecutorBiz; +import com.xxl.job.core.biz.model.KillParam; +import com.xxl.job.core.biz.model.LogParam; +import com.xxl.job.core.biz.model.LogResult; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.util.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * index controller + * @author xuxueli 2015-12-19 16:13:16 + */ +@Controller +@RequestMapping("/joblog") +public class JobLogController { + private static Logger logger = LoggerFactory.getLogger(JobLogController.class); + + @Resource + private XxlJobGroupDao xxlJobGroupDao; + @Resource + public XxlJobInfoDao xxlJobInfoDao; + @Resource + public XxlJobLogDao xxlJobLogDao; + + @RequestMapping + public String index(HttpServletRequest request, Model model, @RequestParam(required = false, defaultValue = "0") Integer jobId) { + + // 执行器列表 + List jobGroupList_all = xxlJobGroupDao.findAll(); + + // filter group + List jobGroupList = JobInfoController.filterJobGroupByRole(request, jobGroupList_all); + if (jobGroupList==null || jobGroupList.size()==0) { + throw new XxlJobException(I18nUtil.getString("jobgroup_empty")); + } + + model.addAttribute("JobGroupList", jobGroupList); + + // 任务 + if (jobId > 0) { + XxlJobInfo jobInfo = xxlJobInfoDao.loadById(jobId); + if (jobInfo == null) { + throw new RuntimeException(I18nUtil.getString("jobinfo_field_id") + I18nUtil.getString("system_unvalid")); + } + + model.addAttribute("jobInfo", jobInfo); + + // valid permission + JobInfoController.validPermission(request, jobInfo.getJobGroup()); + } + + return "joblog/joblog.index"; + } + + @RequestMapping("/getJobsByGroup") + @ResponseBody + public ReturnT> getJobsByGroup(int jobGroup){ + List list = xxlJobInfoDao.getJobsByGroup(jobGroup); + return new ReturnT>(list); + } + + @RequestMapping("/pageList") + @ResponseBody + public Map pageList(HttpServletRequest request, + @RequestParam(required = false, defaultValue = "0") int start, + @RequestParam(required = false, defaultValue = "10") int length, + int jobGroup, int jobId, int logStatus, String filterTime) { + + // valid permission + JobInfoController.validPermission(request, jobGroup); // 仅管理员支持查询全部;普通用户仅支持查询有权限的 jobGroup + + // parse param + Date triggerTimeStart = null; + Date triggerTimeEnd = null; + if (filterTime!=null && filterTime.trim().length()>0) { + String[] temp = filterTime.split(" - "); + if (temp.length == 2) { + triggerTimeStart = DateUtil.parseDateTime(temp[0]); + triggerTimeEnd = DateUtil.parseDateTime(temp[1]); + } + } + + // page query + List list = xxlJobLogDao.pageList(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); + int list_count = xxlJobLogDao.pageListCount(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); + + // package result + Map maps = new HashMap(); + maps.put("recordsTotal", list_count); // 总记录数 + maps.put("recordsFiltered", list_count); // 过滤后的总记录数 + maps.put("data", list); // 分页列表 + return maps; + } + + @RequestMapping("/logDetailPage") + public String logDetailPage(int id, Model model){ + + // base check + ReturnT logStatue = ReturnT.SUCCESS; + XxlJobLog jobLog = xxlJobLogDao.load(id); + if (jobLog == null) { + throw new RuntimeException(I18nUtil.getString("joblog_logid_unvalid")); + } + + model.addAttribute("triggerCode", jobLog.getTriggerCode()); + model.addAttribute("handleCode", jobLog.getHandleCode()); + model.addAttribute("executorAddress", jobLog.getExecutorAddress()); + model.addAttribute("triggerTime", jobLog.getTriggerTime().getTime()); + model.addAttribute("logId", jobLog.getId()); + return "joblog/joblog.detail"; + } + + @RequestMapping("/logDetailCat") + @ResponseBody + public ReturnT logDetailCat(String executorAddress, long triggerTime, long logId, int fromLineNum){ + try { + ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(executorAddress); + ReturnT logResult = executorBiz.log(new LogParam(triggerTime, logId, fromLineNum)); + + // is end + if (logResult.getContent()!=null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) { + XxlJobLog jobLog = xxlJobLogDao.load(logId); + if (jobLog.getHandleCode() > 0) { + logResult.getContent().setEnd(true); + } + } + + return logResult; + } catch (Exception e) { + logger.error(e.getMessage(), e); + return new ReturnT(ReturnT.FAIL_CODE, e.getMessage()); + } + } + + @RequestMapping("/logKill") + @ResponseBody + public ReturnT logKill(int id){ + // base check + XxlJobLog log = xxlJobLogDao.load(id); + XxlJobInfo jobInfo = xxlJobInfoDao.loadById(log.getJobId()); + if (jobInfo==null) { + return new ReturnT(500, I18nUtil.getString("jobinfo_glue_jobid_unvalid")); + } + if (ReturnT.SUCCESS_CODE != log.getTriggerCode()) { + return new ReturnT(500, I18nUtil.getString("joblog_kill_log_limit")); + } + + // request of kill + ReturnT runResult = null; + try { + ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(log.getExecutorAddress()); + runResult = executorBiz.kill(new KillParam(jobInfo.getId())); + } catch (Exception e) { + logger.error(e.getMessage(), e); + runResult = new ReturnT(500, e.getMessage()); + } + + if (ReturnT.SUCCESS_CODE == runResult.getCode()) { + log.setHandleCode(ReturnT.FAIL_CODE); + log.setHandleMsg( I18nUtil.getString("joblog_kill_log_byman")+":" + (runResult.getMsg()!=null?runResult.getMsg():"")); + log.setHandleTime(new Date()); + XxlJobCompleter.updateHandleInfoAndFinish(log); + return new ReturnT(runResult.getMsg()); + } else { + return new ReturnT(500, runResult.getMsg()); + } + } + + @RequestMapping("/clearLog") + @ResponseBody + public ReturnT clearLog(int jobGroup, int jobId, int type){ + + Date clearBeforeTime = null; + int clearBeforeNum = 0; + if (type == 1) { + clearBeforeTime = DateUtil.addMonths(new Date(), -1); // 清理一个月之前日志数据 + } else if (type == 2) { + clearBeforeTime = DateUtil.addMonths(new Date(), -3); // 清理三个月之前日志数据 + } else if (type == 3) { + clearBeforeTime = DateUtil.addMonths(new Date(), -6); // 清理六个月之前日志数据 + } else if (type == 4) { + clearBeforeTime = DateUtil.addYears(new Date(), -1); // 清理一年之前日志数据 + } else if (type == 5) { + clearBeforeNum = 1000; // 清理一千条以前日志数据 + } else if (type == 6) { + clearBeforeNum = 10000; // 清理一万条以前日志数据 + } else if (type == 7) { + clearBeforeNum = 30000; // 清理三万条以前日志数据 + } else if (type == 8) { + clearBeforeNum = 100000; // 清理十万条以前日志数据 + } else if (type == 9) { + clearBeforeNum = 0; // 清理所有日志数据 + } else { + return new ReturnT(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_clean_type_unvalid")); + } + + List logIds = null; + do { + logIds = xxlJobLogDao.findClearLogIds(jobGroup, jobId, clearBeforeTime, clearBeforeNum, 1000); + if (logIds!=null && logIds.size()>0) { + xxlJobLogDao.clearLog(logIds); + } + } while (logIds!=null && logIds.size()>0); + + return ReturnT.SUCCESS; + } + +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8d4993ef8bdac2486c2f2dcec1f9db2b4d5747f9 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-19d7bda86b839e7fc493", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-19d7bda86b839e7fc493", + "project_id": "morefixes__xuxueli__xxl-job", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java" + ], + "patch_units": { + "before": [ + "xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java" + ], + "after": [ + "xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/d6be94d4f161181116212a30be8d9addee217190df6282b76137f5b047bb312c/database", + "cache_key": "d6be94d4f161181116212a30be8d9addee217190df6282b76137f5b047bb312c", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/6309ca52ed49821dad4191b599c8d55604bbec86743d0f138a145ea649cf723b/database", + "cache_key": "6309ca52ed49821dad4191b599c8d55604bbec86743d0f138a145ea649cf723b", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/d0d203a4b762f36f6af7445faeda3efb05f818d6fe79237c1d45d75d36c2a04d/database", + "cache_key": "d0d203a4b762f36f6af7445faeda3efb05f818d6fe79237c1d45d75d36c2a04d", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-19d7bda86b839e7fc493/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-19d7bda86b839e7fc493/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-19d7bda86b839e7fc493/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..3da6f7c863df1748537e5fd0657ae5f5cbd82a19 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/patch.diff @@ -0,0 +1,449 @@ +diff --git a/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/ConnectionIdChannelMap.java b/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/ConnectionIdChannelMap.java +new file mode 100644 +index 0000000..eab9336 +--- /dev/null ++++ b/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/ConnectionIdChannelMap.java +@@ -0,0 +1,100 @@ ++/* ++ * Copyright 2025 The Netty Project ++ * ++ * The Netty Project licenses this file to you under the Apache License, ++ * version 2.0 (the "License"); you may not use this file except in compliance ++ * with the License. You may obtain a copy of the License at: ++ * ++ * https://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ++ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ++ * License for the specific language governing permissions and limitations ++ * under the License. ++ */ ++package io.netty.incubator.codec.quic; ++ ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ ++import java.nio.ByteBuffer; ++import java.security.SecureRandom; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Objects; ++ ++/** ++ * We use a custom hash that uses SipHash 1-3 to prevent ++ * Hash Denial-of-Service Attacks. ++ */ ++final class ConnectionIdChannelMap { ++ private static final SecureRandom random = new SecureRandom(); ++ ++ private final Map channelMap = new HashMap<>(); ++ private final SipHash sipHash; ++ ++ ConnectionIdChannelMap() { ++ byte[] seed = new byte[SipHash.SEED_LENGTH]; ++ random.nextBytes(seed); ++ // Use SipHash 1-3 for now which is also what rust is using by default. ++ sipHash = new SipHash(1, 3, seed); ++ } ++ ++ private ConnectionIdKey key(ByteBuffer cid) { ++ long hash = sipHash.macHash(cid); ++ return new ConnectionIdKey(hash, cid); ++ } ++ ++ @Nullable ++ QuicheQuicChannel put(ByteBuffer cid, QuicheQuicChannel channel) { ++ return channelMap.put(key(cid), channel); ++ } ++ ++ @Nullable ++ QuicheQuicChannel remove(ByteBuffer cid) { ++ return channelMap.remove(key(cid)); ++ } ++ ++ @Nullable ++ QuicheQuicChannel get(ByteBuffer cid) { ++ return channelMap.get(key(cid)); ++ } ++ ++ void clear() { ++ channelMap.clear(); ++ } ++ ++ private static final class ConnectionIdKey implements Comparable { ++ private final long hash; ++ private final ByteBuffer key; ++ ++ ConnectionIdKey(long hash, ByteBuffer key) { ++ this.hash = hash; ++ this.key = key; ++ } ++ ++ @Override ++ public boolean equals(Object o) { ++ if (this == o) { ++ return true; ++ } ++ if (o == null || getClass() != o.getClass()) { ++ return false; ++ } ++ ConnectionIdKey that = (ConnectionIdKey) o; ++ return hash == that.hash && Objects.equals(key, that.key); ++ } ++ ++ @Override ++ public int hashCode() { ++ return (int) hash; ++ } ++ ++ @Override ++ public int compareTo(@NotNull ConnectionIdChannelMap.ConnectionIdKey o) { ++ int result = Long.compare(hash, o.hash); ++ return result != 0 ? result : key.compareTo(o.key); ++ } ++ } ++} +diff --git a/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java b/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java +index ae4807b..082fea8 100644 +--- a/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java ++++ b/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java +@@ -29,9 +29,7 @@ import java.net.InetSocketAddress; + import java.net.SocketAddress; + import java.nio.ByteBuffer; + import java.util.ArrayDeque; +-import java.util.HashMap; + import java.util.HashSet; +-import java.util.Map; + import java.util.Queue; + import java.util.Set; + import java.util.function.Consumer; +@@ -43,7 +41,7 @@ import static io.netty.incubator.codec.quic.Quiche.allocateNativeOrder; + */ + abstract class QuicheQuicCodec extends ChannelDuplexHandler { + private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(QuicheQuicCodec.class); +- private final Map connectionIdToChannel = new HashMap<>(); ++ private final ConnectionIdChannelMap connectionIdToChannel = new ConnectionIdChannelMap(); + private final Set channels = new HashSet<>(); + private final Queue needsFireChannelReadComplete = new ArrayDeque<>(); + private final Queue delayedRemoval = new ArrayDeque<>(); +diff --git a/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/SipHash.java b/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/SipHash.java +new file mode 100644 +index 0000000..86291a6 +--- /dev/null ++++ b/codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/SipHash.java +@@ -0,0 +1,150 @@ ++/* ++ * Copyright 2025 The Netty Project ++ * ++ * The Netty Project licenses this file to you under the Apache License, ++ * version 2.0 (the "License"); you may not use this file except in compliance ++ * with the License. You may obtain a copy of the License at: ++ * ++ * https://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ++ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ++ * License for the specific language governing permissions and limitations ++ * under the License. ++ */ ++package io.netty.incubator.codec.quic; ++ ++import io.netty.util.internal.ObjectUtil; ++ ++import java.nio.ByteBuffer; ++import java.nio.ByteOrder; ++ ++/** ++ * Siphash implementation. ++ */ ++final class SipHash { ++ ++ static final int SEED_LENGTH = 16; ++ ++ // Make this class allocation free as soon as its constructed. ++ private final int compressionRounds; ++ private final int finalizationRounds; ++ ++ // As specified in https://www.aumasson.jp/siphash/siphash.pdf ++ private static final long INITIAL_STATE_V0 = 0x736f6d6570736575L; // "somepseu" ++ private static final long INITIAL_STATE_V1 = 0x646f72616e646f6dL; // "dorandom" ++ private static final long INITIAL_STATE_V2 = 0x6c7967656e657261L; // "lygenera" ++ private static final long INITIAL_STATE_V3 = 0x7465646279746573L; // "tedbytes" ++ ++ private final long initialStateV0; ++ private final long initialStateV1; ++ private final long initialStateV2; ++ private final long initialStateV3; ++ ++ private long v0; ++ private long v1; ++ private long v2; ++ private long v3; ++ ++ SipHash(int compressionRounds, int finalizationRounds, byte[] seed) { ++ if (seed.length != SEED_LENGTH) { ++ throw new IllegalArgumentException("seed must be of length " + SEED_LENGTH); ++ } ++ this.compressionRounds = ObjectUtil.checkPositive(compressionRounds, "compressionRounds"); ++ this.finalizationRounds = ObjectUtil.checkPositive(finalizationRounds, "finalizationRounds"); ++ ++ // Wrap the seed to extract two longs that will be used to generate the initial state. ++ // Use little-endian as in the paper. ++ ByteBuffer keyBuffer = ByteBuffer.wrap(seed).order(ByteOrder.LITTLE_ENDIAN); ++ final long k0 = keyBuffer.getLong(); ++ final long k1 = keyBuffer.getLong(); ++ ++ initialStateV0 = INITIAL_STATE_V0 ^ k0; ++ initialStateV1 = INITIAL_STATE_V1 ^ k1; ++ initialStateV2 = INITIAL_STATE_V2 ^ k0; ++ initialStateV3 = INITIAL_STATE_V3 ^ k1; ++ } ++ ++ long macHash(ByteBuffer input) { ++ v0 = initialStateV0; ++ v1 = initialStateV1; ++ v2 = initialStateV2; ++ v3 = initialStateV3; ++ int remaining = input.remaining(); ++ int position = input.position(); ++ int len = remaining - (remaining % Long.BYTES); ++ boolean needsReverse = input.order() == ByteOrder.BIG_ENDIAN; ++ for (int offset = position; offset < len; offset += Long.BYTES) { ++ long m = input.getLong(offset); ++ if (needsReverse) { ++ // We use little-endian as in the paper. ++ m = Long.reverseBytes(m); ++ } ++ v3 ^= m; ++ for (int i = 0; i < compressionRounds; i++) { ++ sipround(); ++ } ++ v0 ^= m; ++ } ++ ++ // Get last bits. ++ final int left = remaining & (Long.BYTES - 1); ++ long b = (long) remaining << 56; ++ assert left < Long.BYTES; ++ switch (left) { ++ case 7: ++ b |= ((long) input.get(position + len + 6) << 48); ++ case 6: ++ b |= ((long) input.get(position + len + 5) << 40); ++ case 5: ++ b |= ((long) input.get(position + len + 4) << 32); ++ case 4: ++ b |= ((long) input.get(position + len + 3) << 24); ++ case 3: ++ b |= ((long) input.get(position + len + 2) << 16); ++ case 2: ++ b |= ((long) input.get(position + len + 1) << 8); ++ case 1: ++ b |= input.get(position + len); ++ break; ++ case 0: ++ break; ++ default: ++ throw new IllegalStateException("Unexpected value: " + left); ++ } ++ ++ v3 ^= b; ++ for (int i = 0; i < compressionRounds; i++) { ++ sipround(); ++ } ++ ++ v0 ^= b; ++ v2 ^= 0xFF; ++ for (int i = 0; i < finalizationRounds; i++) { ++ sipround(); ++ } ++ ++ return v0 ^ v1 ^ v2 ^ v3; ++ } ++ ++ private void sipround() { ++ v0 += v1; ++ v2 += v3; ++ v1 = Long.rotateLeft(v1, 13); ++ v3 = Long.rotateLeft(v3, 16); ++ v1 ^= v0; ++ v3 ^= v2; ++ ++ v0 = Long.rotateLeft(v0, 32); ++ ++ v2 += v1; ++ v0 += v3; ++ v1 = Long.rotateLeft(v1, 17); ++ v3 = Long.rotateLeft(v3, 21); ++ v1 ^= v2; ++ v3 ^= v0; ++ ++ v2 = Long.rotateLeft(v2, 32); ++ } ++} +diff --git a/codec-native-quic/src/test/java/io/netty/incubator/codec/quic/SipHashTest.java b/codec-native-quic/src/test/java/io/netty/incubator/codec/quic/SipHashTest.java +new file mode 100644 +index 0000000..930629e +--- /dev/null ++++ b/codec-native-quic/src/test/java/io/netty/incubator/codec/quic/SipHashTest.java +@@ -0,0 +1,158 @@ ++/* ++ * Copyright 2025 The Netty Project ++ * ++ * The Netty Project licenses this file to you under the Apache License, ++ * version 2.0 (the "License"); you may not use this file except in compliance ++ * with the License. You may obtain a copy of the License at: ++ * ++ * https://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ++ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ++ * License for the specific language governing permissions and limitations ++ * under the License. ++ */ ++package io.netty.incubator.codec.quic; ++ ++import org.junit.jupiter.api.Test; ++import org.junit.jupiter.params.ParameterizedTest; ++import org.junit.jupiter.params.provider.MethodSource; ++ ++import java.nio.ByteBuffer; ++import java.nio.ByteOrder; ++import java.util.concurrent.ThreadLocalRandom; ++ ++import static org.junit.jupiter.api.Assertions.assertEquals; ++import static org.junit.jupiter.api.Assertions.assertNotEquals; ++ ++public class SipHashTest { ++ ++ private static final byte[] REFERENCE_SEED = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ++ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; ++ ++ private static final int[][] REFERENCE_OUTPUT = { ++ { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, ++ { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, ++ { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, ++ { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, ++ { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, ++ { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, ++ { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, ++ { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, ++ { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, ++ { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, ++ { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, ++ { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, ++ { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, ++ { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, ++ { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, ++ { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, ++ { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, ++ { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, ++ { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, ++ { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, ++ { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, ++ { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, ++ { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, ++ { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, ++ { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, ++ { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, ++ { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, ++ { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, ++ { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, ++ { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, ++ { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, ++ { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, ++ { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, ++ { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, ++ { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, ++ { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, ++ { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, ++ { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, ++ { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, ++ { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, ++ { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, ++ { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, ++ { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, ++ { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, ++ { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, ++ { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, ++ { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, ++ { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, ++ { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, ++ { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, ++ { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, ++ { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, ++ { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, ++ { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, ++ { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, ++ { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, ++ { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, ++ { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, ++ { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, ++ { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, ++ { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, ++ { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, ++ { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, ++ { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } ++ }; ++ ++ static class ReferenceTestParam { ++ private final byte[] input; ++ private final long expectedOutput; ++ ++ ReferenceTestParam(byte[] input, long expectedOutput) { ++ this.input = input; ++ this.expectedOutput = expectedOutput; ++ } ++ } ++ ++ static ReferenceTestParam[] params() { ++ ReferenceTestParam[] testCases = new ReferenceTestParam[64]; ++ // Use little-endian as this is what is expected by the reference output. ++ ByteBuffer bb = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN); ++ for (int i = 0; i < testCases.length; ++i) { ++ byte[] input = new byte[i]; ++ for (int j = 0; j < input.length; ++j) { ++ input[j] = (byte) j; ++ } ++ for (int v: REFERENCE_OUTPUT[i]) { ++ bb.put((byte) v); ++ } ++ bb.flip(); ++ testCases[i] = new ReferenceTestParam(input, bb.getLong()); ++ bb.clear(); ++ } ++ return testCases; ++ } ++ ++ @ParameterizedTest ++ @MethodSource("params") ++ void testReferenceCases(ReferenceTestParam param ) { ++ SipHash hash = new SipHash(2, 4, REFERENCE_SEED); ++ long h = hash.macHash(ByteBuffer.wrap(param.input)); ++ assertEquals(param.expectedOutput, h); ++ } ++ ++ @Test ++ void testHash() { ++ byte[] bytes = new byte[64]; ++ ThreadLocalRandom.current().nextBytes(bytes); ++ ++ byte[] seed = new byte[16]; ++ ThreadLocalRandom.current().nextBytes(seed); ++ SipHash hash = new SipHash(1, 3, seed); ++ ++ ByteBuffer buffer = ByteBuffer.wrap(bytes); ++ ByteBuffer emptyBuffer = ByteBuffer.wrap(new byte[0]); ++ ++ long bufferHash = hash.macHash(buffer); ++ assertEquals(bufferHash, hash.macHash(buffer)); ++ ++ long emptyBufferHash = hash.macHash(emptyBuffer); ++ assertEquals(emptyBufferHash, hash.macHash(emptyBuffer)); ++ ++ assertNotEquals(bufferHash, emptyBufferHash); ++ } ++} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..f6b40c5c100ba42d016fd6d1ecab812386e48a75 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/post_context.md @@ -0,0 +1,810 @@ +# Patch-overlapping Java context after the fix + +## `codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/ConnectionIdChannelMap.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100)) + +```java +/* + * Copyright 2025 The Netty Project + * + * The Netty Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.netty.incubator.codec.quic; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.nio.ByteBuffer; +import java.security.SecureRandom; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * We use a custom hash that uses SipHash 1-3 to prevent + * Hash Denial-of-Service Attacks. + */ +final class ConnectionIdChannelMap { + private static final SecureRandom random = new SecureRandom(); + + private final Map channelMap = new HashMap<>(); + private final SipHash sipHash; + + ConnectionIdChannelMap() { + byte[] seed = new byte[SipHash.SEED_LENGTH]; + random.nextBytes(seed); + // Use SipHash 1-3 for now which is also what rust is using by default. + sipHash = new SipHash(1, 3, seed); + } + + private ConnectionIdKey key(ByteBuffer cid) { + long hash = sipHash.macHash(cid); + return new ConnectionIdKey(hash, cid); + } + + @Nullable + QuicheQuicChannel put(ByteBuffer cid, QuicheQuicChannel channel) { + return channelMap.put(key(cid), channel); + } + + @Nullable + QuicheQuicChannel remove(ByteBuffer cid) { + return channelMap.remove(key(cid)); + } + + @Nullable + QuicheQuicChannel get(ByteBuffer cid) { + return channelMap.get(key(cid)); + } + + void clear() { + channelMap.clear(); + } + + private static final class ConnectionIdKey implements Comparable { + private final long hash; + private final ByteBuffer key; + + ConnectionIdKey(long hash, ByteBuffer key) { + this.hash = hash; + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionIdKey that = (ConnectionIdKey) o; + return hash == that.hash && Objects.equals(key, that.key); + } + + @Override + public int hashCode() { + return (int) hash; + } + + @Override + public int compareTo(@NotNull ConnectionIdChannelMap.ConnectionIdKey o) { + int result = Long.compare(hash, o.hash); + return result != 0 ? result : key.compareTo(o.key); + } + } +} +``` + +## `codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java` (changed lines (32, 33, 44)) + +```java +/* + * Copyright 2020 The Netty Project + * + * The Netty Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.netty.incubator.codec.quic; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelDuplexHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPromise; +import io.netty.channel.MessageSizeEstimator; +import io.netty.channel.socket.DatagramPacket; +import io.netty.util.internal.logging.InternalLogger; +import io.netty.util.internal.logging.InternalLoggerFactory; +import org.jetbrains.annotations.Nullable; + +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.util.ArrayDeque; +import java.util.HashSet; +import java.util.Queue; +import java.util.Set; +import java.util.function.Consumer; + +import static io.netty.incubator.codec.quic.Quiche.allocateNativeOrder; + +/** + * Abstract base class for QUIC codecs. + */ +abstract class QuicheQuicCodec extends ChannelDuplexHandler { + private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(QuicheQuicCodec.class); + private final ConnectionIdChannelMap connectionIdToChannel = new ConnectionIdChannelMap(); + private final Set channels = new HashSet<>(); + private final Queue needsFireChannelReadComplete = new ArrayDeque<>(); + private final Queue delayedRemoval = new ArrayDeque<>(); + + private final Consumer freeTask = this::removeChannel; + private final FlushStrategy flushStrategy; + private final int localConnIdLength; + private final QuicheConfig config; + + private MessageSizeEstimator.Handle estimatorHandle; + private QuicHeaderParser headerParser; + private QuicHeaderParser.QuicHeaderProcessor parserCallback; + private int pendingBytes; + private int pendingPackets; + private boolean inChannelReadComplete; + private boolean delayRemoval; + + // This buffer is used to copy InetSocketAddress to sockaddr_storage and so pass it down the JNI layer. + private ByteBuf senderSockaddrMemory; + private ByteBuf recipientSockaddrMemory; + + QuicheQuicCodec(QuicheConfig config, int localConnIdLength, FlushStrategy flushStrategy) { + this.config = config; + this.localConnIdLength = localConnIdLength; + this.flushStrategy = flushStrategy; + } + + @Override + public final boolean isSharable() { + return false; + } + + @Nullable + protected final QuicheQuicChannel getChannel(ByteBuffer key) { + return connectionIdToChannel.get(key); + } + + private void addMapping(QuicheQuicChannel channel, ByteBuffer id) { + QuicheQuicChannel ch = connectionIdToChannel.put(id, channel); + assert ch == null; + } + + private void removeMapping(QuicheQuicChannel channel, ByteBuffer id) { + QuicheQuicChannel ch = connectionIdToChannel.remove(id); + assert ch == channel; + } + + private void processDelayedRemoval() { + for (;;) { + // Now remove all channels that we marked for removal. + QuicheQuicChannel toBeRemoved = delayedRemoval.poll(); + if (toBeRemoved == null) { + break; + } + removeChannel(toBeRemoved); + } + } + + private void removeChannel(QuicheQuicChannel channel) { + if (delayRemoval) { + boolean added = delayedRemoval.offer(channel); + assert added; + } else { + boolean removed = channels.remove(channel); + if (removed) { + for (ByteBuffer id : channel.sourceConnectionIds()) { + QuicheQuicChannel ch = connectionIdToChannel.remove(id); + assert ch == channel; + } + } + } + } + + protected final void addChannel(QuicheQuicChannel channel) { + boolean added = channels.add(channel); + assert added; + for (ByteBuffer id : channel.sourceConnectionIds()) { + QuicheQuicChannel ch = connectionIdToChannel.put(id.duplicate(), channel); + assert ch == null; + } + } + + @Override + public final void handlerAdded(ChannelHandlerContext ctx) { + senderSockaddrMemory = allocateNativeOrder(Quiche.SIZEOF_SOCKADDR_STORAGE); + recipientSockaddrMemory = allocateNativeOrder(Quiche.SIZEOF_SOCKADDR_STORAGE); + headerParser = new QuicHeaderParser(localConnIdLength); + parserCallback = new QuicCodecHeaderProcessor(ctx); + estimatorHandle = ctx.channel().config().getMessageSizeEstimator().newHandle(); + handlerAdded(ctx, localConnIdLength); + } + + /** + * See {@link io.netty.channel.ChannelHandler#handlerAdded(ChannelHandlerContext)}. + */ + protected void handlerAdded(ChannelHandlerContext ctx, int localConnIdLength) { + // NOOP. + } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) { + try { + // Use a copy of the array as closing the channel may cause an unwritable event that could also + // remove channels. + for (QuicheQuicChannel ch : channels.toArray(new QuicheQuicChannel[0])) { + ch.forceClose(); + } + if (pendingPackets > 0) { + flushNow(ctx); + } + } finally { + channels.clear(); + connectionIdToChannel.clear(); + needsFireChannelReadComplete.clear(); + delayedRemoval.clear(); + + config.free(); + if (senderSockaddrMemory != null) { + senderSockaddrMemory.release(); + } + if (recipientSockaddrMemory != null) { + recipientSockaddrMemory.release(); + } + if (headerParser != null) { + headerParser.close(); + headerParser = null; + } + } + } + + @Override + public final void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + DatagramPacket packet = (DatagramPacket) msg; + try { + ByteBuf buffer = ((DatagramPacket) msg).content(); + if (!buffer.isDirect()) { + // We need a direct buffer as otherwise we can not access the memoryAddress. + // Let's do a copy to direct memory. + ByteBuf direct = ctx.alloc().directBuffer(buffer.readableBytes()); + try { + direct.writeBytes(buffer, buffer.readerIndex(), buffer.readableBytes()); + handleQuicPacket(packet.sender(), packet.recipient(), direct); + } finally { + direct.release(); + } + } else { + handleQuicPacket(packet.sender(), packet.recipient(), buffer); + } + } finally { + packet.release(); + } + } + + private void handleQuicPacket(InetSocketAddress sender, InetSocketAddress recipient, ByteBuf buffer) { + try { + headerParser.parse(sender, recipient, buffer, parserCallback); + } catch (Exception e) { + LOGGER.debug("Error while processing QUIC packet", e); + } + } + + /** + * Handle a QUIC packet and return {@link QuicheQuicChannel} that is mapped to the id. + * + * @param ctx the {@link ChannelHandlerContext}. + * @param sender the {@link InetSocketAddress} of the sender of the QUIC packet + * @param recipient the {@link InetSocketAddress} of the recipient of the QUIC packet + * @param type the type of the packet. + * @param version the QUIC version + * @param scid the source connection id. + * @param dcid the destination connection id + * @param token the token + * @param senderSockaddrMemory the {@link ByteBuf} that can be used for the sender {@code struct sockaddr). + * @param recipientSockaddrMemory the {@link ByteBuf} that can be used for the recipient {@code struct sockaddr). + * @param freeTask the {@link Consumer} that will be called once native memory of the {@link QuicheQuicChannel} is + * freed and so the mappings should be deleted to the ids. + * @param localConnIdLength the length of the local connection ids. + * @param config the {@link QuicheConfig} that is used. + * @return the {@link QuicheQuicChannel} that is mapped to the id. + * @throws Exception thrown if there is an error during processing. + */ + @Nullable + protected abstract QuicheQuicChannel quicPacketRead(ChannelHandlerContext ctx, InetSocketAddress sender, + InetSocketAddress recipient, QuicPacketType type, long version, + ByteBuf scid, ByteBuf dcid, ByteBuf token, + ByteBuf senderSockaddrMemory, ByteBuf recipientSockaddrMemory, + Consumer freeTask, + int localConnIdLength, QuicheConfig config) throws Exception; + + @Override + public final void channelReadComplete(ChannelHandlerContext ctx) { + inChannelReadComplete = true; + try { + for (;;) { + QuicheQuicChannel channel = needsFireChannelReadComplete.poll(); + if (channel == null) { + break; + } + channel.recvComplete(); + } + } finally { + inChannelReadComplete = false; + if (pendingPackets > 0) { + flushNow(ctx); + } + } + } + + @Override + public final void channelWritabilityChanged(ChannelHandlerContext ctx) { + if (ctx.channel().isWritable()) { + // Ensure we delay removal from the channels Set as otherwise we will might see an exception + // due modifications while iteration. + delayRemoval = true; + try { + for (QuicheQuicChannel channel : channels) { + // TODO: Be a bit smarter about this. + channel.writable(); + } + } finally { + // We are done with the loop, reset the flag and process the removals from the channels Set. + delayRemoval = false; + processDelayedRemoval(); + } + } else { + // As we batch flushes we need to ensure we at least try to flush a batch once the channel becomes + // unwritable. Otherwise we may end up with buffering too much writes and so waste memory. + ctx.flush(); + } + + ctx.fireChannelWritabilityChanged(); + } + + @Override + public final void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { + pendingPackets ++; + int size = estimatorHandle.size(msg); + if (size > 0) { + pendingBytes += size; + } + try { + ctx.write(msg, promise); + } finally { + flushIfNeeded(ctx); + } + } + + @Override + public final void flush(ChannelHandlerContext ctx) { + // If we are in the channelReadComplete(...) method we might be able to delay the flush(...) until we finish + // processing all channels. + if (inChannelReadComplete) { + flushIfNeeded(ctx); + } else if (pendingPackets > 0) { + flushNow(ctx); + } + } + + @Override + public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, + ChannelPromise promise) throws Exception { + if (remoteAddress instanceof QuicheQuicChannelAddress) { + QuicheQuicChannelAddress addr = (QuicheQuicChannelAddress) remoteAddress; + QuicheQuicChannel channel = addr.channel; + connectQuicChannel(channel, remoteAddress, localAddress, + senderSockaddrMemory, recipientSockaddrMemory, freeTask, localConnIdLength, config, promise); + } else { + ctx.connect(remoteAddress, localAddress, promise); + } + } + + /** + * Connects the given {@link QuicheQuicChannel}. + * + * @param channel the {@link QuicheQuicChannel} to connect. + * @param remoteAddress the remote {@link SocketAddress}. + * @param localAddress the local {@link SocketAddress} + * @param senderSockaddrMemory the {@link ByteBuf} that can be used for the sender {@code struct sockaddr). + * @param recipientSockaddrMemory the {@link ByteBuf} that can be used for the recipient {@code struct sockaddr). + * @param freeTask the {@link Consumer} that will be called once native memory of the + * {@link QuicheQuicChannel} is freed and so the mappings should be deleted to + * the ids. + * @param localConnIdLength the length of the local connection ids. + * @param config the {@link QuicheConfig} that is used. + * @param promise the {@link ChannelPromise} to notify once the connect is done. + */ + protected abstract void connectQuicChannel(QuicheQuicChannel channel, SocketAddress remoteAddress, + SocketAddress localAddress, ByteBuf senderSockaddrMemory, + ByteBuf recipientSockaddrMemory, Consumer freeTask, + int localConnIdLength, QuicheConfig config, ChannelPromise promise); + + + private void flushIfNeeded(ChannelHandlerContext ctx) { + // Check if we should force a flush() and so ensure the packets are delivered in a timely + // manner and also make room in the outboundbuffer again that belongs to the underlying channel. + if (flushStrategy.shouldFlushNow(pendingPackets, pendingBytes)) { + flushNow(ctx); + } + } + + private void flushNow(ChannelHandlerContext ctx) { + pendingBytes = 0; + pendingPackets = 0; + ctx.flush(); + } + + private final class QuicCodecHeaderProcessor implements QuicHeaderParser.QuicHeaderProcessor { + + private final ChannelHandlerContext ctx; + + QuicCodecHeaderProcessor(ChannelHandlerContext ctx) { + this.ctx = ctx; + } + + @Override + public void process(InetSocketAddress sender, InetSocketAddress recipient, ByteBuf buffer, QuicPacketType type, + long version, ByteBuf scid, ByteBuf dcid, ByteBuf token) throws Exception { + QuicheQuicChannel channel = quicPacketRead(ctx, sender, recipient, + type, version, scid, + dcid, token, senderSockaddrMemory, recipientSockaddrMemory, freeTask, localConnIdLength, config); + if (channel != null) { + // Add to queue first, we might be able to safe some flushes and consolidate them + // in channelReadComplete(...) this way. + if (channel.markInFireChannelReadCompleteQueue()) { + needsFireChannelReadComplete.add(channel); + } + channel.recv(sender, recipient, buffer); + for (ByteBuffer retiredSourceConnectionId : channel.retiredSourceConnectionId()) { + removeMapping(channel, retiredSourceConnectionId); + } + for (ByteBuffer newSourceConnectionId : channel.newSourceConnectionIds()) { + addMapping(channel, newSourceConnectionId); + } + } + } + } +} +``` + +## `codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/SipHash.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150)) + +```java +/* + * Copyright 2025 The Netty Project + * + * The Netty Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.netty.incubator.codec.quic; + +import io.netty.util.internal.ObjectUtil; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * Siphash implementation. + */ +final class SipHash { + + static final int SEED_LENGTH = 16; + + // Make this class allocation free as soon as its constructed. + private final int compressionRounds; + private final int finalizationRounds; + + // As specified in https://www.aumasson.jp/siphash/siphash.pdf + private static final long INITIAL_STATE_V0 = 0x736f6d6570736575L; // "somepseu" + private static final long INITIAL_STATE_V1 = 0x646f72616e646f6dL; // "dorandom" + private static final long INITIAL_STATE_V2 = 0x6c7967656e657261L; // "lygenera" + private static final long INITIAL_STATE_V3 = 0x7465646279746573L; // "tedbytes" + + private final long initialStateV0; + private final long initialStateV1; + private final long initialStateV2; + private final long initialStateV3; + + private long v0; + private long v1; + private long v2; + private long v3; + + SipHash(int compressionRounds, int finalizationRounds, byte[] seed) { + if (seed.length != SEED_LENGTH) { + throw new IllegalArgumentException("seed must be of length " + SEED_LENGTH); + } + this.compressionRounds = ObjectUtil.checkPositive(compressionRounds, "compressionRounds"); + this.finalizationRounds = ObjectUtil.checkPositive(finalizationRounds, "finalizationRounds"); + + // Wrap the seed to extract two longs that will be used to generate the initial state. + // Use little-endian as in the paper. + ByteBuffer keyBuffer = ByteBuffer.wrap(seed).order(ByteOrder.LITTLE_ENDIAN); + final long k0 = keyBuffer.getLong(); + final long k1 = keyBuffer.getLong(); + + initialStateV0 = INITIAL_STATE_V0 ^ k0; + initialStateV1 = INITIAL_STATE_V1 ^ k1; + initialStateV2 = INITIAL_STATE_V2 ^ k0; + initialStateV3 = INITIAL_STATE_V3 ^ k1; + } + + long macHash(ByteBuffer input) { + v0 = initialStateV0; + v1 = initialStateV1; + v2 = initialStateV2; + v3 = initialStateV3; + int remaining = input.remaining(); + int position = input.position(); + int len = remaining - (remaining % Long.BYTES); + boolean needsReverse = input.order() == ByteOrder.BIG_ENDIAN; + for (int offset = position; offset < len; offset += Long.BYTES) { + long m = input.getLong(offset); + if (needsReverse) { + // We use little-endian as in the paper. + m = Long.reverseBytes(m); + } + v3 ^= m; + for (int i = 0; i < compressionRounds; i++) { + sipround(); + } + v0 ^= m; + } + + // Get last bits. + final int left = remaining & (Long.BYTES - 1); + long b = (long) remaining << 56; + assert left < Long.BYTES; + switch (left) { + case 7: + b |= ((long) input.get(position + len + 6) << 48); + case 6: + b |= ((long) input.get(position + len + 5) << 40); + case 5: + b |= ((long) input.get(position + len + 4) << 32); + case 4: + b |= ((long) input.get(position + len + 3) << 24); + case 3: + b |= ((long) input.get(position + len + 2) << 16); + case 2: + b |= ((long) input.get(position + len + 1) << 8); + case 1: + b |= input.get(position + len); + break; + case 0: + break; + default: + throw new IllegalStateException("Unexpected value: " + left); + } + + v3 ^= b; + for (int i = 0; i < compressionRounds; i++) { + sipround(); + } + + v0 ^= b; + v2 ^= 0xFF; + for (int i = 0; i < finalizationRounds; i++) { + sipround(); + } + + return v0 ^ v1 ^ v2 ^ v3; + } + + private void sipround() { + v0 += v1; + v2 += v3; + v1 = Long.rotateLeft(v1, 13); + v3 = Long.rotateLeft(v3, 16); + v1 ^= v0; + v3 ^= v2; + + v0 = Long.rotateLeft(v0, 32); + + v2 += v1; + v0 += v3; + v1 = Long.rotateLeft(v1, 17); + v3 = Long.rotateLeft(v3, 21); + v1 ^= v2; + v3 ^= v0; + + v2 = Long.rotateLeft(v2, 32); + } +} +``` + +## `codec-native-quic/src/test/java/io/netty/incubator/codec/quic/SipHashTest.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158)) + +```java +/* + * Copyright 2025 The Netty Project + * + * The Netty Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.netty.incubator.codec.quic; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.concurrent.ThreadLocalRandom; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +public class SipHashTest { + + private static final byte[] REFERENCE_SEED = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + + private static final int[][] REFERENCE_OUTPUT = { + { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, + { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, + { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, + { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, + { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, + { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, + { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, + { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, + { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, + { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, + { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, + { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, + { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, + { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, + { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, + { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, + { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, + { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, + { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, + { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, + { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, + { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, + { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, + { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, + { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, + { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, + { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, + { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, + { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, + { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, + { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, + { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, + { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, + { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, + { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, + { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, + { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, + { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, + { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, + { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, + { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, + { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, + { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, + { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, + { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, + { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, + { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, + { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, + { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, + { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, + { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, + { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, + { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, + { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, + { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, + { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, + { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, + { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, + { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, + { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, + { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, + { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, + { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, + { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } + }; + + static class ReferenceTestParam { + private final byte[] input; + private final long expectedOutput; + + ReferenceTestParam(byte[] input, long expectedOutput) { + this.input = input; + this.expectedOutput = expectedOutput; + } + } + + static ReferenceTestParam[] params() { + ReferenceTestParam[] testCases = new ReferenceTestParam[64]; + // Use little-endian as this is what is expected by the reference output. + ByteBuffer bb = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN); + for (int i = 0; i < testCases.length; ++i) { + byte[] input = new byte[i]; + for (int j = 0; j < input.length; ++j) { + input[j] = (byte) j; + } + for (int v: REFERENCE_OUTPUT[i]) { + bb.put((byte) v); + } + bb.flip(); + testCases[i] = new ReferenceTestParam(input, bb.getLong()); + bb.clear(); + } + return testCases; + } + + @ParameterizedTest + @MethodSource("params") + void testReferenceCases(ReferenceTestParam param ) { + SipHash hash = new SipHash(2, 4, REFERENCE_SEED); + long h = hash.macHash(ByteBuffer.wrap(param.input)); + assertEquals(param.expectedOutput, h); + } + + @Test + void testHash() { + byte[] bytes = new byte[64]; + ThreadLocalRandom.current().nextBytes(bytes); + + byte[] seed = new byte[16]; + ThreadLocalRandom.current().nextBytes(seed); + SipHash hash = new SipHash(1, 3, seed); + + ByteBuffer buffer = ByteBuffer.wrap(bytes); + ByteBuffer emptyBuffer = ByteBuffer.wrap(new byte[0]); + + long bufferHash = hash.macHash(buffer); + assertEquals(bufferHash, hash.macHash(buffer)); + + long emptyBufferHash = hash.macHash(emptyBuffer); + assertEquals(emptyBufferHash, hash.macHash(emptyBuffer)); + + assertNotEquals(bufferHash, emptyBufferHash); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..deec19e82c8130cf4be2312cfb636896a11c0388 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/pre_context.md @@ -0,0 +1,389 @@ +# Patch-overlapping Java context before the fix + +## `codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java` (changed lines (32, 34, 46, 47)) + +```java +/* + * Copyright 2020 The Netty Project + * + * The Netty Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package io.netty.incubator.codec.quic; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelDuplexHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPromise; +import io.netty.channel.MessageSizeEstimator; +import io.netty.channel.socket.DatagramPacket; +import io.netty.util.internal.logging.InternalLogger; +import io.netty.util.internal.logging.InternalLoggerFactory; +import org.jetbrains.annotations.Nullable; + +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.util.ArrayDeque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.function.Consumer; + +import static io.netty.incubator.codec.quic.Quiche.allocateNativeOrder; + +/** + * Abstract base class for QUIC codecs. + */ +abstract class QuicheQuicCodec extends ChannelDuplexHandler { + private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(QuicheQuicCodec.class); + private final Map connectionIdToChannel = new HashMap<>(); + private final Set channels = new HashSet<>(); + private final Queue needsFireChannelReadComplete = new ArrayDeque<>(); + private final Queue delayedRemoval = new ArrayDeque<>(); + + private final Consumer freeTask = this::removeChannel; + private final FlushStrategy flushStrategy; + private final int localConnIdLength; + private final QuicheConfig config; + + private MessageSizeEstimator.Handle estimatorHandle; + private QuicHeaderParser headerParser; + private QuicHeaderParser.QuicHeaderProcessor parserCallback; + private int pendingBytes; + private int pendingPackets; + private boolean inChannelReadComplete; + private boolean delayRemoval; + + // This buffer is used to copy InetSocketAddress to sockaddr_storage and so pass it down the JNI layer. + private ByteBuf senderSockaddrMemory; + private ByteBuf recipientSockaddrMemory; + + QuicheQuicCodec(QuicheConfig config, int localConnIdLength, FlushStrategy flushStrategy) { + this.config = config; + this.localConnIdLength = localConnIdLength; + this.flushStrategy = flushStrategy; + } + + @Override + public final boolean isSharable() { + return false; + } + + @Nullable + protected final QuicheQuicChannel getChannel(ByteBuffer key) { + return connectionIdToChannel.get(key); + } + + private void addMapping(QuicheQuicChannel channel, ByteBuffer id) { + QuicheQuicChannel ch = connectionIdToChannel.put(id, channel); + assert ch == null; + } + + private void removeMapping(QuicheQuicChannel channel, ByteBuffer id) { + QuicheQuicChannel ch = connectionIdToChannel.remove(id); + assert ch == channel; + } + + private void processDelayedRemoval() { + for (;;) { + // Now remove all channels that we marked for removal. + QuicheQuicChannel toBeRemoved = delayedRemoval.poll(); + if (toBeRemoved == null) { + break; + } + removeChannel(toBeRemoved); + } + } + + private void removeChannel(QuicheQuicChannel channel) { + if (delayRemoval) { + boolean added = delayedRemoval.offer(channel); + assert added; + } else { + boolean removed = channels.remove(channel); + if (removed) { + for (ByteBuffer id : channel.sourceConnectionIds()) { + QuicheQuicChannel ch = connectionIdToChannel.remove(id); + assert ch == channel; + } + } + } + } + + protected final void addChannel(QuicheQuicChannel channel) { + boolean added = channels.add(channel); + assert added; + for (ByteBuffer id : channel.sourceConnectionIds()) { + QuicheQuicChannel ch = connectionIdToChannel.put(id.duplicate(), channel); + assert ch == null; + } + } + + @Override + public final void handlerAdded(ChannelHandlerContext ctx) { + senderSockaddrMemory = allocateNativeOrder(Quiche.SIZEOF_SOCKADDR_STORAGE); + recipientSockaddrMemory = allocateNativeOrder(Quiche.SIZEOF_SOCKADDR_STORAGE); + headerParser = new QuicHeaderParser(localConnIdLength); + parserCallback = new QuicCodecHeaderProcessor(ctx); + estimatorHandle = ctx.channel().config().getMessageSizeEstimator().newHandle(); + handlerAdded(ctx, localConnIdLength); + } + + /** + * See {@link io.netty.channel.ChannelHandler#handlerAdded(ChannelHandlerContext)}. + */ + protected void handlerAdded(ChannelHandlerContext ctx, int localConnIdLength) { + // NOOP. + } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) { + try { + // Use a copy of the array as closing the channel may cause an unwritable event that could also + // remove channels. + for (QuicheQuicChannel ch : channels.toArray(new QuicheQuicChannel[0])) { + ch.forceClose(); + } + if (pendingPackets > 0) { + flushNow(ctx); + } + } finally { + channels.clear(); + connectionIdToChannel.clear(); + needsFireChannelReadComplete.clear(); + delayedRemoval.clear(); + + config.free(); + if (senderSockaddrMemory != null) { + senderSockaddrMemory.release(); + } + if (recipientSockaddrMemory != null) { + recipientSockaddrMemory.release(); + } + if (headerParser != null) { + headerParser.close(); + headerParser = null; + } + } + } + + @Override + public final void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + DatagramPacket packet = (DatagramPacket) msg; + try { + ByteBuf buffer = ((DatagramPacket) msg).content(); + if (!buffer.isDirect()) { + // We need a direct buffer as otherwise we can not access the memoryAddress. + // Let's do a copy to direct memory. + ByteBuf direct = ctx.alloc().directBuffer(buffer.readableBytes()); + try { + direct.writeBytes(buffer, buffer.readerIndex(), buffer.readableBytes()); + handleQuicPacket(packet.sender(), packet.recipient(), direct); + } finally { + direct.release(); + } + } else { + handleQuicPacket(packet.sender(), packet.recipient(), buffer); + } + } finally { + packet.release(); + } + } + + private void handleQuicPacket(InetSocketAddress sender, InetSocketAddress recipient, ByteBuf buffer) { + try { + headerParser.parse(sender, recipient, buffer, parserCallback); + } catch (Exception e) { + LOGGER.debug("Error while processing QUIC packet", e); + } + } + + /** + * Handle a QUIC packet and return {@link QuicheQuicChannel} that is mapped to the id. + * + * @param ctx the {@link ChannelHandlerContext}. + * @param sender the {@link InetSocketAddress} of the sender of the QUIC packet + * @param recipient the {@link InetSocketAddress} of the recipient of the QUIC packet + * @param type the type of the packet. + * @param version the QUIC version + * @param scid the source connection id. + * @param dcid the destination connection id + * @param token the token + * @param senderSockaddrMemory the {@link ByteBuf} that can be used for the sender {@code struct sockaddr). + * @param recipientSockaddrMemory the {@link ByteBuf} that can be used for the recipient {@code struct sockaddr). + * @param freeTask the {@link Consumer} that will be called once native memory of the {@link QuicheQuicChannel} is + * freed and so the mappings should be deleted to the ids. + * @param localConnIdLength the length of the local connection ids. + * @param config the {@link QuicheConfig} that is used. + * @return the {@link QuicheQuicChannel} that is mapped to the id. + * @throws Exception thrown if there is an error during processing. + */ + @Nullable + protected abstract QuicheQuicChannel quicPacketRead(ChannelHandlerContext ctx, InetSocketAddress sender, + InetSocketAddress recipient, QuicPacketType type, long version, + ByteBuf scid, ByteBuf dcid, ByteBuf token, + ByteBuf senderSockaddrMemory, ByteBuf recipientSockaddrMemory, + Consumer freeTask, + int localConnIdLength, QuicheConfig config) throws Exception; + + @Override + public final void channelReadComplete(ChannelHandlerContext ctx) { + inChannelReadComplete = true; + try { + for (;;) { + QuicheQuicChannel channel = needsFireChannelReadComplete.poll(); + if (channel == null) { + break; + } + channel.recvComplete(); + } + } finally { + inChannelReadComplete = false; + if (pendingPackets > 0) { + flushNow(ctx); + } + } + } + + @Override + public final void channelWritabilityChanged(ChannelHandlerContext ctx) { + if (ctx.channel().isWritable()) { + // Ensure we delay removal from the channels Set as otherwise we will might see an exception + // due modifications while iteration. + delayRemoval = true; + try { + for (QuicheQuicChannel channel : channels) { + // TODO: Be a bit smarter about this. + channel.writable(); + } + } finally { + // We are done with the loop, reset the flag and process the removals from the channels Set. + delayRemoval = false; + processDelayedRemoval(); + } + } else { + // As we batch flushes we need to ensure we at least try to flush a batch once the channel becomes + // unwritable. Otherwise we may end up with buffering too much writes and so waste memory. + ctx.flush(); + } + + ctx.fireChannelWritabilityChanged(); + } + + @Override + public final void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { + pendingPackets ++; + int size = estimatorHandle.size(msg); + if (size > 0) { + pendingBytes += size; + } + try { + ctx.write(msg, promise); + } finally { + flushIfNeeded(ctx); + } + } + + @Override + public final void flush(ChannelHandlerContext ctx) { + // If we are in the channelReadComplete(...) method we might be able to delay the flush(...) until we finish + // processing all channels. + if (inChannelReadComplete) { + flushIfNeeded(ctx); + } else if (pendingPackets > 0) { + flushNow(ctx); + } + } + + @Override + public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, + ChannelPromise promise) throws Exception { + if (remoteAddress instanceof QuicheQuicChannelAddress) { + QuicheQuicChannelAddress addr = (QuicheQuicChannelAddress) remoteAddress; + QuicheQuicChannel channel = addr.channel; + connectQuicChannel(channel, remoteAddress, localAddress, + senderSockaddrMemory, recipientSockaddrMemory, freeTask, localConnIdLength, config, promise); + } else { + ctx.connect(remoteAddress, localAddress, promise); + } + } + + /** + * Connects the given {@link QuicheQuicChannel}. + * + * @param channel the {@link QuicheQuicChannel} to connect. + * @param remoteAddress the remote {@link SocketAddress}. + * @param localAddress the local {@link SocketAddress} + * @param senderSockaddrMemory the {@link ByteBuf} that can be used for the sender {@code struct sockaddr). + * @param recipientSockaddrMemory the {@link ByteBuf} that can be used for the recipient {@code struct sockaddr). + * @param freeTask the {@link Consumer} that will be called once native memory of the + * {@link QuicheQuicChannel} is freed and so the mappings should be deleted to + * the ids. + * @param localConnIdLength the length of the local connection ids. + * @param config the {@link QuicheConfig} that is used. + * @param promise the {@link ChannelPromise} to notify once the connect is done. + */ + protected abstract void connectQuicChannel(QuicheQuicChannel channel, SocketAddress remoteAddress, + SocketAddress localAddress, ByteBuf senderSockaddrMemory, + ByteBuf recipientSockaddrMemory, Consumer freeTask, + int localConnIdLength, QuicheConfig config, ChannelPromise promise); + + + private void flushIfNeeded(ChannelHandlerContext ctx) { + // Check if we should force a flush() and so ensure the packets are delivered in a timely + // manner and also make room in the outboundbuffer again that belongs to the underlying channel. + if (flushStrategy.shouldFlushNow(pendingPackets, pendingBytes)) { + flushNow(ctx); + } + } + + private void flushNow(ChannelHandlerContext ctx) { + pendingBytes = 0; + pendingPackets = 0; + ctx.flush(); + } + + private final class QuicCodecHeaderProcessor implements QuicHeaderParser.QuicHeaderProcessor { + + private final ChannelHandlerContext ctx; + + QuicCodecHeaderProcessor(ChannelHandlerContext ctx) { + this.ctx = ctx; + } + + @Override + public void process(InetSocketAddress sender, InetSocketAddress recipient, ByteBuf buffer, QuicPacketType type, + long version, ByteBuf scid, ByteBuf dcid, ByteBuf token) throws Exception { + QuicheQuicChannel channel = quicPacketRead(ctx, sender, recipient, + type, version, scid, + dcid, token, senderSockaddrMemory, recipientSockaddrMemory, freeTask, localConnIdLength, config); + if (channel != null) { + // Add to queue first, we might be able to safe some flushes and consolidate them + // in channelReadComplete(...) this way. + if (channel.markInFireChannelReadCompleteQueue()) { + needsFireChannelReadComplete.add(channel); + } + channel.recv(sender, recipient, buffer); + for (ByteBuffer retiredSourceConnectionId : channel.retiredSourceConnectionId()) { + removeMapping(channel, retiredSourceConnectionId); + } + for (ByteBuffer newSourceConnectionId : channel.newSourceConnectionIds()) { + addMapping(channel, newSourceConnectionId); + } + } + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/task.json new file mode 100644 index 0000000000000000000000000000000000000000..cadd67e24698a7e353c69de93400db68f9815231 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/task.json @@ -0,0 +1,50 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-1f67e1cf382f2e332752", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-1f67e1cf382f2e332752", + "project_id": "morefixes__netty__netty-incubator-codec-quic", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/ConnectionIdChannelMap.java", + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java", + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/SipHash.java", + "codec-native-quic/src/test/java/io/netty/incubator/codec/quic/SipHashTest.java" + ], + "patch_units": { + "before": [ + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java" + ], + "after": [ + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/ConnectionIdChannelMap.java", + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicCodec.java", + "codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/SipHash.java", + "codec-native-quic/src/test/java/io/netty/incubator/codec/quic/SipHashTest.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/99fcdd57bcf223659f8b0211031eaad327f274bd0580744480a0961059e862f0/database", + "cache_key": "99fcdd57bcf223659f8b0211031eaad327f274bd0580744480a0961059e862f0", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/f7d99c3b45f1009ec5e42ae2c947ed4b732f8d9e35e7270b94052e53441a19a9/database", + "cache_key": "f7d99c3b45f1009ec5e42ae2c947ed4b732f8d9e35e7270b94052e53441a19a9", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/ca039c8a2cf3627a72b15ac71d6292f1749234abd0f04bd2d3ff5392bb43fd41/database", + "cache_key": "ca039c8a2cf3627a72b15ac71d6292f1749234abd0f04bd2d3ff5392bb43fd41", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-1f67e1cf382f2e332752/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-1f67e1cf382f2e332752/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-1f67e1cf382f2e332752/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..9119fa330482f444e1c32e6145aac97b5c5282eb --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/patch.diff @@ -0,0 +1,148 @@ +diff --git a/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java b/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java +index 7cd2b74..f627be3 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java +@@ -185,10 +185,11 @@ class AESGCMFallbackCipherState implements CipherState { + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; +- else +- space = ciphertext.length - ciphertextOffset; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) +@@ -214,16 +215,15 @@ class AESGCMFallbackCipherState implements CipherState { + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); +- if (plaintextOffset > plaintext.length) +- space = 0; +- else +- space = plaintext.length - plaintextOffset; ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) +diff --git a/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java b/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java +index deada67..df40945 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java +@@ -218,10 +218,11 @@ class AESGCMOnCtrCipherState implements CipherState { + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; +- else +- space = ciphertext.length - ciphertextOffset; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = ciphertext.length - ciphertextOffset; + if (keySpec == null) { + // The key is not set yet - return the plaintext as-is. + if (length > space) +@@ -262,16 +263,15 @@ class AESGCMOnCtrCipherState implements CipherState { + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); +- if (plaintextOffset > plaintext.length) +- space = 0; +- else +- space = plaintext.length - plaintextOffset; ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = plaintext.length - plaintextOffset; + if (keySpec == null) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) +diff --git a/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java b/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java +index 25b1a4c..40ce2bc 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java +@@ -214,10 +214,11 @@ class ChaChaPolyCipherState implements CipherState { + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; +- else +- space = ciphertext.length - ciphertextOffset; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) +@@ -241,16 +242,15 @@ class ChaChaPolyCipherState implements CipherState { + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; +- if (ciphertextOffset > ciphertext.length) +- space = 0; ++ if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) ++ throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); +- if (plaintextOffset > plaintext.length) +- space = 0; +- else +- space = plaintext.length - plaintextOffset; ++ if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) ++ throw new IllegalArgumentException(); ++ space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) +diff --git a/src/main/java/com/southernstorm/noise/protocol/CipherState.java b/src/main/java/com/southernstorm/noise/protocol/CipherState.java +index 3168139..74f808b 100644 +--- a/src/main/java/com/southernstorm/noise/protocol/CipherState.java ++++ b/src/main/java/com/southernstorm/noise/protocol/CipherState.java +@@ -100,6 +100,8 @@ public interface CipherState extends Destroyable { + * + * @throws IllegalStateException The nonce has wrapped around. + * ++ * @throws IllegalArgumentException One of the parameters is out of range. ++ * + * The plaintext and ciphertext buffers can be the same for in-place + * encryption. In that case, plaintextOffset must be identical to + * ciphertextOffset. +@@ -130,6 +132,8 @@ public interface CipherState extends Destroyable { + * + * @throws IllegalStateException The nonce has wrapped around. + * ++ * @throws IllegalArgumentException One of the parameters is out of range. ++ * + * The plaintext and ciphertext buffers can be the same for in-place + * decryption. In that case, ciphertextOffset must be identical to + * plaintextOffset. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..2c35d4cdf0b1db7976981087af5a1a235817d962 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/post_context.md @@ -0,0 +1,1073 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java` (changed lines (188, 189, 190, 191, 192, 218, 219, 224, 225, 226)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.GHASH; +import com.southernstorm.noise.crypto.RijndaelAES; + +/** + * Fallback implementation of "AESGCM" on platforms where + * the JCA/JCE does not have a suitable GCM or CTR provider. + */ +class AESGCMFallbackCipherState implements CipherState { + + private RijndaelAES aes; + private long n; + private byte[] iv; + private byte[] enciv; + private byte[] hashKey; + private GHASH ghash; + private boolean haskey; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + */ + public AESGCMFallbackCipherState() + { + aes = new RijndaelAES(); + n = 0; + iv = new byte [16]; + enciv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + haskey = false; + } + + @Override + public void destroy() { + aes.destroy(); + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + Noise.destroy(enciv); + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set up the AES key. + aes.setupEnc(key, offset, 256); + haskey = true; + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(hashKey, 0, hashKey, 0); + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(iv, 0, hashKey, 0); + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + /** + * Encrypts a block in CTR mode. + * + * @param plaintext The plaintext to encrypt. + * @param plaintextOffset Offset of the first plaintext byte. + * @param ciphertext The resulting ciphertext. + * @param ciphertextOffset Offset of the first ciphertext byte. + * @param length The number of bytes to encrypt. + * + * This function can also be used to decrypt. + */ + private void encryptCTR(byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) + { + while (length > 0) { + // Increment the IV and encrypt it to get the next keystream block. + if (++(iv[15]) == 0) + if (++(iv[14]) == 0) + if (++(iv[13]) == 0) + ++(iv[12]); + aes.encrypt(iv, 0, enciv, 0); + + // XOR the keystream block with the plaintext to create the ciphertext. + int temp = length; + if (temp > 16) + temp = 16; + for (int index = 0; index < temp; ++index) + ciphertext[ciphertextOffset + index] = (byte)(plaintext[plaintextOffset + index] ^ enciv[index]); + + // Advance to the next block. + plaintextOffset += temp; + ciphertextOffset += temp; + length -= temp; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encryptCTR(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(enciv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ enciv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encryptCTR(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + cipher = new AESGCMFallbackCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java` (changed lines (221, 222, 223, 224, 225, 266, 267, 272, 273, 274)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import com.southernstorm.noise.crypto.GHASH; + +/** + * Emulates the "AESGCM" cipher for Noise using the "AES/CTR/NoPadding" + * transformation from JCA/JCE. + * + * This class is used on platforms that don't have "AES/GCM/NoPadding", + * but which do have the older "AES/CTR/NoPadding". + */ +class AESGCMOnCtrCipherState implements CipherState { + + private Cipher cipher; + private SecretKeySpec keySpec; + private long n; + private byte[] iv; + private byte[] hashKey; + private GHASH ghash; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + * + * @throws NoSuchAlgorithmException The system does not have a + * provider for this algorithm. + */ + public AESGCMOnCtrCipherState() throws NoSuchAlgorithmException + { + try { + cipher = Cipher.getInstance("AES/CTR/NoPadding"); + } catch (NoSuchPaddingException e) { + // AES/CTR is available, but not the unpadded version? Huh? + throw new NoSuchAlgorithmException("AES/CTR/NoPadding not available", e); + } + keySpec = null; + n = 0; + iv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + + // Try to set a 256-bit key on the cipher. Some JCE's are + // configured to disallow 256-bit AES if an extra policy + // file has not been installed. + try { + SecretKeySpec spec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, spec, params); + } catch (InvalidKeyException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } catch (InvalidAlgorithmParameterException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } + } + + @Override + public void destroy() { + // There doesn't seem to be a standard API to clean out a Cipher. + // So we instead set the key and IV to all-zeroes to hopefully + // destroy the sensitive data in the cipher instance. + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + keySpec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, params); + } catch (InvalidKeyException e) { + // Shouldn't happen. + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + } + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return keySpec != null ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set the encryption key. + keySpec = new SecretKeySpec(key, offset, 32, "AES"); + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(iv, (byte)0); + Arrays.fill(hashKey, (byte)0); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + try { + int result = cipher.update(hashKey, 0, 16, hashKey, 0); + cipher.doFinal(hashKey, result); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return keySpec != null; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) throws InvalidKeyException, InvalidAlgorithmParameterException + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block for AES/CTR/NoPadding. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Initialize the CTR mode cipher with the key and IV. + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + try { + cipher.update(hashKey, 0, 16, hashKey, 0); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = ciphertext.length - ciphertextOffset; + if (keySpec == null) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + try { + setup(ad); + int result = cipher.update(plaintext, plaintextOffset, length, ciphertext, ciphertextOffset); + cipher.doFinal(ciphertext, ciphertextOffset + result); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = plaintext.length - plaintextOffset; + if (keySpec == null) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + try { + setup(ad); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(iv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ iv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + try { + int result = cipher.update(ciphertext, ciphertextOffset, dataLen, plaintext, plaintextOffset); + cipher.doFinal(plaintext, plaintextOffset + result); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + try { + cipher = new AESGCMOnCtrCipherState(); + } catch (NoSuchAlgorithmException e) { + // Shouldn't happen. + return null; + } + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java` (changed lines (217, 218, 219, 220, 221, 245, 246, 251, 252, 253)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.ChaChaCore; +import com.southernstorm.noise.crypto.Poly1305; + +/** + * Implements the ChaChaPoly cipher for Noise. + */ +class ChaChaPolyCipherState implements CipherState { + + private Poly1305 poly; + private int[] input; + private int[] output; + private byte[] polyKey; + long n; + private boolean haskey; + + /** + * Constructs a new cipher state for the "ChaChaPoly" algorithm. + */ + public ChaChaPolyCipherState() + { + poly = new Poly1305(); + input = new int [16]; + output = new int [16]; + polyKey = new byte [32]; + n = 0; + haskey = false; + } + + @Override + public void destroy() { + poly.destroy(); + Arrays.fill(input, 0); + Arrays.fill(output, 0); + Noise.destroy(polyKey); + } + + @Override + public String getCipherName() { + return "ChaChaPoly"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + ChaChaCore.initKey256(input, key, offset); + n = 0; + haskey = true; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * XOR's the output of ChaCha20 with a byte buffer. + * + * @param input The input byte buffer. + * @param inputOffset The offset of the first input byte. + * @param output The output byte buffer (can be the same as the input). + * @param outputOffset The offset of the first output byte. + * @param length The number of bytes to XOR between 1 and 64. + * @param block The ChaCha20 output block. + */ + private static void xorBlock(byte[] input, int inputOffset, byte[] output, int outputOffset, int length, int[] block) + { + int posn = 0; + int value; + while (length >= 4) { + value = block[posn++]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + output[outputOffset + 3] = (byte)(input[inputOffset + 3] ^ (value >> 24)); + inputOffset += 4; + outputOffset += 4; + length -= 4; + } + if (length == 3) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + } else if (length == 2) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + } else if (length == 1) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + } + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + ChaChaCore.initIV(input, n++); + ChaChaCore.hash(output, input); + Arrays.fill(polyKey, (byte)0); + xorBlock(polyKey, 0, polyKey, 0, 32, output); + poly.reset(polyKey, 0); + if (ad != null) { + poly.update(ad, 0, ad.length); + poly.pad(); + } + if (++(input[12]) == 0) + ++(input[13]); + } + + /** + * Puts a 64-bit integer into a buffer in little-endian order. + * + * @param output The output buffer. + * @param offset The offset into the output buffer. + * @param value The 64-bit integer value. + */ + private static void putLittleEndian64(byte[] output, int offset, long value) + { + output[offset] = (byte)value; + output[offset + 1] = (byte)(value >> 8); + output[offset + 2] = (byte)(value >> 16); + output[offset + 3] = (byte)(value >> 24); + output[offset + 4] = (byte)(value >> 32); + output[offset + 5] = (byte)(value >> 40); + output[offset + 6] = (byte)(value >> 48); + output[offset + 7] = (byte)(value >> 56); + } + + /** + * Finishes up the authentication tag for a packet. + * + * @param ad The associated data. + * @param length The length of the plaintext data. + */ + private void finish(byte[] ad, int length) + { + poly.pad(); + putLittleEndian64(polyKey, 0, ad != null ? ad.length : 0); + putLittleEndian64(polyKey, 8, length); + poly.update(polyKey, 0, 16); + poly.finish(polyKey, 0); + } + + /** + * Encrypts or decrypts a buffer of bytes for the active packet. + * + * @param plaintext The plaintext data to be encrypted. + * @param plaintextOffset The offset to the first plaintext byte. + * @param ciphertext The ciphertext data that results from encryption. + * @param ciphertextOffset The offset to the first ciphertext byte. + * @param length The number of bytes to encrypt. + */ + private void encrypt(byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) { + while (length > 0) { + int tempLen = 64; + if (tempLen > length) + tempLen = length; + ChaChaCore.hash(output, input); + xorBlock(plaintext, plaintextOffset, ciphertext, ciphertextOffset, tempLen, output); + if (++(input[12]) == 0) + ++(input[13]); + plaintextOffset += tempLen; + ciphertextOffset += tempLen; + length -= tempLen; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encrypt(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + poly.update(ciphertext, ciphertextOffset, length); + finish(ad, length); + System.arraycopy(polyKey, 0, ciphertext, ciphertextOffset + length, 16); + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) + throw new IllegalArgumentException(); + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (length < 0 || plaintextOffset < 0 || plaintextOffset > plaintext.length) + throw new IllegalArgumentException(); + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + poly.update(ciphertext, ciphertextOffset, dataLen); + finish(ad, dataLen); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (polyKey[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encrypt(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher = new ChaChaPolyCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/CipherState.java` (changed lines (103, 104, 135, 136)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +/** + * Interface to an authenticated cipher for use in the Noise protocol. + * + * CipherState objects are used to encrypt or decrypt data during a + * session. Once the handshake has completed, HandshakeState.split() + * will create two CipherState objects for encrypting packets sent to + * the other party, and decrypting packets received from the other party. + */ +public interface CipherState extends Destroyable { + + /** + * Gets the Noise protocol name for this cipher. + * + * @return The cipher name. + */ + String getCipherName(); + + /** + * Gets the length of the key values for this cipher. + * + * @return The length of the key in bytes; usually 32. + */ + int getKeyLength(); + + /** + * Gets the length of the MAC values for this cipher. + * + * @return The length of MAC values in bytes, or zero if the + * key has not yet been initialized. + */ + int getMACLength(); + + /** + * Initializes the key on this cipher object. + * + * @param key Points to a buffer that contains the key. + * @param offset The offset of the key in the key buffer. + * + * The key buffer must contain at least getKeyLength() bytes + * starting at offset. + * + * @see #hasKey() + */ + void initializeKey(byte[] key, int offset); + + /** + * Determine if this cipher object has been configured with a key. + * + * @return true if this cipher object has a key; false if the + * key has not yet been set with initializeKey(). + * + * @see #initializeKey(byte[], int) + */ + boolean hasKey(); + + /** + * Encrypts a plaintext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param plaintext The buffer containing the plaintext to encrypt. + * @param plaintextOffset The offset within the plaintext buffer of the + * first byte or plaintext data. + * @param ciphertext The buffer to place the ciphertext in. This can + * be the same as the plaintext buffer. + * @param ciphertextOffset The first offset within the ciphertext buffer + * to place the ciphertext and the MAC tag. + * @param length The length of the plaintext. + * @return The length of the ciphertext plus the MAC tag, or -1 if the + * ciphertext buffer is not large enough to hold the result. + * + * @throws ShortBufferException The ciphertext buffer does not have + * enough space to hold the ciphertext plus MAC. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * @throws IllegalArgumentException One of the parameters is out of range. + * + * The plaintext and ciphertext buffers can be the same for in-place + * encryption. In that case, plaintextOffset must be identical to + * ciphertextOffset. + * + * There must be enough space in the ciphertext buffer to accomodate + * length + getMACLength() bytes of data starting at ciphertextOffset. + */ + int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException; + + /** + * Decrypts a ciphertext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param ciphertext The buffer containing the ciphertext to decrypt. + * @param ciphertextOffset The offset within the ciphertext buffer of + * the first byte of ciphertext data. + * @param plaintext The buffer to place the plaintext in. This can be + * the same as the ciphertext buffer. + * @param plaintextOffset The first offset within the plaintext buffer + * to place the plaintext. + * @param length The length of the incoming ciphertext plus the MAC tag. + * @return The length of the plaintext with the MAC tag stripped off. + * + * @throws ShortBufferException The plaintext buffer does not have + * enough space to store the decrypted data. + * + * @throws BadPaddingException The MAC value failed to verify. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * @throws IllegalArgumentException One of the parameters is out of range. + * + * The plaintext and ciphertext buffers can be the same for in-place + * decryption. In that case, ciphertextOffset must be identical to + * plaintextOffset. + */ + int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException; + + /** + * Creates a new instance of this cipher and initializes it with a key. + * + * @param key The buffer containing the key. + * @param offset The offset into the key buffer of the first key byte. + * @return A new CipherState of the same class as this one. + */ + CipherState fork(byte[] key, int offset); + + /** + * Sets the nonce value. + * + * @param nonce The new nonce value, which must be greater than or equal + * to the current value. + * + * This function is intended for testing purposes only. If the nonce + * value goes backwards then security may be compromised. + */ + void setNonce(long nonce); +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..80c4cfef1c3381c1b38be4c165e857e8b6d9934c --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/pre_context.md @@ -0,0 +1,1069 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java` (changed lines (188, 189, 190, 191, 192, 217, 218, 219, 223, 224, 225, 226, 227)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.GHASH; +import com.southernstorm.noise.crypto.RijndaelAES; + +/** + * Fallback implementation of "AESGCM" on platforms where + * the JCA/JCE does not have a suitable GCM or CTR provider. + */ +class AESGCMFallbackCipherState implements CipherState { + + private RijndaelAES aes; + private long n; + private byte[] iv; + private byte[] enciv; + private byte[] hashKey; + private GHASH ghash; + private boolean haskey; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + */ + public AESGCMFallbackCipherState() + { + aes = new RijndaelAES(); + n = 0; + iv = new byte [16]; + enciv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + haskey = false; + } + + @Override + public void destroy() { + aes.destroy(); + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + Noise.destroy(enciv); + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set up the AES key. + aes.setupEnc(key, offset, 256); + haskey = true; + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(hashKey, 0, hashKey, 0); + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + aes.encrypt(iv, 0, hashKey, 0); + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + /** + * Encrypts a block in CTR mode. + * + * @param plaintext The plaintext to encrypt. + * @param plaintextOffset Offset of the first plaintext byte. + * @param ciphertext The resulting ciphertext. + * @param ciphertextOffset Offset of the first ciphertext byte. + * @param length The number of bytes to encrypt. + * + * This function can also be used to decrypt. + */ + private void encryptCTR(byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) + { + while (length > 0) { + // Increment the IV and encrypt it to get the next keystream block. + if (++(iv[15]) == 0) + if (++(iv[14]) == 0) + if (++(iv[13]) == 0) + ++(iv[12]); + aes.encrypt(iv, 0, enciv, 0); + + // XOR the keystream block with the plaintext to create the ciphertext. + int temp = length; + if (temp > 16) + temp = 16; + for (int index = 0; index < temp; ++index) + ciphertext[ciphertextOffset + index] = (byte)(plaintext[plaintextOffset + index] ^ enciv[index]); + + // Advance to the next block. + plaintextOffset += temp; + ciphertextOffset += temp; + length -= temp; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encryptCTR(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (plaintextOffset > plaintext.length) + space = 0; + else + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(enciv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ enciv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encryptCTR(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + cipher = new AESGCMFallbackCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java` (changed lines (221, 222, 223, 224, 225, 265, 266, 267, 271, 272, 273, 274, 275)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import com.southernstorm.noise.crypto.GHASH; + +/** + * Emulates the "AESGCM" cipher for Noise using the "AES/CTR/NoPadding" + * transformation from JCA/JCE. + * + * This class is used on platforms that don't have "AES/GCM/NoPadding", + * but which do have the older "AES/CTR/NoPadding". + */ +class AESGCMOnCtrCipherState implements CipherState { + + private Cipher cipher; + private SecretKeySpec keySpec; + private long n; + private byte[] iv; + private byte[] hashKey; + private GHASH ghash; + + /** + * Constructs a new cipher state for the "AESGCM" algorithm. + * + * @throws NoSuchAlgorithmException The system does not have a + * provider for this algorithm. + */ + public AESGCMOnCtrCipherState() throws NoSuchAlgorithmException + { + try { + cipher = Cipher.getInstance("AES/CTR/NoPadding"); + } catch (NoSuchPaddingException e) { + // AES/CTR is available, but not the unpadded version? Huh? + throw new NoSuchAlgorithmException("AES/CTR/NoPadding not available", e); + } + keySpec = null; + n = 0; + iv = new byte [16]; + hashKey = new byte [16]; + ghash = new GHASH(); + + // Try to set a 256-bit key on the cipher. Some JCE's are + // configured to disallow 256-bit AES if an extra policy + // file has not been installed. + try { + SecretKeySpec spec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, spec, params); + } catch (InvalidKeyException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } catch (InvalidAlgorithmParameterException e) { + throw new NoSuchAlgorithmException("AES/CTR/NoPadding does not support 256-bit keys", e); + } + } + + @Override + public void destroy() { + // There doesn't seem to be a standard API to clean out a Cipher. + // So we instead set the key and IV to all-zeroes to hopefully + // destroy the sensitive data in the cipher instance. + ghash.destroy(); + Noise.destroy(hashKey); + Noise.destroy(iv); + keySpec = new SecretKeySpec(new byte [32], "AES"); + IvParameterSpec params = new IvParameterSpec(iv); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, params); + } catch (InvalidKeyException e) { + // Shouldn't happen. + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + } + } + + @Override + public String getCipherName() { + return "AESGCM"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return keySpec != null ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + // Set the encryption key. + keySpec = new SecretKeySpec(key, offset, 32, "AES"); + + // Generate the hashing key by encrypting a block of zeroes. + Arrays.fill(iv, (byte)0); + Arrays.fill(hashKey, (byte)0); + try { + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + try { + int result = cipher.update(hashKey, 0, 16, hashKey, 0); + cipher.doFinal(hashKey, result); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.reset(hashKey, 0); + + // Reset the nonce. + n = 0; + } + + @Override + public boolean hasKey() { + return keySpec != null; + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) throws InvalidKeyException, InvalidAlgorithmParameterException + { + // Check for nonce wrap-around. + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + + // Format the counter/IV block for AES/CTR/NoPadding. + iv[0] = 0; + iv[1] = 0; + iv[2] = 0; + iv[3] = 0; + iv[4] = (byte)(n >> 56); + iv[5] = (byte)(n >> 48); + iv[6] = (byte)(n >> 40); + iv[7] = (byte)(n >> 32); + iv[8] = (byte)(n >> 24); + iv[9] = (byte)(n >> 16); + iv[10] = (byte)(n >> 8); + iv[11] = (byte)n; + iv[12] = 0; + iv[13] = 0; + iv[14] = 0; + iv[15] = 1; + ++n; + + // Initialize the CTR mode cipher with the key and IV. + cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); + + // Encrypt a block of zeroes to generate the hash key to XOR + // the GHASH tag with at the end of the encrypt/decrypt operation. + Arrays.fill(hashKey, (byte)0); + try { + cipher.update(hashKey, 0, 16, hashKey, 0); + } catch (ShortBufferException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + + // Initialize the GHASH with the associated data value. + ghash.reset(); + if (ad != null) { + ghash.update(ad, 0, ad.length); + ghash.pad(); + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) + throws ShortBufferException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (keySpec == null) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + try { + setup(ad); + int result = cipher.update(plaintext, plaintextOffset, length, ciphertext, ciphertextOffset); + cipher.doFinal(ciphertext, ciphertextOffset + result); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, length); + ghash.pad(ad != null ? ad.length : 0, length); + ghash.finish(ciphertext, ciphertextOffset + length, 16); + for (int index = 0; index < 16; ++index) + ciphertext[ciphertextOffset + length + index] ^= hashKey[index]; + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (plaintextOffset > plaintext.length) + space = 0; + else + space = plaintext.length - plaintextOffset; + if (keySpec == null) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + try { + setup(ad); + } catch (InvalidKeyException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (InvalidAlgorithmParameterException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + ghash.update(ciphertext, ciphertextOffset, dataLen); + ghash.pad(ad != null ? ad.length : 0, dataLen); + ghash.finish(iv, 0, 16); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (hashKey[index] ^ iv[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + try { + int result = cipher.update(ciphertext, ciphertextOffset, dataLen, plaintext, plaintextOffset); + cipher.doFinal(plaintext, plaintextOffset + result); + } catch (IllegalBlockSizeException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } catch (BadPaddingException e) { + // Shouldn't happen. + throw new IllegalStateException(e); + } + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher; + try { + cipher = new AESGCMOnCtrCipherState(); + } catch (NoSuchAlgorithmException e) { + // Shouldn't happen. + return null; + } + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java` (changed lines (217, 218, 219, 220, 221, 244, 245, 246, 250, 251, 252, 253, 254)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import java.util.Arrays; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +import com.southernstorm.noise.crypto.ChaChaCore; +import com.southernstorm.noise.crypto.Poly1305; + +/** + * Implements the ChaChaPoly cipher for Noise. + */ +class ChaChaPolyCipherState implements CipherState { + + private Poly1305 poly; + private int[] input; + private int[] output; + private byte[] polyKey; + long n; + private boolean haskey; + + /** + * Constructs a new cipher state for the "ChaChaPoly" algorithm. + */ + public ChaChaPolyCipherState() + { + poly = new Poly1305(); + input = new int [16]; + output = new int [16]; + polyKey = new byte [32]; + n = 0; + haskey = false; + } + + @Override + public void destroy() { + poly.destroy(); + Arrays.fill(input, 0); + Arrays.fill(output, 0); + Noise.destroy(polyKey); + } + + @Override + public String getCipherName() { + return "ChaChaPoly"; + } + + @Override + public int getKeyLength() { + return 32; + } + + @Override + public int getMACLength() { + return haskey ? 16 : 0; + } + + @Override + public void initializeKey(byte[] key, int offset) { + ChaChaCore.initKey256(input, key, offset); + n = 0; + haskey = true; + } + + @Override + public boolean hasKey() { + return haskey; + } + + /** + * XOR's the output of ChaCha20 with a byte buffer. + * + * @param input The input byte buffer. + * @param inputOffset The offset of the first input byte. + * @param output The output byte buffer (can be the same as the input). + * @param outputOffset The offset of the first output byte. + * @param length The number of bytes to XOR between 1 and 64. + * @param block The ChaCha20 output block. + */ + private static void xorBlock(byte[] input, int inputOffset, byte[] output, int outputOffset, int length, int[] block) + { + int posn = 0; + int value; + while (length >= 4) { + value = block[posn++]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + output[outputOffset + 3] = (byte)(input[inputOffset + 3] ^ (value >> 24)); + inputOffset += 4; + outputOffset += 4; + length -= 4; + } + if (length == 3) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + output[outputOffset + 2] = (byte)(input[inputOffset + 2] ^ (value >> 16)); + } else if (length == 2) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + output[outputOffset + 1] = (byte)(input[inputOffset + 1] ^ (value >> 8)); + } else if (length == 1) { + value = block[posn]; + output[outputOffset] = (byte)(input[inputOffset] ^ value); + } + } + + /** + * Set up to encrypt or decrypt the next packet. + * + * @param ad The associated data for the packet. + */ + private void setup(byte[] ad) + { + if (n == -1L) + throw new IllegalStateException("Nonce has wrapped around"); + ChaChaCore.initIV(input, n++); + ChaChaCore.hash(output, input); + Arrays.fill(polyKey, (byte)0); + xorBlock(polyKey, 0, polyKey, 0, 32, output); + poly.reset(polyKey, 0); + if (ad != null) { + poly.update(ad, 0, ad.length); + poly.pad(); + } + if (++(input[12]) == 0) + ++(input[13]); + } + + /** + * Puts a 64-bit integer into a buffer in little-endian order. + * + * @param output The output buffer. + * @param offset The offset into the output buffer. + * @param value The 64-bit integer value. + */ + private static void putLittleEndian64(byte[] output, int offset, long value) + { + output[offset] = (byte)value; + output[offset + 1] = (byte)(value >> 8); + output[offset + 2] = (byte)(value >> 16); + output[offset + 3] = (byte)(value >> 24); + output[offset + 4] = (byte)(value >> 32); + output[offset + 5] = (byte)(value >> 40); + output[offset + 6] = (byte)(value >> 48); + output[offset + 7] = (byte)(value >> 56); + } + + /** + * Finishes up the authentication tag for a packet. + * + * @param ad The associated data. + * @param length The length of the plaintext data. + */ + private void finish(byte[] ad, int length) + { + poly.pad(); + putLittleEndian64(polyKey, 0, ad != null ? ad.length : 0); + putLittleEndian64(polyKey, 8, length); + poly.update(polyKey, 0, 16); + poly.finish(polyKey, 0); + } + + /** + * Encrypts or decrypts a buffer of bytes for the active packet. + * + * @param plaintext The plaintext data to be encrypted. + * @param plaintextOffset The offset to the first plaintext byte. + * @param ciphertext The ciphertext data that results from encryption. + * @param ciphertextOffset The offset to the first ciphertext byte. + * @param length The number of bytes to encrypt. + */ + private void encrypt(byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) { + while (length > 0) { + int tempLen = 64; + if (tempLen > length) + tempLen = length; + ChaChaCore.hash(output, input); + xorBlock(plaintext, plaintextOffset, ciphertext, ciphertextOffset, tempLen, output); + if (++(input[12]) == 0) + ++(input[13]); + plaintextOffset += tempLen; + ciphertextOffset += tempLen; + length -= tempLen; + } + } + + @Override + public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, + byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (!haskey) { + // The key is not set yet - return the plaintext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + return length; + } + if (space < 16 || length > (space - 16)) + throw new ShortBufferException(); + setup(ad); + encrypt(plaintext, plaintextOffset, ciphertext, ciphertextOffset, length); + poly.update(ciphertext, ciphertextOffset, length); + finish(ad, length); + System.arraycopy(polyKey, 0, ciphertext, ciphertextOffset + length, 16); + return length + 16; + } + + @Override + public int decryptWithAd(byte[] ad, byte[] ciphertext, + int ciphertextOffset, byte[] plaintext, int plaintextOffset, + int length) throws ShortBufferException, BadPaddingException { + int space; + if (ciphertextOffset > ciphertext.length) + space = 0; + else + space = ciphertext.length - ciphertextOffset; + if (length > space) + throw new ShortBufferException(); + if (plaintextOffset > plaintext.length) + space = 0; + else + space = plaintext.length - plaintextOffset; + if (!haskey) { + // The key is not set yet - return the ciphertext as-is. + if (length > space) + throw new ShortBufferException(); + if (plaintext != ciphertext || plaintextOffset != ciphertextOffset) + System.arraycopy(ciphertext, ciphertextOffset, plaintext, plaintextOffset, length); + return length; + } + if (length < 16) + Noise.throwBadTagException(); + int dataLen = length - 16; + if (dataLen > space) + throw new ShortBufferException(); + setup(ad); + poly.update(ciphertext, ciphertextOffset, dataLen); + finish(ad, dataLen); + int temp = 0; + for (int index = 0; index < 16; ++index) + temp |= (polyKey[index] ^ ciphertext[ciphertextOffset + dataLen + index]); + if ((temp & 0xFF) != 0) + Noise.throwBadTagException(); + encrypt(ciphertext, ciphertextOffset, plaintext, plaintextOffset, dataLen); + return dataLen; + } + + @Override + public CipherState fork(byte[] key, int offset) { + CipherState cipher = new ChaChaPolyCipherState(); + cipher.initializeKey(key, offset); + return cipher; + } + + @Override + public void setNonce(long nonce) { + n = nonce; + } +} +``` + +## `src/main/java/com/southernstorm/noise/protocol/CipherState.java` (changed lines (103, 133)) + +```java +/* + * Copyright (C) 2016 Southern Storm Software, Pty Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.southernstorm.noise.protocol; + +import javax.crypto.BadPaddingException; +import javax.crypto.ShortBufferException; + +/** + * Interface to an authenticated cipher for use in the Noise protocol. + * + * CipherState objects are used to encrypt or decrypt data during a + * session. Once the handshake has completed, HandshakeState.split() + * will create two CipherState objects for encrypting packets sent to + * the other party, and decrypting packets received from the other party. + */ +public interface CipherState extends Destroyable { + + /** + * Gets the Noise protocol name for this cipher. + * + * @return The cipher name. + */ + String getCipherName(); + + /** + * Gets the length of the key values for this cipher. + * + * @return The length of the key in bytes; usually 32. + */ + int getKeyLength(); + + /** + * Gets the length of the MAC values for this cipher. + * + * @return The length of MAC values in bytes, or zero if the + * key has not yet been initialized. + */ + int getMACLength(); + + /** + * Initializes the key on this cipher object. + * + * @param key Points to a buffer that contains the key. + * @param offset The offset of the key in the key buffer. + * + * The key buffer must contain at least getKeyLength() bytes + * starting at offset. + * + * @see #hasKey() + */ + void initializeKey(byte[] key, int offset); + + /** + * Determine if this cipher object has been configured with a key. + * + * @return true if this cipher object has a key; false if the + * key has not yet been set with initializeKey(). + * + * @see #initializeKey(byte[], int) + */ + boolean hasKey(); + + /** + * Encrypts a plaintext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param plaintext The buffer containing the plaintext to encrypt. + * @param plaintextOffset The offset within the plaintext buffer of the + * first byte or plaintext data. + * @param ciphertext The buffer to place the ciphertext in. This can + * be the same as the plaintext buffer. + * @param ciphertextOffset The first offset within the ciphertext buffer + * to place the ciphertext and the MAC tag. + * @param length The length of the plaintext. + * @return The length of the ciphertext plus the MAC tag, or -1 if the + * ciphertext buffer is not large enough to hold the result. + * + * @throws ShortBufferException The ciphertext buffer does not have + * enough space to hold the ciphertext plus MAC. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * The plaintext and ciphertext buffers can be the same for in-place + * encryption. In that case, plaintextOffset must be identical to + * ciphertextOffset. + * + * There must be enough space in the ciphertext buffer to accomodate + * length + getMACLength() bytes of data starting at ciphertextOffset. + */ + int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException; + + /** + * Decrypts a ciphertext buffer using the cipher and a block of associated data. + * + * @param ad The associated data, or null if there is none. + * @param ciphertext The buffer containing the ciphertext to decrypt. + * @param ciphertextOffset The offset within the ciphertext buffer of + * the first byte of ciphertext data. + * @param plaintext The buffer to place the plaintext in. This can be + * the same as the ciphertext buffer. + * @param plaintextOffset The first offset within the plaintext buffer + * to place the plaintext. + * @param length The length of the incoming ciphertext plus the MAC tag. + * @return The length of the plaintext with the MAC tag stripped off. + * + * @throws ShortBufferException The plaintext buffer does not have + * enough space to store the decrypted data. + * + * @throws BadPaddingException The MAC value failed to verify. + * + * @throws IllegalStateException The nonce has wrapped around. + * + * The plaintext and ciphertext buffers can be the same for in-place + * decryption. In that case, ciphertextOffset must be identical to + * plaintextOffset. + */ + int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException; + + /** + * Creates a new instance of this cipher and initializes it with a key. + * + * @param key The buffer containing the key. + * @param offset The offset into the key buffer of the first key byte. + * @return A new CipherState of the same class as this one. + */ + CipherState fork(byte[] key, int offset); + + /** + * Sets the nonce value. + * + * @param nonce The new nonce value, which must be greater than or equal + * to the current value. + * + * This function is intended for testing purposes only. If the nonce + * value goes backwards then security may be compromised. + */ + void setNonce(long nonce); +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/task.json new file mode 100644 index 0000000000000000000000000000000000000000..eb1c5b0679be66b00052b9ed374d47061684dd52 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/task.json @@ -0,0 +1,53 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-21b89e6983680bd0068c", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-21b89e6983680bd0068c", + "project_id": "morefixes__rweather__noise-java", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/CipherState.java" + ], + "patch_units": { + "before": [ + "src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/CipherState.java" + ], + "after": [ + "src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java", + "src/main/java/com/southernstorm/noise/protocol/CipherState.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/33858cf98c185cc8b7e5afc90a733ed237d54c4f9f4ee6452d01abb77542094e/database", + "cache_key": "33858cf98c185cc8b7e5afc90a733ed237d54c4f9f4ee6452d01abb77542094e", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/477f7f32d126a34b1b8942c75148d7ec9f134a2f34b2883bfa80815246559dcd/database", + "cache_key": "477f7f32d126a34b1b8942c75148d7ec9f134a2f34b2883bfa80815246559dcd", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/4c263a54c66ea2f20b42a1955c6d1854523ded76aaddd393ca8a8f94f211b130/database", + "cache_key": "4c263a54c66ea2f20b42a1955c6d1854523ded76aaddd393ca8a8f94f211b130", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-21b89e6983680bd0068c/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-21b89e6983680bd0068c/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-21b89e6983680bd0068c/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..707fc7f50714c5b0064e13ad4d081843ce9d3425 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/patch.diff @@ -0,0 +1,824 @@ +diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/Environment.java b/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/Environment.java +new file mode 100644 +index 0000000..9b9e178 +--- /dev/null ++++ b/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/Environment.java +@@ -0,0 +1,38 @@ ++/* ++ * Copyright 2022, Google Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are ++ * met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above ++ * copyright notice, this list of conditions and the following disclaimer ++ * in the documentation and/or other materials provided with the ++ * distribution. ++ * ++ * * Neither the name of Google Inc. nor the names of its ++ * contributors may be used to endorse or promote products derived from ++ * this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++package com.google.api.client.auth.openidconnect; ++ ++class Environment { ++ public String getVariable(String name) { ++ return System.getenv(name); ++ } ++} +diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/HttpTransportFactory.java b/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/HttpTransportFactory.java +new file mode 100644 +index 0000000..4ec046d +--- /dev/null ++++ b/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/HttpTransportFactory.java +@@ -0,0 +1,50 @@ ++/* ++ * Copyright 2022, Google Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are ++ * met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above ++ * copyright notice, this list of conditions and the following disclaimer ++ * in the documentation and/or other materials provided with the ++ * distribution. ++ * ++ * * Neither the name of Google Inc. nor the names of its ++ * contributors may be used to endorse or promote products derived from ++ * this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++package com.google.api.client.auth.openidconnect; ++ ++import com.google.api.client.http.HttpTransport; ++ ++/** ++ * A base interface for all {@link HttpTransport} factories. ++ * ++ *

Implementation must provide a public no-arg constructor. Loading of a factory implementation ++ * is done via {@link java.util.ServiceLoader}. ++ */ ++public interface HttpTransportFactory { ++ ++ /** ++ * Creates a {@code HttpTransport} instance. ++ * ++ * @return The HttpTransport instance. ++ */ ++ HttpTransport create(); ++} +diff --git a/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java b/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java +index 6f97418..9f3c446 100644 +--- a/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java ++++ b/google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java +@@ -14,11 +14,53 @@ + + package com.google.api.client.auth.openidconnect; + ++import com.google.api.client.http.GenericUrl; ++import com.google.api.client.http.HttpRequest; ++import com.google.api.client.http.HttpResponse; ++import com.google.api.client.http.HttpTransport; ++import com.google.api.client.http.javanet.NetHttpTransport; ++import com.google.api.client.json.GenericJson; ++import com.google.api.client.json.gson.GsonFactory; ++import com.google.api.client.json.webtoken.JsonWebSignature.Header; ++import com.google.api.client.util.Base64; + import com.google.api.client.util.Beta; + import com.google.api.client.util.Clock; ++import com.google.api.client.util.Key; + import com.google.api.client.util.Preconditions; ++import com.google.common.annotations.VisibleForTesting; ++import com.google.common.cache.CacheBuilder; ++import com.google.common.cache.CacheLoader; ++import com.google.common.cache.LoadingCache; ++import com.google.common.collect.ImmutableMap; ++import com.google.common.collect.ImmutableSet; ++import com.google.common.util.concurrent.UncheckedExecutionException; ++import java.io.ByteArrayInputStream; ++import java.io.IOException; ++import java.io.UnsupportedEncodingException; ++import java.math.BigInteger; ++import java.security.AlgorithmParameters; ++import java.security.GeneralSecurityException; ++import java.security.KeyFactory; ++import java.security.NoSuchAlgorithmException; ++import java.security.PublicKey; ++import java.security.cert.CertificateException; ++import java.security.cert.CertificateFactory; ++import java.security.spec.ECGenParameterSpec; ++import java.security.spec.ECParameterSpec; ++import java.security.spec.ECPoint; ++import java.security.spec.ECPublicKeySpec; ++import java.security.spec.InvalidKeySpecException; ++import java.security.spec.InvalidParameterSpecException; ++import java.security.spec.RSAPublicKeySpec; + import java.util.Collection; + import java.util.Collections; ++import java.util.List; ++import java.util.Map; ++import java.util.Set; ++import java.util.concurrent.ExecutionException; ++import java.util.concurrent.TimeUnit; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * {@link Beta}
+@@ -39,6 +81,25 @@ import java.util.Collections; + * if (!verifier.verify(idToken)) {...} + * + * ++ * The verifier validates token signature per current OpenID Connect Spec: ++ * https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation By default, method gets a ++ * certificate from well-known location A request to certificate location is performed using {@link ++ * com.google.api.client.http.javanet.NetHttpTransport} Either or both certificate location and ++ * transport implementation can be overridden via {@link Builder} ++ * ++ *

++ * IdTokenVerifier verifier = new IdTokenVerifier.Builder()
++ * .setIssuer("issuer.example.com")
++ * .setAudience(Arrays.asList("myClientId"))
++ * .setHttpTransportFactory(customHttpTransportFactory)
++ * .build();
++ * ...
++ * if (!verifier.verify(idToken)) {...}
++ * 
++ * ++ * not recommended: this check can be disabled with OAUTH_CLIENT_SKIP_SIGNATURE environment variable ++ * set to true. ++ * + *

Note that {@link #verify(IdToken)} only implements a subset of the verification steps, mostly + * just the MUST steps. Please read SUPPORTED_ALGORITHMS = ImmutableSet.of("RS256", "ES256"); ++ private static final String NOT_SUPPORTED_ALGORITHM = ++ "Unexpected signing algorithm %s: expected either RS256 or ES256"; ++ ++ static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); ++ static final String SKIP_SIGNATURE_ENV_VAR = "OAUTH_CLIENT_SKIP_SIGNATURE"; + /** Default value for seconds of time skew to accept when verifying time (5 minutes). */ + public static final long DEFAULT_TIME_SKEW_SECONDS = 300; + + /** Clock to use for expiration checks. */ + private final Clock clock; + ++ private final String certificatesLocation; ++ private final Environment environment; ++ private final LoadingCache> publicKeyCache; ++ + /** Seconds of time skew to accept when verifying time. */ + private final long acceptableTimeSkewSeconds; + +@@ -76,11 +150,21 @@ public class IdTokenVerifier { + + /** @param builder builder */ + protected IdTokenVerifier(Builder builder) { ++ this.certificatesLocation = builder.certificatesLocation; + clock = builder.clock; + acceptableTimeSkewSeconds = builder.acceptableTimeSkewSeconds; + issuers = builder.issuers == null ? null : Collections.unmodifiableCollection(builder.issuers); + audience = + builder.audience == null ? null : Collections.unmodifiableCollection(builder.audience); ++ HttpTransportFactory transport = ++ builder.httpTransportFactory == null ++ ? new DefaultHttpTransportFactory() ++ : builder.httpTransportFactory; ++ this.publicKeyCache = ++ CacheBuilder.newBuilder() ++ .expireAfterWrite(1, TimeUnit.HOURS) ++ .build(new PublicKeyLoader(transport)); ++ this.environment = builder.environment == null ? new Environment() : builder.environment; + } + + /** Returns the clock. */ +@@ -134,6 +218,13 @@ public class IdTokenVerifier { + *

  • The current time against the issued at and expiration time, using the {@link #getClock()} + * and allowing for a time skew specified in {@link #getAcceptableTimeSkewSeconds()} , by + * calling {@link IdToken#verifyTime(long, long)}. ++ *
  • This method verifies token signature per current OpenID Connect Spec: ++ * https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation. By default, ++ * method gets a certificate from well-known location. A request to certificate location is ++ * performed using {@link com.google.api.client.http.javanet.NetHttpTransport} Both ++ * certificate location and transport implementation can be overridden via {@link Builder} ++ * not recommended: this check can be disabled with OAUTH_CLIENT_SKIP_SIGNATURE environment ++ * variable set to true. + * + * + *

    Overriding is allowed, but it must call the super implementation. +@@ -142,9 +233,74 @@ public class IdTokenVerifier { + * @return {@code true} if verified successfully or {@code false} if failed + */ + public boolean verify(IdToken idToken) { +- return (issuers == null || idToken.verifyIssuer(issuers)) +- && (audience == null || idToken.verifyAudience(audience)) +- && idToken.verifyTime(clock.currentTimeMillis(), acceptableTimeSkewSeconds); ++ boolean tokenFieldsValid = ++ (issuers == null || idToken.verifyIssuer(issuers)) ++ && (audience == null || idToken.verifyAudience(audience)) ++ && idToken.verifyTime(clock.currentTimeMillis(), acceptableTimeSkewSeconds); ++ ++ if (!tokenFieldsValid) { ++ return false; ++ } ++ ++ try { ++ return verifySignature(idToken); ++ } catch (VerificationException ex) { ++ LOGGER.log( ++ Level.SEVERE, ++ "id token signature verification failed. " ++ + "Please see docs for IdTokenVerifier for default settings and configuration options", ++ ex); ++ return false; ++ } ++ } ++ ++ @VisibleForTesting ++ boolean verifySignature(IdToken idToken) throws VerificationException { ++ if (Boolean.parseBoolean(environment.getVariable(SKIP_SIGNATURE_ENV_VAR))) { ++ return true; ++ } ++ ++ // Short-circuit signature types ++ if (!SUPPORTED_ALGORITHMS.contains(idToken.getHeader().getAlgorithm())) { ++ throw new VerificationException( ++ String.format(NOT_SUPPORTED_ALGORITHM, idToken.getHeader().getAlgorithm())); ++ } ++ ++ PublicKey publicKeyToUse = null; ++ try { ++ String certificateLocation = getCertificateLocation(idToken.getHeader()); ++ publicKeyToUse = publicKeyCache.get(certificateLocation).get(idToken.getHeader().getKeyId()); ++ } catch (ExecutionException | UncheckedExecutionException e) { ++ throw new VerificationException( ++ "Error fetching PublicKey from certificate location " + certificatesLocation, e); ++ } ++ ++ if (publicKeyToUse == null) { ++ throw new VerificationException( ++ "Could not find PublicKey for provided keyId: " + idToken.getHeader().getKeyId()); ++ } ++ ++ try { ++ if (idToken.verifySignature(publicKeyToUse)) { ++ return true; ++ } ++ throw new VerificationException("Invalid signature"); ++ } catch (GeneralSecurityException e) { ++ throw new VerificationException("Error validating token", e); ++ } ++ } ++ ++ private String getCertificateLocation(Header header) throws VerificationException { ++ if (certificatesLocation != null) return certificatesLocation; ++ ++ switch (header.getAlgorithm()) { ++ case "RS256": ++ return FEDERATED_SIGNON_CERT_URL; ++ case "ES256": ++ return IAP_CERT_URL; ++ } ++ ++ throw new VerificationException(String.format(NOT_SUPPORTED_ALGORITHM, header.getAlgorithm())); + } + + /** +@@ -161,6 +317,11 @@ public class IdTokenVerifier { + /** Clock. */ + Clock clock = Clock.SYSTEM; + ++ String certificatesLocation; ++ ++ /** wrapper for environment variables */ ++ Environment environment; ++ + /** Seconds of time skew to accept when verifying time. */ + long acceptableTimeSkewSeconds = DEFAULT_TIME_SKEW_SECONDS; + +@@ -170,6 +331,8 @@ public class IdTokenVerifier { + /** List of trusted audience client IDs or {@code null} to suppress the audience check. */ + Collection audience; + ++ HttpTransportFactory httpTransportFactory; ++ + /** Builds a new instance of {@link IdTokenVerifier}. */ + public IdTokenVerifier build() { + return new IdTokenVerifier(this); +@@ -216,6 +379,18 @@ public class IdTokenVerifier { + } + } + ++ /** ++ * Override the location URL that contains published public keys. Defaults to well-known Google ++ * locations. ++ * ++ * @param certificatesLocation URL to published public keys ++ * @return the builder ++ */ ++ public Builder setCertificatesLocation(String certificatesLocation) { ++ this.certificatesLocation = certificatesLocation; ++ return this; ++ } ++ + /** + * Returns the equivalent expected issuers or {@code null} if issuer check suppressed. + * +@@ -280,5 +455,173 @@ public class IdTokenVerifier { + this.acceptableTimeSkewSeconds = acceptableTimeSkewSeconds; + return this; + } ++ ++ /** Returns an instance of the {@link Environment} */ ++ final Environment getEnvironment() { ++ return environment; ++ } ++ ++ /** Sets the environment. Used mostly for testing */ ++ Builder setEnvironment(Environment environment) { ++ this.environment = environment; ++ return this; ++ } ++ ++ /** ++ * Sets the HttpTransportFactory used for requesting public keys from the certificate URL. Used ++ * mostly for testing. ++ * ++ * @param httpTransportFactory the HttpTransportFactory used to build certificate URL requests ++ * @return the builder ++ */ ++ public Builder setHttpTransportFactory(HttpTransportFactory httpTransportFactory) { ++ this.httpTransportFactory = httpTransportFactory; ++ return this; ++ } ++ } ++ ++ /** Custom CacheLoader for mapping certificate urls to the contained public keys. */ ++ static class PublicKeyLoader extends CacheLoader> { ++ private final HttpTransportFactory httpTransportFactory; ++ ++ /** ++ * Data class used for deserializing a JSON Web Key Set (JWKS) from an external HTTP request. ++ */ ++ public static class JsonWebKeySet extends GenericJson { ++ @Key public List keys; ++ } ++ ++ /** Data class used for deserializing a single JSON Web Key. */ ++ public static class JsonWebKey { ++ @Key public String alg; ++ ++ @Key public String crv; ++ ++ @Key public String kid; ++ ++ @Key public String kty; ++ ++ @Key public String use; ++ ++ @Key public String x; ++ ++ @Key public String y; ++ ++ @Key public String e; ++ ++ @Key public String n; ++ } ++ ++ PublicKeyLoader(HttpTransportFactory httpTransportFactory) { ++ super(); ++ this.httpTransportFactory = httpTransportFactory; ++ } ++ ++ @Override ++ public Map load(String certificateUrl) throws Exception { ++ HttpTransport httpTransport = httpTransportFactory.create(); ++ JsonWebKeySet jwks; ++ try { ++ HttpRequest request = ++ httpTransport ++ .createRequestFactory() ++ .buildGetRequest(new GenericUrl(certificateUrl)) ++ .setParser(GsonFactory.getDefaultInstance().createJsonObjectParser()); ++ HttpResponse response = request.execute(); ++ jwks = response.parseAs(JsonWebKeySet.class); ++ } catch (IOException io) { ++ LOGGER.log( ++ Level.WARNING, ++ "Failed to get a certificate from certificate location " + certificateUrl, ++ io); ++ return ImmutableMap.of(); ++ } ++ ++ ImmutableMap.Builder keyCacheBuilder = new ImmutableMap.Builder<>(); ++ if (jwks.keys == null) { ++ // Fall back to x509 formatted specification ++ for (String keyId : jwks.keySet()) { ++ String publicKeyPem = (String) jwks.get(keyId); ++ keyCacheBuilder.put(keyId, buildPublicKey(publicKeyPem)); ++ } ++ } else { ++ for (JsonWebKey key : jwks.keys) { ++ try { ++ keyCacheBuilder.put(key.kid, buildPublicKey(key)); ++ } catch (NoSuchAlgorithmException ++ | InvalidKeySpecException ++ | InvalidParameterSpecException ignored) { ++ LOGGER.log(Level.WARNING, "Failed to put a key into the cache", ignored); ++ } ++ } ++ } ++ ++ return keyCacheBuilder.build(); ++ } ++ ++ private PublicKey buildPublicKey(JsonWebKey key) ++ throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeySpecException { ++ if ("ES256".equals(key.alg)) { ++ return buildEs256PublicKey(key); ++ } else if ("RS256".equals((key.alg))) { ++ return buildRs256PublicKey(key); ++ } else { ++ return null; ++ } ++ } ++ ++ private PublicKey buildPublicKey(String publicPem) ++ throws CertificateException, UnsupportedEncodingException { ++ return CertificateFactory.getInstance("X.509") ++ .generateCertificate(new ByteArrayInputStream(publicPem.getBytes("UTF-8"))) ++ .getPublicKey(); ++ } ++ ++ private PublicKey buildRs256PublicKey(JsonWebKey key) ++ throws NoSuchAlgorithmException, InvalidKeySpecException { ++ com.google.common.base.Preconditions.checkArgument("RSA".equals(key.kty)); ++ com.google.common.base.Preconditions.checkNotNull(key.e); ++ com.google.common.base.Preconditions.checkNotNull(key.n); ++ ++ BigInteger modulus = new BigInteger(1, Base64.decodeBase64(key.n)); ++ BigInteger exponent = new BigInteger(1, Base64.decodeBase64(key.e)); ++ ++ RSAPublicKeySpec spec = new RSAPublicKeySpec(modulus, exponent); ++ KeyFactory factory = KeyFactory.getInstance("RSA"); ++ return factory.generatePublic(spec); ++ } ++ ++ private PublicKey buildEs256PublicKey(JsonWebKey key) ++ throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeySpecException { ++ com.google.common.base.Preconditions.checkArgument("EC".equals(key.kty)); ++ com.google.common.base.Preconditions.checkArgument("P-256".equals(key.crv)); ++ ++ BigInteger x = new BigInteger(1, Base64.decodeBase64(key.x)); ++ BigInteger y = new BigInteger(1, Base64.decodeBase64(key.y)); ++ ECPoint pubPoint = new ECPoint(x, y); ++ AlgorithmParameters parameters = AlgorithmParameters.getInstance("EC"); ++ parameters.init(new ECGenParameterSpec("secp256r1")); ++ ECParameterSpec ecParameters = parameters.getParameterSpec(ECParameterSpec.class); ++ ECPublicKeySpec pubSpec = new ECPublicKeySpec(pubPoint, ecParameters); ++ KeyFactory kf = KeyFactory.getInstance("EC"); ++ return kf.generatePublic(pubSpec); ++ } ++ } ++ ++ /** Custom exception for wrapping all verification errors. */ ++ static class VerificationException extends Exception { ++ public VerificationException(String message) { ++ super(message); ++ } ++ ++ public VerificationException(String message, Throwable cause) { ++ super(message, cause); ++ } ++ } ++ ++ static class DefaultHttpTransportFactory implements HttpTransportFactory { ++ public HttpTransport create() { ++ return HTTP_TRANSPORT; ++ } + } + } +diff --git a/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java b/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java +index 9db0e98..cf32e8e 100644 +--- a/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java ++++ b/google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java +@@ -15,12 +15,29 @@ + package com.google.api.client.auth.openidconnect; + + import com.google.api.client.auth.openidconnect.IdToken.Payload; ++import com.google.api.client.auth.openidconnect.IdTokenVerifier.VerificationException; ++import com.google.api.client.http.HttpTransport; ++import com.google.api.client.http.LowLevelHttpRequest; ++import com.google.api.client.http.LowLevelHttpResponse; ++import com.google.api.client.http.javanet.NetHttpTransport; ++import com.google.api.client.json.JsonFactory; ++import com.google.api.client.json.gson.GsonFactory; + import com.google.api.client.json.webtoken.JsonWebSignature.Header; ++import com.google.api.client.testing.http.MockHttpTransport; ++import com.google.api.client.testing.http.MockLowLevelHttpRequest; ++import com.google.api.client.testing.http.MockLowLevelHttpResponse; + import com.google.api.client.util.Clock; + import com.google.api.client.util.Lists; ++import com.google.common.io.CharStreams; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.InputStreamReader; ++import java.io.Reader; + import java.util.Arrays; + import java.util.Collections; ++import java.util.HashMap; + import java.util.List; ++import java.util.Map; + import junit.framework.TestCase; + + /** +@@ -39,6 +56,25 @@ public class IdTokenVerifierTest extends TestCase { + private static final String ISSUER2 = ISSUER + "2"; + private static final String ISSUER3 = ISSUER + "3"; + ++ private static final String ES256_TOKEN = ++ "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im1wZjBEQSJ9.eyJhdWQiOiIvcHJvamVjdHMvNjUyNTYyNzc2Nzk4L2FwcHMvY2xvdWQtc2FtcGxlcy10ZXN0cy1waHAtaWFwIiwiZW1haWwiOiJjaGluZ29yQGdvb2dsZS5jb20iLCJleHAiOjE1ODQwNDc2MTcsImdvb2dsZSI6eyJhY2Nlc3NfbGV2ZWxzIjpbImFjY2Vzc1BvbGljaWVzLzUxODU1MTI4MDkyNC9hY2Nlc3NMZXZlbHMvcmVjZW50U2VjdXJlQ29ubmVjdERhdGEiLCJhY2Nlc3NQb2xpY2llcy81MTg1NTEyODA5MjQvYWNjZXNzTGV2ZWxzL3Rlc3ROb09wIiwiYWNjZXNzUG9saWNpZXMvNTE4NTUxMjgwOTI0L2FjY2Vzc0xldmVscy9ldmFwb3JhdGlvblFhRGF0YUZ1bGx5VHJ1c3RlZCJdfSwiaGQiOiJnb29nbGUuY29tIiwiaWF0IjoxNTg0MDQ3MDE3LCJpc3MiOiJodHRwczovL2Nsb3VkLmdvb2dsZS5jb20vaWFwIiwic3ViIjoiYWNjb3VudHMuZ29vZ2xlLmNvbToxMTIxODE3MTI3NzEyMDE5NzI4OTEifQ.yKNtdFY5EKkRboYNexBdfugzLhC3VuGyFcuFYA8kgpxMqfyxa41zkML68hYKrWu2kOBTUW95UnbGpsIi_u1fiA"; ++ ++ private static final String FEDERATED_SIGNON_RS256_TOKEN = ++ "eyJhbGciOiJSUzI1NiIsImtpZCI6ImY5ZDk3YjRjYWU5MGJjZDc2YWViMjAwMjZmNmI3NzBjYWMyMjE3ODMiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL3BhdGgiLCJhenAiOiJpbnRlZ3JhdGlvbi10ZXN0c0BjaGluZ29yLXRlc3QuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJlbWFpbCI6ImludGVncmF0aW9uLXRlc3RzQGNoaW5nb3ItdGVzdC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJleHAiOjE1ODc2Mjk4ODgsImlhdCI6MTU4NzYyNjI4OCwiaXNzIjoiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA0MDI5MjkyODUzMDk5OTc4MjkzIn0.Pj4KsJh7riU7ZIbPMcHcHWhasWEcbVjGP4yx_5E0iOpeDalTdri97E-o0dSSkuVX2FeBIgGUg_TNNgJ3YY97T737jT5DUYwdv6M51dDlLmmNqlu_P6toGCSRC8-Beu5gGmqS2Y82TmpHH9Vhoh5PsK7_rVHk8U6VrrVVKKTWm_IzTFhqX1oYKPdvfyaNLsXPbCt_NFE0C3DNmFkgVhRJu7LtzQQN-ghaqd3Ga3i6KH222OEI_PU4BUTvEiNOqRGoMlT_YOsyFN3XwqQ6jQGWhhkArL1z3CG2BVQjHTKpgVsRyy_H6WTZiju2Q-XWobgH-UPSZbyymV8-cFT9XKEtZQ"; ++ private static final String LEGACY_FEDERATED_SIGNON_CERT_URL = ++ "https://www.googleapis.com/oauth2/v1/certs"; ++ ++ private static final String SERVICE_ACCOUNT_RS256_TOKEN = ++ "eyJhbGciOiJSUzI1NiIsImtpZCI6IjJlZjc3YjM4YTFiMDM3MDQ4NzA0MzkxNmFjYmYyN2Q3NGVkZDA4YjEiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL2F1ZGllbmNlIiwiZXhwIjoxNTg3NjMwNTQzLCJpYXQiOjE1ODc2MjY5NDMsImlzcyI6InNvbWUgaXNzdWVyIiwic3ViIjoic29tZSBzdWJqZWN0In0.gGOQW0qQgs4jGUmCsgRV83RqsJLaEy89-ZOG6p1u0Y26FyY06b6Odgd7xXLsSTiiSnch62dl0Lfi9D0x2ByxvsGOCbovmBl2ZZ0zHr1wpc4N0XS9lMUq5RJQbonDibxXG4nC2zroDfvD0h7i-L8KMXeJb9pYwW7LkmrM_YwYfJnWnZ4bpcsDjojmPeUBlACg7tjjOgBFbyQZvUtaERJwSRlaWibvNjof7eCVfZChE0PwBpZc_cGqSqKXv544L4ttqdCnmONjqrTATXwC4gYxruevkjHfYI5ojcQmXoWDJJ0-_jzfyPE4MFFdCFgzLgnfIOwe5ve0MtquKuv2O0pgvg"; ++ private static final String SERVICE_ACCOUNT_CERT_URL = ++ "https://www.googleapis.com/robot/v1/metadata/x509/integration-tests%40chingor-test.iam.gserviceaccount.com"; ++ ++ private static final List ALL_TOKENS = ++ Arrays.asList(ES256_TOKEN, FEDERATED_SIGNON_RS256_TOKEN, SERVICE_ACCOUNT_RS256_TOKEN); ++ ++ static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance(); ++ static final MockClock FIXED_CLOCK = new MockClock(1584047020000L); ++ + private static IdToken newIdToken(String issuer, String audience) { + Payload payload = new Payload(); + payload.setIssuer(issuer); +@@ -54,8 +90,8 @@ public class IdTokenVerifierTest extends TestCase { + assertEquals(Clock.SYSTEM, builder.getClock()); + assertEquals(ISSUER, builder.getIssuer()); + assertEquals(Collections.singleton(ISSUER), builder.getIssuers()); +- assertTrue(TRUSTED_CLIENT_IDS.equals(builder.getAudience())); +- Clock clock = new MyClock(); ++ assertEquals(TRUSTED_CLIENT_IDS, builder.getAudience()); ++ Clock clock = new MockClock(); + builder.setClock(clock); + assertEquals(clock, builder.getClock()); + IdTokenVerifier verifier = builder.build(); +@@ -65,25 +101,22 @@ public class IdTokenVerifierTest extends TestCase { + assertEquals(TRUSTED_CLIENT_IDS, Lists.newArrayList(verifier.getAudience())); + } + +- static class MyClock implements Clock { +- +- long timeMillis; +- +- public long currentTimeMillis() { +- return timeMillis; +- } +- } +- + public void testVerify() throws Exception { +- MyClock clock = new MyClock(); ++ MockClock clock = new MockClock(); ++ MockEnvironment testEnvironment = new MockEnvironment(); ++ testEnvironment.setVariable(IdTokenVerifier.SKIP_SIGNATURE_ENV_VAR, "true"); + IdTokenVerifier verifier = + new IdTokenVerifier.Builder() + .setIssuers(Arrays.asList(ISSUER, ISSUER3)) + .setAudience(Arrays.asList(CLIENT_ID)) + .setClock(clock) ++ .setEnvironment(testEnvironment) + .build(); ++ + // verifier flexible doesn't check issuer and audience +- IdTokenVerifier verifierFlexible = new IdTokenVerifier.Builder().setClock(clock).build(); ++ IdTokenVerifier verifierFlexible = ++ new IdTokenVerifier.Builder().setClock(clock).setEnvironment(testEnvironment).build(); ++ + // issuer + clock.timeMillis = 1500000L; + IdToken idToken = newIdToken(ISSUER, CLIENT_ID); +@@ -138,10 +171,10 @@ public class IdTokenVerifierTest extends TestCase { + assertNull(verifier.getIssuer()); + } + +- public void testMissingAudience() { ++ public void testMissingAudience() throws VerificationException { + IdToken idToken = newIdToken(ISSUER, null); + +- MyClock clock = new MyClock(); ++ MockClock clock = new MockClock(); + clock.timeMillis = 1500000L; + IdTokenVerifier verifier = + new IdTokenVerifier.Builder() +@@ -151,4 +184,165 @@ public class IdTokenVerifierTest extends TestCase { + .build(); + assertFalse(verifier.verify(idToken)); + } ++ ++ public void testVerifyEs256TokenPublicKeyMismatch() throws Exception { ++ // Mock HTTP requests ++ HttpTransportFactory httpTransportFactory = ++ new HttpTransportFactory() { ++ @Override ++ public HttpTransport create() { ++ return new MockHttpTransport() { ++ @Override ++ public LowLevelHttpRequest buildRequest(String method, String url) ++ throws IOException { ++ return new MockLowLevelHttpRequest() { ++ @Override ++ public LowLevelHttpResponse execute() throws IOException { ++ MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); ++ response.setStatusCode(200); ++ response.setContentType("application/json"); ++ response.setContent(""); ++ return response; ++ } ++ }; ++ } ++ }; ++ } ++ }; ++ IdTokenVerifier tokenVerifier = ++ new IdTokenVerifier.Builder() ++ .setClock(FIXED_CLOCK) ++ .setHttpTransportFactory(httpTransportFactory) ++ .build(); ++ ++ try { ++ tokenVerifier.verifySignature(IdToken.parse(JSON_FACTORY, ES256_TOKEN)); ++ fail("Should have failed verification"); ++ } catch (VerificationException ex) { ++ assertTrue(ex.getMessage().contains("Error fetching PublicKey")); ++ } ++ } ++ ++ public void testVerifyEs256Token() throws VerificationException, IOException { ++ HttpTransportFactory httpTransportFactory = ++ mockTransport( ++ "https://www.gstatic.com/iap/verify/public_key-jwk", ++ readResourceAsString("iap_keys.json")); ++ IdTokenVerifier tokenVerifier = ++ new IdTokenVerifier.Builder() ++ .setClock(FIXED_CLOCK) ++ .setHttpTransportFactory(httpTransportFactory) ++ .build(); ++ assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, ES256_TOKEN))); ++ } ++ ++ public void testVerifyRs256Token() throws VerificationException, IOException { ++ HttpTransportFactory httpTransportFactory = ++ mockTransport( ++ "https://www.googleapis.com/oauth2/v3/certs", ++ readResourceAsString("federated_keys.json")); ++ MockClock clock = new MockClock(1587625988000L); ++ IdTokenVerifier tokenVerifier = ++ new IdTokenVerifier.Builder() ++ .setClock(clock) ++ .setHttpTransportFactory(httpTransportFactory) ++ .build(); ++ assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, FEDERATED_SIGNON_RS256_TOKEN))); ++ } ++ ++ public void testVerifyRs256TokenWithLegacyCertificateUrlFormat() ++ throws VerificationException, IOException { ++ HttpTransportFactory httpTransportFactory = ++ mockTransport( ++ LEGACY_FEDERATED_SIGNON_CERT_URL, readResourceAsString("legacy_federated_keys.json")); ++ MockClock clock = new MockClock(1587626288000L); ++ IdTokenVerifier tokenVerifier = ++ new IdTokenVerifier.Builder() ++ .setCertificatesLocation(LEGACY_FEDERATED_SIGNON_CERT_URL) ++ .setClock(clock) ++ .setHttpTransportFactory(httpTransportFactory) ++ .build(); ++ assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, FEDERATED_SIGNON_RS256_TOKEN))); ++ } ++ ++ public void testVerifyServiceAccountRs256Token() throws VerificationException, IOException { ++ MockClock clock = new MockClock(1587626643000L); ++ IdTokenVerifier tokenVerifier = ++ new IdTokenVerifier.Builder() ++ .setClock(clock) ++ .setCertificatesLocation(SERVICE_ACCOUNT_CERT_URL) ++ .setHttpTransportFactory(new DefaultHttpTransportFactory()) ++ .build(); ++ assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, SERVICE_ACCOUNT_RS256_TOKEN))); ++ } ++ ++ static String readResourceAsString(String resourceName) throws IOException { ++ InputStream inputStream = ++ IdTokenVerifierTest.class.getClassLoader().getResourceAsStream(resourceName); ++ try (final Reader reader = new InputStreamReader(inputStream)) { ++ return CharStreams.toString(reader); ++ } ++ } ++ ++ static HttpTransportFactory mockTransport(String url, String certificates) { ++ final String certificatesContent = certificates; ++ final String certificatesUrl = url; ++ return new HttpTransportFactory() { ++ @Override ++ public HttpTransport create() { ++ return new MockHttpTransport() { ++ @Override ++ public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { ++ assertEquals(certificatesUrl, url); ++ return new MockLowLevelHttpRequest() { ++ @Override ++ public LowLevelHttpResponse execute() throws IOException { ++ MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); ++ response.setStatusCode(200); ++ response.setContentType("application/json"); ++ response.setContent(certificatesContent); ++ return response; ++ } ++ }; ++ } ++ }; ++ } ++ }; ++ } ++ ++ /** A mock implementation of {@link Clock} to set clock for testing */ ++ static class MockClock implements Clock { ++ public MockClock() {} ++ ++ public MockClock(long timeMillis) { ++ this.timeMillis = timeMillis; ++ } ++ ++ long timeMillis; ++ ++ public long currentTimeMillis() { ++ return timeMillis; ++ } ++ } ++ ++ /** A default http transport factory for testing */ ++ static class DefaultHttpTransportFactory implements HttpTransportFactory { ++ public HttpTransport create() { ++ return new NetHttpTransport(); ++ } ++ } ++ ++ /** A mock implementation of {@link Environment} to set environment variables for testing */ ++ class MockEnvironment extends Environment { ++ private final Map variables = new HashMap<>(); ++ ++ @Override ++ public String getVariable(String name) { ++ return variables.get(name); ++ } ++ ++ public void setVariable(String name, String value) { ++ variables.put(name, value); ++ } ++ } + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..093683207ed5d5e3043602431071acb13552d4ea --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/post_context.md @@ -0,0 +1,1084 @@ +# Patch-overlapping Java context after the fix + +## `google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/Environment.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)) + +```java +/* + * Copyright 2022, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.client.auth.openidconnect; + +class Environment { + public String getVariable(String name) { + return System.getenv(name); + } +} +``` + +## `google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/HttpTransportFactory.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50)) + +```java +/* + * Copyright 2022, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.client.auth.openidconnect; + +import com.google.api.client.http.HttpTransport; + +/** + * A base interface for all {@link HttpTransport} factories. + * + *

    Implementation must provide a public no-arg constructor. Loading of a factory implementation + * is done via {@link java.util.ServiceLoader}. + */ +public interface HttpTransportFactory { + + /** + * Creates a {@code HttpTransport} instance. + * + * @return The HttpTransport instance. + */ + HttpTransport create(); +} +``` + +## `google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java` (changed lines (17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 57, 58, 59, 60, 61, 62, 63, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 128, 129, 130, 131, 153, 159, 160, 161, 162, 163, 164, 165, 166, 167, 221, 222, 223, 224, 225, 226, 227, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 320, 321, 322, 323, 324, 334, 335, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625)) + +```java +/* + * Copyright (c) 2013 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.api.client.auth.openidconnect; + +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.json.GenericJson; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature.Header; +import com.google.api.client.util.Base64; +import com.google.api.client.util.Beta; +import com.google.api.client.util.Clock; +import com.google.api.client.util.Key; +import com.google.api.client.util.Preconditions; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.util.concurrent.UncheckedExecutionException; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.security.AlgorithmParameters; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PublicKey; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.ECPublicKeySpec; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.InvalidParameterSpecException; +import java.security.spec.RSAPublicKeySpec; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * {@link Beta}
    + * Thread-safe ID token verifier based on
    ID Token + * Validation. + * + *

    Call {@link #verify(IdToken)} to verify a ID token. This is a light-weight object, so you may + * use a new instance for each configuration of expected issuer and trusted client IDs. Sample + * usage: + * + *

    + * IdTokenVerifier verifier = new IdTokenVerifier.Builder()
    + * .setIssuer("issuer.example.com")
    + * .setAudience(Arrays.asList("myClientId"))
    + * .build();
    + * ...
    + * if (!verifier.verify(idToken)) {...}
    + * 
    + * + * The verifier validates token signature per current OpenID Connect Spec: + * https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation By default, method gets a + * certificate from well-known location A request to certificate location is performed using {@link + * com.google.api.client.http.javanet.NetHttpTransport} Either or both certificate location and + * transport implementation can be overridden via {@link Builder} + * + *
    + * IdTokenVerifier verifier = new IdTokenVerifier.Builder()
    + * .setIssuer("issuer.example.com")
    + * .setAudience(Arrays.asList("myClientId"))
    + * .setHttpTransportFactory(customHttpTransportFactory)
    + * .build();
    + * ...
    + * if (!verifier.verify(idToken)) {...}
    + * 
    + * + * not recommended: this check can be disabled with OAUTH_CLIENT_SKIP_SIGNATURE environment variable + * set to true. + * + *

    Note that {@link #verify(IdToken)} only implements a subset of the verification steps, mostly + * just the MUST steps. Please read SUPPORTED_ALGORITHMS = ImmutableSet.of("RS256", "ES256"); + private static final String NOT_SUPPORTED_ALGORITHM = + "Unexpected signing algorithm %s: expected either RS256 or ES256"; + + static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); + static final String SKIP_SIGNATURE_ENV_VAR = "OAUTH_CLIENT_SKIP_SIGNATURE"; + /** Default value for seconds of time skew to accept when verifying time (5 minutes). */ + public static final long DEFAULT_TIME_SKEW_SECONDS = 300; + + /** Clock to use for expiration checks. */ + private final Clock clock; + + private final String certificatesLocation; + private final Environment environment; + private final LoadingCache> publicKeyCache; + + /** Seconds of time skew to accept when verifying time. */ + private final long acceptableTimeSkewSeconds; + + /** + * Unmodifiable collection of equivalent expected issuers or {@code null} to suppress the issuer + * check. + */ + private final Collection issuers; + + /** + * Unmodifiable list of trusted audience client IDs or {@code null} to suppress the audience + * check. + */ + private final Collection audience; + + public IdTokenVerifier() { + this(new Builder()); + } + + /** @param builder builder */ + protected IdTokenVerifier(Builder builder) { + this.certificatesLocation = builder.certificatesLocation; + clock = builder.clock; + acceptableTimeSkewSeconds = builder.acceptableTimeSkewSeconds; + issuers = builder.issuers == null ? null : Collections.unmodifiableCollection(builder.issuers); + audience = + builder.audience == null ? null : Collections.unmodifiableCollection(builder.audience); + HttpTransportFactory transport = + builder.httpTransportFactory == null + ? new DefaultHttpTransportFactory() + : builder.httpTransportFactory; + this.publicKeyCache = + CacheBuilder.newBuilder() + .expireAfterWrite(1, TimeUnit.HOURS) + .build(new PublicKeyLoader(transport)); + this.environment = builder.environment == null ? new Environment() : builder.environment; + } + + /** Returns the clock. */ + public final Clock getClock() { + return clock; + } + + /** Returns the seconds of time skew to accept when verifying time. */ + public final long getAcceptableTimeSkewSeconds() { + return acceptableTimeSkewSeconds; + } + + /** + * Returns the first of equivalent expected issuers or {@code null} if issuer check suppressed. + */ + public final String getIssuer() { + if (issuers == null) { + return null; + } else { + return issuers.iterator().next(); + } + } + + /** + * Returns the equivalent expected issuers or {@code null} if issuer check suppressed. + * + * @since 1.21.0 + */ + public final Collection getIssuers() { + return issuers; + } + + /** + * Returns the unmodifiable list of trusted audience client IDs or {@code null} to suppress the + * audience check. + */ + public final Collection getAudience() { + return audience; + } + + /** + * Verifies that the given ID token is valid using the cached public keys. + * + *

    It verifies: + * + *

    + * + *

    Overriding is allowed, but it must call the super implementation. + * + * @param idToken ID token + * @return {@code true} if verified successfully or {@code false} if failed + */ + public boolean verify(IdToken idToken) { + boolean tokenFieldsValid = + (issuers == null || idToken.verifyIssuer(issuers)) + && (audience == null || idToken.verifyAudience(audience)) + && idToken.verifyTime(clock.currentTimeMillis(), acceptableTimeSkewSeconds); + + if (!tokenFieldsValid) { + return false; + } + + try { + return verifySignature(idToken); + } catch (VerificationException ex) { + LOGGER.log( + Level.SEVERE, + "id token signature verification failed. " + + "Please see docs for IdTokenVerifier for default settings and configuration options", + ex); + return false; + } + } + + @VisibleForTesting + boolean verifySignature(IdToken idToken) throws VerificationException { + if (Boolean.parseBoolean(environment.getVariable(SKIP_SIGNATURE_ENV_VAR))) { + return true; + } + + // Short-circuit signature types + if (!SUPPORTED_ALGORITHMS.contains(idToken.getHeader().getAlgorithm())) { + throw new VerificationException( + String.format(NOT_SUPPORTED_ALGORITHM, idToken.getHeader().getAlgorithm())); + } + + PublicKey publicKeyToUse = null; + try { + String certificateLocation = getCertificateLocation(idToken.getHeader()); + publicKeyToUse = publicKeyCache.get(certificateLocation).get(idToken.getHeader().getKeyId()); + } catch (ExecutionException | UncheckedExecutionException e) { + throw new VerificationException( + "Error fetching PublicKey from certificate location " + certificatesLocation, e); + } + + if (publicKeyToUse == null) { + throw new VerificationException( + "Could not find PublicKey for provided keyId: " + idToken.getHeader().getKeyId()); + } + + try { + if (idToken.verifySignature(publicKeyToUse)) { + return true; + } + throw new VerificationException("Invalid signature"); + } catch (GeneralSecurityException e) { + throw new VerificationException("Error validating token", e); + } + } + + private String getCertificateLocation(Header header) throws VerificationException { + if (certificatesLocation != null) return certificatesLocation; + + switch (header.getAlgorithm()) { + case "RS256": + return FEDERATED_SIGNON_CERT_URL; + case "ES256": + return IAP_CERT_URL; + } + + throw new VerificationException(String.format(NOT_SUPPORTED_ALGORITHM, header.getAlgorithm())); + } + + /** + * {@link Beta}
    + * Builder for {@link IdTokenVerifier}. + * + *

    Implementation is not thread-safe. + * + * @since 1.16 + */ + @Beta + public static class Builder { + + /** Clock. */ + Clock clock = Clock.SYSTEM; + + String certificatesLocation; + + /** wrapper for environment variables */ + Environment environment; + + /** Seconds of time skew to accept when verifying time. */ + long acceptableTimeSkewSeconds = DEFAULT_TIME_SKEW_SECONDS; + + /** Collection of equivalent expected issuers or {@code null} to suppress the issuer check. */ + Collection issuers; + + /** List of trusted audience client IDs or {@code null} to suppress the audience check. */ + Collection audience; + + HttpTransportFactory httpTransportFactory; + + /** Builds a new instance of {@link IdTokenVerifier}. */ + public IdTokenVerifier build() { + return new IdTokenVerifier(this); + } + + /** Returns the clock. */ + public final Clock getClock() { + return clock; + } + + /** + * Sets the clock. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + */ + public Builder setClock(Clock clock) { + this.clock = Preconditions.checkNotNull(clock); + return this; + } + + /** + * Returns the first of equivalent expected issuers or {@code null} if issuer check suppressed. + */ + public final String getIssuer() { + if (issuers == null) { + return null; + } else { + return issuers.iterator().next(); + } + } + + /** + * Sets the expected issuer or {@code null} to suppress the issuer check. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + */ + public Builder setIssuer(String issuer) { + if (issuer == null) { + return setIssuers(null); + } else { + return setIssuers(Collections.singleton(issuer)); + } + } + + /** + * Override the location URL that contains published public keys. Defaults to well-known Google + * locations. + * + * @param certificatesLocation URL to published public keys + * @return the builder + */ + public Builder setCertificatesLocation(String certificatesLocation) { + this.certificatesLocation = certificatesLocation; + return this; + } + + /** + * Returns the equivalent expected issuers or {@code null} if issuer check suppressed. + * + * @since 1.21.0 + */ + public final Collection getIssuers() { + return issuers; + } + + /** + * Sets the list of equivalent expected issuers or {@code null} to suppress the issuer check. + * Typically only a single issuer should be used, but multiple may be specified to support an + * issuer transitioning to a new string. The collection must not be empty. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + * + * @since 1.21.0 + */ + public Builder setIssuers(Collection issuers) { + Preconditions.checkArgument( + issuers == null || !issuers.isEmpty(), "Issuers must not be empty"); + this.issuers = issuers; + return this; + } + + /** + * Returns the list of trusted audience client IDs or {@code null} to suppress the audience + * check. + */ + public final Collection getAudience() { + return audience; + } + + /** + * Sets the list of trusted audience client IDs or {@code null} to suppress the audience check. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + */ + public Builder setAudience(Collection audience) { + this.audience = audience; + return this; + } + + /** Returns the seconds of time skew to accept when verifying time. */ + public final long getAcceptableTimeSkewSeconds() { + return acceptableTimeSkewSeconds; + } + + /** + * Sets the seconds of time skew to accept when verifying time (default is {@link + * #DEFAULT_TIME_SKEW_SECONDS}). + * + *

    It must be greater or equal to zero. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + */ + public Builder setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds) { + Preconditions.checkArgument(acceptableTimeSkewSeconds >= 0); + this.acceptableTimeSkewSeconds = acceptableTimeSkewSeconds; + return this; + } + + /** Returns an instance of the {@link Environment} */ + final Environment getEnvironment() { + return environment; + } + + /** Sets the environment. Used mostly for testing */ + Builder setEnvironment(Environment environment) { + this.environment = environment; + return this; + } + + /** + * Sets the HttpTransportFactory used for requesting public keys from the certificate URL. Used + * mostly for testing. + * + * @param httpTransportFactory the HttpTransportFactory used to build certificate URL requests + * @return the builder + */ + public Builder setHttpTransportFactory(HttpTransportFactory httpTransportFactory) { + this.httpTransportFactory = httpTransportFactory; + return this; + } + } + + /** Custom CacheLoader for mapping certificate urls to the contained public keys. */ + static class PublicKeyLoader extends CacheLoader> { + private final HttpTransportFactory httpTransportFactory; + + /** + * Data class used for deserializing a JSON Web Key Set (JWKS) from an external HTTP request. + */ + public static class JsonWebKeySet extends GenericJson { + @Key public List keys; + } + + /** Data class used for deserializing a single JSON Web Key. */ + public static class JsonWebKey { + @Key public String alg; + + @Key public String crv; + + @Key public String kid; + + @Key public String kty; + + @Key public String use; + + @Key public String x; + + @Key public String y; + + @Key public String e; + + @Key public String n; + } + + PublicKeyLoader(HttpTransportFactory httpTransportFactory) { + super(); + this.httpTransportFactory = httpTransportFactory; + } + + @Override + public Map load(String certificateUrl) throws Exception { + HttpTransport httpTransport = httpTransportFactory.create(); + JsonWebKeySet jwks; + try { + HttpRequest request = + httpTransport + .createRequestFactory() + .buildGetRequest(new GenericUrl(certificateUrl)) + .setParser(GsonFactory.getDefaultInstance().createJsonObjectParser()); + HttpResponse response = request.execute(); + jwks = response.parseAs(JsonWebKeySet.class); + } catch (IOException io) { + LOGGER.log( + Level.WARNING, + "Failed to get a certificate from certificate location " + certificateUrl, + io); + return ImmutableMap.of(); + } + + ImmutableMap.Builder keyCacheBuilder = new ImmutableMap.Builder<>(); + if (jwks.keys == null) { + // Fall back to x509 formatted specification + for (String keyId : jwks.keySet()) { + String publicKeyPem = (String) jwks.get(keyId); + keyCacheBuilder.put(keyId, buildPublicKey(publicKeyPem)); + } + } else { + for (JsonWebKey key : jwks.keys) { + try { + keyCacheBuilder.put(key.kid, buildPublicKey(key)); + } catch (NoSuchAlgorithmException + | InvalidKeySpecException + | InvalidParameterSpecException ignored) { + LOGGER.log(Level.WARNING, "Failed to put a key into the cache", ignored); + } + } + } + + return keyCacheBuilder.build(); + } + + private PublicKey buildPublicKey(JsonWebKey key) + throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeySpecException { + if ("ES256".equals(key.alg)) { + return buildEs256PublicKey(key); + } else if ("RS256".equals((key.alg))) { + return buildRs256PublicKey(key); + } else { + return null; + } + } + + private PublicKey buildPublicKey(String publicPem) + throws CertificateException, UnsupportedEncodingException { + return CertificateFactory.getInstance("X.509") + .generateCertificate(new ByteArrayInputStream(publicPem.getBytes("UTF-8"))) + .getPublicKey(); + } + + private PublicKey buildRs256PublicKey(JsonWebKey key) + throws NoSuchAlgorithmException, InvalidKeySpecException { + com.google.common.base.Preconditions.checkArgument("RSA".equals(key.kty)); + com.google.common.base.Preconditions.checkNotNull(key.e); + com.google.common.base.Preconditions.checkNotNull(key.n); + + BigInteger modulus = new BigInteger(1, Base64.decodeBase64(key.n)); + BigInteger exponent = new BigInteger(1, Base64.decodeBase64(key.e)); + + RSAPublicKeySpec spec = new RSAPublicKeySpec(modulus, exponent); + KeyFactory factory = KeyFactory.getInstance("RSA"); + return factory.generatePublic(spec); + } + + private PublicKey buildEs256PublicKey(JsonWebKey key) + throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeySpecException { + com.google.common.base.Preconditions.checkArgument("EC".equals(key.kty)); + com.google.common.base.Preconditions.checkArgument("P-256".equals(key.crv)); + + BigInteger x = new BigInteger(1, Base64.decodeBase64(key.x)); + BigInteger y = new BigInteger(1, Base64.decodeBase64(key.y)); + ECPoint pubPoint = new ECPoint(x, y); + AlgorithmParameters parameters = AlgorithmParameters.getInstance("EC"); + parameters.init(new ECGenParameterSpec("secp256r1")); + ECParameterSpec ecParameters = parameters.getParameterSpec(ECParameterSpec.class); + ECPublicKeySpec pubSpec = new ECPublicKeySpec(pubPoint, ecParameters); + KeyFactory kf = KeyFactory.getInstance("EC"); + return kf.generatePublic(pubSpec); + } + } + + /** Custom exception for wrapping all verification errors. */ + static class VerificationException extends Exception { + public VerificationException(String message) { + super(message); + } + + public VerificationException(String message, Throwable cause) { + super(message, cause); + } + } + + static class DefaultHttpTransportFactory implements HttpTransportFactory { + public HttpTransport create() { + return HTTP_TRANSPORT; + } + } +} +``` + +## `google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java` (changed lines (18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 93, 94, 104, 105, 106, 107, 113, 115, 117, 118, 119, 174, 177, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347)) + +```java +/* + * Copyright (c) 2012 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.api.client.auth.openidconnect; + +import com.google.api.client.auth.openidconnect.IdToken.Payload; +import com.google.api.client.auth.openidconnect.IdTokenVerifier.VerificationException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.http.LowLevelHttpResponse; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature.Header; +import com.google.api.client.testing.http.MockHttpTransport; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.api.client.testing.http.MockLowLevelHttpResponse; +import com.google.api.client.util.Clock; +import com.google.api.client.util.Lists; +import com.google.common.io.CharStreams; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import junit.framework.TestCase; + +/** + * Tests {@link IdTokenVerifier}. + * + * @author Yaniv Inbar + */ +public class IdTokenVerifierTest extends TestCase { + + private static final String CLIENT_ID = "myclientid"; + private static final String CLIENT_ID2 = CLIENT_ID + "2"; + + private static final List TRUSTED_CLIENT_IDS = Arrays.asList(CLIENT_ID, CLIENT_ID2); + + private static final String ISSUER = "issuer.example.com"; + private static final String ISSUER2 = ISSUER + "2"; + private static final String ISSUER3 = ISSUER + "3"; + + private static final String ES256_TOKEN = + "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im1wZjBEQSJ9.eyJhdWQiOiIvcHJvamVjdHMvNjUyNTYyNzc2Nzk4L2FwcHMvY2xvdWQtc2FtcGxlcy10ZXN0cy1waHAtaWFwIiwiZW1haWwiOiJjaGluZ29yQGdvb2dsZS5jb20iLCJleHAiOjE1ODQwNDc2MTcsImdvb2dsZSI6eyJhY2Nlc3NfbGV2ZWxzIjpbImFjY2Vzc1BvbGljaWVzLzUxODU1MTI4MDkyNC9hY2Nlc3NMZXZlbHMvcmVjZW50U2VjdXJlQ29ubmVjdERhdGEiLCJhY2Nlc3NQb2xpY2llcy81MTg1NTEyODA5MjQvYWNjZXNzTGV2ZWxzL3Rlc3ROb09wIiwiYWNjZXNzUG9saWNpZXMvNTE4NTUxMjgwOTI0L2FjY2Vzc0xldmVscy9ldmFwb3JhdGlvblFhRGF0YUZ1bGx5VHJ1c3RlZCJdfSwiaGQiOiJnb29nbGUuY29tIiwiaWF0IjoxNTg0MDQ3MDE3LCJpc3MiOiJodHRwczovL2Nsb3VkLmdvb2dsZS5jb20vaWFwIiwic3ViIjoiYWNjb3VudHMuZ29vZ2xlLmNvbToxMTIxODE3MTI3NzEyMDE5NzI4OTEifQ.yKNtdFY5EKkRboYNexBdfugzLhC3VuGyFcuFYA8kgpxMqfyxa41zkML68hYKrWu2kOBTUW95UnbGpsIi_u1fiA"; + + private static final String FEDERATED_SIGNON_RS256_TOKEN = + "eyJhbGciOiJSUzI1NiIsImtpZCI6ImY5ZDk3YjRjYWU5MGJjZDc2YWViMjAwMjZmNmI3NzBjYWMyMjE3ODMiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL3BhdGgiLCJhenAiOiJpbnRlZ3JhdGlvbi10ZXN0c0BjaGluZ29yLXRlc3QuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJlbWFpbCI6ImludGVncmF0aW9uLXRlc3RzQGNoaW5nb3ItdGVzdC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJleHAiOjE1ODc2Mjk4ODgsImlhdCI6MTU4NzYyNjI4OCwiaXNzIjoiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA0MDI5MjkyODUzMDk5OTc4MjkzIn0.Pj4KsJh7riU7ZIbPMcHcHWhasWEcbVjGP4yx_5E0iOpeDalTdri97E-o0dSSkuVX2FeBIgGUg_TNNgJ3YY97T737jT5DUYwdv6M51dDlLmmNqlu_P6toGCSRC8-Beu5gGmqS2Y82TmpHH9Vhoh5PsK7_rVHk8U6VrrVVKKTWm_IzTFhqX1oYKPdvfyaNLsXPbCt_NFE0C3DNmFkgVhRJu7LtzQQN-ghaqd3Ga3i6KH222OEI_PU4BUTvEiNOqRGoMlT_YOsyFN3XwqQ6jQGWhhkArL1z3CG2BVQjHTKpgVsRyy_H6WTZiju2Q-XWobgH-UPSZbyymV8-cFT9XKEtZQ"; + private static final String LEGACY_FEDERATED_SIGNON_CERT_URL = + "https://www.googleapis.com/oauth2/v1/certs"; + + private static final String SERVICE_ACCOUNT_RS256_TOKEN = + "eyJhbGciOiJSUzI1NiIsImtpZCI6IjJlZjc3YjM4YTFiMDM3MDQ4NzA0MzkxNmFjYmYyN2Q3NGVkZDA4YjEiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJodHRwczovL2V4YW1wbGUuY29tL2F1ZGllbmNlIiwiZXhwIjoxNTg3NjMwNTQzLCJpYXQiOjE1ODc2MjY5NDMsImlzcyI6InNvbWUgaXNzdWVyIiwic3ViIjoic29tZSBzdWJqZWN0In0.gGOQW0qQgs4jGUmCsgRV83RqsJLaEy89-ZOG6p1u0Y26FyY06b6Odgd7xXLsSTiiSnch62dl0Lfi9D0x2ByxvsGOCbovmBl2ZZ0zHr1wpc4N0XS9lMUq5RJQbonDibxXG4nC2zroDfvD0h7i-L8KMXeJb9pYwW7LkmrM_YwYfJnWnZ4bpcsDjojmPeUBlACg7tjjOgBFbyQZvUtaERJwSRlaWibvNjof7eCVfZChE0PwBpZc_cGqSqKXv544L4ttqdCnmONjqrTATXwC4gYxruevkjHfYI5ojcQmXoWDJJ0-_jzfyPE4MFFdCFgzLgnfIOwe5ve0MtquKuv2O0pgvg"; + private static final String SERVICE_ACCOUNT_CERT_URL = + "https://www.googleapis.com/robot/v1/metadata/x509/integration-tests%40chingor-test.iam.gserviceaccount.com"; + + private static final List ALL_TOKENS = + Arrays.asList(ES256_TOKEN, FEDERATED_SIGNON_RS256_TOKEN, SERVICE_ACCOUNT_RS256_TOKEN); + + static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance(); + static final MockClock FIXED_CLOCK = new MockClock(1584047020000L); + + private static IdToken newIdToken(String issuer, String audience) { + Payload payload = new Payload(); + payload.setIssuer(issuer); + payload.setAudience(audience); + payload.setExpirationTimeSeconds(2000L); + payload.setIssuedAtTimeSeconds(1000L); + return new IdToken(new Header(), payload, new byte[0], new byte[0]); + } + + public void testBuilder() throws Exception { + IdTokenVerifier.Builder builder = + new IdTokenVerifier.Builder().setIssuer(ISSUER).setAudience(TRUSTED_CLIENT_IDS); + assertEquals(Clock.SYSTEM, builder.getClock()); + assertEquals(ISSUER, builder.getIssuer()); + assertEquals(Collections.singleton(ISSUER), builder.getIssuers()); + assertEquals(TRUSTED_CLIENT_IDS, builder.getAudience()); + Clock clock = new MockClock(); + builder.setClock(clock); + assertEquals(clock, builder.getClock()); + IdTokenVerifier verifier = builder.build(); + assertEquals(clock, verifier.getClock()); + assertEquals(ISSUER, verifier.getIssuer()); + assertEquals(Collections.singleton(ISSUER), builder.getIssuers()); + assertEquals(TRUSTED_CLIENT_IDS, Lists.newArrayList(verifier.getAudience())); + } + + public void testVerify() throws Exception { + MockClock clock = new MockClock(); + MockEnvironment testEnvironment = new MockEnvironment(); + testEnvironment.setVariable(IdTokenVerifier.SKIP_SIGNATURE_ENV_VAR, "true"); + IdTokenVerifier verifier = + new IdTokenVerifier.Builder() + .setIssuers(Arrays.asList(ISSUER, ISSUER3)) + .setAudience(Arrays.asList(CLIENT_ID)) + .setClock(clock) + .setEnvironment(testEnvironment) + .build(); + + // verifier flexible doesn't check issuer and audience + IdTokenVerifier verifierFlexible = + new IdTokenVerifier.Builder().setClock(clock).setEnvironment(testEnvironment).build(); + + // issuer + clock.timeMillis = 1500000L; + IdToken idToken = newIdToken(ISSUER, CLIENT_ID); + assertTrue(verifier.verify(idToken)); + assertTrue(verifierFlexible.verify(newIdToken(ISSUER2, CLIENT_ID))); + assertFalse(verifier.verify(newIdToken(ISSUER2, CLIENT_ID))); + assertTrue(verifier.verify(newIdToken(ISSUER3, CLIENT_ID))); + // audience + assertTrue(verifierFlexible.verify(newIdToken(ISSUER, CLIENT_ID2))); + assertFalse(verifier.verify(newIdToken(ISSUER, CLIENT_ID2))); + // time + clock.timeMillis = 700000L; + assertTrue(verifier.verify(idToken)); + clock.timeMillis = 2300000L; + assertTrue(verifier.verify(idToken)); + clock.timeMillis = 699999L; + assertFalse(verifier.verify(idToken)); + clock.timeMillis = 2300001L; + assertFalse(verifier.verify(idToken)); + } + + public void testEmptyIssuersFails() throws Exception { + IdTokenVerifier.Builder builder = new IdTokenVerifier.Builder(); + try { + builder.setIssuers(Collections.emptyList()); + fail("Exception expected"); + } catch (IllegalArgumentException ex) { + // Expected + } + } + + public void testBuilderSetNullIssuers() throws Exception { + IdTokenVerifier.Builder builder = new IdTokenVerifier.Builder(); + IdTokenVerifier verifier = builder.build(); + assertNull(builder.getIssuers()); + assertNull(builder.getIssuer()); + assertNull(verifier.getIssuers()); + assertNull(verifier.getIssuer()); + + builder.setIssuers(null); + verifier = builder.build(); + assertNull(builder.getIssuers()); + assertNull(builder.getIssuer()); + assertNull(verifier.getIssuers()); + assertNull(verifier.getIssuer()); + + builder.setIssuer(null); + verifier = builder.build(); + assertNull(builder.getIssuers()); + assertNull(builder.getIssuer()); + assertNull(verifier.getIssuers()); + assertNull(verifier.getIssuer()); + } + + public void testMissingAudience() throws VerificationException { + IdToken idToken = newIdToken(ISSUER, null); + + MockClock clock = new MockClock(); + clock.timeMillis = 1500000L; + IdTokenVerifier verifier = + new IdTokenVerifier.Builder() + .setIssuers(Arrays.asList(ISSUER, ISSUER3)) + .setAudience(Collections.emptyList()) + .setClock(clock) + .build(); + assertFalse(verifier.verify(idToken)); + } + + public void testVerifyEs256TokenPublicKeyMismatch() throws Exception { + // Mock HTTP requests + HttpTransportFactory httpTransportFactory = + new HttpTransportFactory() { + @Override + public HttpTransport create() { + return new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) + throws IOException { + return new MockLowLevelHttpRequest() { + @Override + public LowLevelHttpResponse execute() throws IOException { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + response.setContentType("application/json"); + response.setContent(""); + return response; + } + }; + } + }; + } + }; + IdTokenVerifier tokenVerifier = + new IdTokenVerifier.Builder() + .setClock(FIXED_CLOCK) + .setHttpTransportFactory(httpTransportFactory) + .build(); + + try { + tokenVerifier.verifySignature(IdToken.parse(JSON_FACTORY, ES256_TOKEN)); + fail("Should have failed verification"); + } catch (VerificationException ex) { + assertTrue(ex.getMessage().contains("Error fetching PublicKey")); + } + } + + public void testVerifyEs256Token() throws VerificationException, IOException { + HttpTransportFactory httpTransportFactory = + mockTransport( + "https://www.gstatic.com/iap/verify/public_key-jwk", + readResourceAsString("iap_keys.json")); + IdTokenVerifier tokenVerifier = + new IdTokenVerifier.Builder() + .setClock(FIXED_CLOCK) + .setHttpTransportFactory(httpTransportFactory) + .build(); + assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, ES256_TOKEN))); + } + + public void testVerifyRs256Token() throws VerificationException, IOException { + HttpTransportFactory httpTransportFactory = + mockTransport( + "https://www.googleapis.com/oauth2/v3/certs", + readResourceAsString("federated_keys.json")); + MockClock clock = new MockClock(1587625988000L); + IdTokenVerifier tokenVerifier = + new IdTokenVerifier.Builder() + .setClock(clock) + .setHttpTransportFactory(httpTransportFactory) + .build(); + assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, FEDERATED_SIGNON_RS256_TOKEN))); + } + + public void testVerifyRs256TokenWithLegacyCertificateUrlFormat() + throws VerificationException, IOException { + HttpTransportFactory httpTransportFactory = + mockTransport( + LEGACY_FEDERATED_SIGNON_CERT_URL, readResourceAsString("legacy_federated_keys.json")); + MockClock clock = new MockClock(1587626288000L); + IdTokenVerifier tokenVerifier = + new IdTokenVerifier.Builder() + .setCertificatesLocation(LEGACY_FEDERATED_SIGNON_CERT_URL) + .setClock(clock) + .setHttpTransportFactory(httpTransportFactory) + .build(); + assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, FEDERATED_SIGNON_RS256_TOKEN))); + } + + public void testVerifyServiceAccountRs256Token() throws VerificationException, IOException { + MockClock clock = new MockClock(1587626643000L); + IdTokenVerifier tokenVerifier = + new IdTokenVerifier.Builder() + .setClock(clock) + .setCertificatesLocation(SERVICE_ACCOUNT_CERT_URL) + .setHttpTransportFactory(new DefaultHttpTransportFactory()) + .build(); + assertTrue(tokenVerifier.verify(IdToken.parse(JSON_FACTORY, SERVICE_ACCOUNT_RS256_TOKEN))); + } + + static String readResourceAsString(String resourceName) throws IOException { + InputStream inputStream = + IdTokenVerifierTest.class.getClassLoader().getResourceAsStream(resourceName); + try (final Reader reader = new InputStreamReader(inputStream)) { + return CharStreams.toString(reader); + } + } + + static HttpTransportFactory mockTransport(String url, String certificates) { + final String certificatesContent = certificates; + final String certificatesUrl = url; + return new HttpTransportFactory() { + @Override + public HttpTransport create() { + return new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + assertEquals(certificatesUrl, url); + return new MockLowLevelHttpRequest() { + @Override + public LowLevelHttpResponse execute() throws IOException { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + response.setContentType("application/json"); + response.setContent(certificatesContent); + return response; + } + }; + } + }; + } + }; + } + + /** A mock implementation of {@link Clock} to set clock for testing */ + static class MockClock implements Clock { + public MockClock() {} + + public MockClock(long timeMillis) { + this.timeMillis = timeMillis; + } + + long timeMillis; + + public long currentTimeMillis() { + return timeMillis; + } + } + + /** A default http transport factory for testing */ + static class DefaultHttpTransportFactory implements HttpTransportFactory { + public HttpTransport create() { + return new NetHttpTransport(); + } + } + + /** A mock implementation of {@link Environment} to set environment variables for testing */ + class MockEnvironment extends Environment { + private final Map variables = new HashMap<>(); + + @Override + public String getVariable(String name) { + return variables.get(name); + } + + public void setVariable(String name, String value) { + variables.put(name, value); + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..ba6dda72f3142f156483c4a2fdb4db0f21c69758 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/pre_context.md @@ -0,0 +1,449 @@ +# Patch-overlapping Java context before the fix + +## `google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java` (changed lines (17, 19, 20, 22, 42, 51, 52, 58, 79, 84, 137, 145, 146, 147, 148, 164, 173, 219, 283)) + +```java +/* + * Copyright (c) 2013 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.api.client.auth.openidconnect; + +import com.google.api.client.util.Beta; +import com.google.api.client.util.Clock; +import com.google.api.client.util.Preconditions; +import java.util.Collection; +import java.util.Collections; + +/** + * {@link Beta}
    + * Thread-safe ID token verifier based on
    ID Token + * Validation. + * + *

    Call {@link #verify(IdToken)} to verify a ID token. This is a light-weight object, so you may + * use a new instance for each configuration of expected issuer and trusted client IDs. Sample + * usage: + * + *

    + * IdTokenVerifier verifier = new IdTokenVerifier.Builder()
    + * .setIssuer("issuer.example.com")
    + * .setAudience(Arrays.asList("myClientId"))
    + * .build();
    + * ...
    + * if (!verifier.verify(idToken)) {...}
    + * 
    + * + *

    Note that {@link #verify(IdToken)} only implements a subset of the verification steps, mostly + * just the MUST steps. Please read getAudience() { + return audience; + } + + /** + * Sets the list of trusted audience client IDs or {@code null} to suppress the audience check. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + */ + public Builder setAudience(Collection audience) { + this.audience = audience; + return this; + } + + /** Returns the seconds of time skew to accept when verifying time. */ + public final long getAcceptableTimeSkewSeconds() { + return acceptableTimeSkewSeconds; + } + + /** + * Sets the seconds of time skew to accept when verifying time (default is {@link + * #DEFAULT_TIME_SKEW_SECONDS}). + * + *

    It must be greater or equal to zero. + * + *

    Overriding is only supported for the purpose of calling the super implementation and + * changing the return type, but nothing else. + */ + public Builder setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds) { + Preconditions.checkArgument(acceptableTimeSkewSeconds >= 0); + this.acceptableTimeSkewSeconds = acceptableTimeSkewSeconds; + return this; + } + } +} +``` + +## `google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java` (changed lines (18, 19, 21, 23, 24, 42, 57, 58, 59, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 84, 85, 86, 87, 141, 142, 144, 145, 154)) + +```java +/* + * Copyright (c) 2012 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.api.client.auth.openidconnect; + +import com.google.api.client.auth.openidconnect.IdToken.Payload; +import com.google.api.client.json.webtoken.JsonWebSignature.Header; +import com.google.api.client.util.Clock; +import com.google.api.client.util.Lists; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import junit.framework.TestCase; + +/** + * Tests {@link IdTokenVerifier}. + * + * @author Yaniv Inbar + */ +public class IdTokenVerifierTest extends TestCase { + + private static final String CLIENT_ID = "myclientid"; + private static final String CLIENT_ID2 = CLIENT_ID + "2"; + + private static final List TRUSTED_CLIENT_IDS = Arrays.asList(CLIENT_ID, CLIENT_ID2); + + private static final String ISSUER = "issuer.example.com"; + private static final String ISSUER2 = ISSUER + "2"; + private static final String ISSUER3 = ISSUER + "3"; + + private static IdToken newIdToken(String issuer, String audience) { + Payload payload = new Payload(); + payload.setIssuer(issuer); + payload.setAudience(audience); + payload.setExpirationTimeSeconds(2000L); + payload.setIssuedAtTimeSeconds(1000L); + return new IdToken(new Header(), payload, new byte[0], new byte[0]); + } + + public void testBuilder() throws Exception { + IdTokenVerifier.Builder builder = + new IdTokenVerifier.Builder().setIssuer(ISSUER).setAudience(TRUSTED_CLIENT_IDS); + assertEquals(Clock.SYSTEM, builder.getClock()); + assertEquals(ISSUER, builder.getIssuer()); + assertEquals(Collections.singleton(ISSUER), builder.getIssuers()); + assertTrue(TRUSTED_CLIENT_IDS.equals(builder.getAudience())); + Clock clock = new MyClock(); + builder.setClock(clock); + assertEquals(clock, builder.getClock()); + IdTokenVerifier verifier = builder.build(); + assertEquals(clock, verifier.getClock()); + assertEquals(ISSUER, verifier.getIssuer()); + assertEquals(Collections.singleton(ISSUER), builder.getIssuers()); + assertEquals(TRUSTED_CLIENT_IDS, Lists.newArrayList(verifier.getAudience())); + } + + static class MyClock implements Clock { + + long timeMillis; + + public long currentTimeMillis() { + return timeMillis; + } + } + + public void testVerify() throws Exception { + MyClock clock = new MyClock(); + IdTokenVerifier verifier = + new IdTokenVerifier.Builder() + .setIssuers(Arrays.asList(ISSUER, ISSUER3)) + .setAudience(Arrays.asList(CLIENT_ID)) + .setClock(clock) + .build(); + // verifier flexible doesn't check issuer and audience + IdTokenVerifier verifierFlexible = new IdTokenVerifier.Builder().setClock(clock).build(); + // issuer + clock.timeMillis = 1500000L; + IdToken idToken = newIdToken(ISSUER, CLIENT_ID); + assertTrue(verifier.verify(idToken)); + assertTrue(verifierFlexible.verify(newIdToken(ISSUER2, CLIENT_ID))); + assertFalse(verifier.verify(newIdToken(ISSUER2, CLIENT_ID))); + assertTrue(verifier.verify(newIdToken(ISSUER3, CLIENT_ID))); + // audience + assertTrue(verifierFlexible.verify(newIdToken(ISSUER, CLIENT_ID2))); + assertFalse(verifier.verify(newIdToken(ISSUER, CLIENT_ID2))); + // time + clock.timeMillis = 700000L; + assertTrue(verifier.verify(idToken)); + clock.timeMillis = 2300000L; + assertTrue(verifier.verify(idToken)); + clock.timeMillis = 699999L; + assertFalse(verifier.verify(idToken)); + clock.timeMillis = 2300001L; + assertFalse(verifier.verify(idToken)); + } + + public void testEmptyIssuersFails() throws Exception { + IdTokenVerifier.Builder builder = new IdTokenVerifier.Builder(); + try { + builder.setIssuers(Collections.emptyList()); + fail("Exception expected"); + } catch (IllegalArgumentException ex) { + // Expected + } + } + + public void testBuilderSetNullIssuers() throws Exception { + IdTokenVerifier.Builder builder = new IdTokenVerifier.Builder(); + IdTokenVerifier verifier = builder.build(); + assertNull(builder.getIssuers()); + assertNull(builder.getIssuer()); + assertNull(verifier.getIssuers()); + assertNull(verifier.getIssuer()); + + builder.setIssuers(null); + verifier = builder.build(); + assertNull(builder.getIssuers()); + assertNull(builder.getIssuer()); + assertNull(verifier.getIssuers()); + assertNull(verifier.getIssuer()); + + builder.setIssuer(null); + verifier = builder.build(); + assertNull(builder.getIssuers()); + assertNull(builder.getIssuer()); + assertNull(verifier.getIssuers()); + assertNull(verifier.getIssuer()); + } + + public void testMissingAudience() { + IdToken idToken = newIdToken(ISSUER, null); + + MyClock clock = new MyClock(); + clock.timeMillis = 1500000L; + IdTokenVerifier verifier = + new IdTokenVerifier.Builder() + .setIssuers(Arrays.asList(ISSUER, ISSUER3)) + .setAudience(Collections.emptyList()) + .setClock(clock) + .build(); + assertFalse(verifier.verify(idToken)); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/task.json new file mode 100644 index 0000000000000000000000000000000000000000..1635afeb1b4253c7247010fdcbb5d9e362fcba8a --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/task.json @@ -0,0 +1,51 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-23c03b1bf7a3c44f444b", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-23c03b1bf7a3c44f444b", + "project_id": "morefixes__googleapis__google-oauth-java-client", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/Environment.java", + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/HttpTransportFactory.java", + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java", + "google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java" + ], + "patch_units": { + "before": [ + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java", + "google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java" + ], + "after": [ + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/Environment.java", + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/HttpTransportFactory.java", + "google-oauth-client/src/main/java/com/google/api/client/auth/openidconnect/IdTokenVerifier.java", + "google-oauth-client/src/test/java/com/google/api/client/auth/openidconnect/IdTokenVerifierTest.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/f4433a64b1e5813064fc3943a382d8a8213ec47268f6cb2f36a109324e7adeec/database", + "cache_key": "f4433a64b1e5813064fc3943a382d8a8213ec47268f6cb2f36a109324e7adeec", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/1a972b57bc7a3ad411e3efcc18aad691a9952bba82f67553a85a6afada7ce5c0/database", + "cache_key": "1a972b57bc7a3ad411e3efcc18aad691a9952bba82f67553a85a6afada7ce5c0", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/020ac12aed43d066dee7a129db39fffb674c3dd90153c4d30aed08557b4e34f3/database", + "cache_key": "020ac12aed43d066dee7a129db39fffb674c3dd90153c4d30aed08557b4e34f3", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-23c03b1bf7a3c44f444b/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-23c03b1bf7a3c44f444b/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-23c03b1bf7a3c44f444b/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..1cecce0d5b860cf61e905cc2fb30f46983f69007 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/patch.diff @@ -0,0 +1,24 @@ +diff --git a/src/main/java/com/rtds/svc/CaptureTypeService.java b/src/main/java/com/rtds/svc/CaptureTypeService.java +index 52bdea3..be6c346 100644 +--- a/src/main/java/com/rtds/svc/CaptureTypeService.java ++++ b/src/main/java/com/rtds/svc/CaptureTypeService.java +@@ -52,12 +52,16 @@ public class CaptureTypeService + + CaptureType type = em.find( CaptureType.class, url_suffix ); + +- if( type != null ) ++ if( type == null ) + { +- return type.getCaptureFilter(); ++ throw new IllegalArgumentException( "The url_suffix must exist in the database." ); + } + +- return null; ++ // It is okay for the capture filter itself to be null, but the CaptureType ++ // must be in the database, otherwise the user could effectively forge ++ // a capture filter for "all" just by requesting a non-existent filter. ++ ++ return type.getCaptureFilter(); + } + + public CaptureType find( String url_suffix ) diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..72e154500dd3b321fcef349efd3a16d273549d54 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/post_context.md @@ -0,0 +1,98 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/com/rtds/svc/CaptureTypeService.java` (changed lines (55, 57, 60, 61, 62, 63, 64)) + +```java +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.rtds.svc; + +import com.rtds.jpa.CaptureType; +import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.persistence.EntityManager; +import javax.transaction.Transactional; + +/** + * + * @author jdh + */ +@ApplicationScoped +@Transactional +public class CaptureTypeService +{ + @Inject + EntityManager em; + + public void createOrUpdateCaptureType( CaptureType value ) + { + if( value == null || value.getLabel() == null || value.getUrlSuffix() == null ) + { + throw new IllegalArgumentException( "The CaptureType, it's label and url_suffix must not be null." ); + } + + CaptureType persistent = em.find( CaptureType.class, value.getUrlSuffix() ); + + if( persistent != null ) + { + persistent.setLabel( value.getLabel() ); + persistent.setCaptureFilter( value.getCaptureFilter() ); + } + else + { + em.persist( value ); + } + } + + public String findFilter( String url_suffix ) + { + if( url_suffix == null ) + { + throw new IllegalArgumentException( "The url_suffix must not be null." ); + } + + CaptureType type = em.find( CaptureType.class, url_suffix ); + + if( type == null ) + { + throw new IllegalArgumentException( "The url_suffix must exist in the database." ); + } + + // It is okay for the capture filter itself to be null, but the CaptureType + // must be in the database, otherwise the user could effectively forge + // a capture filter for "all" just by requesting a non-existent filter. + + return type.getCaptureFilter(); + } + + public CaptureType find( String url_suffix ) + { + return em.find( CaptureType.class, url_suffix ); + } + + public List list() + { + return em.createQuery( "select ct from CaptureType ct", CaptureType.class ).getResultList(); + } + + public void deleteCaptureType( String url_suffix ) + { + if( url_suffix == null ) + { + throw new IllegalArgumentException( "The url_suffix must not be null." ); + } + + CaptureType persistent = em.find( CaptureType.class, url_suffix ); + + if( persistent != null ) + { + em.remove( persistent ); + } + } + +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..80d19b331aad4f8492abf86bbcad9c6fd8f8d678 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/pre_context.md @@ -0,0 +1,94 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/com/rtds/svc/CaptureTypeService.java` (changed lines (55, 56, 57, 58, 60, 61)) + +```java +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.rtds.svc; + +import com.rtds.jpa.CaptureType; +import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.persistence.EntityManager; +import javax.transaction.Transactional; + +/** + * + * @author jdh + */ +@ApplicationScoped +@Transactional +public class CaptureTypeService +{ + @Inject + EntityManager em; + + public void createOrUpdateCaptureType( CaptureType value ) + { + if( value == null || value.getLabel() == null || value.getUrlSuffix() == null ) + { + throw new IllegalArgumentException( "The CaptureType, it's label and url_suffix must not be null." ); + } + + CaptureType persistent = em.find( CaptureType.class, value.getUrlSuffix() ); + + if( persistent != null ) + { + persistent.setLabel( value.getLabel() ); + persistent.setCaptureFilter( value.getCaptureFilter() ); + } + else + { + em.persist( value ); + } + } + + public String findFilter( String url_suffix ) + { + if( url_suffix == null ) + { + throw new IllegalArgumentException( "The url_suffix must not be null." ); + } + + CaptureType type = em.find( CaptureType.class, url_suffix ); + + if( type != null ) + { + return type.getCaptureFilter(); + } + + return null; + } + + public CaptureType find( String url_suffix ) + { + return em.find( CaptureType.class, url_suffix ); + } + + public List list() + { + return em.createQuery( "select ct from CaptureType ct", CaptureType.class ).getResultList(); + } + + public void deleteCaptureType( String url_suffix ) + { + if( url_suffix == null ) + { + throw new IllegalArgumentException( "The url_suffix must not be null." ); + } + + CaptureType persistent = em.find( CaptureType.class, url_suffix ); + + if( persistent != null ) + { + em.remove( persistent ); + } + } + +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/task.json new file mode 100644 index 0000000000000000000000000000000000000000..78180cf78bbbf16b0833503dfccc45ea76188c8a --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-2b14860afe0d3bf8094a", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-2b14860afe0d3bf8094a", + "project_id": "morefixes__jdhwpgmbca__pcapture", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/com/rtds/svc/CaptureTypeService.java" + ], + "patch_units": { + "before": [ + "src/main/java/com/rtds/svc/CaptureTypeService.java" + ], + "after": [ + "src/main/java/com/rtds/svc/CaptureTypeService.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/30119a94ef62626c4bac0389d0b1095dd82b5260b88858fa1cbeadac2987c670/database", + "cache_key": "30119a94ef62626c4bac0389d0b1095dd82b5260b88858fa1cbeadac2987c670", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/c9decbefe36510374b95632d7d034cc36106223a99577803faab4dca8607121e/database", + "cache_key": "c9decbefe36510374b95632d7d034cc36106223a99577803faab4dca8607121e", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/ea28801407083c2a3dff37f0e57bc821a08600250bf6a683af5d981c67d269cf/database", + "cache_key": "ea28801407083c2a3dff37f0e57bc821a08600250bf6a683af5d981c67d269cf", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-2b14860afe0d3bf8094a/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-2b14860afe0d3bf8094a/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-2b14860afe0d3bf8094a/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..6c2f1b08bd6fbf772b4ef38e4b99ec0d8061e333 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/patch.diff @@ -0,0 +1,21 @@ +diff --git a/src/main/java/org/apache/mahout/pig/LogisticRegression.java b/src/main/java/org/apache/mahout/pig/LogisticRegression.java +index 17af842..ff6953d 100644 +--- a/src/main/java/org/apache/mahout/pig/LogisticRegression.java ++++ b/src/main/java/org/apache/mahout/pig/LogisticRegression.java +@@ -38,6 +38,7 @@ import org.apache.pig.data.Tuple; + import org.apache.pig.impl.util.UDFContext; + + import java.io.*; ++import java.nio.file.Files; + import java.util.Iterator; + import java.util.List; + import java.util.Map; +@@ -159,7 +160,7 @@ public class LogisticRegression extends EvalFunc implements Accum + } + + if (!inMemory) { +- tmpFile = File.createTempFile("trainingData", "tmp"); ++ tmpFile = Files.createTempFile("trainingData", "tmp").toFile(); + tmpFile.deleteOnExit(); + } + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..ce4f3c46b5b7300ae871086d5ebc8a88886a32f0 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/post_context.md @@ -0,0 +1,347 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/org/apache/mahout/pig/LogisticRegression.java` (changed lines (41, 163)) + +```java +/* + * Copyright 2014 Ted Dunning + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.mahout.pig; + +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.AbstractIterator; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Closeables; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.mahout.classifier.sgd.L1; +import org.apache.mahout.classifier.sgd.OnlineLogisticRegression; +import org.apache.mahout.classifier.sgd.PolymorphicWritable; +import org.apache.mahout.math.Vector; +import org.apache.mahout.math.VectorWritable; +import org.apache.pig.Accumulator; +import org.apache.pig.EvalFunc; +import org.apache.pig.data.DataBag; +import org.apache.pig.data.DataByteArray; +import org.apache.pig.data.Tuple; +import org.apache.pig.impl.util.UDFContext; + +import java.io.*; +import java.nio.file.Files; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; + +/** + * Trains a logistic regression model entirely in memory using the simplest learning algorithm from Mahout. + *

    + * A number of options can be supplied in a configuration string passed to the constructor. These options + * are of the form name=value and options are separated by commas. Whitespace around option names and around + * values is not significant. Spaces inside values are preserved. + *

    + * The model to be trained can be read from a file in order to allow learning to continue at a previous + * stopping point or the particulars of a new model to be trained from scratch can be specified using the + * options. Training data can be held in-memory or written to a temporary file. + *

    + * The following options can be used to load a pre-existing model: + *

    + *

    + *

    + * The following options can be used with a newly created model: + *

    + *

      + *
    • categories - specifies a list of values that the target variable can take on. This list should be space + * separated and given in the same order as when the model is later used. (required)
    • + *
    • features - the number of elements in the feature vectors to be given to the learning algorithm. (required)
    • + *
    • decayExponent - specifies how quickly the learning rate will decay. Optional with default value of 0.5. + * Note that per-term annealing still has effect.
    • + *
    • lambda - specifies how much regularization constant is used. Optional with default of 1e-5.
    • + *
    • stepOffset - slows down the decay of the learning rate at first if set greater than zero. Default is 10
    • + *
    • learningRate - initial value of the learning rate. Default is 1.
    • + *
    + *

    + * The following options can be used with any model: + *

    + *

      + *
    • inMemory - if "true" then training examples are kept in-memory and used in a random order. If "false" then + * a temporary file is used to hold training examples and the order they are used is fixed by the order they are + * given to this UDF. The default is "true".
    • + *
    • iterations - the number of iterations through the training data that are to be taken.
    • + *
    + */ +public class LogisticRegression extends EvalFunc implements Accumulator { + private List categories; + OnlineLogisticRegression model; + List trainingData = Lists.newArrayList(); + private int iterations; + private boolean inMemory; + private File tmpFile; + + public LogisticRegression(String modelParams) throws IOException { + Splitter onComma = Splitter.on(",").trimResults().omitEmptyStrings(); + Splitter onEquals = Splitter.on("=").trimResults(); + Splitter onSpaces = Splitter.on(" "); + Joiner withSpaces = Joiner.on(" "); + + Map options = Maps.newHashMap(); + + for (String option : onComma.split(modelParams)) { + List values = Lists.newArrayList(onEquals.split(option)); + options.put(values.get(0), values.get(1)); + } + + if (options.containsKey("model")) { + if (options.containsKey("categories")) { + categories = Lists.newArrayList(onSpaces.split(options.get("categories"))); + Configuration conf = UDFContext.getUDFContext().getJobConf(); + model = PolymorphicWritable.read(FileSystem.get(conf).open(new Path(options.get("model"))), OnlineLogisticRegression.class); + options.remove("model"); + options.remove(("categories")); + } else { + throw new BadClassifierSpecException("Must specify \"categories\" if pre-existing model is used"); + } + } else { + if (options.containsKey("categories") && options.containsKey("features")) { + categories = Lists.newArrayList(onSpaces.split(options.get("categories"))); + if (categories.size() < 2) { + throw new BadClassifierSpecException("Must have more than one target category. Remember that categories is a space separated list"); + } + model = new OnlineLogisticRegression(categories.size(), Integer.parseInt(options.get("features")), new L1()); + options.remove("categories"); + options.remove("features"); + } else { + throw new BadClassifierSpecException("Must specify previous model location using \"file\" or supply \"categories\" and \"features\""); + } + + if (options.containsKey("decayExponent")) { + model.decayExponent(Double.parseDouble(options.get("decayExponent"))); + options.remove("decayExponent"); + } + + if (options.containsKey("lambda")) { + model.lambda(Double.parseDouble(options.get("lambda"))); + options.remove("lambda"); + } + + if (options.containsKey("stepOffset")) { + model.stepOffset(Integer.parseInt(options.get("stepOffset"))); + options.remove("stepOffset"); + } + + if (options.containsKey("learningRate")) { + model.learningRate(Double.parseDouble(options.get("learningRate"))); + options.remove("learningRate"); + } + } + + iterations = options.containsKey("iterations") ? Integer.parseInt(options.get("iterations")) : 1; + options.remove("iterations"); + + inMemory = options.containsKey("inMemory") ? Boolean.parseBoolean(options.get("inMemory")) : true; + options.remove("inMemory"); + + if (options.size() > 0) { + throw new BadClassifierSpecException("Extra options supplied: " + withSpaces.join(options.keySet())); + } + + if (!inMemory) { + tmpFile = Files.createTempFile("trainingData", "tmp").toFile(); + tmpFile.deleteOnExit(); + } + } + + @Override + public DataByteArray exec(Tuple input) throws IOException { + addBagOfData((DataBag) input.get(0)); + return getValue(); + } + + /** + * Pass tuples to the learning algorithm. Each tuple should have two fields. The first + * fields should correspond to one of the categories for the model and the second should + * be the encoded features for the training example. + * + * @param example A tuple containing a single field, which is a bag. The bag will contain the set + * of training examples being passed to the learning algorithm in this iteration. Not all + * training examples will be passed at once. + */ + public void accumulate(Tuple example) throws IOException { + if (example.size() != 1) { + throw new IllegalArgumentException("Input to training algorithm should be a single bag containing tuples each with target and vector"); + } + addBagOfData((DataBag) example.get(0)); + } + + private void addBagOfData(DataBag data) throws IOException { + if (inMemory) { + for (Tuple input : data) { + trainingData.add(new Example(categories.indexOf(input.get(0)), PigVector.fromBytes((DataByteArray) input.get(1)))); + } + } else { + DataOutputStream out = new DataOutputStream(new FileOutputStream(tmpFile)); + try { + for (Tuple input : data) { + out.writeInt(categories.indexOf(input.get(0))); + PolymorphicWritable.write(out, new VectorWritable(PigVector.fromBytes((DataByteArray) input.get(1)))); + } + } finally { + out.close(); + } + } + } + + /** + * Called when all tuples from current key have been passed to accumulate. This is where the + * actual training occurs. We can't do it earlier unless iterations = 1 which is an unusual + * case. + * + * @return the trained model. + */ + public DataByteArray getValue() { + for (int i = 0; i < iterations; i++) { + for (Example example : readInput()) { + model.train(example.getTarget(), example.getFeatures()); + } + } + + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream out = new DataOutputStream(baos); + PolymorphicWritable.write(out, new Classifier(categories, model)); + out.close(); + + return new DataByteArray(baos.toByteArray()); + } catch (IOException e) { + // should never happen + throw new ImpossibleStateError("Can't put results into tuple", e); + } + } + + /** + * Called after getValue() to prepare processing for next key. + */ + public void cleanup() { + if (tmpFile != null) { + tmpFile.delete(); + } + } + + public int getIterations() { + return iterations; + } + + public boolean isInMemory() { + return inMemory; + } + + public OnlineLogisticRegression getModel() { + return model; + } + + private Iterable readInput() { + if (inMemory) { + return new Iterable() { + public Iterator iterator() { + return new AbstractIterator() { + int remainingExamples = trainingData.size(); + Random gen = new Random(); + + @Override + protected Example computeNext() { + if (remainingExamples > 0) { + remainingExamples--; + return trainingData.get(gen.nextInt(trainingData.size())); + } else { + return endOfData(); + } + } + }; + } + }; + } else { + return new Iterable() { + public Iterator iterator() { + try { + return new AbstractIterator() { + DataInputStream in = new DataInputStream(new FileInputStream(tmpFile)); + + @Override + protected Example computeNext() { + int target; + try { + target = in.readInt(); + } catch (EOFException e) { + Closeables.closeQuietly(in); + return endOfData(); + } catch (IOException e) { + Closeables.closeQuietly(in); + throw new TrainingDataException("Error reading training data", e); + } + try { + return new Example(target, PolymorphicWritable.read(in, VectorWritable.class)); + } catch (EOFException e) { + Closeables.closeQuietly(in); + throw new TrainingDataException("Premature EOF while reading training data", e); + } catch (IOException e) { + Closeables.closeQuietly(in); + throw new TrainingDataException("Error reading training data", e); + } + } + }; + } catch (FileNotFoundException e) { + throw new TrainingDataException("Could not training data file", e); + } + } + }; + } + } + + private static class Example { + int target; + Vector features; + + public Example(int target, Vector v) { + this.target = target; + this.features = v; + } + + public Example(int target, VectorWritable v) { + this(target, v.get()); + } + + public int getTarget() { + return target; + } + + public Vector getFeatures() { + return features; + } + } + + private static class TrainingDataException extends RuntimeException { + public TrainingDataException(String msg, Throwable e) { + super(msg, e); + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..85dd8081c4a824b490bad12e0bbb4b314178eb5c --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/pre_context.md @@ -0,0 +1,346 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/org/apache/mahout/pig/LogisticRegression.java` (changed lines (41, 162, 163)) + +```java +/* + * Copyright 2014 Ted Dunning + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.mahout.pig; + +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.AbstractIterator; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Closeables; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.mahout.classifier.sgd.L1; +import org.apache.mahout.classifier.sgd.OnlineLogisticRegression; +import org.apache.mahout.classifier.sgd.PolymorphicWritable; +import org.apache.mahout.math.Vector; +import org.apache.mahout.math.VectorWritable; +import org.apache.pig.Accumulator; +import org.apache.pig.EvalFunc; +import org.apache.pig.data.DataBag; +import org.apache.pig.data.DataByteArray; +import org.apache.pig.data.Tuple; +import org.apache.pig.impl.util.UDFContext; + +import java.io.*; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; + +/** + * Trains a logistic regression model entirely in memory using the simplest learning algorithm from Mahout. + *

    + * A number of options can be supplied in a configuration string passed to the constructor. These options + * are of the form name=value and options are separated by commas. Whitespace around option names and around + * values is not significant. Spaces inside values are preserved. + *

    + * The model to be trained can be read from a file in order to allow learning to continue at a previous + * stopping point or the particulars of a new model to be trained from scratch can be specified using the + * options. Training data can be held in-memory or written to a temporary file. + *

    + * The following options can be used to load a pre-existing model: + *

    + *

      + *
    • model
    • + *
    • categories
    • + *
    + *

    + * The following options can be used with a newly created model: + *

    + *

      + *
    • categories - specifies a list of values that the target variable can take on. This list should be space + * separated and given in the same order as when the model is later used. (required)
    • + *
    • features - the number of elements in the feature vectors to be given to the learning algorithm. (required)
    • + *
    • decayExponent - specifies how quickly the learning rate will decay. Optional with default value of 0.5. + * Note that per-term annealing still has effect.
    • + *
    • lambda - specifies how much regularization constant is used. Optional with default of 1e-5.
    • + *
    • stepOffset - slows down the decay of the learning rate at first if set greater than zero. Default is 10
    • + *
    • learningRate - initial value of the learning rate. Default is 1.
    • + *
    + *

    + * The following options can be used with any model: + *

    + *

      + *
    • inMemory - if "true" then training examples are kept in-memory and used in a random order. If "false" then + * a temporary file is used to hold training examples and the order they are used is fixed by the order they are + * given to this UDF. The default is "true".
    • + *
    • iterations - the number of iterations through the training data that are to be taken.
    • + *
    + */ +public class LogisticRegression extends EvalFunc implements Accumulator { + private List categories; + OnlineLogisticRegression model; + List trainingData = Lists.newArrayList(); + private int iterations; + private boolean inMemory; + private File tmpFile; + + public LogisticRegression(String modelParams) throws IOException { + Splitter onComma = Splitter.on(",").trimResults().omitEmptyStrings(); + Splitter onEquals = Splitter.on("=").trimResults(); + Splitter onSpaces = Splitter.on(" "); + Joiner withSpaces = Joiner.on(" "); + + Map options = Maps.newHashMap(); + + for (String option : onComma.split(modelParams)) { + List values = Lists.newArrayList(onEquals.split(option)); + options.put(values.get(0), values.get(1)); + } + + if (options.containsKey("model")) { + if (options.containsKey("categories")) { + categories = Lists.newArrayList(onSpaces.split(options.get("categories"))); + Configuration conf = UDFContext.getUDFContext().getJobConf(); + model = PolymorphicWritable.read(FileSystem.get(conf).open(new Path(options.get("model"))), OnlineLogisticRegression.class); + options.remove("model"); + options.remove(("categories")); + } else { + throw new BadClassifierSpecException("Must specify \"categories\" if pre-existing model is used"); + } + } else { + if (options.containsKey("categories") && options.containsKey("features")) { + categories = Lists.newArrayList(onSpaces.split(options.get("categories"))); + if (categories.size() < 2) { + throw new BadClassifierSpecException("Must have more than one target category. Remember that categories is a space separated list"); + } + model = new OnlineLogisticRegression(categories.size(), Integer.parseInt(options.get("features")), new L1()); + options.remove("categories"); + options.remove("features"); + } else { + throw new BadClassifierSpecException("Must specify previous model location using \"file\" or supply \"categories\" and \"features\""); + } + + if (options.containsKey("decayExponent")) { + model.decayExponent(Double.parseDouble(options.get("decayExponent"))); + options.remove("decayExponent"); + } + + if (options.containsKey("lambda")) { + model.lambda(Double.parseDouble(options.get("lambda"))); + options.remove("lambda"); + } + + if (options.containsKey("stepOffset")) { + model.stepOffset(Integer.parseInt(options.get("stepOffset"))); + options.remove("stepOffset"); + } + + if (options.containsKey("learningRate")) { + model.learningRate(Double.parseDouble(options.get("learningRate"))); + options.remove("learningRate"); + } + } + + iterations = options.containsKey("iterations") ? Integer.parseInt(options.get("iterations")) : 1; + options.remove("iterations"); + + inMemory = options.containsKey("inMemory") ? Boolean.parseBoolean(options.get("inMemory")) : true; + options.remove("inMemory"); + + if (options.size() > 0) { + throw new BadClassifierSpecException("Extra options supplied: " + withSpaces.join(options.keySet())); + } + + if (!inMemory) { + tmpFile = File.createTempFile("trainingData", "tmp"); + tmpFile.deleteOnExit(); + } + } + + @Override + public DataByteArray exec(Tuple input) throws IOException { + addBagOfData((DataBag) input.get(0)); + return getValue(); + } + + /** + * Pass tuples to the learning algorithm. Each tuple should have two fields. The first + * fields should correspond to one of the categories for the model and the second should + * be the encoded features for the training example. + * + * @param example A tuple containing a single field, which is a bag. The bag will contain the set + * of training examples being passed to the learning algorithm in this iteration. Not all + * training examples will be passed at once. + */ + public void accumulate(Tuple example) throws IOException { + if (example.size() != 1) { + throw new IllegalArgumentException("Input to training algorithm should be a single bag containing tuples each with target and vector"); + } + addBagOfData((DataBag) example.get(0)); + } + + private void addBagOfData(DataBag data) throws IOException { + if (inMemory) { + for (Tuple input : data) { + trainingData.add(new Example(categories.indexOf(input.get(0)), PigVector.fromBytes((DataByteArray) input.get(1)))); + } + } else { + DataOutputStream out = new DataOutputStream(new FileOutputStream(tmpFile)); + try { + for (Tuple input : data) { + out.writeInt(categories.indexOf(input.get(0))); + PolymorphicWritable.write(out, new VectorWritable(PigVector.fromBytes((DataByteArray) input.get(1)))); + } + } finally { + out.close(); + } + } + } + + /** + * Called when all tuples from current key have been passed to accumulate. This is where the + * actual training occurs. We can't do it earlier unless iterations = 1 which is an unusual + * case. + * + * @return the trained model. + */ + public DataByteArray getValue() { + for (int i = 0; i < iterations; i++) { + for (Example example : readInput()) { + model.train(example.getTarget(), example.getFeatures()); + } + } + + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream out = new DataOutputStream(baos); + PolymorphicWritable.write(out, new Classifier(categories, model)); + out.close(); + + return new DataByteArray(baos.toByteArray()); + } catch (IOException e) { + // should never happen + throw new ImpossibleStateError("Can't put results into tuple", e); + } + } + + /** + * Called after getValue() to prepare processing for next key. + */ + public void cleanup() { + if (tmpFile != null) { + tmpFile.delete(); + } + } + + public int getIterations() { + return iterations; + } + + public boolean isInMemory() { + return inMemory; + } + + public OnlineLogisticRegression getModel() { + return model; + } + + private Iterable readInput() { + if (inMemory) { + return new Iterable() { + public Iterator iterator() { + return new AbstractIterator() { + int remainingExamples = trainingData.size(); + Random gen = new Random(); + + @Override + protected Example computeNext() { + if (remainingExamples > 0) { + remainingExamples--; + return trainingData.get(gen.nextInt(trainingData.size())); + } else { + return endOfData(); + } + } + }; + } + }; + } else { + return new Iterable() { + public Iterator iterator() { + try { + return new AbstractIterator() { + DataInputStream in = new DataInputStream(new FileInputStream(tmpFile)); + + @Override + protected Example computeNext() { + int target; + try { + target = in.readInt(); + } catch (EOFException e) { + Closeables.closeQuietly(in); + return endOfData(); + } catch (IOException e) { + Closeables.closeQuietly(in); + throw new TrainingDataException("Error reading training data", e); + } + try { + return new Example(target, PolymorphicWritable.read(in, VectorWritable.class)); + } catch (EOFException e) { + Closeables.closeQuietly(in); + throw new TrainingDataException("Premature EOF while reading training data", e); + } catch (IOException e) { + Closeables.closeQuietly(in); + throw new TrainingDataException("Error reading training data", e); + } + } + }; + } catch (FileNotFoundException e) { + throw new TrainingDataException("Could not training data file", e); + } + } + }; + } + } + + private static class Example { + int target; + Vector features; + + public Example(int target, Vector v) { + this.target = target; + this.features = v; + } + + public Example(int target, VectorWritable v) { + this(target, v.get()); + } + + public int getTarget() { + return target; + } + + public Vector getFeatures() { + return features; + } + } + + private static class TrainingDataException extends RuntimeException { + public TrainingDataException(String msg, Throwable e) { + super(msg, e); + } + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0cc91384af20a6192acc59dff80c76cc6492f0b1 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/task.json @@ -0,0 +1,44 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-35510b21cf51a9acf072", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-35510b21cf51a9acf072", + "project_id": "morefixes__tdunning__pig-vector", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/org/apache/mahout/pig/LogisticRegression.java" + ], + "patch_units": { + "before": [ + "src/main/java/org/apache/mahout/pig/LogisticRegression.java" + ], + "after": [ + "src/main/java/org/apache/mahout/pig/LogisticRegression.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/581d1418f445d29534e12e7d56acd5ce5913fdd5bf35ece653a2c7424432349a/database", + "cache_key": "581d1418f445d29534e12e7d56acd5ce5913fdd5bf35ece653a2c7424432349a", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/e1730c32b0be3ab71f9726f620140ac8e0e77343b4dedd4a290c36443bfd71df/database", + "cache_key": "e1730c32b0be3ab71f9726f620140ac8e0e77343b4dedd4a290c36443bfd71df", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/050b72f2c8224f24848206192335371c5baf643390b4f254a61ecb4b952e04ce/database", + "cache_key": "050b72f2c8224f24848206192335371c5baf643390b4f254a61ecb4b952e04ce", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-35510b21cf51a9acf072/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-35510b21cf51a9acf072/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-35510b21cf51a9acf072/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..939d6ba6dd418769e23c74043d9db21e7f3e07e7 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/patch.diff @@ -0,0 +1,180 @@ +diff --git a/src/main/java/org/codehaus/plexus/util/Expand.java b/src/main/java/org/codehaus/plexus/util/Expand.java +index 8abcdd95..6ac71dc1 100644 +--- a/src/main/java/org/codehaus/plexus/util/Expand.java ++++ b/src/main/java/org/codehaus/plexus/util/Expand.java +@@ -111,8 +111,19 @@ public class Expand { + throws Exception { + File f = FileUtils.resolveFile(dir, entryName); + +- if (!f.getAbsolutePath().startsWith(dir.getAbsolutePath())) { +- throw new IOException("Entry '" + entryName + "' outside the target directory."); ++ try { ++ String canonicalDirPath = dir.getCanonicalPath(); ++ String canonicalFilePath = f.getCanonicalPath(); ++ ++ // Ensure the file is within the target directory ++ // We need to check that the canonical file path starts with the canonical directory path ++ // followed by a file separator to prevent path traversal attacks ++ if (!canonicalFilePath.startsWith(canonicalDirPath + File.separator) ++ && !canonicalFilePath.equals(canonicalDirPath)) { ++ throw new IOException("Entry '" + entryName + "' outside the target directory."); ++ } ++ } catch (IOException e) { ++ throw new IOException("Failed to verify entry path for '" + entryName + "'", e); + } + + try { +diff --git a/src/test/java/org/codehaus/plexus/util/ExpandTest.java b/src/test/java/org/codehaus/plexus/util/ExpandTest.java +new file mode 100644 +index 00000000..46e3d0e3 +--- /dev/null ++++ b/src/test/java/org/codehaus/plexus/util/ExpandTest.java +@@ -0,0 +1,148 @@ ++package org.codehaus.plexus.util; ++ ++/* ++ * Copyright The Codehaus Foundation. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++import java.io.File; ++import java.nio.file.Files; ++import java.util.zip.ZipEntry; ++import java.util.zip.ZipOutputStream; ++ ++import org.junit.jupiter.api.Test; ++ ++import static org.junit.jupiter.api.Assertions.assertFalse; ++import static org.junit.jupiter.api.Assertions.assertThrows; ++import static org.junit.jupiter.api.Assertions.assertTrue; ++ ++/** ++ * Test for {@link Expand}. ++ */ ++class ExpandTest extends FileBasedTestCase { ++ ++ @Test ++ void testZipSlipVulnerabilityWithParentDirectory() throws Exception { ++ File tempDir = getTestDirectory(); ++ File zipFile = new File(tempDir, "malicious.zip"); ++ File targetDir = new File(tempDir, "extract"); ++ targetDir.mkdirs(); ++ ++ // Create a malicious zip with path traversal ++ try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { ++ ZipEntry entry = new ZipEntry("../../evil.txt"); ++ zos.putNextEntry(entry); ++ zos.write("malicious content".getBytes()); ++ zos.closeEntry(); ++ } ++ ++ Expand expand = new Expand(); ++ expand.setSrc(zipFile); ++ expand.setDest(targetDir); ++ ++ // This should throw an exception, not extract the file ++ assertThrows(Exception.class, () -> expand.execute()); ++ ++ // Verify the file was not created outside the target directory ++ File evilFile = new File(tempDir, "evil.txt"); ++ assertFalse(evilFile.exists(), "File should not be extracted outside target directory"); ++ } ++ ++ @Test ++ void testZipSlipVulnerabilityWithAbsolutePath() throws Exception { ++ File tempDir = getTestDirectory(); ++ File zipFile = new File(tempDir, "malicious-absolute.zip"); ++ File targetDir = new File(tempDir, "extract-abs"); ++ targetDir.mkdirs(); ++ ++ // Create a malicious zip with absolute path ++ File evilTarget = new File("/tmp/evil-absolute.txt"); ++ try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { ++ ZipEntry entry = new ZipEntry(evilTarget.getAbsolutePath()); ++ zos.putNextEntry(entry); ++ zos.write("malicious content".getBytes()); ++ zos.closeEntry(); ++ } ++ ++ Expand expand = new Expand(); ++ expand.setSrc(zipFile); ++ expand.setDest(targetDir); ++ ++ // This should throw an exception, not extract the file ++ assertThrows(Exception.class, () -> expand.execute()); ++ ++ // Verify the file was not created at the absolute path ++ assertFalse(evilTarget.exists(), "File should not be extracted to absolute path"); ++ } ++ ++ @Test ++ void testZipSlipVulnerabilityWithSimilarDirectoryName() throws Exception { ++ File tempDir = getTestDirectory(); ++ File zipFile = new File(tempDir, "malicious-similar.zip"); ++ File targetDir = new File(tempDir, "extract"); ++ targetDir.mkdirs(); ++ ++ // Create a directory with a similar name to test prefix matching vulnerability ++ File similarDir = new File(tempDir, "extract-evil"); ++ similarDir.mkdirs(); ++ ++ // Create a malicious zip that tries to exploit prefix matching ++ // If targetDir is /tmp/extract, this tries to write to /tmp/extract-evil/file.txt ++ String maliciousPath = "../extract-evil/evil.txt"; ++ try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { ++ ZipEntry entry = new ZipEntry(maliciousPath); ++ zos.putNextEntry(entry); ++ zos.write("malicious content".getBytes()); ++ zos.closeEntry(); ++ } ++ ++ Expand expand = new Expand(); ++ expand.setSrc(zipFile); ++ expand.setDest(targetDir); ++ ++ // This should throw an exception, not extract the file ++ assertThrows(Exception.class, () -> expand.execute()); ++ ++ // Verify the file was not created in the similar directory ++ File evilFile = new File(similarDir, "evil.txt"); ++ assertFalse(evilFile.exists(), "File should not be extracted to directory with similar name"); ++ } ++ ++ @Test ++ void testNormalZipExtraction() throws Exception { ++ File tempDir = getTestDirectory(); ++ File zipFile = new File(tempDir, "normal.zip"); ++ File targetDir = new File(tempDir, "extract-normal"); ++ targetDir.mkdirs(); ++ ++ // Create a normal zip ++ try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { ++ ZipEntry entry = new ZipEntry("subdir/normal.txt"); ++ zos.putNextEntry(entry); ++ zos.write("normal content".getBytes()); ++ zos.closeEntry(); ++ } ++ ++ Expand expand = new Expand(); ++ expand.setSrc(zipFile); ++ expand.setDest(targetDir); ++ ++ // This should succeed ++ expand.execute(); ++ ++ // Verify the file was created in the correct location ++ File normalFile = new File(targetDir, "subdir/normal.txt"); ++ assertTrue(normalFile.exists(), "File should be extracted to correct location"); ++ } ++} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..f5fcdc10ef81cc028c0b2f5c9ffc45698ee7b801 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/post_context.md @@ -0,0 +1,340 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/org/codehaus/plexus/util/Expand.java` (changed lines (114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)) + +```java +package org.codehaus.plexus.util; + +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.codehaus.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Ant", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact codehaus@codehaus.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.util.Date; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** + * Unzip a file. + * + * @author costin@dnt.ro + * @author
    Stefan Bodewig + * @author Magesh Umasankar + * @since Ant 1.1 @ant.task category="packaging" name="unzip" name="unjar" name="unwar" + * + */ +public class Expand { + + private File dest; // req + + private File source; // req + + private boolean overwrite = true; + + /** + * Do the work. + * + * @exception Exception Thrown in unrecoverable error. + */ + public void execute() throws Exception { + expandFile(source, dest); + } + + protected void expandFile(final File srcF, final File dir) throws Exception { + // code from WarExpand + try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(srcF.toPath()))) { + for (ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) { + extractFile(srcF, dir, zis, ze.getName(), new Date(ze.getTime()), ze.isDirectory()); + } + } catch (IOException ioe) { + throw new Exception("Error while expanding " + srcF.getPath(), ioe); + } + } + + protected void extractFile( + File srcF, + File dir, + InputStream compressedInputStream, + String entryName, + Date entryDate, + boolean isDirectory) + throws Exception { + File f = FileUtils.resolveFile(dir, entryName); + + try { + String canonicalDirPath = dir.getCanonicalPath(); + String canonicalFilePath = f.getCanonicalPath(); + + // Ensure the file is within the target directory + // We need to check that the canonical file path starts with the canonical directory path + // followed by a file separator to prevent path traversal attacks + if (!canonicalFilePath.startsWith(canonicalDirPath + File.separator) + && !canonicalFilePath.equals(canonicalDirPath)) { + throw new IOException("Entry '" + entryName + "' outside the target directory."); + } + } catch (IOException e) { + throw new IOException("Failed to verify entry path for '" + entryName + "'", e); + } + + try { + if (!overwrite && f.exists() && f.lastModified() >= entryDate.getTime()) { + return; + } + + // create intermediary directories - sometimes zip don't add them + File dirF = f.getParentFile(); + dirF.mkdirs(); + + if (isDirectory) { + f.mkdirs(); + } else { + byte[] buffer = new byte[65536]; + + try (OutputStream fos = Files.newOutputStream(f.toPath())) { + for (int length = compressedInputStream.read(buffer); + length >= 0; + fos.write(buffer, 0, length), length = compressedInputStream.read(buffer)) + ; + } + } + + f.setLastModified(entryDate.getTime()); + } catch (FileNotFoundException ex) { + throw new Exception("Can't extract file " + srcF.getPath(), ex); + } + } + + /** + * Set the destination directory. File will be unzipped into the destination directory. + * + * @param d Path to the directory. + */ + public void setDest(File d) { + this.dest = d; + } + + /** + * Set the path to zip-file. + * + * @param s Path to zip-file. + */ + public void setSrc(File s) { + this.source = s; + } + + /** + * @param b Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive? + */ + public void setOverwrite(boolean b) { + overwrite = b; + } +} +``` + +## `src/test/java/org/codehaus/plexus/util/ExpandTest.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148)) + +```java +package org.codehaus.plexus.util; + +/* + * Copyright The Codehaus Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.io.File; +import java.nio.file.Files; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Test for {@link Expand}. + */ +class ExpandTest extends FileBasedTestCase { + + @Test + void testZipSlipVulnerabilityWithParentDirectory() throws Exception { + File tempDir = getTestDirectory(); + File zipFile = new File(tempDir, "malicious.zip"); + File targetDir = new File(tempDir, "extract"); + targetDir.mkdirs(); + + // Create a malicious zip with path traversal + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { + ZipEntry entry = new ZipEntry("../../evil.txt"); + zos.putNextEntry(entry); + zos.write("malicious content".getBytes()); + zos.closeEntry(); + } + + Expand expand = new Expand(); + expand.setSrc(zipFile); + expand.setDest(targetDir); + + // This should throw an exception, not extract the file + assertThrows(Exception.class, () -> expand.execute()); + + // Verify the file was not created outside the target directory + File evilFile = new File(tempDir, "evil.txt"); + assertFalse(evilFile.exists(), "File should not be extracted outside target directory"); + } + + @Test + void testZipSlipVulnerabilityWithAbsolutePath() throws Exception { + File tempDir = getTestDirectory(); + File zipFile = new File(tempDir, "malicious-absolute.zip"); + File targetDir = new File(tempDir, "extract-abs"); + targetDir.mkdirs(); + + // Create a malicious zip with absolute path + File evilTarget = new File("/tmp/evil-absolute.txt"); + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { + ZipEntry entry = new ZipEntry(evilTarget.getAbsolutePath()); + zos.putNextEntry(entry); + zos.write("malicious content".getBytes()); + zos.closeEntry(); + } + + Expand expand = new Expand(); + expand.setSrc(zipFile); + expand.setDest(targetDir); + + // This should throw an exception, not extract the file + assertThrows(Exception.class, () -> expand.execute()); + + // Verify the file was not created at the absolute path + assertFalse(evilTarget.exists(), "File should not be extracted to absolute path"); + } + + @Test + void testZipSlipVulnerabilityWithSimilarDirectoryName() throws Exception { + File tempDir = getTestDirectory(); + File zipFile = new File(tempDir, "malicious-similar.zip"); + File targetDir = new File(tempDir, "extract"); + targetDir.mkdirs(); + + // Create a directory with a similar name to test prefix matching vulnerability + File similarDir = new File(tempDir, "extract-evil"); + similarDir.mkdirs(); + + // Create a malicious zip that tries to exploit prefix matching + // If targetDir is /tmp/extract, this tries to write to /tmp/extract-evil/file.txt + String maliciousPath = "../extract-evil/evil.txt"; + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { + ZipEntry entry = new ZipEntry(maliciousPath); + zos.putNextEntry(entry); + zos.write("malicious content".getBytes()); + zos.closeEntry(); + } + + Expand expand = new Expand(); + expand.setSrc(zipFile); + expand.setDest(targetDir); + + // This should throw an exception, not extract the file + assertThrows(Exception.class, () -> expand.execute()); + + // Verify the file was not created in the similar directory + File evilFile = new File(similarDir, "evil.txt"); + assertFalse(evilFile.exists(), "File should not be extracted to directory with similar name"); + } + + @Test + void testNormalZipExtraction() throws Exception { + File tempDir = getTestDirectory(); + File zipFile = new File(tempDir, "normal.zip"); + File targetDir = new File(tempDir, "extract-normal"); + targetDir.mkdirs(); + + // Create a normal zip + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) { + ZipEntry entry = new ZipEntry("subdir/normal.txt"); + zos.putNextEntry(entry); + zos.write("normal content".getBytes()); + zos.closeEntry(); + } + + Expand expand = new Expand(); + expand.setSrc(zipFile); + expand.setDest(targetDir); + + // This should succeed + expand.execute(); + + // Verify the file was created in the correct location + File normalFile = new File(targetDir, "subdir/normal.txt"); + assertTrue(normalFile.exists(), "File should be extracted to correct location"); + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..6d58b12845499fe6c2a1b74193bb66ca157f53d8 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/pre_context.md @@ -0,0 +1,176 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/org/codehaus/plexus/util/Expand.java` (changed lines (114, 115, 116)) + +```java +package org.codehaus.plexus.util; + +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.codehaus.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Ant", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact codehaus@codehaus.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.util.Date; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** + * Unzip a file. + * + * @author costin@dnt.ro + * @author Stefan Bodewig + * @author Magesh Umasankar + * @since Ant 1.1 @ant.task category="packaging" name="unzip" name="unjar" name="unwar" + * + */ +public class Expand { + + private File dest; // req + + private File source; // req + + private boolean overwrite = true; + + /** + * Do the work. + * + * @exception Exception Thrown in unrecoverable error. + */ + public void execute() throws Exception { + expandFile(source, dest); + } + + protected void expandFile(final File srcF, final File dir) throws Exception { + // code from WarExpand + try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(srcF.toPath()))) { + for (ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) { + extractFile(srcF, dir, zis, ze.getName(), new Date(ze.getTime()), ze.isDirectory()); + } + } catch (IOException ioe) { + throw new Exception("Error while expanding " + srcF.getPath(), ioe); + } + } + + protected void extractFile( + File srcF, + File dir, + InputStream compressedInputStream, + String entryName, + Date entryDate, + boolean isDirectory) + throws Exception { + File f = FileUtils.resolveFile(dir, entryName); + + if (!f.getAbsolutePath().startsWith(dir.getAbsolutePath())) { + throw new IOException("Entry '" + entryName + "' outside the target directory."); + } + + try { + if (!overwrite && f.exists() && f.lastModified() >= entryDate.getTime()) { + return; + } + + // create intermediary directories - sometimes zip don't add them + File dirF = f.getParentFile(); + dirF.mkdirs(); + + if (isDirectory) { + f.mkdirs(); + } else { + byte[] buffer = new byte[65536]; + + try (OutputStream fos = Files.newOutputStream(f.toPath())) { + for (int length = compressedInputStream.read(buffer); + length >= 0; + fos.write(buffer, 0, length), length = compressedInputStream.read(buffer)) + ; + } + } + + f.setLastModified(entryDate.getTime()); + } catch (FileNotFoundException ex) { + throw new Exception("Can't extract file " + srcF.getPath(), ex); + } + } + + /** + * Set the destination directory. File will be unzipped into the destination directory. + * + * @param d Path to the directory. + */ + public void setDest(File d) { + this.dest = d; + } + + /** + * Set the path to zip-file. + * + * @param s Path to zip-file. + */ + public void setSrc(File s) { + this.source = s; + } + + /** + * @param b Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive? + */ + public void setOverwrite(boolean b) { + overwrite = b; + } +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/task.json new file mode 100644 index 0000000000000000000000000000000000000000..dcdab369850df4a3312d88487844750e0bbaa791 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/task.json @@ -0,0 +1,46 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-378f408f498b20422fe9", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-378f408f498b20422fe9", + "project_id": "morefixes__codehaus-plexus__plexus-utils", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/org/codehaus/plexus/util/Expand.java", + "src/test/java/org/codehaus/plexus/util/ExpandTest.java" + ], + "patch_units": { + "before": [ + "src/main/java/org/codehaus/plexus/util/Expand.java" + ], + "after": [ + "src/main/java/org/codehaus/plexus/util/Expand.java", + "src/test/java/org/codehaus/plexus/util/ExpandTest.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/ade57626a5859aac21434632a3966cf2c18276830fdcc0b393f373ae73ad951f/database", + "cache_key": "ade57626a5859aac21434632a3966cf2c18276830fdcc0b393f373ae73ad951f", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/29c1e6abb0d15e29ce61d331b5eb4de825d91613225a6a54edc3e44649c01411/database", + "cache_key": "29c1e6abb0d15e29ce61d331b5eb4de825d91613225a6a54edc3e44649c01411", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/bb22e14ab2e5522ae05cbbe240b43186849ebd6e07df6f263d0856205f43bae5/database", + "cache_key": "bb22e14ab2e5522ae05cbbe240b43186849ebd6e07df6f263d0856205f43bae5", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-378f408f498b20422fe9/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-378f408f498b20422fe9/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-378f408f498b20422fe9/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..80ece0ff8de7e2eac344181b666dca2d1c3aeedb --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/patch.diff @@ -0,0 +1,1885 @@ +diff --git a/src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java b/src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java +index fb39310..578e9c6 100644 +--- a/src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java ++++ b/src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java +@@ -1,906 +1,959 @@ +-package co.uk.mommyheather.advancedbackups.cli; +- +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileOutputStream; +-import java.io.FileReader; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.PrintWriter; +-import java.io.StringWriter; +-import java.nio.file.FileSystem; +-import java.nio.file.FileSystems; +-import java.nio.file.FileVisitResult; +-import java.nio.file.Files; +-import java.nio.file.Path; +-import java.nio.file.SimpleFileVisitor; +-import java.nio.file.StandardCopyOption; +-import java.nio.file.attribute.BasicFileAttributes; +-import java.text.SimpleDateFormat; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Date; +-import java.util.Enumeration; +-import java.util.HashMap; +-import java.util.InputMismatchException; +-import java.util.List; +-import java.util.Properties; +-import java.util.regex.Pattern; +-import java.util.zip.ZipEntry; +-import java.util.zip.ZipFile; +-import java.util.zip.ZipInputStream; +-import java.util.zip.ZipOutputStream; +- +-import org.fusesource.jansi.AnsiConsole; +- +-public class AdvancedBackupsCLI { +- +- private static String backupLocation; +- private static File serverDir = new File(new File("").toPath().toAbsolutePath().getParent().toString()); +- private static String type; +- private static ArrayList fileNames = new ArrayList<>(); +- private static File worldFile; +- private static String worldPath; +- public static void main(String args[]){ +- +- +- +- if (System.console() != null) { +- AnsiConsole.systemInstall(); //this gets ansi escape codes working on windows. this was a FUCKING PAIN IN MY ASS +- } +- +- System.out.print("\033[H\033[2J"); +- System.out.flush(); +- +- +- CLIIOHelpers.info("Advanced Backups - Version " + AdvancedBackupsCLI.class.getPackage().getImplementationVersion()); +- CLIIOHelpers.info("Note : this cannot restore backups made prior to the 3.0 release."); +- CLIIOHelpers.info("Searching for properties...", false); +- +- +- Properties props = new Properties(); +- File file = new File(serverDir, "config/AdvancedBackups.properties"); +- FileReader reader; +- try { +- reader = new FileReader(file); +- props.load(reader); +- +- backupLocation = props.getProperty("config.advancedbackups.path"); +- type = props.getProperty("config.advancedbackups.type"); +- } catch (Exception e) { +- CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); +- CLIIOHelpers.error(getStackTrace(e)); +- CLIIOHelpers.error(""); +- CLIIOHelpers.error(""); +- CLIIOHelpers.error("Ensure you're running this from within the mods directory, and the config file is in the parent directory!"); +- // Fatal, cannot proceed +- return; +- } +- +- if (backupLocation == null || type == null) { +- CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); +- CLIIOHelpers.error("Backup location : " + backupLocation); +- CLIIOHelpers.error("Type : " + type); +- // Fatal, cannot proceed +- return; +- } +- +- CLIIOHelpers.info("Config loaded!"); +- +- //What's a good way to check between absolute and relative? Not all absolute paths will start with /.. +- File backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); +- +- if (!backupDir.exists()) { +- //Is it absolute? +- backupDir = new File(backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); +- if (!backupDir.exists()) { +- CLIIOHelpers.error("Could not find backup directory!"); +- CLIIOHelpers.error(backupDir.getAbsolutePath()); +- CLIIOHelpers.error("Have you made any backups before?"); +- //Fatal, cannot continue +- return; +- } +- } +- +- +- //check for backups from "other mods" +- boolean flag = false; +- ArrayList otherBackups = new ArrayList<>(); +- for (File b : backupDir.listFiles()) { +- if (b.getName().endsWith("zip")) { +- flag = true; +- otherBackups.add(b); +- } +- +- } +- +- if (flag) { +- String result = CLIIOHelpers.getSelectionFromList("Backups from another mod have been found. These can be restored if you want.\nWould you want to work with these backups?", +- Arrays.asList(new String[]{"Use backups from AdvancedBackups", "Use backups from other mod"})); +- if (result == "Use backups from other mod") { +- restoreOtherModZip(backupDir); +- return; +- } +- } +- +- type = CLIIOHelpers.getBackupType(type); +- if (type.equals("snapshot (command-made only)")) type = "snapshots"; +- +- /*/ +- if (backupLocation.startsWith(Pattern.quote(File.separator)) || backupLocation.indexOf(":") == 1) { +- backupDir = new File(backupLocation, File.separator + type + File.separator); +- } +- else { +- backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "") + File.separator + type + File.separator); +- } +-*/ +- +- +- boolean exportMode = false; +- int backupDateIndex; +- +- +- +- CLIIOHelpers.info("Do you want to export a backup, restore the entire world state at this point, or a singular file?"); +- +- String restore = CLIIOHelpers.getSelectionFromList("Enter a number.", +- Arrays.asList(new String[]{"Export backup as zip", "Restore single file", "Restore entire world"})); +- +- +- if (restore.equals("Export backup as zip")) { +- exportMode = true; +- } +- +- +- worldFile = CLIIOHelpers.getWorldFile(serverDir); +- worldPath = worldFile.getName().replace(" ", "_"); +- +- backupDir = new File(backupDir, worldFile.getName() + "/" + type); +- +- try { +- backupDateIndex = getBackupDate(backupDir, exportMode); +- } catch (IOException e) { +- CLIIOHelpers.error("ERROR VIEWING BACKUPS!"); +- e.printStackTrace(); +- return; +- } +- +- if (exportMode) { +- worldFile = new File(serverDir, "AdvancedBackups.temp"); +- worldFile.mkdirs(); +- } +- +- +- if (!CLIIOHelpers.confirmWarningMessage()) { +- CLIIOHelpers.error("ABORTED - WILL NOT PROCEED."); +- return; +- } +- +- CLIIOHelpers.info("Preparing..."); +- +- +- +- switch(restore) { +- case "Restore entire world" : { +- //No going back now! +- CLIIOHelpers.info("Backing up current world state..."); +- CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(worldFile, false)); +- switch(type) { +- case "snapshots" : +- case "zips" : { +- restoreFullZip(backupDateIndex, worldFile); +- return; +- } +- case "differential" : { +- restoreFullDifferential(backupDateIndex, worldFile); +- return; +- } +- case "incremental" : { +- restoreFullIncremental(backupDateIndex, worldFile); +- return; +- } +- } +- } +- case "Restore single file" : { +- switch(type) { +- case "snapshots" : +- case "zips" : { +- restorePartialZip(backupDateIndex, worldFile); +- return; +- } +- case "differential" : { +- restorePartialDifferential(backupDateIndex, worldFile); +- return; +- } +- case "incremental" : { +- restorePartialIncremental(backupDateIndex, worldFile); +- return; +- } +- } +- } +- case "Export backup as zip" : { +- +- CLIIOHelpers.info("Restoring to temporary directory..."); +- +- switch(type) { +- case "snapshots" : +- case "zips" : { +- restoreFullZip(backupDateIndex, worldFile); +- break; +- } +- case "differential" : { +- restoreFullDifferential(backupDateIndex, worldFile); +- break; +- } +- case "incremental" : { +- restoreFullIncremental(backupDateIndex, worldFile); +- break; +- } +- } +- +- CLIIOHelpers.info("Done. Preparing to write to zip..."); +- CLIIOHelpers.info("Export saved to : " + deleteEntireWorld(worldFile, true)); +- } +- +- } +- } +- +- +- private static String getStackTrace(final Throwable throwable) { +- final StringWriter sw = new StringWriter(); +- final PrintWriter pw = new PrintWriter(sw, true); +- throwable.printStackTrace(pw); +- return sw.getBuffer().toString(); +- } +- +- +- +- private static int getBackupDate(File backupDir, boolean exportMode) throws IOException { +- fileNames.clear(); +- int inputType; +- +- CLIIOHelpers.info("Select a backup to restore."); +- +- String[] fileNameArray = backupDir.list(); +- if (fileNameArray == null || fileNameArray.length <=0) { +- throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); +- } +- ArrayList fileNameList = new ArrayList(Arrays.asList(fileNameArray)); //i need to do this. i hate this. +- fileNameList.removeIf((name) -> { +- return (name.endsWith("json") || +- name.contains("incomplete") || +- name.contains("DS_Store")); +- }); +- +- if (fileNameList.isEmpty()) { +- throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); +- } +- +- for (String fileName : CLIIOHelpers.sortStringsAlphabeticallyWithDirectoryPriority(fileNameList)) { +- if (exportMode) { +- if (fileName.endsWith("json")) continue; +- if (fileName.contains("incomplete")) continue; +- File file = new File(backupDir, fileName); +- fileNames.add(file.getAbsolutePath()); +- String out = file.getName(); +- String[] outs = out.split("\\_"); +- if (outs.length >=2) { +- out = ". " + outs[outs.length-2] + "_" + outs[outs.length-1]; +- } +- else { +- out = ". " + out; +- } +- CLIIOHelpers.info(fileNames.size() + out); +- +- } +- else { +- if (fileName.endsWith("json")) continue; +- if (fileName.contains("incomplete")) continue; +- File file = new File(backupDir, fileName); +- fileNames.add(file.getAbsolutePath()); +- String out = file.getName(); +- out = out.replaceAll(".zip", ""); +- //out = out.replaceAll(worldPath + "_", ": "); +- out = out.replaceAll("backup_", ": "); +- out = out.replaceAll("-partial", "\u001B[33m partial\u001B[0m"); +- out = out.replaceAll("-full", "\u001B[32m full\u001B[0m"); +- CLIIOHelpers.info(fileNames.size() + out); +- +- } +- } +- +- try { +- String line = CLIIOHelpers.input.nextLine(); +- if (line == "") { +- CLIIOHelpers.warn("Please enter a number."); +- return getBackupDate(backupDir, exportMode); +- } +- inputType = Integer.parseInt(line); +- } catch (InputMismatchException | NumberFormatException e) { +- CLIIOHelpers.warn("That was not a number. Please enter a number."); +- return getBackupDate(backupDir, exportMode); +- } +- +- if (inputType < 1 || inputType > fileNames.size()) { +- CLIIOHelpers.warn("Please enter a number between " + fileNames.size() + "."); +- return getBackupDate(backupDir, exportMode); +- } +- +- return inputType - 1; +- } +- +- +- +- private static void restoreFullZip(int index, File worldFile) { +- byte[] buffer = new byte[1024]; +- //The most basic of the bunch. +- ZipEntry entry; +- try { +- FileInputStream fileInputStream = new FileInputStream(fileNames.get(index)); +- ZipInputStream zip = new ZipInputStream(fileInputStream); +- while ((entry = zip.getNextEntry()) != null) { +- File outputFile; +- +- outputFile = new File(worldFile, entry.getName()); +- +- if (!outputFile.getParentFile().exists()) { +- outputFile.getParentFile().mkdirs(); +- } +- +- CLIIOHelpers.info("Restoring " + outputFile.getName()); +- +- FileOutputStream outputStream = new FileOutputStream(outputFile); +- int length = 0; +- while ((length = zip.read(buffer)) > 0) { +- outputStream.write(buffer, 0, length); +- } +- outputStream.close(); +- } +- } catch (IOException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- } +- } +- +- private static void restoreFullDifferential(int index, File worldFile) { +- //Do we need to check for past backups? if selected is a full backup, we do not. +- File backup = new File(fileNames.get(index)); +- if (backup.getName().contains("-full")) { +- if (backup.isFile()) { +- restoreFullZip(index, worldFile); +- return; +- } +- restoreFolder(index, worldFile); +- return; +- } +- //find last FULL backup +- for (int i = index;i>=0;i--) { +- String name = fileNames.get(i); +- if (name.contains("-full")) { +- CLIIOHelpers.info("Restoring last full backup..."); +- File file = new File(name); +- if (file.isFile()) { +- restoreFullZip(i, worldFile); +- } +- else { +- restoreFolder(i, worldFile); +- } +- break; +- } +- } +- CLIIOHelpers.info("\n\nRestoring selected backup..."); +- if (backup.isFile()) { +- restoreFullZip(index, worldFile); +- } +- else { +- restoreFolder(index, worldFile); +- } +- } +- +- private static void restoreFullIncremental(int index, File worldFile) { +- //Do we need to check for past backups? if selected is a full backup, we do not. +- File backup = new File(fileNames.get(index)); +- if (backup.getName().contains("-full")) { +- if (backup.isFile()) { +- restoreFullZip(index, worldFile); +- return; +- } +- restoreFolder(index, worldFile); +- return; +- } +- //find last FULL backup +- int i = index; +- while(i >= 0) { +- String name = fileNames.get(i); +- if (name.contains("-full")) { +- CLIIOHelpers.info("Restoring last full backup..."); +- File file = new File(name); +- if (file.isFile()) { +- restoreFullZip(i, worldFile); +- } +- else { +- restoreFolder(i, worldFile); +- } +- break; +- } +- i--; +- } +- //restore backups up until the selected one +- while(i < index) { +- String name = fileNames.get(i); +- CLIIOHelpers.info("Restoring chained backup..."); +- File file = new File(name); +- if (file.isFile()) { +- restoreFullZip(i, worldFile); +- } +- else { +- restoreFolder(i, worldFile); +- } +- i++; +- } +- +- +- CLIIOHelpers.info("\n\nRestoring selected backup..."); +- if (backup.isFile()) { +- restoreFullZip(index, worldFile); +- } +- else { +- restoreFolder(index, worldFile); +- } +- } +- +- private static void restorePartialZip(int index, File worldFile) { +- +- HashMap filePaths = new HashMap<>(); +- HashMap dates = new HashMap<>(); +- HashMap entryOwners = new HashMap<>(); +- try { +- File backup = new File(fileNames.get(index)); +- +- addBackupNamesToLists(backup, entryOwners, filePaths, dates, "\u001B[32m"); +- +- ZipEntry select = ((ZipEntry) CLIIOHelpers.getFileToRestore(filePaths, "", worldFile)); +- +- File outputFile = new File(worldFile, select.toString()); +- FileOutputStream outputStream = new FileOutputStream(outputFile); +- +- CLIIOHelpers.info("Restoring " + select.toString() + "..."); +- +- byte[] buffer = new byte[1028]; +- InputStream inputSteam = entryOwners.get(select.toString()).getInputStream(select); +- int length; +- while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { +- outputStream.write(buffer, 0, length); +- } +- outputStream.flush(); +- outputStream.close(); +- +- } catch (IOException e) { +- +- } +- +- +- +- +- } +- +- private static void restorePartialDifferential(int index, File worldFile) { +- //Do we need to check for past backups? if selected is a full backup, we do not. +- HashMap filePaths = new HashMap<>(); +- HashMap dates = new HashMap<>(); +- HashMap entryOwners = new HashMap<>(); +- try { +- File backup = new File(fileNames.get(index)); +- if (!backup.getName().contains("-full")) { +- //find last FULL backup +- for (int i = index;i>=0;i--) { +- String name = fileNames.get(i); +- if (name.contains("-full")) { +- addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); +- break; +- } +- } +- } +- +- File file = new File(fileNames.get(index)); +- addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); +- +- HashMap properMapping = new HashMap<>(); +- for (String date : dates.keySet()) { +- properMapping.put( +- date + " " + dates.get(date), +- filePaths.get(date) +- ); +- } +- +- Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); +- if (select instanceof Path) { +- Path input = (Path) select; +- +- +- if (select.toString().replace("\\", "/").contains("-full/")) { +- select = new File( +- select.toString().replace("\\", "/") +- .split("-full/")[1] +- ).toPath(); +- } +- if (select.toString().replace("\\", "/").contains("-partial/")) { +- select = new File( +- select.toString().replace("\\", "/") +- .split("-partial/")[1] +- ).toPath(); +- } +- +- File outputFile = new File(worldFile, select.toString()); +- if (!outputFile.getParentFile().exists()) { +- outputFile.getParentFile().mkdirs(); +- } +- CLIIOHelpers.info("\n\nRestoring file : " + select); +- Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); +- } +- else if (select instanceof ZipEntry) { +- ZipEntry entry = (ZipEntry) select; +- +- File outputFile = new File(worldFile, entry.toString()); +- FileOutputStream outputStream = new FileOutputStream(outputFile); +- +- CLIIOHelpers.info("Restoring " + entry.toString() + "..."); +- +- byte[] buffer = new byte[1028]; +- InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); +- int length; +- while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { +- outputStream.write(buffer, 0, length); +- } +- outputStream.flush(); +- outputStream.close(); +- } +- +- +- } +- catch (IOException e){ +- //TODO : Scream at user +- e.printStackTrace(); +- } +- } +- +- private static void restorePartialIncremental(int index, File worldFile) { +- //Do we need to check for past backups? if selected is a full backup, we do not. +- HashMap filePaths = new HashMap<>(); +- HashMap dates = new HashMap<>(); +- HashMap entryOwners = new HashMap<>(); +- try { +- File backup = new File(fileNames.get(index)); +- if (!backup.getName().contains("-full")) { +- int i; +- //find last FULL backup +- for (i = index;i>=0;i--) { +- String name = fileNames.get(i); +- if (name.contains("-full")) { +- addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); +- break; +- } +- } +- while (i < index) { +- String name = fileNames.get(i); +- addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); +- i++; +- } +- +- } +- +- File file = new File(fileNames.get(index)); +- addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); +- +- HashMap properMapping = new HashMap<>(); +- for (String date : dates.keySet()) { +- properMapping.put( +- date + " " + dates.get(date), +- filePaths.get(date) +- ); +- } +- +- Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); +- if (select instanceof Path) { +- Path input = (Path) select; +- +- +- if (select.toString().replace("\\", "/").contains("-full/")) { +- select = new File( +- select.toString().replace("\\", "/") +- .split("-full/")[1] +- ).toPath(); +- } +- if (select.toString().replace("\\", "/").contains("-partial/")) { +- select = new File( +- select.toString().replace("\\", "/") +- .split("-partial/")[1] +- ).toPath(); +- } +- +- File outputFile = new File(worldFile, select.toString()); +- if (!outputFile.getParentFile().exists()) { +- outputFile.getParentFile().mkdirs(); +- } +- CLIIOHelpers.info("\n\nRestoring file : " + select); +- Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); +- } +- else if (select instanceof ZipEntry) { +- ZipEntry entry = (ZipEntry) select; +- +- File outputFile = new File(worldFile, entry.toString()); +- FileOutputStream outputStream = new FileOutputStream(outputFile); +- +- CLIIOHelpers.info("Restoring " + entry.toString() + "..."); +- +- byte[] buffer = new byte[1028]; +- InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); +- int length; +- while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { +- outputStream.write(buffer, 0, length); +- } +- outputStream.flush(); +- outputStream.close(); +- } +- +- +- } +- catch (IOException e){ +- //TODO : Scream at user +- e.printStackTrace(); +- } +- } +- +- +- private static void restoreFolder(int index, File worldFile) { +- File backup = new File(fileNames.get(index)); +- +- try { +- Files.walkFileTree(backup.toPath(), new SimpleFileVisitor() { +- @Override +- public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { +- File source = backup.toPath().relativize(file).toFile(); +- File outputFile = new File(worldFile, source.getPath()); +- +- if (!outputFile.getParentFile().exists()) { +- outputFile.getParentFile().mkdirs(); +- } +- +- CLIIOHelpers.info("Restoring " + outputFile.getName()); +- Files.copy(file, outputFile.toPath()); +- return FileVisitResult.CONTINUE; +- } +- }); +- } catch (IOException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- } +- } +- +- +- private static void restoreOtherModZip(File backupDir) { +- worldFile = serverDir; +- Path file; +- HashMap backups = new HashMap<>(); +- HashMap entries = new HashMap<>(); +- +- for (File b : backupDir.getParentFile().listFiles()) { +- if (b.getName().endsWith("zip")) { +- backups.put(b.getName(), b); +- } +- } +- +- String backupName = CLIIOHelpers.getSelectionFromList("Select a backup to restore from.", new ArrayList(backups.keySet())); +- +- boolean fullWorld = CLIIOHelpers.getSelectionFromList("Do you want to restore the whole world or a singular file?", +- Arrays.asList(new String[]{"Whole world", "Single file"})) == "Whole world"; +- +- if (!fullWorld) { +- if (!CLIIOHelpers.confirmWarningMessage()) return; +- +- try { +- FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); +- Path root = zipFs.getPath(""); +- Files.walkFileTree(root, new SimpleFileVisitor() { +- @Override +- public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { +- entries.put(file.toString(), file); +- return FileVisitResult.CONTINUE; +- } +- }); +- +- file = CLIIOHelpers.getFileToRestore(entries, "", worldFile); +- CLIIOHelpers.info("Restoring " + file.toString() + "..."); +- Path outputFile = new File(worldFile, file.toString()).toPath(); +- if (!outputFile.getParent().toFile().exists()) { +- outputFile.getParent().toFile().mkdirs(); +- } +- Files.copy(file, outputFile, StandardCopyOption.REPLACE_EXISTING); +- CLIIOHelpers.info("Done."); +- +- } catch (IOException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- return; +- } +- } +- +- else { +- if (!CLIIOHelpers.confirmWarningMessage()) return; +- +- Path levelDatPath; +- ArrayList levelDatPathWrapper = new ArrayList<>(); +- +- try { +- FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); +- Path root = zipFs.getPath(""); +- Files.walkFileTree(root, new SimpleFileVisitor() { +- @Override +- public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { +- if (file.getFileName().toString().equals("level.dat")) levelDatPathWrapper.add(file); +- return FileVisitResult.CONTINUE; +- } +- }); +- +- levelDatPath = levelDatPathWrapper.get(0); +- CLIIOHelpers.info("Making backup of existing world..."); +- CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(new File(worldFile, levelDatPath.getParent().toString()), false)); +- byte[] buffer = new byte[1024]; +- ZipEntry entry; +- FileInputStream fileInputStream = new FileInputStream(backups.get(backupName)); +- ZipInputStream zip = new ZipInputStream(fileInputStream); +- while ((entry = zip.getNextEntry()) != null) { +- File outputFile; +- +- outputFile = new File(worldFile, entry.getName()); +- +- if (!outputFile.getParentFile().exists()) { +- outputFile.getParentFile().mkdirs(); +- } +- +- +- CLIIOHelpers.info("Restoring " + outputFile.toString() + "..."); +- +- FileOutputStream outputStream = new FileOutputStream(outputFile); +- int length = 0; +- while ((length = zip.read(buffer)) > 0) { +- outputStream.write(buffer, 0, length); +- } +- outputStream.close(); +- } +- +- } catch (IOException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- } +- +- +- +- } +- +- CLIIOHelpers.info("Done."); +- +- } +- +- +- +- private static String deleteEntireWorld(File worldDir, boolean exportMode) { +- String ret = backupExistingWorld(worldDir, exportMode); +- try { +- Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { +- @Override +- public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { +- file.toFile().delete(); +- return FileVisitResult.CONTINUE; +- } +- +- @Override +- public FileVisitResult postVisitDirectory(Path file, java.io.IOException arg1) { +- if (file.toFile().listFiles().length == 0) { +- file.toFile().delete(); +- } +- return FileVisitResult.CONTINUE; +- } +- }); +- } catch (IOException e) { +- CLIIOHelpers.warn("Failed to delete file :"); +- e.printStackTrace(); +- } +- return ret; +- } +- +- private static String backupExistingWorld(File worldDir, boolean export) { +- File out = new File(worldDir, "../cli" + serialiseBackupName(export ? "export" : "backup") + ".zip"); +- try { +- FileOutputStream outputStream = new FileOutputStream(out); +- ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream); +- zipOutputStream.setLevel(4); +- Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { +- @Override +- public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { +- Path targetFile; +- try { +- targetFile = worldDir.toPath().relativize(file); +- if (targetFile.toFile().getName().compareTo("session.lock") == 0) { +- return FileVisitResult.CONTINUE; +- } +- zipOutputStream.putNextEntry(new ZipEntry(targetFile.toString())); +- byte[] bytes = Files.readAllBytes(file); +- zipOutputStream.write(bytes, 0, bytes.length); +- zipOutputStream.closeEntry(); +- +- } catch (IOException e) { +- // TODO : Scream at user +- e.printStackTrace(); +- } +- +- return FileVisitResult.CONTINUE; +- } +- }); +- zipOutputStream.flush(); +- zipOutputStream.close(); +- +- CLIIOHelpers.info("Done."); +- } catch (Exception e) { +- +- } +- +- return out.getName(); +- } +- +- +- +- private static void addBackupNamesToLists(File file, HashMap entryOwners, HashMap filePaths, +- HashMap dates, String colour) throws IOException { +- +- if (file.isFile()) { +- +- ZipFile zipFile = new ZipFile(file); +- Enumeration entryEnum = zipFile.entries(); +- +- while (entryEnum.hasMoreElements()) { +- ZipEntry entry = entryEnum.nextElement(); +- +- String backupName = file.toString().replace("\\", "/"); +- filePaths.put(entry.toString().replace("\\", "/"), entry); +- dates.put(entry.toString().replace("\\", "/"), "\u001b[31m" +- + backupName +- .substring(backupName.toString().lastIndexOf("/") + 1) +- //.replace(worldPath + "_", "") +- .replace("backup_", "") +- .replace("-full.zip", "") +- .replace("-partial.zip", "") +- + "\u001B[0m"); +- entryOwners.put(entry.toString(), zipFile); +- } +- } +- +- else { +- Files.walkFileTree(file.toPath(), new SimpleFileVisitor() { +- @Override +- public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException { +- String backupName = file.toString().replace("\\", "/"); +- filePaths.put(file.toPath().relativize(path).toString().replace("\\", "/"), path); +- dates.put(file.toPath().relativize(path).toString().replace("\\", "/"), "\u001b[31m" +- + backupName +- .substring(backupName.toString().lastIndexOf("/") + 1) +- //.replace(worldPath + "_", "") +- .replace("backup_", "") +- .replace("-full", "") +- .replace("-partial", "") +- + "\u001B[0m"); +- return FileVisitResult.CONTINUE; +- } +- }); +- } +- } +- +- +- public static String serialiseBackupName(String in) { +- Date date = new Date(); +- String pattern = "yyyy-MM-dd_HH-mm-ss"; +- +- return in + "_" + new SimpleDateFormat(pattern).format(date); +- } +- +-} ++package co.uk.mommyheather.advancedbackups.cli; ++ ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileOutputStream; ++import java.io.FileReader; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.PrintWriter; ++import java.io.StringWriter; ++import java.nio.file.FileSystem; ++import java.nio.file.FileSystems; ++import java.nio.file.FileVisitResult; ++import java.nio.file.Files; ++import java.nio.file.Path; ++import java.nio.file.SimpleFileVisitor; ++import java.nio.file.StandardCopyOption; ++import java.nio.file.attribute.BasicFileAttributes; ++import java.text.SimpleDateFormat; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Date; ++import java.util.Enumeration; ++import java.util.HashMap; ++import java.util.InputMismatchException; ++import java.util.List; ++import java.util.Properties; ++import java.util.regex.Pattern; ++import java.util.zip.ZipEntry; ++import java.util.zip.ZipFile; ++import java.util.zip.ZipInputStream; ++import java.util.zip.ZipOutputStream; ++ ++import org.fusesource.jansi.AnsiConsole; ++ ++import co.uk.mommyheather.advancedbackups.core.ABCore; ++ ++public class AdvancedBackupsCLI { ++ ++ private static String backupLocation; ++ private static File serverDir = new File(new File("").toPath().toAbsolutePath().getParent().toString()); ++ private static String type; ++ private static ArrayList fileNames = new ArrayList<>(); ++ private static File worldFile; ++ private static String worldPath; ++ public static void main(String args[]) throws IllegalBackupException { ++ ++ ++ ++ if (System.console() != null) { ++ AnsiConsole.systemInstall(); //this gets ansi escape codes working on windows. this was a FUCKING PAIN IN MY ASS ++ } ++ ++ System.out.print("\033[H\033[2J"); ++ System.out.flush(); ++ ++ ++ CLIIOHelpers.info("Advanced Backups - Version " + AdvancedBackupsCLI.class.getPackage().getImplementationVersion()); ++ CLIIOHelpers.info("Note : this cannot restore backups made prior to the 3.0 release."); ++ CLIIOHelpers.info("Searching for properties...", false); ++ ++ ++ Properties props = new Properties(); ++ File file = new File(serverDir, "config/AdvancedBackups.properties"); ++ FileReader reader; ++ try { ++ reader = new FileReader(file); ++ props.load(reader); ++ ++ backupLocation = props.getProperty("config.advancedbackups.path"); ++ type = props.getProperty("config.advancedbackups.type"); ++ } catch (Exception e) { ++ CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); ++ CLIIOHelpers.error(getStackTrace(e)); ++ CLIIOHelpers.error(""); ++ CLIIOHelpers.error(""); ++ CLIIOHelpers.error("Ensure you're running this from within the mods directory, and the config file is in the parent directory!"); ++ // Fatal, cannot proceed ++ return; ++ } ++ ++ if (backupLocation == null || type == null) { ++ CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); ++ CLIIOHelpers.error("Backup location : " + backupLocation); ++ CLIIOHelpers.error("Type : " + type); ++ // Fatal, cannot proceed ++ return; ++ } ++ ++ CLIIOHelpers.info("Config loaded!"); ++ ++ //What's a good way to check between absolute and relative? Not all absolute paths will start with /.. ++ File backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); ++ ++ if (!backupDir.exists()) { ++ //Is it absolute? ++ backupDir = new File(backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); ++ if (!backupDir.exists()) { ++ CLIIOHelpers.error("Could not find backup directory!"); ++ CLIIOHelpers.error(backupDir.getAbsolutePath()); ++ CLIIOHelpers.error("Have you made any backups before?"); ++ //Fatal, cannot continue ++ return; ++ } ++ } ++ ++ ++ //check for backups from "other mods" ++ boolean flag = false; ++ ArrayList otherBackups = new ArrayList<>(); ++ for (File b : backupDir.listFiles()) { ++ if (b.getName().endsWith("zip")) { ++ flag = true; ++ otherBackups.add(b); ++ } ++ ++ } ++ ++ if (flag) { ++ String result = CLIIOHelpers.getSelectionFromList("Backups from another mod have been found. These can be restored if you want.\nWould you want to work with these backups?", ++ Arrays.asList(new String[]{"Use backups from AdvancedBackups", "Use backups from other mod"})); ++ if (result == "Use backups from other mod") { ++ restoreOtherModZip(backupDir); ++ return; ++ } ++ } ++ ++ type = CLIIOHelpers.getBackupType(type); ++ if (type.equals("snapshot (command-made only)")) type = "snapshots"; ++ ++ /*/ ++ if (backupLocation.startsWith(Pattern.quote(File.separator)) || backupLocation.indexOf(":") == 1) { ++ backupDir = new File(backupLocation, File.separator + type + File.separator); ++ } ++ else { ++ backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "") + File.separator + type + File.separator); ++ } ++*/ ++ ++ ++ boolean exportMode = false; ++ int backupDateIndex; ++ ++ ++ ++ CLIIOHelpers.info("Do you want to export a backup, restore the entire world state at this point, or a singular file?"); ++ ++ String restore = CLIIOHelpers.getSelectionFromList("Enter a number.", ++ Arrays.asList(new String[]{"Export backup as zip", "Restore single file", "Restore entire world"})); ++ ++ ++ if (restore.equals("Export backup as zip")) { ++ exportMode = true; ++ } ++ ++ ++ worldFile = CLIIOHelpers.getWorldFile(serverDir); ++ worldPath = worldFile.getName().replace(" ", "_"); ++ ++ backupDir = new File(backupDir, worldFile.getName() + "/" + type); ++ ++ try { ++ backupDateIndex = getBackupDate(backupDir, exportMode); ++ } catch (IOException e) { ++ CLIIOHelpers.error("ERROR VIEWING BACKUPS!"); ++ e.printStackTrace(); ++ return; ++ } ++ ++ if (exportMode) { ++ worldFile = new File(serverDir, "AdvancedBackups.temp"); ++ worldFile.mkdirs(); ++ } ++ ++ ++ if (!CLIIOHelpers.confirmWarningMessage()) { ++ CLIIOHelpers.error("ABORTED - WILL NOT PROCEED."); ++ return; ++ } ++ ++ CLIIOHelpers.info("Preparing..."); ++ ++ ++ ++ switch(restore) { ++ case "Restore entire world" : { ++ //No going back now! ++ CLIIOHelpers.info("Backing up current world state..."); ++ CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(worldFile, false)); ++ switch(type) { ++ case "snapshots" : ++ case "zips" : { ++ restoreFullZip(backupDateIndex, worldFile); ++ return; ++ } ++ case "differential" : { ++ restoreFullDifferential(backupDateIndex, worldFile); ++ return; ++ } ++ case "incremental" : { ++ restoreFullIncremental(backupDateIndex, worldFile); ++ return; ++ } ++ } ++ } ++ case "Restore single file" : { ++ switch(type) { ++ case "snapshots" : ++ case "zips" : { ++ restorePartialZip(backupDateIndex, worldFile); ++ return; ++ } ++ case "differential" : { ++ restorePartialDifferential(backupDateIndex, worldFile); ++ return; ++ } ++ case "incremental" : { ++ restorePartialIncremental(backupDateIndex, worldFile); ++ return; ++ } ++ } ++ } ++ case "Export backup as zip" : { ++ ++ CLIIOHelpers.info("Restoring to temporary directory..."); ++ ++ switch(type) { ++ case "snapshots" : ++ case "zips" : { ++ restoreFullZip(backupDateIndex, worldFile); ++ break; ++ } ++ case "differential" : { ++ restoreFullDifferential(backupDateIndex, worldFile); ++ break; ++ } ++ case "incremental" : { ++ restoreFullIncremental(backupDateIndex, worldFile); ++ break; ++ } ++ } ++ ++ CLIIOHelpers.info("Done. Preparing to write to zip..."); ++ CLIIOHelpers.info("Export saved to : " + deleteEntireWorld(worldFile, true)); ++ } ++ ++ } ++ } ++ ++ ++ private static String getStackTrace(final Throwable throwable) { ++ final StringWriter sw = new StringWriter(); ++ final PrintWriter pw = new PrintWriter(sw, true); ++ throwable.printStackTrace(pw); ++ return sw.getBuffer().toString(); ++ } ++ ++ ++ ++ private static int getBackupDate(File backupDir, boolean exportMode) throws IOException { ++ fileNames.clear(); ++ int inputType; ++ ++ CLIIOHelpers.info("Select a backup to restore."); ++ ++ String[] fileNameArray = backupDir.list(); ++ if (fileNameArray == null || fileNameArray.length <=0) { ++ throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); ++ } ++ ArrayList fileNameList = new ArrayList(Arrays.asList(fileNameArray)); //i need to do this. i hate this. ++ fileNameList.removeIf((name) -> { ++ return (name.endsWith("json") || ++ name.contains("incomplete") || ++ name.contains("DS_Store")); ++ }); ++ ++ if (fileNameList.isEmpty()) { ++ throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); ++ } ++ ++ for (String fileName : CLIIOHelpers.sortStringsAlphabeticallyWithDirectoryPriority(fileNameList)) { ++ if (exportMode) { ++ if (fileName.endsWith("json")) continue; ++ if (fileName.contains("incomplete")) continue; ++ File file = new File(backupDir, fileName); ++ fileNames.add(file.getAbsolutePath()); ++ String out = file.getName(); ++ String[] outs = out.split("\\_"); ++ if (outs.length >=2) { ++ out = ". " + outs[outs.length-2] + "_" + outs[outs.length-1]; ++ } ++ else { ++ out = ". " + out; ++ } ++ CLIIOHelpers.info(fileNames.size() + out); ++ ++ } ++ else { ++ if (fileName.endsWith("json")) continue; ++ if (fileName.contains("incomplete")) continue; ++ File file = new File(backupDir, fileName); ++ fileNames.add(file.getAbsolutePath()); ++ String out = file.getName(); ++ out = out.replaceAll(".zip", ""); ++ //out = out.replaceAll(worldPath + "_", ": "); ++ out = out.replaceAll("backup_", ": "); ++ out = out.replaceAll("-partial", "\u001B[33m partial\u001B[0m"); ++ out = out.replaceAll("-full", "\u001B[32m full\u001B[0m"); ++ CLIIOHelpers.info(fileNames.size() + out); ++ ++ } ++ } ++ ++ try { ++ String line = CLIIOHelpers.input.nextLine(); ++ if (line == "") { ++ CLIIOHelpers.warn("Please enter a number."); ++ return getBackupDate(backupDir, exportMode); ++ } ++ inputType = Integer.parseInt(line); ++ } catch (InputMismatchException | NumberFormatException e) { ++ CLIIOHelpers.warn("That was not a number. Please enter a number."); ++ return getBackupDate(backupDir, exportMode); ++ } ++ ++ if (inputType < 1 || inputType > fileNames.size()) { ++ CLIIOHelpers.warn("Please enter a number between " + fileNames.size() + "."); ++ return getBackupDate(backupDir, exportMode); ++ } ++ ++ return inputType - 1; ++ } ++ ++ ++ ++ private static void restoreFullZip(int index, File worldFile) throws IllegalBackupException { ++ byte[] buffer = new byte[1024]; ++ //The most basic of the bunch. ++ ZipEntry entry; ++ try { ++ FileInputStream fileInputStream = new FileInputStream(fileNames.get(index)); ++ ZipInputStream zip = new ZipInputStream(fileInputStream); ++ while ((entry = zip.getNextEntry()) != null) { ++ File outputFile; ++ ++ ++ outputFile = new File(worldFile, entry.getName()); ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ zip.close(); ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + entry.getName()); ++ } ++ ++ if (!outputFile.getParentFile().exists()) { ++ outputFile.getParentFile().mkdirs(); ++ } ++ ++ CLIIOHelpers.info("Restoring " + outputFile.getName()); ++ ++ FileOutputStream outputStream = new FileOutputStream(outputFile); ++ int length = 0; ++ while ((length = zip.read(buffer)) > 0) { ++ outputStream.write(buffer, 0, length); ++ } ++ outputStream.close(); ++ } ++ zip.close(); ++ } catch (IOException e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ } ++ } ++ ++ private static void restoreFullDifferential(int index, File worldFile) throws IllegalBackupException { ++ //Do we need to check for past backups? if selected is a full backup, we do not. ++ File backup = new File(fileNames.get(index)); ++ if (backup.getName().contains("-full")) { ++ if (backup.isFile()) { ++ restoreFullZip(index, worldFile); ++ return; ++ } ++ restoreFolder(index, worldFile); ++ return; ++ } ++ //find last FULL backup ++ for (int i = index;i>=0;i--) { ++ String name = fileNames.get(i); ++ if (name.contains("-full")) { ++ CLIIOHelpers.info("Restoring last full backup..."); ++ File file = new File(name); ++ if (file.isFile()) { ++ restoreFullZip(i, worldFile); ++ } ++ else { ++ restoreFolder(i, worldFile); ++ } ++ break; ++ } ++ } ++ CLIIOHelpers.info("\n\nRestoring selected backup..."); ++ if (backup.isFile()) { ++ restoreFullZip(index, worldFile); ++ } ++ else { ++ restoreFolder(index, worldFile); ++ } ++ } ++ ++ private static void restoreFullIncremental(int index, File worldFile) throws IllegalBackupException { ++ //Do we need to check for past backups? if selected is a full backup, we do not. ++ File backup = new File(fileNames.get(index)); ++ if (backup.getName().contains("-full")) { ++ if (backup.isFile()) { ++ restoreFullZip(index, worldFile); ++ return; ++ } ++ restoreFolder(index, worldFile); ++ return; ++ } ++ //find last FULL backup ++ int i = index; ++ while(i >= 0) { ++ String name = fileNames.get(i); ++ if (name.contains("-full")) { ++ CLIIOHelpers.info("Restoring last full backup..."); ++ File file = new File(name); ++ if (file.isFile()) { ++ restoreFullZip(i, worldFile); ++ } ++ else { ++ restoreFolder(i, worldFile); ++ } ++ break; ++ } ++ i--; ++ } ++ //restore backups up until the selected one ++ while(i < index) { ++ String name = fileNames.get(i); ++ CLIIOHelpers.info("Restoring chained backup..."); ++ File file = new File(name); ++ if (file.isFile()) { ++ restoreFullZip(i, worldFile); ++ } ++ else { ++ restoreFolder(i, worldFile); ++ } ++ i++; ++ } ++ ++ ++ CLIIOHelpers.info("\n\nRestoring selected backup..."); ++ if (backup.isFile()) { ++ restoreFullZip(index, worldFile); ++ } ++ else { ++ restoreFolder(index, worldFile); ++ } ++ } ++ ++ private static void restorePartialZip(int index, File worldFile) { ++ ++ HashMap filePaths = new HashMap<>(); ++ HashMap dates = new HashMap<>(); ++ HashMap entryOwners = new HashMap<>(); ++ try { ++ File backup = new File(fileNames.get(index)); ++ ++ addBackupNamesToLists(backup, entryOwners, filePaths, dates, "\u001B[32m"); ++ ++ ZipEntry select = ((ZipEntry) CLIIOHelpers.getFileToRestore(filePaths, "", worldFile)); ++ ++ File outputFile = new File(worldFile, select.toString()); ++ FileOutputStream outputStream = new FileOutputStream(outputFile); ++ ++ CLIIOHelpers.info("Restoring " + select.toString() + "..."); ++ ++ byte[] buffer = new byte[1028]; ++ InputStream inputSteam = entryOwners.get(select.toString()).getInputStream(select); ++ int length; ++ while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { ++ outputStream.write(buffer, 0, length); ++ } ++ outputStream.flush(); ++ outputStream.close(); ++ ++ } catch (IOException e) { ++ ++ } ++ ++ ++ ++ ++ } ++ ++ private static void restorePartialDifferential(int index, File worldFile) throws IllegalBackupException { ++ //Do we need to check for past backups? if selected is a full backup, we do not. ++ HashMap filePaths = new HashMap<>(); ++ HashMap dates = new HashMap<>(); ++ HashMap entryOwners = new HashMap<>(); ++ try { ++ File backup = new File(fileNames.get(index)); ++ if (!backup.getName().contains("-full")) { ++ //find last FULL backup ++ for (int i = index;i>=0;i--) { ++ String name = fileNames.get(i); ++ if (name.contains("-full")) { ++ addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); ++ break; ++ } ++ } ++ } ++ ++ File file = new File(fileNames.get(index)); ++ addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); ++ ++ HashMap properMapping = new HashMap<>(); ++ for (String date : dates.keySet()) { ++ properMapping.put( ++ date + " " + dates.get(date), ++ filePaths.get(date) ++ ); ++ } ++ ++ Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); ++ if (select instanceof Path) { ++ Path input = (Path) select; ++ ++ ++ if (select.toString().replace("\\", "/").contains("-full/")) { ++ select = new File( ++ select.toString().replace("\\", "/") ++ .split("-full/")[1] ++ ).toPath(); ++ } ++ if (select.toString().replace("\\", "/").contains("-partial/")) { ++ select = new File( ++ select.toString().replace("\\", "/") ++ .split("-partial/")[1] ++ ).toPath(); ++ } ++ ++ File outputFile = new File(worldFile, select.toString()); ++ if (!outputFile.getParentFile().exists()) { ++ outputFile.getParentFile().mkdirs(); ++ } ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); ++ } ++ ++ CLIIOHelpers.info("\n\nRestoring file : " + select); ++ Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); ++ } ++ else if (select instanceof ZipEntry) { ++ ZipEntry entry = (ZipEntry) select; ++ ++ File outputFile = new File(worldFile, entry.toString()); ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); ++ } ++ ++ FileOutputStream outputStream = new FileOutputStream(outputFile); ++ ++ CLIIOHelpers.info("Restoring " + entry.toString() + "..."); ++ ++ byte[] buffer = new byte[1028]; ++ InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); ++ int length; ++ while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { ++ outputStream.write(buffer, 0, length); ++ } ++ outputStream.flush(); ++ outputStream.close(); ++ } ++ ++ ++ } ++ catch (IOException e){ ++ //TODO : Scream at user ++ e.printStackTrace(); ++ } ++ } ++ ++ private static void restorePartialIncremental(int index, File worldFile) throws IllegalBackupException { ++ //Do we need to check for past backups? if selected is a full backup, we do not. ++ HashMap filePaths = new HashMap<>(); ++ HashMap dates = new HashMap<>(); ++ HashMap entryOwners = new HashMap<>(); ++ try { ++ File backup = new File(fileNames.get(index)); ++ if (!backup.getName().contains("-full")) { ++ int i; ++ //find last FULL backup ++ for (i = index;i>=0;i--) { ++ String name = fileNames.get(i); ++ if (name.contains("-full")) { ++ addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); ++ break; ++ } ++ } ++ while (i < index) { ++ String name = fileNames.get(i); ++ addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); ++ i++; ++ } ++ ++ } ++ ++ File file = new File(fileNames.get(index)); ++ addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); ++ ++ HashMap properMapping = new HashMap<>(); ++ for (String date : dates.keySet()) { ++ properMapping.put( ++ date + " " + dates.get(date), ++ filePaths.get(date) ++ ); ++ } ++ ++ Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); ++ if (select instanceof Path) { ++ Path input = (Path) select; ++ ++ ++ if (select.toString().replace("\\", "/").contains("-full/")) { ++ select = new File( ++ select.toString().replace("\\", "/") ++ .split("-full/")[1] ++ ).toPath(); ++ } ++ if (select.toString().replace("\\", "/").contains("-partial/")) { ++ select = new File( ++ select.toString().replace("\\", "/") ++ .split("-partial/")[1] ++ ).toPath(); ++ } ++ ++ File outputFile = new File(worldFile, select.toString()); ++ ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); ++ } ++ ++ if (!outputFile.getParentFile().exists()) { ++ outputFile.getParentFile().mkdirs(); ++ } ++ CLIIOHelpers.info("\n\nRestoring file : " + select); ++ Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); ++ } ++ else if (select instanceof ZipEntry) { ++ ZipEntry entry = (ZipEntry) select; ++ ++ File outputFile = new File(worldFile, entry.toString()); ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); ++ } ++ ++ FileOutputStream outputStream = new FileOutputStream(outputFile); ++ ++ CLIIOHelpers.info("Restoring " + entry.toString() + "..."); ++ ++ byte[] buffer = new byte[1028]; ++ InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); ++ int length; ++ while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { ++ outputStream.write(buffer, 0, length); ++ } ++ outputStream.flush(); ++ outputStream.close(); ++ } ++ ++ ++ } ++ catch (IOException e){ ++ //TODO : Scream at user ++ e.printStackTrace(); ++ } ++ } ++ ++ ++ private static void restoreFolder(int index, File worldFile) throws IllegalBackupException { ++ File backup = new File(fileNames.get(index)); ++ ++ try { ++ Files.walkFileTree(backup.toPath(), new SimpleFileVisitor() { ++ @Override ++ public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { ++ File source = backup.toPath().relativize(file).toFile(); ++ File outputFile = new File(worldFile, source.getPath()); ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + source.getPath()).printStackTrace(); ++ return FileVisitResult.TERMINATE; ++ } ++ ++ if (!outputFile.getParentFile().exists()) { ++ outputFile.getParentFile().mkdirs(); ++ } ++ ++ CLIIOHelpers.info("Restoring " + outputFile.getName()); ++ Files.copy(file, outputFile.toPath()); ++ return FileVisitResult.CONTINUE; ++ } ++ }); ++ } catch (IOException e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ } ++ } ++ ++ ++ private static void restoreOtherModZip(File backupDir) throws IllegalBackupException { ++ worldFile = serverDir; ++ Path file; ++ HashMap backups = new HashMap<>(); ++ HashMap entries = new HashMap<>(); ++ ++ for (File b : backupDir.getParentFile().listFiles()) { ++ if (b.getName().endsWith("zip")) { ++ backups.put(b.getName(), b); ++ } ++ } ++ ++ String backupName = CLIIOHelpers.getSelectionFromList("Select a backup to restore from.", new ArrayList(backups.keySet())); ++ ++ boolean fullWorld = CLIIOHelpers.getSelectionFromList("Do you want to restore the whole world or a singular file?", ++ Arrays.asList(new String[]{"Whole world", "Single file"})) == "Whole world"; ++ ++ if (!fullWorld) { ++ if (!CLIIOHelpers.confirmWarningMessage()) return; ++ ++ try { ++ FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); ++ Path root = zipFs.getPath(""); ++ Files.walkFileTree(root, new SimpleFileVisitor() { ++ @Override ++ public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { ++ entries.put(file.toString(), file); ++ return FileVisitResult.CONTINUE; ++ } ++ }); ++ ++ file = CLIIOHelpers.getFileToRestore(entries, "", worldFile); ++ CLIIOHelpers.info("Restoring " + file.toString() + "..."); ++ Path outputFile = new File(worldFile, file.toString()).toPath(); ++ ++ if (!outputFile.normalize().startsWith(worldFile.toPath())) { ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + file.toString()); ++ } ++ if (!outputFile.getParent().toFile().exists()) { ++ outputFile.getParent().toFile().mkdirs(); ++ } ++ Files.copy(file, outputFile, StandardCopyOption.REPLACE_EXISTING); ++ CLIIOHelpers.info("Done."); ++ ++ } catch (IOException e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ return; ++ } ++ } ++ ++ else { ++ if (!CLIIOHelpers.confirmWarningMessage()) return; ++ ++ Path levelDatPath; ++ ArrayList levelDatPathWrapper = new ArrayList<>(); ++ ++ try { ++ FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); ++ Path root = zipFs.getPath(""); ++ Files.walkFileTree(root, new SimpleFileVisitor() { ++ @Override ++ public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { ++ if (file.getFileName().toString().equals("level.dat")) levelDatPathWrapper.add(file); ++ return FileVisitResult.CONTINUE; ++ } ++ }); ++ ++ levelDatPath = levelDatPathWrapper.get(0); ++ CLIIOHelpers.info("Making backup of existing world..."); ++ CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(new File(worldFile, levelDatPath.getParent().toString()), false)); ++ byte[] buffer = new byte[1024]; ++ ZipEntry entry; ++ FileInputStream fileInputStream = new FileInputStream(backups.get(backupName)); ++ ZipInputStream zip = new ZipInputStream(fileInputStream); ++ while ((entry = zip.getNextEntry()) != null) { ++ File outputFile; ++ ++ outputFile = new File(worldFile, entry.getName()); ++ ++ if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { ++ zip.close(); ++ ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); ++ throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + entry.getName()); ++ } ++ ++ if (!outputFile.getParentFile().exists()) { ++ outputFile.getParentFile().mkdirs(); ++ } ++ ++ ++ CLIIOHelpers.info("Restoring " + outputFile.toString() + "..."); ++ ++ FileOutputStream outputStream = new FileOutputStream(outputFile); ++ int length = 0; ++ while ((length = zip.read(buffer)) > 0) { ++ outputStream.write(buffer, 0, length); ++ } ++ outputStream.close(); ++ } ++ zip.close(); ++ ++ } catch (IOException e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ } ++ ++ ++ ++ } ++ ++ CLIIOHelpers.info("Done."); ++ ++ } ++ ++ ++ ++ private static String deleteEntireWorld(File worldDir, boolean exportMode) { ++ String ret = backupExistingWorld(worldDir, exportMode); ++ try { ++ Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { ++ @Override ++ public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { ++ file.toFile().delete(); ++ return FileVisitResult.CONTINUE; ++ } ++ ++ @Override ++ public FileVisitResult postVisitDirectory(Path file, java.io.IOException arg1) { ++ if (file.toFile().listFiles().length == 0) { ++ file.toFile().delete(); ++ } ++ return FileVisitResult.CONTINUE; ++ } ++ }); ++ } catch (IOException e) { ++ CLIIOHelpers.warn("Failed to delete file :"); ++ e.printStackTrace(); ++ } ++ return ret; ++ } ++ ++ private static String backupExistingWorld(File worldDir, boolean export) { ++ File out = new File(worldDir, "../cli" + serialiseBackupName(export ? "export" : "backup") + ".zip"); ++ try { ++ FileOutputStream outputStream = new FileOutputStream(out); ++ ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream); ++ zipOutputStream.setLevel(4); ++ Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { ++ @Override ++ public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { ++ Path targetFile; ++ try { ++ targetFile = worldDir.toPath().relativize(file); ++ if (targetFile.toFile().getName().compareTo("session.lock") == 0) { ++ return FileVisitResult.CONTINUE; ++ } ++ zipOutputStream.putNextEntry(new ZipEntry(targetFile.toString())); ++ byte[] bytes = Files.readAllBytes(file); ++ zipOutputStream.write(bytes, 0, bytes.length); ++ zipOutputStream.closeEntry(); ++ ++ } catch (IOException e) { ++ // TODO : Scream at user ++ e.printStackTrace(); ++ } ++ ++ return FileVisitResult.CONTINUE; ++ } ++ }); ++ zipOutputStream.flush(); ++ zipOutputStream.close(); ++ ++ CLIIOHelpers.info("Done."); ++ } catch (Exception e) { ++ ++ } ++ ++ return out.getName(); ++ } ++ ++ ++ ++ private static void addBackupNamesToLists(File file, HashMap entryOwners, HashMap filePaths, ++ HashMap dates, String colour) throws IOException { ++ ++ if (file.isFile()) { ++ ++ ZipFile zipFile = new ZipFile(file); ++ Enumeration entryEnum = zipFile.entries(); ++ ++ while (entryEnum.hasMoreElements()) { ++ ZipEntry entry = entryEnum.nextElement(); ++ ++ String backupName = file.toString().replace("\\", "/"); ++ filePaths.put(entry.toString().replace("\\", "/"), entry); ++ dates.put(entry.toString().replace("\\", "/"), "\u001b[31m" ++ + backupName ++ .substring(backupName.toString().lastIndexOf("/") + 1) ++ //.replace(worldPath + "_", "") ++ .replace("backup_", "") ++ .replace("-full.zip", "") ++ .replace("-partial.zip", "") ++ + "\u001B[0m"); ++ entryOwners.put(entry.toString(), zipFile); ++ } ++ } ++ ++ else { ++ Files.walkFileTree(file.toPath(), new SimpleFileVisitor() { ++ @Override ++ public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException { ++ String backupName = file.toString().replace("\\", "/"); ++ filePaths.put(file.toPath().relativize(path).toString().replace("\\", "/"), path); ++ dates.put(file.toPath().relativize(path).toString().replace("\\", "/"), "\u001b[31m" ++ + backupName ++ .substring(backupName.toString().lastIndexOf("/") + 1) ++ //.replace(worldPath + "_", "") ++ .replace("backup_", "") ++ .replace("-full", "") ++ .replace("-partial", "") ++ + "\u001B[0m"); ++ return FileVisitResult.CONTINUE; ++ } ++ }); ++ } ++ } ++ ++ ++ public static String serialiseBackupName(String in) { ++ Date date = new Date(); ++ String pattern = "yyyy-MM-dd_HH-mm-ss"; ++ ++ return in + "_" + new SimpleDateFormat(pattern).format(date); ++ } ++ ++} +diff --git a/src/main/java/co/uk/mommyheather/advancedbackups/cli/IllegalBackupException.java b/src/main/java/co/uk/mommyheather/advancedbackups/cli/IllegalBackupException.java +new file mode 100644 +index 0000000..da35957 +--- /dev/null ++++ b/src/main/java/co/uk/mommyheather/advancedbackups/cli/IllegalBackupException.java +@@ -0,0 +1,9 @@ ++package co.uk.mommyheather.advancedbackups.cli; ++ ++public class IllegalBackupException extends Exception { ++ ++ public IllegalBackupException(String string) { ++ super(string); ++ } ++ ++} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..313e05ebe0897bba11350cc82b3103f6c07df20c --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/post_context.md @@ -0,0 +1,979 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959)) + +```java +package co.uk.mommyheather.advancedbackups.cli; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.InputMismatchException; +import java.util.List; +import java.util.Properties; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import org.fusesource.jansi.AnsiConsole; + +import co.uk.mommyheather.advancedbackups.core.ABCore; + +public class AdvancedBackupsCLI { + + private static String backupLocation; + private static File serverDir = new File(new File("").toPath().toAbsolutePath().getParent().toString()); + private static String type; + private static ArrayList fileNames = new ArrayList<>(); + private static File worldFile; + private static String worldPath; + public static void main(String args[]) throws IllegalBackupException { + + + + if (System.console() != null) { + AnsiConsole.systemInstall(); //this gets ansi escape codes working on windows. this was a FUCKING PAIN IN MY ASS + } + + System.out.print("\033[H\033[2J"); + System.out.flush(); + + + CLIIOHelpers.info("Advanced Backups - Version " + AdvancedBackupsCLI.class.getPackage().getImplementationVersion()); + CLIIOHelpers.info("Note : this cannot restore backups made prior to the 3.0 release."); + CLIIOHelpers.info("Searching for properties...", false); + + + Properties props = new Properties(); + File file = new File(serverDir, "config/AdvancedBackups.properties"); + FileReader reader; + try { + reader = new FileReader(file); + props.load(reader); + + backupLocation = props.getProperty("config.advancedbackups.path"); + type = props.getProperty("config.advancedbackups.type"); + } catch (Exception e) { + CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); + CLIIOHelpers.error(getStackTrace(e)); + CLIIOHelpers.error(""); + CLIIOHelpers.error(""); + CLIIOHelpers.error("Ensure you're running this from within the mods directory, and the config file is in the parent directory!"); + // Fatal, cannot proceed + return; + } + + if (backupLocation == null || type == null) { + CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); + CLIIOHelpers.error("Backup location : " + backupLocation); + CLIIOHelpers.error("Type : " + type); + // Fatal, cannot proceed + return; + } + + CLIIOHelpers.info("Config loaded!"); + + //What's a good way to check between absolute and relative? Not all absolute paths will start with /.. + File backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); + + if (!backupDir.exists()) { + //Is it absolute? + backupDir = new File(backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); + if (!backupDir.exists()) { + CLIIOHelpers.error("Could not find backup directory!"); + CLIIOHelpers.error(backupDir.getAbsolutePath()); + CLIIOHelpers.error("Have you made any backups before?"); + //Fatal, cannot continue + return; + } + } + + + //check for backups from "other mods" + boolean flag = false; + ArrayList otherBackups = new ArrayList<>(); + for (File b : backupDir.listFiles()) { + if (b.getName().endsWith("zip")) { + flag = true; + otherBackups.add(b); + } + + } + + if (flag) { + String result = CLIIOHelpers.getSelectionFromList("Backups from another mod have been found. These can be restored if you want.\nWould you want to work with these backups?", + Arrays.asList(new String[]{"Use backups from AdvancedBackups", "Use backups from other mod"})); + if (result == "Use backups from other mod") { + restoreOtherModZip(backupDir); + return; + } + } + + type = CLIIOHelpers.getBackupType(type); + if (type.equals("snapshot (command-made only)")) type = "snapshots"; + + /*/ + if (backupLocation.startsWith(Pattern.quote(File.separator)) || backupLocation.indexOf(":") == 1) { + backupDir = new File(backupLocation, File.separator + type + File.separator); + } + else { + backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "") + File.separator + type + File.separator); + } +*/ + + + boolean exportMode = false; + int backupDateIndex; + + + + CLIIOHelpers.info("Do you want to export a backup, restore the entire world state at this point, or a singular file?"); + + String restore = CLIIOHelpers.getSelectionFromList("Enter a number.", + Arrays.asList(new String[]{"Export backup as zip", "Restore single file", "Restore entire world"})); + + + if (restore.equals("Export backup as zip")) { + exportMode = true; + } + + + worldFile = CLIIOHelpers.getWorldFile(serverDir); + worldPath = worldFile.getName().replace(" ", "_"); + + backupDir = new File(backupDir, worldFile.getName() + "/" + type); + + try { + backupDateIndex = getBackupDate(backupDir, exportMode); + } catch (IOException e) { + CLIIOHelpers.error("ERROR VIEWING BACKUPS!"); + e.printStackTrace(); + return; + } + + if (exportMode) { + worldFile = new File(serverDir, "AdvancedBackups.temp"); + worldFile.mkdirs(); + } + + + if (!CLIIOHelpers.confirmWarningMessage()) { + CLIIOHelpers.error("ABORTED - WILL NOT PROCEED."); + return; + } + + CLIIOHelpers.info("Preparing..."); + + + + switch(restore) { + case "Restore entire world" : { + //No going back now! + CLIIOHelpers.info("Backing up current world state..."); + CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(worldFile, false)); + switch(type) { + case "snapshots" : + case "zips" : { + restoreFullZip(backupDateIndex, worldFile); + return; + } + case "differential" : { + restoreFullDifferential(backupDateIndex, worldFile); + return; + } + case "incremental" : { + restoreFullIncremental(backupDateIndex, worldFile); + return; + } + } + } + case "Restore single file" : { + switch(type) { + case "snapshots" : + case "zips" : { + restorePartialZip(backupDateIndex, worldFile); + return; + } + case "differential" : { + restorePartialDifferential(backupDateIndex, worldFile); + return; + } + case "incremental" : { + restorePartialIncremental(backupDateIndex, worldFile); + return; + } + } + } + case "Export backup as zip" : { + + CLIIOHelpers.info("Restoring to temporary directory..."); + + switch(type) { + case "snapshots" : + case "zips" : { + restoreFullZip(backupDateIndex, worldFile); + break; + } + case "differential" : { + restoreFullDifferential(backupDateIndex, worldFile); + break; + } + case "incremental" : { + restoreFullIncremental(backupDateIndex, worldFile); + break; + } + } + + CLIIOHelpers.info("Done. Preparing to write to zip..."); + CLIIOHelpers.info("Export saved to : " + deleteEntireWorld(worldFile, true)); + } + + } + } + + + private static String getStackTrace(final Throwable throwable) { + final StringWriter sw = new StringWriter(); + final PrintWriter pw = new PrintWriter(sw, true); + throwable.printStackTrace(pw); + return sw.getBuffer().toString(); + } + + + + private static int getBackupDate(File backupDir, boolean exportMode) throws IOException { + fileNames.clear(); + int inputType; + + CLIIOHelpers.info("Select a backup to restore."); + + String[] fileNameArray = backupDir.list(); + if (fileNameArray == null || fileNameArray.length <=0) { + throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); + } + ArrayList fileNameList = new ArrayList(Arrays.asList(fileNameArray)); //i need to do this. i hate this. + fileNameList.removeIf((name) -> { + return (name.endsWith("json") || + name.contains("incomplete") || + name.contains("DS_Store")); + }); + + if (fileNameList.isEmpty()) { + throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); + } + + for (String fileName : CLIIOHelpers.sortStringsAlphabeticallyWithDirectoryPriority(fileNameList)) { + if (exportMode) { + if (fileName.endsWith("json")) continue; + if (fileName.contains("incomplete")) continue; + File file = new File(backupDir, fileName); + fileNames.add(file.getAbsolutePath()); + String out = file.getName(); + String[] outs = out.split("\\_"); + if (outs.length >=2) { + out = ". " + outs[outs.length-2] + "_" + outs[outs.length-1]; + } + else { + out = ". " + out; + } + CLIIOHelpers.info(fileNames.size() + out); + + } + else { + if (fileName.endsWith("json")) continue; + if (fileName.contains("incomplete")) continue; + File file = new File(backupDir, fileName); + fileNames.add(file.getAbsolutePath()); + String out = file.getName(); + out = out.replaceAll(".zip", ""); + //out = out.replaceAll(worldPath + "_", ": "); + out = out.replaceAll("backup_", ": "); + out = out.replaceAll("-partial", "\u001B[33m partial\u001B[0m"); + out = out.replaceAll("-full", "\u001B[32m full\u001B[0m"); + CLIIOHelpers.info(fileNames.size() + out); + + } + } + + try { + String line = CLIIOHelpers.input.nextLine(); + if (line == "") { + CLIIOHelpers.warn("Please enter a number."); + return getBackupDate(backupDir, exportMode); + } + inputType = Integer.parseInt(line); + } catch (InputMismatchException | NumberFormatException e) { + CLIIOHelpers.warn("That was not a number. Please enter a number."); + return getBackupDate(backupDir, exportMode); + } + + if (inputType < 1 || inputType > fileNames.size()) { + CLIIOHelpers.warn("Please enter a number between " + fileNames.size() + "."); + return getBackupDate(backupDir, exportMode); + } + + return inputType - 1; + } + + + + private static void restoreFullZip(int index, File worldFile) throws IllegalBackupException { + byte[] buffer = new byte[1024]; + //The most basic of the bunch. + ZipEntry entry; + try { + FileInputStream fileInputStream = new FileInputStream(fileNames.get(index)); + ZipInputStream zip = new ZipInputStream(fileInputStream); + while ((entry = zip.getNextEntry()) != null) { + File outputFile; + + + outputFile = new File(worldFile, entry.getName()); + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + zip.close(); + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + entry.getName()); + } + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + CLIIOHelpers.info("Restoring " + outputFile.getName()); + + FileOutputStream outputStream = new FileOutputStream(outputFile); + int length = 0; + while ((length = zip.read(buffer)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.close(); + } + zip.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private static void restoreFullDifferential(int index, File worldFile) throws IllegalBackupException { + //Do we need to check for past backups? if selected is a full backup, we do not. + File backup = new File(fileNames.get(index)); + if (backup.getName().contains("-full")) { + if (backup.isFile()) { + restoreFullZip(index, worldFile); + return; + } + restoreFolder(index, worldFile); + return; + } + //find last FULL backup + for (int i = index;i>=0;i--) { + String name = fileNames.get(i); + if (name.contains("-full")) { + CLIIOHelpers.info("Restoring last full backup..."); + File file = new File(name); + if (file.isFile()) { + restoreFullZip(i, worldFile); + } + else { + restoreFolder(i, worldFile); + } + break; + } + } + CLIIOHelpers.info("\n\nRestoring selected backup..."); + if (backup.isFile()) { + restoreFullZip(index, worldFile); + } + else { + restoreFolder(index, worldFile); + } + } + + private static void restoreFullIncremental(int index, File worldFile) throws IllegalBackupException { + //Do we need to check for past backups? if selected is a full backup, we do not. + File backup = new File(fileNames.get(index)); + if (backup.getName().contains("-full")) { + if (backup.isFile()) { + restoreFullZip(index, worldFile); + return; + } + restoreFolder(index, worldFile); + return; + } + //find last FULL backup + int i = index; + while(i >= 0) { + String name = fileNames.get(i); + if (name.contains("-full")) { + CLIIOHelpers.info("Restoring last full backup..."); + File file = new File(name); + if (file.isFile()) { + restoreFullZip(i, worldFile); + } + else { + restoreFolder(i, worldFile); + } + break; + } + i--; + } + //restore backups up until the selected one + while(i < index) { + String name = fileNames.get(i); + CLIIOHelpers.info("Restoring chained backup..."); + File file = new File(name); + if (file.isFile()) { + restoreFullZip(i, worldFile); + } + else { + restoreFolder(i, worldFile); + } + i++; + } + + + CLIIOHelpers.info("\n\nRestoring selected backup..."); + if (backup.isFile()) { + restoreFullZip(index, worldFile); + } + else { + restoreFolder(index, worldFile); + } + } + + private static void restorePartialZip(int index, File worldFile) { + + HashMap filePaths = new HashMap<>(); + HashMap dates = new HashMap<>(); + HashMap entryOwners = new HashMap<>(); + try { + File backup = new File(fileNames.get(index)); + + addBackupNamesToLists(backup, entryOwners, filePaths, dates, "\u001B[32m"); + + ZipEntry select = ((ZipEntry) CLIIOHelpers.getFileToRestore(filePaths, "", worldFile)); + + File outputFile = new File(worldFile, select.toString()); + FileOutputStream outputStream = new FileOutputStream(outputFile); + + CLIIOHelpers.info("Restoring " + select.toString() + "..."); + + byte[] buffer = new byte[1028]; + InputStream inputSteam = entryOwners.get(select.toString()).getInputStream(select); + int length; + while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.flush(); + outputStream.close(); + + } catch (IOException e) { + + } + + + + + } + + private static void restorePartialDifferential(int index, File worldFile) throws IllegalBackupException { + //Do we need to check for past backups? if selected is a full backup, we do not. + HashMap filePaths = new HashMap<>(); + HashMap dates = new HashMap<>(); + HashMap entryOwners = new HashMap<>(); + try { + File backup = new File(fileNames.get(index)); + if (!backup.getName().contains("-full")) { + //find last FULL backup + for (int i = index;i>=0;i--) { + String name = fileNames.get(i); + if (name.contains("-full")) { + addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); + break; + } + } + } + + File file = new File(fileNames.get(index)); + addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); + + HashMap properMapping = new HashMap<>(); + for (String date : dates.keySet()) { + properMapping.put( + date + " " + dates.get(date), + filePaths.get(date) + ); + } + + Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); + if (select instanceof Path) { + Path input = (Path) select; + + + if (select.toString().replace("\\", "/").contains("-full/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-full/")[1] + ).toPath(); + } + if (select.toString().replace("\\", "/").contains("-partial/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-partial/")[1] + ).toPath(); + } + + File outputFile = new File(worldFile, select.toString()); + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); + } + + CLIIOHelpers.info("\n\nRestoring file : " + select); + Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + else if (select instanceof ZipEntry) { + ZipEntry entry = (ZipEntry) select; + + File outputFile = new File(worldFile, entry.toString()); + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); + } + + FileOutputStream outputStream = new FileOutputStream(outputFile); + + CLIIOHelpers.info("Restoring " + entry.toString() + "..."); + + byte[] buffer = new byte[1028]; + InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); + int length; + while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.flush(); + outputStream.close(); + } + + + } + catch (IOException e){ + //TODO : Scream at user + e.printStackTrace(); + } + } + + private static void restorePartialIncremental(int index, File worldFile) throws IllegalBackupException { + //Do we need to check for past backups? if selected is a full backup, we do not. + HashMap filePaths = new HashMap<>(); + HashMap dates = new HashMap<>(); + HashMap entryOwners = new HashMap<>(); + try { + File backup = new File(fileNames.get(index)); + if (!backup.getName().contains("-full")) { + int i; + //find last FULL backup + for (i = index;i>=0;i--) { + String name = fileNames.get(i); + if (name.contains("-full")) { + addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); + break; + } + } + while (i < index) { + String name = fileNames.get(i); + addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); + i++; + } + + } + + File file = new File(fileNames.get(index)); + addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); + + HashMap properMapping = new HashMap<>(); + for (String date : dates.keySet()) { + properMapping.put( + date + " " + dates.get(date), + filePaths.get(date) + ); + } + + Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); + if (select instanceof Path) { + Path input = (Path) select; + + + if (select.toString().replace("\\", "/").contains("-full/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-full/")[1] + ).toPath(); + } + if (select.toString().replace("\\", "/").contains("-partial/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-partial/")[1] + ).toPath(); + } + + File outputFile = new File(worldFile, select.toString()); + + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); + } + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + CLIIOHelpers.info("\n\nRestoring file : " + select); + Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + else if (select instanceof ZipEntry) { + ZipEntry entry = (ZipEntry) select; + + File outputFile = new File(worldFile, entry.toString()); + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + select.toString()); + } + + FileOutputStream outputStream = new FileOutputStream(outputFile); + + CLIIOHelpers.info("Restoring " + entry.toString() + "..."); + + byte[] buffer = new byte[1028]; + InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); + int length; + while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.flush(); + outputStream.close(); + } + + + } + catch (IOException e){ + //TODO : Scream at user + e.printStackTrace(); + } + } + + + private static void restoreFolder(int index, File worldFile) throws IllegalBackupException { + File backup = new File(fileNames.get(index)); + + try { + Files.walkFileTree(backup.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + File source = backup.toPath().relativize(file).toFile(); + File outputFile = new File(worldFile, source.getPath()); + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + source.getPath()).printStackTrace(); + return FileVisitResult.TERMINATE; + } + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + CLIIOHelpers.info("Restoring " + outputFile.getName()); + Files.copy(file, outputFile.toPath()); + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + private static void restoreOtherModZip(File backupDir) throws IllegalBackupException { + worldFile = serverDir; + Path file; + HashMap backups = new HashMap<>(); + HashMap entries = new HashMap<>(); + + for (File b : backupDir.getParentFile().listFiles()) { + if (b.getName().endsWith("zip")) { + backups.put(b.getName(), b); + } + } + + String backupName = CLIIOHelpers.getSelectionFromList("Select a backup to restore from.", new ArrayList(backups.keySet())); + + boolean fullWorld = CLIIOHelpers.getSelectionFromList("Do you want to restore the whole world or a singular file?", + Arrays.asList(new String[]{"Whole world", "Single file"})) == "Whole world"; + + if (!fullWorld) { + if (!CLIIOHelpers.confirmWarningMessage()) return; + + try { + FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); + Path root = zipFs.getPath(""); + Files.walkFileTree(root, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + entries.put(file.toString(), file); + return FileVisitResult.CONTINUE; + } + }); + + file = CLIIOHelpers.getFileToRestore(entries, "", worldFile); + CLIIOHelpers.info("Restoring " + file.toString() + "..."); + Path outputFile = new File(worldFile, file.toString()).toPath(); + + if (!outputFile.normalize().startsWith(worldFile.toPath())) { + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + file.toString()); + } + if (!outputFile.getParent().toFile().exists()) { + outputFile.getParent().toFile().mkdirs(); + } + Files.copy(file, outputFile, StandardCopyOption.REPLACE_EXISTING); + CLIIOHelpers.info("Done."); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return; + } + } + + else { + if (!CLIIOHelpers.confirmWarningMessage()) return; + + Path levelDatPath; + ArrayList levelDatPathWrapper = new ArrayList<>(); + + try { + FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); + Path root = zipFs.getPath(""); + Files.walkFileTree(root, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + if (file.getFileName().toString().equals("level.dat")) levelDatPathWrapper.add(file); + return FileVisitResult.CONTINUE; + } + }); + + levelDatPath = levelDatPathWrapper.get(0); + CLIIOHelpers.info("Making backup of existing world..."); + CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(new File(worldFile, levelDatPath.getParent().toString()), false)); + byte[] buffer = new byte[1024]; + ZipEntry entry; + FileInputStream fileInputStream = new FileInputStream(backups.get(backupName)); + ZipInputStream zip = new ZipInputStream(fileInputStream); + while ((entry = zip.getNextEntry()) != null) { + File outputFile; + + outputFile = new File(worldFile, entry.getName()); + + if (!outputFile.toPath().normalize().startsWith(worldFile.toPath())) { + zip.close(); + ABCore.errorLogger.accept("Found a potentially malicious zip file - cowardly exiting, restoration may be incomplete!"); + throw new IllegalBackupException("Zip file is likely malicious! Found an erroneus path: " + entry.getName()); + } + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + + CLIIOHelpers.info("Restoring " + outputFile.toString() + "..."); + + FileOutputStream outputStream = new FileOutputStream(outputFile); + int length = 0; + while ((length = zip.read(buffer)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.close(); + } + zip.close(); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + + } + + CLIIOHelpers.info("Done."); + + } + + + + private static String deleteEntireWorld(File worldDir, boolean exportMode) { + String ret = backupExistingWorld(worldDir, exportMode); + try { + Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { + file.toFile().delete(); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path file, java.io.IOException arg1) { + if (file.toFile().listFiles().length == 0) { + file.toFile().delete(); + } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + CLIIOHelpers.warn("Failed to delete file :"); + e.printStackTrace(); + } + return ret; + } + + private static String backupExistingWorld(File worldDir, boolean export) { + File out = new File(worldDir, "../cli" + serialiseBackupName(export ? "export" : "backup") + ".zip"); + try { + FileOutputStream outputStream = new FileOutputStream(out); + ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream); + zipOutputStream.setLevel(4); + Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { + Path targetFile; + try { + targetFile = worldDir.toPath().relativize(file); + if (targetFile.toFile().getName().compareTo("session.lock") == 0) { + return FileVisitResult.CONTINUE; + } + zipOutputStream.putNextEntry(new ZipEntry(targetFile.toString())); + byte[] bytes = Files.readAllBytes(file); + zipOutputStream.write(bytes, 0, bytes.length); + zipOutputStream.closeEntry(); + + } catch (IOException e) { + // TODO : Scream at user + e.printStackTrace(); + } + + return FileVisitResult.CONTINUE; + } + }); + zipOutputStream.flush(); + zipOutputStream.close(); + + CLIIOHelpers.info("Done."); + } catch (Exception e) { + + } + + return out.getName(); + } + + + + private static void addBackupNamesToLists(File file, HashMap entryOwners, HashMap filePaths, + HashMap dates, String colour) throws IOException { + + if (file.isFile()) { + + ZipFile zipFile = new ZipFile(file); + Enumeration entryEnum = zipFile.entries(); + + while (entryEnum.hasMoreElements()) { + ZipEntry entry = entryEnum.nextElement(); + + String backupName = file.toString().replace("\\", "/"); + filePaths.put(entry.toString().replace("\\", "/"), entry); + dates.put(entry.toString().replace("\\", "/"), "\u001b[31m" + + backupName + .substring(backupName.toString().lastIndexOf("/") + 1) + //.replace(worldPath + "_", "") + .replace("backup_", "") + .replace("-full.zip", "") + .replace("-partial.zip", "") + + "\u001B[0m"); + entryOwners.put(entry.toString(), zipFile); + } + } + + else { + Files.walkFileTree(file.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException { + String backupName = file.toString().replace("\\", "/"); + filePaths.put(file.toPath().relativize(path).toString().replace("\\", "/"), path); + dates.put(file.toPath().relativize(path).toString().replace("\\", "/"), "\u001b[31m" + + backupName + .substring(backupName.toString().lastIndexOf("/") + 1) + //.replace(worldPath + "_", "") + .replace("backup_", "") + .replace("-full", "") + .replace("-partial", "") + + "\u001B[0m"); + return FileVisitResult.CONTINUE; + } + }); + } + } + + + public static String serialiseBackupName(String in) { + Date date = new Date(); + String pattern = "yyyy-MM-dd_HH-mm-ss"; + + return in + "_" + new SimpleDateFormat(pattern).format(date); + } + +} +``` + +## `src/main/java/co/uk/mommyheather/advancedbackups/cli/IllegalBackupException.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9)) + +```java +package co.uk.mommyheather.advancedbackups.cli; + +public class IllegalBackupException extends Exception { + + public IllegalBackupException(String string) { + super(string); + } + +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/pre_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/pre_context.md new file mode 100644 index 0000000000000000000000000000000000000000..cee312bb8990ee9d438e34879e81e5d9dcb2d967 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/pre_context.md @@ -0,0 +1,912 @@ +# Patch-overlapping Java context before the fix + +## `src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java` (changed lines (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907)) + +```java +package co.uk.mommyheather.advancedbackups.cli; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.InputMismatchException; +import java.util.List; +import java.util.Properties; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import org.fusesource.jansi.AnsiConsole; + +public class AdvancedBackupsCLI { + + private static String backupLocation; + private static File serverDir = new File(new File("").toPath().toAbsolutePath().getParent().toString()); + private static String type; + private static ArrayList fileNames = new ArrayList<>(); + private static File worldFile; + private static String worldPath; + public static void main(String args[]){ + + + + if (System.console() != null) { + AnsiConsole.systemInstall(); //this gets ansi escape codes working on windows. this was a FUCKING PAIN IN MY ASS + } + + System.out.print("\033[H\033[2J"); + System.out.flush(); + + + CLIIOHelpers.info("Advanced Backups - Version " + AdvancedBackupsCLI.class.getPackage().getImplementationVersion()); + CLIIOHelpers.info("Note : this cannot restore backups made prior to the 3.0 release."); + CLIIOHelpers.info("Searching for properties...", false); + + + Properties props = new Properties(); + File file = new File(serverDir, "config/AdvancedBackups.properties"); + FileReader reader; + try { + reader = new FileReader(file); + props.load(reader); + + backupLocation = props.getProperty("config.advancedbackups.path"); + type = props.getProperty("config.advancedbackups.type"); + } catch (Exception e) { + CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); + CLIIOHelpers.error(getStackTrace(e)); + CLIIOHelpers.error(""); + CLIIOHelpers.error(""); + CLIIOHelpers.error("Ensure you're running this from within the mods directory, and the config file is in the parent directory!"); + // Fatal, cannot proceed + return; + } + + if (backupLocation == null || type == null) { + CLIIOHelpers.error("ERROR LOADING PROPERTIES!"); + CLIIOHelpers.error("Backup location : " + backupLocation); + CLIIOHelpers.error("Type : " + type); + // Fatal, cannot proceed + return; + } + + CLIIOHelpers.info("Config loaded!"); + + //What's a good way to check between absolute and relative? Not all absolute paths will start with /.. + File backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); + + if (!backupDir.exists()) { + //Is it absolute? + backupDir = new File(backupLocation.replaceAll(Pattern.quote("." + File.separator), "")); + if (!backupDir.exists()) { + CLIIOHelpers.error("Could not find backup directory!"); + CLIIOHelpers.error(backupDir.getAbsolutePath()); + CLIIOHelpers.error("Have you made any backups before?"); + //Fatal, cannot continue + return; + } + } + + + //check for backups from "other mods" + boolean flag = false; + ArrayList otherBackups = new ArrayList<>(); + for (File b : backupDir.listFiles()) { + if (b.getName().endsWith("zip")) { + flag = true; + otherBackups.add(b); + } + + } + + if (flag) { + String result = CLIIOHelpers.getSelectionFromList("Backups from another mod have been found. These can be restored if you want.\nWould you want to work with these backups?", + Arrays.asList(new String[]{"Use backups from AdvancedBackups", "Use backups from other mod"})); + if (result == "Use backups from other mod") { + restoreOtherModZip(backupDir); + return; + } + } + + type = CLIIOHelpers.getBackupType(type); + if (type.equals("snapshot (command-made only)")) type = "snapshots"; + + /*/ + if (backupLocation.startsWith(Pattern.quote(File.separator)) || backupLocation.indexOf(":") == 1) { + backupDir = new File(backupLocation, File.separator + type + File.separator); + } + else { + backupDir = new File(serverDir, backupLocation.replaceAll(Pattern.quote("." + File.separator), "") + File.separator + type + File.separator); + } +*/ + + + boolean exportMode = false; + int backupDateIndex; + + + + CLIIOHelpers.info("Do you want to export a backup, restore the entire world state at this point, or a singular file?"); + + String restore = CLIIOHelpers.getSelectionFromList("Enter a number.", + Arrays.asList(new String[]{"Export backup as zip", "Restore single file", "Restore entire world"})); + + + if (restore.equals("Export backup as zip")) { + exportMode = true; + } + + + worldFile = CLIIOHelpers.getWorldFile(serverDir); + worldPath = worldFile.getName().replace(" ", "_"); + + backupDir = new File(backupDir, worldFile.getName() + "/" + type); + + try { + backupDateIndex = getBackupDate(backupDir, exportMode); + } catch (IOException e) { + CLIIOHelpers.error("ERROR VIEWING BACKUPS!"); + e.printStackTrace(); + return; + } + + if (exportMode) { + worldFile = new File(serverDir, "AdvancedBackups.temp"); + worldFile.mkdirs(); + } + + + if (!CLIIOHelpers.confirmWarningMessage()) { + CLIIOHelpers.error("ABORTED - WILL NOT PROCEED."); + return; + } + + CLIIOHelpers.info("Preparing..."); + + + + switch(restore) { + case "Restore entire world" : { + //No going back now! + CLIIOHelpers.info("Backing up current world state..."); + CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(worldFile, false)); + switch(type) { + case "snapshots" : + case "zips" : { + restoreFullZip(backupDateIndex, worldFile); + return; + } + case "differential" : { + restoreFullDifferential(backupDateIndex, worldFile); + return; + } + case "incremental" : { + restoreFullIncremental(backupDateIndex, worldFile); + return; + } + } + } + case "Restore single file" : { + switch(type) { + case "snapshots" : + case "zips" : { + restorePartialZip(backupDateIndex, worldFile); + return; + } + case "differential" : { + restorePartialDifferential(backupDateIndex, worldFile); + return; + } + case "incremental" : { + restorePartialIncremental(backupDateIndex, worldFile); + return; + } + } + } + case "Export backup as zip" : { + + CLIIOHelpers.info("Restoring to temporary directory..."); + + switch(type) { + case "snapshots" : + case "zips" : { + restoreFullZip(backupDateIndex, worldFile); + break; + } + case "differential" : { + restoreFullDifferential(backupDateIndex, worldFile); + break; + } + case "incremental" : { + restoreFullIncremental(backupDateIndex, worldFile); + break; + } + } + + CLIIOHelpers.info("Done. Preparing to write to zip..."); + CLIIOHelpers.info("Export saved to : " + deleteEntireWorld(worldFile, true)); + } + + } + } + + + private static String getStackTrace(final Throwable throwable) { + final StringWriter sw = new StringWriter(); + final PrintWriter pw = new PrintWriter(sw, true); + throwable.printStackTrace(pw); + return sw.getBuffer().toString(); + } + + + + private static int getBackupDate(File backupDir, boolean exportMode) throws IOException { + fileNames.clear(); + int inputType; + + CLIIOHelpers.info("Select a backup to restore."); + + String[] fileNameArray = backupDir.list(); + if (fileNameArray == null || fileNameArray.length <=0) { + throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); + } + ArrayList fileNameList = new ArrayList(Arrays.asList(fileNameArray)); //i need to do this. i hate this. + fileNameList.removeIf((name) -> { + return (name.endsWith("json") || + name.contains("incomplete") || + name.contains("DS_Store")); + }); + + if (fileNameList.isEmpty()) { + throw new IOException(String.format("Selected backup directory %s is empty, or is a file!", backupDir.getAbsolutePath())); + } + + for (String fileName : CLIIOHelpers.sortStringsAlphabeticallyWithDirectoryPriority(fileNameList)) { + if (exportMode) { + if (fileName.endsWith("json")) continue; + if (fileName.contains("incomplete")) continue; + File file = new File(backupDir, fileName); + fileNames.add(file.getAbsolutePath()); + String out = file.getName(); + String[] outs = out.split("\\_"); + if (outs.length >=2) { + out = ". " + outs[outs.length-2] + "_" + outs[outs.length-1]; + } + else { + out = ". " + out; + } + CLIIOHelpers.info(fileNames.size() + out); + + } + else { + if (fileName.endsWith("json")) continue; + if (fileName.contains("incomplete")) continue; + File file = new File(backupDir, fileName); + fileNames.add(file.getAbsolutePath()); + String out = file.getName(); + out = out.replaceAll(".zip", ""); + //out = out.replaceAll(worldPath + "_", ": "); + out = out.replaceAll("backup_", ": "); + out = out.replaceAll("-partial", "\u001B[33m partial\u001B[0m"); + out = out.replaceAll("-full", "\u001B[32m full\u001B[0m"); + CLIIOHelpers.info(fileNames.size() + out); + + } + } + + try { + String line = CLIIOHelpers.input.nextLine(); + if (line == "") { + CLIIOHelpers.warn("Please enter a number."); + return getBackupDate(backupDir, exportMode); + } + inputType = Integer.parseInt(line); + } catch (InputMismatchException | NumberFormatException e) { + CLIIOHelpers.warn("That was not a number. Please enter a number."); + return getBackupDate(backupDir, exportMode); + } + + if (inputType < 1 || inputType > fileNames.size()) { + CLIIOHelpers.warn("Please enter a number between " + fileNames.size() + "."); + return getBackupDate(backupDir, exportMode); + } + + return inputType - 1; + } + + + + private static void restoreFullZip(int index, File worldFile) { + byte[] buffer = new byte[1024]; + //The most basic of the bunch. + ZipEntry entry; + try { + FileInputStream fileInputStream = new FileInputStream(fileNames.get(index)); + ZipInputStream zip = new ZipInputStream(fileInputStream); + while ((entry = zip.getNextEntry()) != null) { + File outputFile; + + outputFile = new File(worldFile, entry.getName()); + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + CLIIOHelpers.info("Restoring " + outputFile.getName()); + + FileOutputStream outputStream = new FileOutputStream(outputFile); + int length = 0; + while ((length = zip.read(buffer)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.close(); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private static void restoreFullDifferential(int index, File worldFile) { + //Do we need to check for past backups? if selected is a full backup, we do not. + File backup = new File(fileNames.get(index)); + if (backup.getName().contains("-full")) { + if (backup.isFile()) { + restoreFullZip(index, worldFile); + return; + } + restoreFolder(index, worldFile); + return; + } + //find last FULL backup + for (int i = index;i>=0;i--) { + String name = fileNames.get(i); + if (name.contains("-full")) { + CLIIOHelpers.info("Restoring last full backup..."); + File file = new File(name); + if (file.isFile()) { + restoreFullZip(i, worldFile); + } + else { + restoreFolder(i, worldFile); + } + break; + } + } + CLIIOHelpers.info("\n\nRestoring selected backup..."); + if (backup.isFile()) { + restoreFullZip(index, worldFile); + } + else { + restoreFolder(index, worldFile); + } + } + + private static void restoreFullIncremental(int index, File worldFile) { + //Do we need to check for past backups? if selected is a full backup, we do not. + File backup = new File(fileNames.get(index)); + if (backup.getName().contains("-full")) { + if (backup.isFile()) { + restoreFullZip(index, worldFile); + return; + } + restoreFolder(index, worldFile); + return; + } + //find last FULL backup + int i = index; + while(i >= 0) { + String name = fileNames.get(i); + if (name.contains("-full")) { + CLIIOHelpers.info("Restoring last full backup..."); + File file = new File(name); + if (file.isFile()) { + restoreFullZip(i, worldFile); + } + else { + restoreFolder(i, worldFile); + } + break; + } + i--; + } + //restore backups up until the selected one + while(i < index) { + String name = fileNames.get(i); + CLIIOHelpers.info("Restoring chained backup..."); + File file = new File(name); + if (file.isFile()) { + restoreFullZip(i, worldFile); + } + else { + restoreFolder(i, worldFile); + } + i++; + } + + + CLIIOHelpers.info("\n\nRestoring selected backup..."); + if (backup.isFile()) { + restoreFullZip(index, worldFile); + } + else { + restoreFolder(index, worldFile); + } + } + + private static void restorePartialZip(int index, File worldFile) { + + HashMap filePaths = new HashMap<>(); + HashMap dates = new HashMap<>(); + HashMap entryOwners = new HashMap<>(); + try { + File backup = new File(fileNames.get(index)); + + addBackupNamesToLists(backup, entryOwners, filePaths, dates, "\u001B[32m"); + + ZipEntry select = ((ZipEntry) CLIIOHelpers.getFileToRestore(filePaths, "", worldFile)); + + File outputFile = new File(worldFile, select.toString()); + FileOutputStream outputStream = new FileOutputStream(outputFile); + + CLIIOHelpers.info("Restoring " + select.toString() + "..."); + + byte[] buffer = new byte[1028]; + InputStream inputSteam = entryOwners.get(select.toString()).getInputStream(select); + int length; + while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.flush(); + outputStream.close(); + + } catch (IOException e) { + + } + + + + + } + + private static void restorePartialDifferential(int index, File worldFile) { + //Do we need to check for past backups? if selected is a full backup, we do not. + HashMap filePaths = new HashMap<>(); + HashMap dates = new HashMap<>(); + HashMap entryOwners = new HashMap<>(); + try { + File backup = new File(fileNames.get(index)); + if (!backup.getName().contains("-full")) { + //find last FULL backup + for (int i = index;i>=0;i--) { + String name = fileNames.get(i); + if (name.contains("-full")) { + addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); + break; + } + } + } + + File file = new File(fileNames.get(index)); + addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); + + HashMap properMapping = new HashMap<>(); + for (String date : dates.keySet()) { + properMapping.put( + date + " " + dates.get(date), + filePaths.get(date) + ); + } + + Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); + if (select instanceof Path) { + Path input = (Path) select; + + + if (select.toString().replace("\\", "/").contains("-full/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-full/")[1] + ).toPath(); + } + if (select.toString().replace("\\", "/").contains("-partial/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-partial/")[1] + ).toPath(); + } + + File outputFile = new File(worldFile, select.toString()); + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + CLIIOHelpers.info("\n\nRestoring file : " + select); + Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + else if (select instanceof ZipEntry) { + ZipEntry entry = (ZipEntry) select; + + File outputFile = new File(worldFile, entry.toString()); + FileOutputStream outputStream = new FileOutputStream(outputFile); + + CLIIOHelpers.info("Restoring " + entry.toString() + "..."); + + byte[] buffer = new byte[1028]; + InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); + int length; + while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.flush(); + outputStream.close(); + } + + + } + catch (IOException e){ + //TODO : Scream at user + e.printStackTrace(); + } + } + + private static void restorePartialIncremental(int index, File worldFile) { + //Do we need to check for past backups? if selected is a full backup, we do not. + HashMap filePaths = new HashMap<>(); + HashMap dates = new HashMap<>(); + HashMap entryOwners = new HashMap<>(); + try { + File backup = new File(fileNames.get(index)); + if (!backup.getName().contains("-full")) { + int i; + //find last FULL backup + for (i = index;i>=0;i--) { + String name = fileNames.get(i); + if (name.contains("-full")) { + addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); + break; + } + } + while (i < index) { + String name = fileNames.get(i); + addBackupNamesToLists(new File(name), entryOwners, filePaths, dates, "\u001b[31m"); + i++; + } + + } + + File file = new File(fileNames.get(index)); + addBackupNamesToLists(file, entryOwners, filePaths, dates, "\u001B[32m"); + + HashMap properMapping = new HashMap<>(); + for (String date : dates.keySet()) { + properMapping.put( + date + " " + dates.get(date), + filePaths.get(date) + ); + } + + Object select = CLIIOHelpers.getFileToRestore(properMapping, "", worldFile); + if (select instanceof Path) { + Path input = (Path) select; + + + if (select.toString().replace("\\", "/").contains("-full/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-full/")[1] + ).toPath(); + } + if (select.toString().replace("\\", "/").contains("-partial/")) { + select = new File( + select.toString().replace("\\", "/") + .split("-partial/")[1] + ).toPath(); + } + + File outputFile = new File(worldFile, select.toString()); + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + CLIIOHelpers.info("\n\nRestoring file : " + select); + Files.copy(input, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + else if (select instanceof ZipEntry) { + ZipEntry entry = (ZipEntry) select; + + File outputFile = new File(worldFile, entry.toString()); + FileOutputStream outputStream = new FileOutputStream(outputFile); + + CLIIOHelpers.info("Restoring " + entry.toString() + "..."); + + byte[] buffer = new byte[1028]; + InputStream inputSteam = entryOwners.get(entry.toString()).getInputStream(entry); + int length; + while ((length = inputSteam.read(buffer, 0, buffer.length)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.flush(); + outputStream.close(); + } + + + } + catch (IOException e){ + //TODO : Scream at user + e.printStackTrace(); + } + } + + + private static void restoreFolder(int index, File worldFile) { + File backup = new File(fileNames.get(index)); + + try { + Files.walkFileTree(backup.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + File source = backup.toPath().relativize(file).toFile(); + File outputFile = new File(worldFile, source.getPath()); + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + CLIIOHelpers.info("Restoring " + outputFile.getName()); + Files.copy(file, outputFile.toPath()); + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + private static void restoreOtherModZip(File backupDir) { + worldFile = serverDir; + Path file; + HashMap backups = new HashMap<>(); + HashMap entries = new HashMap<>(); + + for (File b : backupDir.getParentFile().listFiles()) { + if (b.getName().endsWith("zip")) { + backups.put(b.getName(), b); + } + } + + String backupName = CLIIOHelpers.getSelectionFromList("Select a backup to restore from.", new ArrayList(backups.keySet())); + + boolean fullWorld = CLIIOHelpers.getSelectionFromList("Do you want to restore the whole world or a singular file?", + Arrays.asList(new String[]{"Whole world", "Single file"})) == "Whole world"; + + if (!fullWorld) { + if (!CLIIOHelpers.confirmWarningMessage()) return; + + try { + FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); + Path root = zipFs.getPath(""); + Files.walkFileTree(root, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + entries.put(file.toString(), file); + return FileVisitResult.CONTINUE; + } + }); + + file = CLIIOHelpers.getFileToRestore(entries, "", worldFile); + CLIIOHelpers.info("Restoring " + file.toString() + "..."); + Path outputFile = new File(worldFile, file.toString()).toPath(); + if (!outputFile.getParent().toFile().exists()) { + outputFile.getParent().toFile().mkdirs(); + } + Files.copy(file, outputFile, StandardCopyOption.REPLACE_EXISTING); + CLIIOHelpers.info("Done."); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return; + } + } + + else { + if (!CLIIOHelpers.confirmWarningMessage()) return; + + Path levelDatPath; + ArrayList levelDatPathWrapper = new ArrayList<>(); + + try { + FileSystem zipFs = FileSystems.newFileSystem(backups.get(backupName).toPath(), AdvancedBackupsCLI.class.getClassLoader()); + Path root = zipFs.getPath(""); + Files.walkFileTree(root, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + if (file.getFileName().toString().equals("level.dat")) levelDatPathWrapper.add(file); + return FileVisitResult.CONTINUE; + } + }); + + levelDatPath = levelDatPathWrapper.get(0); + CLIIOHelpers.info("Making backup of existing world..."); + CLIIOHelpers.info("Backup saved to : " + deleteEntireWorld(new File(worldFile, levelDatPath.getParent().toString()), false)); + byte[] buffer = new byte[1024]; + ZipEntry entry; + FileInputStream fileInputStream = new FileInputStream(backups.get(backupName)); + ZipInputStream zip = new ZipInputStream(fileInputStream); + while ((entry = zip.getNextEntry()) != null) { + File outputFile; + + outputFile = new File(worldFile, entry.getName()); + + if (!outputFile.getParentFile().exists()) { + outputFile.getParentFile().mkdirs(); + } + + + CLIIOHelpers.info("Restoring " + outputFile.toString() + "..."); + + FileOutputStream outputStream = new FileOutputStream(outputFile); + int length = 0; + while ((length = zip.read(buffer)) > 0) { + outputStream.write(buffer, 0, length); + } + outputStream.close(); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + + } + + CLIIOHelpers.info("Done."); + + } + + + + private static String deleteEntireWorld(File worldDir, boolean exportMode) { + String ret = backupExistingWorld(worldDir, exportMode); + try { + Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { + file.toFile().delete(); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path file, java.io.IOException arg1) { + if (file.toFile().listFiles().length == 0) { + file.toFile().delete(); + } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + CLIIOHelpers.warn("Failed to delete file :"); + e.printStackTrace(); + } + return ret; + } + + private static String backupExistingWorld(File worldDir, boolean export) { + File out = new File(worldDir, "../cli" + serialiseBackupName(export ? "export" : "backup") + ".zip"); + try { + FileOutputStream outputStream = new FileOutputStream(out); + ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream); + zipOutputStream.setLevel(4); + Files.walkFileTree(worldDir.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { + Path targetFile; + try { + targetFile = worldDir.toPath().relativize(file); + if (targetFile.toFile().getName().compareTo("session.lock") == 0) { + return FileVisitResult.CONTINUE; + } + zipOutputStream.putNextEntry(new ZipEntry(targetFile.toString())); + byte[] bytes = Files.readAllBytes(file); + zipOutputStream.write(bytes, 0, bytes.length); + zipOutputStream.closeEntry(); + + } catch (IOException e) { + // TODO : Scream at user + e.printStackTrace(); + } + + return FileVisitResult.CONTINUE; + } + }); + zipOutputStream.flush(); + zipOutputStream.close(); + + CLIIOHelpers.info("Done."); + } catch (Exception e) { + + } + + return out.getName(); + } + + + + private static void addBackupNamesToLists(File file, HashMap entryOwners, HashMap filePaths, + HashMap dates, String colour) throws IOException { + + if (file.isFile()) { + + ZipFile zipFile = new ZipFile(file); + Enumeration entryEnum = zipFile.entries(); + + while (entryEnum.hasMoreElements()) { + ZipEntry entry = entryEnum.nextElement(); + + String backupName = file.toString().replace("\\", "/"); + filePaths.put(entry.toString().replace("\\", "/"), entry); + dates.put(entry.toString().replace("\\", "/"), "\u001b[31m" + + backupName + .substring(backupName.toString().lastIndexOf("/") + 1) + //.replace(worldPath + "_", "") + .replace("backup_", "") + .replace("-full.zip", "") + .replace("-partial.zip", "") + + "\u001B[0m"); + entryOwners.put(entry.toString(), zipFile); + } + } + + else { + Files.walkFileTree(file.toPath(), new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException { + String backupName = file.toString().replace("\\", "/"); + filePaths.put(file.toPath().relativize(path).toString().replace("\\", "/"), path); + dates.put(file.toPath().relativize(path).toString().replace("\\", "/"), "\u001b[31m" + + backupName + .substring(backupName.toString().lastIndexOf("/") + 1) + //.replace(worldPath + "_", "") + .replace("backup_", "") + .replace("-full", "") + .replace("-partial", "") + + "\u001B[0m"); + return FileVisitResult.CONTINUE; + } + }); + } + } + + + public static String serialiseBackupName(String in) { + Date date = new Date(); + String pattern = "yyyy-MM-dd_HH-mm-ss"; + + return in + "_" + new SimpleDateFormat(pattern).format(date); + } + +} +``` diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/task.json b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/task.json new file mode 100644 index 0000000000000000000000000000000000000000..add0d0844820200fccedb3d1ded0260c8deebc64 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/task.json @@ -0,0 +1,46 @@ +{ + "schema_version": "synthesis-task-v1", + "task": { + "pair_id": "morefixes-3cc69a690ef991c8bd71", + "dataset_id": "morefixes", + "dataset_item_id": "morefixes-3cc69a690ef991c8bd71", + "project_id": "morefixes__mommyheather__advancedbackups", + "language": "java", + "backend": "codeql" + }, + "changed_java_files": [ + "src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java", + "src/main/java/co/uk/mommyheather/advancedbackups/cli/IllegalBackupException.java" + ], + "patch_units": { + "before": [ + "src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java" + ], + "after": [ + "src/main/java/co/uk/mommyheather/advancedbackups/cli/AdvancedBackupsCLI.java", + "src/main/java/co/uk/mommyheather/advancedbackups/cli/IllegalBackupException.java" + ] + }, + "runtime_assets": { + "before": { + "database": "assets/28bffef4ceebf1aa5c53305f523be8d23bd64a197a3d27544804b9e799dcea36/database", + "cache_key": "28bffef4ceebf1aa5c53305f523be8d23bd64a197a3d27544804b9e799dcea36", + "codeql_version": "2.26.4" + }, + "after": { + "database": "assets/ab2cff8e4bdfae339682b0695271a7fde84700fd6837c62bb98bfbe732efed65/database", + "cache_key": "ab2cff8e4bdfae339682b0695271a7fde84700fd6837c62bb98bfbe732efed65", + "codeql_version": "2.26.4" + }, + "refine": { + "database": "assets/64b7c7c1b3cbdcf62cd9a8552435b76068c6350eb53729e8d67c55027a1c30b7/database", + "cache_key": "64b7c7c1b3cbdcf62cd9a8552435b76068c6350eb53729e8d67c55027a1c30b7", + "codeql_version": "2.26.4" + } + }, + "benchmark_contract": { + "agent_visible": true, + "reference_query_location": "references/morefixes-3cc69a690ef991c8bd71/query/ (do not mount into agent)", + "evaluator_location": "evaluator/morefixes-3cc69a690ef991c8bd71/ (do not mount into agent)" + } +} diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/task_prompt.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/task_prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c1fde380c5692426a09c456d7a56fe42a01938a6 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-3cc69a690ef991c8bd71/task_prompt.md @@ -0,0 +1,82 @@ +# Java CodeQL detector synthesis + +You are cc operating in `/work`. Starting only from the supplied patch, +before/after Java context, CodeQL references, and validation tools, synthesize a semantic CodeQL +detector for the vulnerability fixed by the patch. This is one fresh session. You may iterate inside +this session, but no later framework repair or resume will occur. + +## Inputs and owned outputs + +- Read `patch.diff`, `java_patch.diff`, `pre_context.md`, and `post_context.md`. +- Read `references/codeql/convergence_protocol.md` and + `references/codeql/api_navigation.md` before experimenting. Read the remaining + `references/codeql/` files for the selected mechanism. +- Use `scripts/search_codeql_api.sh` to inspect the pinned official libraries when an API detail is + uncertain. Do not guess predicate names or build a large family of inspection queries. +- Complete the design contract in `state.json` and `scope_statement.md` before final validation. +- Replace `query/vulnerability.ql`; add only genuinely shared `.qll` helpers when useful. Keep the + fixed offline dependency in `query/qlpack.yml`. +- Preserve the exact `expected_query_id` from `config.json` as the query's sole `@id`. This + task-unique metadata must never be used in a query predicate. +- Use `scripts/compile_query.sh`, `scripts/run_before.sh`, and `scripts/run_after.sh`. +- Finish by writing `summary.json` with `status`, `query_path`, `query_kind`, `build_passed`, + `before_findings`, `after_findings`, `validation_completed`, and a concise `notes` field. + +## Required reasoning contract + +Before coding, record this mapping in `state.json`: + +```text +vulnerable operation / trigger / patch safety condition + → CodeQL-observable evidence + → syntax, control-flow, local value-flow, global taint/value-flow, or interprocedural mechanism + → source, sink/report site, guard/barrier and query predicates +``` + +Choose the lowest mechanism that can actually prove the condition. Guard-sensitive patches require +real path/control-flow semantics; provenance-sensitive patches require value flow. Do not replace +either with source-text matching or with the mere presence of patch-added syntax. + +## Mandatory convergence contract + +The rollout has a 30-minute hard wall-clock ceiling and must be finalized by minute 27. Minutes +27–30 are an emergency shutdown buffer, not exploration time. A sophisticated unfinished query is +a failure; an early compilable semantic candidate can be improved. Follow the checkpoints in +`references/codeql/convergence_protocol.md`: + +1. Record the mechanism contract, then replace the placeholder in `query/vulnerability.ql` + immediately. Do not wait until every CodeQL API detail is known. +2. Use at most three distinct scratch `.ql` files. Prefer repeatedly editing one + `query/scratch.ql`. After two failed variants of one API assumption, inspect the exact bundled + definition with `scripts/search_codeql_api.sh` or simplify the mechanism. +3. Obtain a compiling minimal main query before broadening it. Compile the main query after every + meaningful mechanism change. +4. Move in order from compile → relevant before finding → after elimination → final contract. Do + not continue API exploration after the intended before/after differential is established. +5. Run `scripts/check_progress.sh` at each checkpoint. It reports elapsed time, the minute-27 + finalization deadline, and the minute-30 hard timeout. When it prints `finalize_now`, stop all + exploration, preserve the best compiling query, finish the contract files, and exit. + +## Semantic and generalization rules + +- Report at the vulnerable call, operator, access, or sink. +- Do not use a patch-local path, line, commit hash, label, or local variable name as the primary + matching condition. Stable library/framework APIs or public project APIs are allowed only when + `scope_statement.md` explains why they define the intended vulnerability family. +- The safety condition introduced by the patch must be represented by the query. +- A lower after warning count is not enough: inspect SARIF and ensure at least one intended before + finding is in a patch-overlapping semantic unit and the corresponding finding disappears after. +- Avoid broad proxy queries that report an enclosing function or unrelated API merely because it + changed in the patch. + +## Final validation protocol + +1. Compile the final query. +2. Run it on before and inspect `raw/before.sarif` for the intended report location. +3. Run the identical query on after and inspect `raw/after.sarif`. +4. Recheck query metadata, query kind/select signature, report locality, design-to-code consistency, + and absence of patch-local hardcoding. +5. Update `state.json`, `scope_statement.md`, and write valid `summary.json`. + +Do not modify the runtime databases, references, patch, context, or validation scripts except for +normal CodeQL-generated database caches produced by the provided run scripts. diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20/patch.diff b/tasks/codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20/patch.diff new file mode 100644 index 0000000000000000000000000000000000000000..cf8d4be509d9212d5e115bb6bc1f7d5514316d50 --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20/patch.diff @@ -0,0 +1,33 @@ +diff --git a/src/main/java/io/airlift/compress/snappy/SnappyRawDecompressor.java b/src/main/java/io/airlift/compress/snappy/SnappyRawDecompressor.java +index 2871b9a..b11907b 100644 +--- a/src/main/java/io/airlift/compress/snappy/SnappyRawDecompressor.java ++++ b/src/main/java/io/airlift/compress/snappy/SnappyRawDecompressor.java +@@ -306,6 +306,9 @@ public final class SnappyRawDecompressor + } + } + } ++ if (result < 0) { ++ throw new MalformedInputException(compressedAddress, "negative compressed length"); ++ } + return new int[] {result, bytesRead}; + } + +diff --git a/src/test/java/io/airlift/compress/snappy/TestSnappy.java b/src/test/java/io/airlift/compress/snappy/TestSnappy.java +index b2e92d7..36f39fe 100644 +--- a/src/test/java/io/airlift/compress/snappy/TestSnappy.java ++++ b/src/test/java/io/airlift/compress/snappy/TestSnappy.java +@@ -67,4 +67,14 @@ public class TestSnappy + assertThatThrownBy(() -> new SnappyDecompressor().decompress(data, 0, data.length, new byte[1024], 0, 1024)) + .isInstanceOf(MalformedInputException.class); + } ++ ++ @Test ++ public void testNegativeLength() ++ { ++ byte[] data = {(byte) 255, (byte) 255, (byte) 255, (byte) 255, 0b0000_1000}; ++ ++ assertThatThrownBy(() -> SnappyDecompressor.getUncompressedLength(data, 0)) ++ .isInstanceOf(MalformedInputException.class) ++ .hasMessageStartingWith("negative compressed length"); ++ } + } diff --git a/tasks/codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20/post_context.md b/tasks/codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20/post_context.md new file mode 100644 index 0000000000000000000000000000000000000000..a53939303d803f977d060f253457d7434106bb6b --- /dev/null +++ b/tasks/codeql_java_benchmark_top30_v2/morefixes-462566b2f857f458bf20/post_context.md @@ -0,0 +1,413 @@ +# Patch-overlapping Java context after the fix + +## `src/main/java/io/airlift/compress/snappy/SnappyRawDecompressor.java` (changed lines (309, 310, 311)) + +```java +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.airlift.compress.snappy; + +import io.airlift.compress.MalformedInputException; + +import static io.airlift.compress.snappy.SnappyConstants.LITERAL; +import static io.airlift.compress.snappy.SnappyConstants.SIZE_OF_INT; +import static io.airlift.compress.snappy.SnappyConstants.SIZE_OF_LONG; +import static io.airlift.compress.snappy.UnsafeUtil.UNSAFE; + +public final class SnappyRawDecompressor +{ + private static final int[] DEC_32_TABLE = {4, 1, 2, 1, 4, 4, 4, 4}; + private static final int[] DEC_64_TABLE = {0, 0, 0, -1, 0, 1, 2, 3}; + + private SnappyRawDecompressor() {} + + public static int getUncompressedLength(Object compressed, long compressedAddress, long compressedLimit) + { + return readUncompressedLength(compressed, compressedAddress, compressedLimit)[0]; + } + + public static int decompress( + final Object inputBase, + final long inputAddress, + final long inputLimit, + final Object outputBase, + final long outputAddress, + final long outputLimit) + { + // Read the uncompressed length from the front of the input + long input = inputAddress; + int[] varInt = readUncompressedLength(inputBase, input, inputLimit); + int expectedLength = varInt[0]; + input += varInt[1]; + + SnappyInternalUtils.checkArgument(expectedLength <= (outputLimit - outputAddress), + "Uncompressed length %s must be less than %s", expectedLength, (outputLimit - outputAddress)); + + // Process the entire input + int uncompressedSize = uncompressAll( + inputBase, + input, + inputLimit, + outputBase, + outputAddress, + outputLimit); + + if (!(expectedLength == uncompressedSize)) { + throw new MalformedInputException(0, String.format("Recorded length is %s bytes but actual length after decompression is %s bytes ", + expectedLength, + uncompressedSize)); + } + + return expectedLength; + } + + private static int uncompressAll( + final Object inputBase, + final long inputAddress, + final long inputLimit, + final Object outputBase, + final long outputAddress, + final long outputLimit) + { + final long fastOutputLimit = outputLimit - SIZE_OF_LONG; // maximum offset in output buffer to which it's safe to write long-at-a-time + + long output = outputAddress; + long input = inputAddress; + + while (input < inputLimit) { + int opCode = UNSAFE.getByte(inputBase, input++) & 0xFF; + int entry = opLookupTable[opCode] & 0xFFFF; + + int trailerBytes = entry >>> 11; + int trailer = 0; + if (input + SIZE_OF_INT < inputLimit) { + trailer = UNSAFE.getInt(inputBase, input) & wordmask[trailerBytes]; + } + else { + if (input + trailerBytes > inputLimit) { + throw new MalformedInputException(input - inputAddress); + } + switch (trailerBytes) { + case 4: + trailer = (UNSAFE.getByte(inputBase, input + 3) & 0xff) << 24; + case 3: + trailer |= (UNSAFE.getByte(inputBase, input + 2) & 0xff) << 16; + case 2: + trailer |= (UNSAFE.getByte(inputBase, input + 1) & 0xff) << 8; + case 1: + trailer |= (UNSAFE.getByte(inputBase, input) & 0xff); + } + } + if (trailer < 0) { + throw new MalformedInputException(input - inputAddress); + } + input += trailerBytes; + + int length = entry & 0xff; + if (length == 0) { + continue; + } + + if ((opCode & 0x3) == LITERAL) { + int literalLength = length + trailer; + if (literalLength < 0) { + throw new MalformedInputException(input - inputAddress); + } + + // copy literal + long literalOutputLimit = output + literalLength; + if (literalOutputLimit > fastOutputLimit || input + literalLength > inputLimit - SIZE_OF_LONG) { + if (literalOutputLimit > outputLimit || input + literalLength > inputLimit) { + throw new MalformedInputException(input - inputAddress); + } + + // slow, precise copy + UNSAFE.copyMemory(inputBase, input, outputBase, output, literalLength); + input += literalLength; + output += literalLength; + } + else { + // fast copy. We may over-copy but there's enough room in input and output to not overrun them + do { + UNSAFE.putLong(outputBase, output, UNSAFE.getLong(inputBase, input)); + input += SIZE_OF_LONG; + output += SIZE_OF_LONG; + } + while (output < literalOutputLimit); + input -= (output - literalOutputLimit); // adjust index if we over-copied + output = literalOutputLimit; + } + } + else { + // matchOffset/256 is encoded in bits 8..10. By just fetching + // those bits, we get matchOffset (since the bit-field starts at + // bit 8). + int matchOffset = entry & 0x700; + matchOffset += trailer; + if (matchOffset < 0) { + throw new MalformedInputException(input - inputAddress); + } + + long matchAddress = output - matchOffset; + if (matchAddress < outputAddress || output + length > outputLimit) { + throw new MalformedInputException(input - inputAddress); + } + long matchOutputLimit = output + length; + if (matchOutputLimit > outputLimit) { + throw new MalformedInputException(input - inputAddress); + } + + if (output > fastOutputLimit) { + // slow match copy + while (output < matchOutputLimit) { + UNSAFE.putByte(outputBase, output++, UNSAFE.getByte(outputBase, matchAddress++)); + } + } + else { + // copy repeated sequence + if (matchOffset < SIZE_OF_LONG) { + // 8 bytes apart so that we can copy long-at-a-time below + int increment32 = DEC_32_TABLE[matchOffset]; + int decrement64 = DEC_64_TABLE[matchOffset]; + + UNSAFE.putByte(outputBase, output, UNSAFE.getByte(outputBase, matchAddress)); + UNSAFE.putByte(outputBase, output + 1, UNSAFE.getByte(outputBase, matchAddress + 1)); + UNSAFE.putByte(outputBase, output + 2, UNSAFE.getByte(outputBase, matchAddress + 2)); + UNSAFE.putByte(outputBase, output + 3, UNSAFE.getByte(outputBase, matchAddress + 3)); + output += SIZE_OF_INT; + matchAddress += increment32; + + UNSAFE.putInt(outputBase, output, UNSAFE.getInt(outputBase, matchAddress)); + output += SIZE_OF_INT; + matchAddress -= decrement64; + } + else { + UNSAFE.putLong(outputBase, output, UNSAFE.getLong(outputBase, matchAddress)); + matchAddress += SIZE_OF_LONG; + output += SIZE_OF_LONG; + } + + if (matchOutputLimit > fastOutputLimit) { + while (output < fastOutputLimit) { + UNSAFE.putLong(outputBase, output, UNSAFE.getLong(outputBase, matchAddress)); + matchAddress += SIZE_OF_LONG; + output += SIZE_OF_LONG; + } + + while (output < matchOutputLimit) { + UNSAFE.putByte(outputBase, output++, UNSAFE.getByte(outputBase, matchAddress++)); + } + } + else { + while (output < matchOutputLimit) { + UNSAFE.putLong(outputBase, output, UNSAFE.getLong(outputBase, matchAddress)); + matchAddress += SIZE_OF_LONG; + output += SIZE_OF_LONG; + } + } + } + output = matchOutputLimit; // correction in case we over-copied + } + } + + return (int) (output - outputAddress); + } + + // Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits + private static final int[] wordmask = new int[] { + 0, 0xff, 0xffff, 0xffffff, 0xffffffff + }; + + // Data stored per entry in lookup table: + // Range Bits-used Description + // ------------------------------------ + // 1..64 0..7 Literal/copy length encoded in opcode byte + // 0..7 8..10 Copy offset encoded in opcode byte / 256 + // 0..4 11..13 Extra bytes after opcode + // + // We use eight bits for the length even though 7 would have sufficed + // because of efficiency reasons: + // (1) Extracting a byte is faster than a bit-field + // (2) It properly aligns copy offset so we do not need a <<8 + private static final short[] opLookupTable = new short[] { + 0x0001, 0x0804, 0x1001, 0x2001, 0x0002, 0x0805, 0x1002, 0x2002, + 0x0003, 0x0806, 0x1003, 0x2003, 0x0004, 0x0807, 0x1004, 0x2004, + 0x0005, 0x0808, 0x1005, 0x2005, 0x0006, 0x0809, 0x1006, 0x2006, + 0x0007, 0x080a, 0x1007, 0x2007, 0x0008, 0x080b, 0x1008, 0x2008, + 0x0009, 0x0904, 0x1009, 0x2009, 0x000a, 0x0905, 0x100a, 0x200a, + 0x000b, 0x0906, 0x100b, 0x200b, 0x000c, 0x0907, 0x100c, 0x200c, + 0x000d, 0x0908, 0x100d, 0x200d, 0x000e, 0x0909, 0x100e, 0x200e, + 0x000f, 0x090a, 0x100f, 0x200f, 0x0010, 0x090b, 0x1010, 0x2010, + 0x0011, 0x0a04, 0x1011, 0x2011, 0x0012, 0x0a05, 0x1012, 0x2012, + 0x0013, 0x0a06, 0x1013, 0x2013, 0x0014, 0x0a07, 0x1014, 0x2014, + 0x0015, 0x0a08, 0x1015, 0x2015, 0x0016, 0x0a09, 0x1016, 0x2016, + 0x0017, 0x0a0a, 0x1017, 0x2017, 0x0018, 0x0a0b, 0x1018, 0x2018, + 0x0019, 0x0b04, 0x1019, 0x2019, 0x001a, 0x0b05, 0x101a, 0x201a, + 0x001b, 0x0b06, 0x101b, 0x201b, 0x001c, 0x0b07, 0x101c, 0x201c, + 0x001d, 0x0b08, 0x101d, 0x201d, 0x001e, 0x0b09, 0x101e, 0x201e, + 0x001f, 0x0b0a, 0x101f, 0x201f, 0x0020, 0x0b0b, 0x1020, 0x2020, + 0x0021, 0x0c04, 0x1021, 0x2021, 0x0022, 0x0c05, 0x1022, 0x2022, + 0x0023, 0x0c06, 0x1023, 0x2023, 0x0024, 0x0c07, 0x1024, 0x2024, + 0x0025, 0x0c08, 0x1025, 0x2025, 0x0026, 0x0c09, 0x1026, 0x2026, + 0x0027, 0x0c0a, 0x1027, 0x2027, 0x0028, 0x0c0b, 0x1028, 0x2028, + 0x0029, 0x0d04, 0x1029, 0x2029, 0x002a, 0x0d05, 0x102a, 0x202a, + 0x002b, 0x0d06, 0x102b, 0x202b, 0x002c, 0x0d07, 0x102c, 0x202c, + 0x002d, 0x0d08, 0x102d, 0x202d, 0x002e, 0x0d09, 0x102e, 0x202e, + 0x002f, 0x0d0a, 0x102f, 0x202f, 0x0030, 0x0d0b, 0x1030, 0x2030, + 0x0031, 0x0e04, 0x1031, 0x2031, 0x0032, 0x0e05, 0x1032, 0x2032, + 0x0033, 0x0e06, 0x1033, 0x2033, 0x0034, 0x0e07, 0x1034, 0x2034, + 0x0035, 0x0e08, 0x1035, 0x2035, 0x0036, 0x0e09, 0x1036, 0x2036, + 0x0037, 0x0e0a, 0x1037, 0x2037, 0x0038, 0x0e0b, 0x1038, 0x2038, + 0x0039, 0x0f04, 0x1039, 0x2039, 0x003a, 0x0f05, 0x103a, 0x203a, + 0x003b, 0x0f06, 0x103b, 0x203b, 0x003c, 0x0f07, 0x103c, 0x203c, + 0x0801, 0x0f08, 0x103d, 0x203d, 0x1001, 0x0f09, 0x103e, 0x203e, + 0x1801, 0x0f0a, 0x103f, 0x203f, 0x2001, 0x0f0b, 0x1040, 0x2040 + }; + + /** + * Reads the variable length integer encoded a the specified offset, and + * returns this length with the number of bytes read. + */ + static int[] readUncompressedLength(Object compressed, long compressedAddress, long compressedLimit) + { + int result; + int bytesRead = 0; + { + int b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); + bytesRead++; + result = b & 0x7f; + if ((b & 0x80) != 0) { + b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); + bytesRead++; + result |= (b & 0x7f) << 7; + if ((b & 0x80) != 0) { + b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); + bytesRead++; + result |= (b & 0x7f) << 14; + if ((b & 0x80) != 0) { + b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); + bytesRead++; + result |= (b & 0x7f) << 21; + if ((b & 0x80) != 0) { + b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); + bytesRead++; + result |= (b & 0x7f) << 28; + if ((b & 0x80) != 0) { + throw new MalformedInputException(compressedAddress + bytesRead, "last byte of compressed length int has high bit set"); + } + } + } + } + } + } + if (result < 0) { + throw new MalformedInputException(compressedAddress, "negative compressed length"); + } + return new int[] {result, bytesRead}; + } + + private static int getUnsignedByteSafe(Object base, long address, long limit) + { + if (address >= limit) { + throw new MalformedInputException(limit - address, "Input is truncated"); + } + return UNSAFE.getByte(base, address) & 0xFF; + } +} +``` + +## `src/test/java/io/airlift/compress/snappy/TestSnappy.java` (changed lines (70, 71, 72, 73, 74, 75, 76, 77, 78, 79)) + +```java +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.airlift.compress.snappy; + +import io.airlift.compress.AbstractTestCompression; +import io.airlift.compress.Compressor; +import io.airlift.compress.Decompressor; +import io.airlift.compress.MalformedInputException; +import io.airlift.compress.thirdparty.XerialSnappyCompressor; +import io.airlift.compress.thirdparty.XerialSnappyDecompressor; +import org.testng.annotations.Test; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +public class TestSnappy + extends AbstractTestCompression +{ + @Override + protected Compressor getCompressor() + { + return new SnappyCompressor(); + } + + @Override + protected Decompressor getDecompressor() + { + return new SnappyDecompressor(); + } + + @Override + protected Compressor getVerifyCompressor() + { + return new XerialSnappyCompressor(); + } + + @Override + protected Decompressor getVerifyDecompressor() + { + return new XerialSnappyDecompressor(); + } + + @Test + public void testInvalidLiteralLength() + { + byte[] data = { + // Encoded uncompressed length 1024 + -128, 8, + // op-code + (byte) 252, + // Trailer value Integer.MAX_VALUE + (byte) 0b1111_1111, (byte) 0b1111_1111, (byte) 0b1111_1111, (byte) 0b0111_1111, + // Some arbitrary data + 0, 0, 0, 0, 0, 0, 0, 0 + }; + + assertThatThrownBy(() -> new SnappyDecompressor().decompress(data, 0, data.length, new byte[1024], 0, 1024)) + .isInstanceOf(MalformedInputException.class); + } + + @Test + public void testNegativeLength() + { + byte[] data = {(byte) 255, (byte) 255, (byte) 255, (byte) 255, 0b0000_1000}; + + assertThatThrownBy(() -> SnappyDecompressor.getUncompressedLength(data, 0)) + .isInstanceOf(MalformedInputException.class) + .hasMessageStartingWith("negative compressed length"); + } +} +```